From: corredor <> Date: Tue, 22 Jun 2010 09:17:29 +0000 (+0000) Subject: Documentation of the wxLibrary X-Git-Tag: v1_0_0~59 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=20d8646f40b23f856e8514f4201f4a371d15abd9;p=bbtkGEditor.git Documentation of the wxLibrary --- diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx index 4d69b64..6a51858 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx @@ -28,12 +28,14 @@ Version: $Revision$ * knowledge of the CeCILL-B license and that you accept its terms. * ------------------------------------------------------------------------ */ -/** -* \file -* \brief Class bbtk::GBlackBox -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ + #include "GBlackBoxModel.h" namespace bbtk @@ -223,9 +225,7 @@ namespace bbtk } //========================================================================= - - -} // EO namespace bbtk +} // EO namespace bbtk // EOF diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.h index a459102..f6ad73b 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.h @@ -9,7 +9,7 @@ Version: $Revision$ /* --------------------------------------------------------------------- * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) -* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux +* Authors : Ricardo A Corredor, Eduardo Davila, Laurent Guigues, Jean-Pierre Roux * * This software is governed by the CeCILL-B license under French law and * abiding by the rules of distribution of free software. You can use, @@ -28,17 +28,11 @@ Version: $Revision$ * knowledge of the CeCILL-B license and that you accept its terms. * ------------------------------------------------------------------------ */ - - -/** -* \file -* \brief Class bbtk::GBlackBox : abstract black-box interface. -*/ - -/** -* \class bbtk::GBlackBox -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __GBlackBoxModel_h__ #define __GBlackBoxModel_h__ @@ -65,23 +59,37 @@ namespace bbtk GBlackBoxModel(); ~GBlackBoxModel(); - //Public methods + //Public methods + + // The black box has an specific package (important to search in the list with the BBTK Interpreter) std::string getBBTKPackage(); void setBBTKPackage(std::string obpackage); + // Text in the status bar virtual std::string getStatusText(); + + // Method to write the information of the black box to be saved in the parameter string virtual void save(std::string &content); + // Is the black box executable or not bool isExecutable(); void setExecutable(bool executable); + // Set 'value' to the port in position 'pos' void setValueToInputPort(int pos,std::string value); + + // Set 'value' to the port with name 'name' void setValueToInput(std::string name,std::string value); + // Get the value of the port in position 'pos' std::string getValueInputPort(int pos); + + // Get the value of the port with name 'name' std::string getValueInput(std::string name); + // Get id's of the connected inputs std::vector getConnectedInputs(); + // Get id's of the connected outputs std::vector getConnectedOutputs(); private: diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBoxModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBoxModel.h index 05cb6bc..8c05ad7 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBoxModel.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBoxModel.h @@ -28,17 +28,11 @@ Version: $Revision$ * knowledge of the CeCILL-B license and that you accept its terms. * ------------------------------------------------------------------------ */ - - -/** -* \file -* \brief Class bbtk::GBoxModel : abstract black-box interface. -*/ - -/** -* \class bbtk::GBoxModel -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __GBoxModel_h__ #define __GBoxModel_h__ @@ -57,6 +51,7 @@ Version: $Revision$ namespace bbtk { + // Mandatory when exists a bidirectional relation: GPortModel includes GBoxModel and viceversa class GPortModel; class GBoxModel : public GObjectModel @@ -70,24 +65,35 @@ namespace bbtk //Public methods virtual void setInicPoint(double& x, double& y, double& z); + void addInputPort(GPortModel *inputport); void addOutputPort(GPortModel *outputport); + int getNumInputPorts(); int getNumOutputPorts(); + + // Change the position of the box and its ports virtual void move(double xx,double yy,double zz); + // Text in the status bar virtual std::string getStatusText(); + + // Method to write the information of the black box to be saved in the parameter string virtual void save(std::string &content); + // Returns a vector with inputs or outputs std::vector getInputPorts(); std::vector getOutputPorts(); + // Get input with the name given by parameter GPortModel* getInputPort(std::string name); - GPortModel* getOutputPort(std::string name); - GPortModel* getInputPort(int pos); - GPortModel* getOutputPort(int pos); + // Get output with the name given by parameter + GPortModel* getOutputPort(std::string name); + GPortModel* getOutputPort(int pos); + + // Updates the position and finally the view of inputs and outputs void updatePorts(); private: @@ -98,6 +104,7 @@ namespace bbtk protected: //Protected Attributes + std::vector _inputs; std::vector _outputs; diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GComplexBoxPortModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GComplexBoxPortModel.cxx index e5a604c..dc9003b 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GComplexBoxPortModel.cxx +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GComplexBoxPortModel.cxx @@ -28,11 +28,11 @@ Version: $Revision$ * knowledge of the CeCILL-B license and that you accept its terms. * ------------------------------------------------------------------------ */ -/** -* \file -* \brief Class bbtk::GBlackBox -*/ - +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #include "GComplexBoxPortModel.h" diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GComplexBoxPortModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GComplexBoxPortModel.h index 74703ac..6a30ea4 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GComplexBoxPortModel.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GComplexBoxPortModel.h @@ -30,15 +30,11 @@ Version: $Revision$ -/** -* \file -* \brief Class bbtk::GBlackBox : abstract black-box interface. -*/ - -/** -* \class bbtk::GBlackBox -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __GComplexBoxPortModel_h__ #define __GComplexBoxPortModel_h__ @@ -65,8 +61,10 @@ namespace bbtk GComplexBoxPortModel(); ~GComplexBoxPortModel(); - //Public methods + //Public methods + virtual void setInicPoint(double& x, double& y, double& z); + int getComplexPortType(); void setComplexPortType(int pType); @@ -76,6 +74,8 @@ namespace bbtk private: //Private Attributes + + // According to the constants in GlobalConstants.h, the complex port can be an input or an output int _complexPortType; //Private Methods diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx index 84cc58d..ebdf371 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx @@ -82,6 +82,7 @@ namespace bbtk setFinalPoint(xCenter,yIport,zCenter); + // Sets the last point of the contour model in the position of the end input port manualPoint* point = _model->GetManualPoint(_model->GetSizeLstPoints()-1); point->SetPoint(xCenter,yIport,zCenter); } @@ -124,6 +125,7 @@ namespace bbtk double xport,yport,zport; _startPort->getFinalPoint(xport,yport,zport); + // Refresh the position of the contourModel first point with the data of the connector model manualPoint* point = _model->GetManualPoint(0); point->SetPoint(xCenter,yport,zCenter); @@ -131,6 +133,7 @@ namespace bbtk _endPort->getCenter(xCenter,yCenter,zCenter); _endPort->getInicPoint(xport,yport,zport); + // Refresh the position of the contourModel last point with the data of the connector model point = _model->GetManualPoint(_model->GetSizeLstPoints()-1); point->SetPoint(xCenter,yport,zCenter); } @@ -152,13 +155,6 @@ namespace bbtk //========================================================================= - bool GConnectorModel::isPointInside(double x,double y, double z)//virtual - { - return false; - } - - //========================================================================= - void GConnectorModel::save(std::string &content) { content+="CONNECTION\n"; diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.h index d590b84..9a79ad4 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.h @@ -29,16 +29,11 @@ Version: $Revision$ * ------------------------------------------------------------------------ */ - -/** -* \file -* \brief Class bbtk::GConnectorModel : abstract black-box interface. -*/ - -/** -* \class bbtk::GConnectorModel -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __GConnectorModel_h__ #define __GConnectorModel_h__ @@ -67,29 +62,44 @@ namespace bbtk GConnectorModel(); ~GConnectorModel(); - //Public methods + //Public methods + + // Sets the start port of the connection that will be used in the manualContourModel void setStartPort(GPortModel* startPort); + + // Sets the end port in the BBTKGEditor connector model and also in the contour model void setEndPort(GPortModel* endPort); + + // Assigns the creaMaracasVisu model void setManualContourModel(manualContourModel* model); + manualContourModel* getManualContourModel(); GPortModel* getStartPort(); GPortModel* getEndPort(); - manualContourModel* getManualContourModel(); + + // Refresh the position of the contourModel first and last points with the data of the connector model void updateStartEndPoints(); + + // Set the ports as NO connected void disconnectConnection(); - virtual bool isPointInside(double x,double y, double z); + virtual void save(std::string &content); private: - //Attributes + //Private Attributes + GPortModel* _startPort; GPortModel* _endPort; + manualContourModel* _model; //Private Methods protected: + + //Protected Attributes + //Protected methods }; diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h index 39648f9..bfebe6b 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h @@ -35,10 +35,11 @@ Version: $Revision$ * \brief Class bbtk::GObjectModel : abstract black-box interface. */ -/** -* \class bbtk::GObjectModel -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __GObjectModel_h__ #define __GObjectModel_h__ @@ -69,29 +70,42 @@ namespace bbtk //Public methods + // Method to get the values of Inic or Final point passed as references in the parameters void getInicPoint(double& x, double& y, double& z); void getFinalPoint(double& x, double& y, double& z); + + // Returns the center of the enclosing rectangle void getCenter(double& x, double& y, double& z); + + // Method to set the values of Inic or Final point virtual void setInicPoint(double& x, double& y, double& z); virtual void setFinalPoint(double& x, double& y, double& z); + // Changes the inic(top-left point) point of the rectangle virtual void move(double xx,double yy,double zz); + // Returns true if (x,y,z) is inside the rectangle virtual bool isPointInside(double x,double y, double z); + // Get the type of the graphical objects (See the GlobalConstants.h file) int getGObjectType(); void setGObjectType(int obtype); + // The type in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), LoadHola is the type std::string getBBTKType(); void setBBTKType(std::string obtype); - + + // The name in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), abcd is the name std::string getBBTKName(); void setBBTKName(std::string obname); + // Object ID int getObjectId(); void setObjectId(int id); + // Status bar message virtual std::string getStatusText(); + virtual void save(std::string &content); private: @@ -111,10 +125,15 @@ namespace bbtk double _yFin; double _zFin; - int _gObjectType; int _objectId; + // The type of the graphical objects (See the GlobalConstants.h file) + int _gObjectType; + + // The type in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), LoadHola is the type std::string _bbtkType; + + // The name in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), abcd is the name std::string _bbtkName; //Protected methods diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx index 69c41e3..1d16dc1 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx @@ -33,7 +33,11 @@ Version: $Revision$ * \brief Class bbtk::GPortModel */ - +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #include "GPortModel.h" namespace bbtk diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h index 474ebb3..d82b885 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h @@ -35,10 +35,11 @@ Version: $Revision$ * \brief Class bbtk::GPortModel : abstract black-box interface. */ -/** -* \class bbtk::GPortModel -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __GPortModel_h__ #define __GPortModel_h__ @@ -57,6 +58,7 @@ Version: $Revision$ namespace bbtk { + // Mandatory when exists a bidirectional relation: GPortModel includes GBoxModel and viceversa class GBoxModel; class GPortModel : public GObjectModel @@ -68,29 +70,48 @@ namespace bbtk GPortModel(); virtual ~GPortModel(); - //Public methods + //Public methods + + // Register the input or output in a position of the black box, depending in the portType(INPUT/OUTPUT). void registerInBox(GBoxModel *blackBox,int portType, int pos); + + // Update the port position based in the parent box initial point void updatePortPosition(); + + // Port type (INPUT/OUTPUT) int getPortType(); + GBoxModel* getParentBox(); - virtual std::string getStatusText(); + + // Returns the position of the port in the box + int getPosInBox(); + bool isConnected(); void setConnected(bool value); + bool isValueSet(); void setValue(std::string value); + std::string getValue(); + + virtual std::string getStatusText(); virtual void save(std::string &content); - int getPosInBox(); + private: - //Attributes + //Private Attributes GBoxModel *_parentBox; - + + // Port type (INPUT/OUTPUT) int _portType; + + // The position of the port in the box int _posInBox; + bool _isConnected; + std::string _value; bool _isValueSet; diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h index ce68e60..43677d4 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h @@ -29,13 +29,11 @@ Version: $Revision$ * ------------------------------------------------------------------------ */ - -/** -* \file -* \brief bbtk::GlobalConstants -*/ - - +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __GlobalConstants_h__ #define __GlobalConstants_h__ @@ -151,7 +149,7 @@ namespace bbtk const double BOXTEXT_SELECTED_G = 0.35; const double BOXTEXT_SELECTED_B = 0.05; - // Id's + // GUI Id's const int ID_NEW = 1000; const int ID_SAVE_AS_DIAGRAM = 1001; const int ID_OPEN = 1002; diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observable.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observable.h index 7adc257..0377134 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observable.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observable.h @@ -40,6 +40,12 @@ Version: $Revision$ * \brief */ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ + #ifndef __Observable_h__ #define __Observable_h__ @@ -69,6 +75,8 @@ namespace bbtk //Public methods void addObserver(Observer *observer); + // It is possible to notify the observers with an specific command (See GlobalConstants.h), for example, + // to initialize the contour creation INIT_CREATION_CONTOUR void notifyObservers(int idCaller,int command=NO_COMMAND); private: diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observer.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observer.h index f5c10e9..3cb8b05 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observer.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observer.h @@ -40,6 +40,12 @@ Version: $Revision$ * \brief */ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ + #ifndef __Observer_h__ #define __Observer_h__ @@ -59,6 +65,9 @@ namespace bbtk ~Observer(); //Public methods + + // It is possible to notify the observers with an specific command (See GlobalConstants.h), for example, + // to initialize the contour creation INIT_CREATION_CONTOUR virtual void update(int idController,int command); diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx index 7b9736e..25eccdf 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx @@ -69,6 +69,8 @@ printf ("EED %p ~wxGEditorTabPanel()\n" , this ); wxVtk3DBaseView *baseview = new wxVtk3DBaseView(this); baseview->Configure(); _sceneManager=new wxVtkSceneManager(this,baseview,_id); + + printf("RaC-EED 21-06-2010 wxGEditorTabPanel::initWxVtkCanvas Remove the panelAUIMgr, and change to a normal sizer inside the wxGEditorTabPanel\n"); _panelAUIMgr->AddPane((wxWindow*)baseview->GetWxVTKRenderWindowInteractor(),wxAuiPaneInfo().Fixed().CenterPane()); //EED02JUIN2010 diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index c4f2c5d..dae6833 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -54,6 +54,7 @@ namespace bbtk if( _baseView!=NULL ) { //EED02JUIN2010 + printf ("RaC-EED 21-06-2010 %p wxVtkSceneManager::wxVtkSceneManager If you comment this line, the drag and drop functionnality is not initialized.\n" , this ); _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget((wxDropTarget*)parent); configureBaseView(); _worldState=NOTHING_HAPPENS; diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h index 8e8a7aa..362c677 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h @@ -170,23 +170,7 @@ namespace bbtk void centerView(); //------- - //Get a collection of object ids - std::vector getBlackBoxes(); - std::vector getConnections(); - std::vector getComplexInputPorts(); - std::vector getComplexOutputPorts(); - - //Get the map of selected objects (id, controller) - std::map getSelectedObjects(); - - //Get size of selected objects map - int getNumSelectedObjects(); - - //Complex box edition mode - bool isComplexBox(); - void setComplexBox(bool val); - - + private: