#ifndef GWt_ligneFaisceau_SEEN #define GWt_ligneFaisceau_SEEN #include "dataManager.h" #include "nomdElements.h" #include "GWt_pspaApplication.h" #include "GWt_abstractElement.h" #include #include #include #include using namespace Wt; class GWt_dropZoneLigneFaisceau; class GWt_sector; class compteur { int n_; public : compteur() {n_= 0;} int incr() {return ++n_;} }; class GWt_ligneFaisceau : public WContainerWidget { dataManager* dataManager_; public : GWt_ligneFaisceau(dataManager*,GWt_sector*); /** Add an element at a position inside the beam line. @param eType : type of element @param dropContainer : origin of the drop event - Special case, when first element is created, we add a drop zone at the end and beginning of the drop zone and we center everything */ GWt_abstractElement* addElement(nomdElements::typedElement eType, GWt_dropZoneLigneFaisceau* dropContainer); void removeElement(GWt_abstractElement*); ~GWt_ligneFaisceau() {;} /** return the abstract element at a position @param : position in the beam line */ abstractElement* getAbstractElement(int i); /** return the numero (1.. infty) of the abstract element @param : label of this abstractElement in the beam line */ int getAbstractElementNumeroFromLabel(std::string txt); // void restoreElementCollectionFromDataManager(); void clickEvent(WContainerWidget*); void deleteElement(WContainerWidget*); int getBeamLineSize(); /** remove all elements from beam line */ void clear(); /** Return a vector contains all abstract elements in the beam line */ vector getAllAbstractElements(); void update(); /** Return the sector of this beamLine */ inline GWt_sector* getUISector() { return UI_sector_;}; void buildBeamLineWidget(); private : void manageLineFaisceauLayout_deprecated(); GWt_dropZoneLigneFaisceau* allDropZone_; WHBoxLayout* ligneFaisceauLayout_; GWt_sector* UI_sector_; }; #endif