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

Last change on this file since 379 was 379, checked in by touze, 11 years ago

ajout d'une extension de fichier pour les cliches

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