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

Last change on this file since 308 was 308, checked in by garnier, 11 years ago

LigneFaisceau: Correction d un bug qui ne remplissqit pas les parametres des elements

File size: 1.9 KB
Line 
1#ifndef LIGNEFAISCEAU_SEEN
2#define 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    WHBoxLayout* ligneFaisceauLayout_;
29    PspaApplication* pspa_;
30    Compteur *nObjets_;
31   
32    public :
33   
34    GWt_LigneFaisceau() {;}
35    GWt_LigneFaisceau(PspaApplication*);
36   
37    /**
38     
39     Add an element at a position inside the beam line.
40     @param eType : type of element
41     @param dropContainer : origin of the drop event
42     -
43     Special case, when first element is created, we add a drop zone at the end and beginning of the drop zone
44     and we center everything
45     */
46    GWt_abstractElement* addElement(typedElement eType, GWt_dropZoneLigneFaisceau* dropContainer);
47    GWt_abstractElement* addElement(typedElement eType);
48   
49    void removeElement(GWt_abstractElement*);
50   
51    ~GWt_LigneFaisceau() {
52        if(nObjets_ != NULL) delete[] nObjets_;
53    }
54   
55    /** return the abstract element at a position
56     @param : position in the beam line
57     */
58    abstractElement* getAbstractElement(int i);
59    //    void restoreElementCollectionFromDataManager();
60    void clickEvent(WContainerWidget*);
61    void deleteElement(WContainerWidget*);
62    int getBeamLineSize();
63   
64    /**
65     remove all elements from beam line
66     */
67    void clear();
68   
69    /**
70     Return a vector contains all abstract elements in the beam line
71     */
72    vector <abstractElement*> getAllAbstractElements();
73   
74    void update();
75   
76    private :
77    void manageLineFaisceauLayout();
78    GWt_dropZoneLigneFaisceau* allDropZone_;
79   
80};
81
82#endif
Note: See TracBrowser for help on using the repository browser.