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

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

Renommage de GWt_LigneFaisceau en GWt_ligneFaisceau dans tout les fichiers pour plus de cohérence

File size: 2.2 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;
17
18class compteur {
19    int n_;
20   
21    public :
22    compteur() {n_= 0;}
23    int incr() {return ++n_;}
24};
25
26class GWt_ligneFaisceau : public WContainerWidget
27{
28    PspaApplication* pspa_;
29   
30    public :
31   
32    GWt_ligneFaisceau() {;}
33    GWt_ligneFaisceau(PspaApplication*);
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(int);
81
82    void initializeSoftwares();
83
84    private :
85    void manageLineFaisceauLayout();
86    GWt_dropZoneLigneFaisceau* allDropZone_;
87    WHBoxLayout* ligneFaisceauLayout_;
88};
89
90#endif
Note: See TracBrowser for help on using the repository browser.