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

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

grosse modification pour intégrer les sections

File size: 2.4 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    void initializeSoftwares();
83 
84  /** Return the sector of this beamLine */
85  inline GWt_sector* getUISector() { return UI_sector_;};
86 
87  private :
88  void manageLineFaisceauLayout_deprecated();
89  void buildBeamLineWidget();
90 
91  GWt_dropZoneLigneFaisceau* allDropZone_;
92  WHBoxLayout* ligneFaisceauLayout_;
93  GWt_sector* UI_sector_;
94};
95
96#endif
Note: See TracBrowser for help on using the repository browser.