source: PSPA/Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_ligneFaisceau.h @ 469

Last change on this file since 469 was 469, checked in by garnier, 10 years ago

Désormais il est de nouveau possible d'ajouter des sections et dy affecter des softwares (ne marche pour le moment quavec la 1ere sectionToExecute. Autres améliorations et renommages

File size: 2.3 KB
Line 
1#ifndef GWt_ligneFaisceau_SEEN
2#define GWt_ligneFaisceau_SEEN
3
4#include "dataManager.h"
5#include "nomdElements.h"
6#include "GWt_pspaApplication.h"
7#include "GWt_abstractElement.h"
8
9#include <Wt/WApplication>
10#include <Wt/WPushButton>
11#include <Wt/WHBoxLayout>
12#include <Wt/WContainerWidget>
13
14using namespace Wt;
15
16class GWt_dropZoneLigneFaisceau;
17class GWt_sector;
18
19class compteur {
20    int n_;
21   
22    public :
23    compteur() {n_= 0;}
24    int incr() {return ++n_;}
25};
26
27class GWt_ligneFaisceau : public WContainerWidget
28{
29  dataManager* dataManager_;
30 
31    public :
32 
33  GWt_ligneFaisceau(dataManager*,GWt_sector*);
34 
35    /**
36     
37     Add an element at a position inside the beam line.
38     @param eType : type of element
39     @param dropContainer : origin of the drop event
40     -
41     Special case, when first element is created, we add a drop zone at the end and beginning of the drop zone
42     and we center everything
43     */
44    GWt_abstractElement* addElement(nomdElements::typedElement eType, GWt_dropZoneLigneFaisceau* dropContainer);
45    GWt_abstractElement* addElement(nomdElements::typedElement eType);
46   
47    void removeElement(GWt_abstractElement*);
48   
49    ~GWt_ligneFaisceau() {;}
50   
51    /** return the abstract element at a position
52     @param : position in the beam line
53     */
54    abstractElement* getAbstractElement(int i);
55
56    /** return the numero (1.. infty)  of the abstract element
57     @param : label of this abstractElement in the beam line
58     */
59    int getAbstractElementNumeroFromLabel(std::string txt);
60
61    //    void restoreElementCollectionFromDataManager();
62    void clickEvent(WContainerWidget*);
63    void deleteElement(WContainerWidget*);
64    int getBeamLineSize();
65   
66    /**
67     remove all elements from beam line
68     */
69    void clear();
70   
71    /**
72     Return a vector contains all abstract elements in the beam line
73     */
74    vector <abstractElement*> getAllAbstractElements();
75   
76    void update();
77 
78  /** update the status of the given index element
79   */
80  void update_deprecated(int);
81   
82  /** Return the sector of this beamLine */
83  inline GWt_sector* getUISector() { return UI_sector_;};
84 
85  void buildBeamLineWidget();
86
87  private :
88  void manageLineFaisceauLayout_deprecated();
89 
90  GWt_dropZoneLigneFaisceau* allDropZone_;
91  WHBoxLayout* ligneFaisceauLayout_;
92  GWt_sector* UI_sector_;
93};
94
95#endif
Note: See TracBrowser for help on using the repository browser.