//==========================================================================
#include "bbtkwxGUIEditorGraphicBBS.h"
-
+
#include <wx/cmdline.h>
#include <wx/app.h>
-
+
class wxBBEditorApp : public wxApp
{
public:
bool OnInit( );
int OnExit() { return true; }
-
+
};
IMPLEMENT_APP(wxBBEditorApp);
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::GBlackBox
+*/
+
+
+#include "GBlackBoxModel.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ GBlackBoxModel::GBlackBoxModel()
+ {
+
+
+ }
+
+ //=========================================================================
+ GBlackBoxModel::~GBlackBoxModel()
+ {
+ }
+ //=========================================================================
+
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* 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
+*/
+
+#ifndef __GBlackBoxModel_h__
+#define __GBlackBoxModel_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+#include "GObjectModel.h"
+
+//Includes creaMaracasVisu
+
+//Includes std
+#include <iostream>
+
+namespace bbtk
+{
+
+ class GBlackBoxModel : public GObjectModel
+ {
+
+ public:
+
+ //Constructors
+ GBlackBoxModel();
+ ~GBlackBoxModel();
+
+ //Public methods
+
+
+ private:
+
+ //Attributes
+
+
+ //Private Methods
+
+ protected:
+ //Protected methods
+
+ };
+
+
+}
+// namespace bbtk
+#endif
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::GObjectModel
+*/
+
+
+#include "GObjectModel.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ GObjectModel::GObjectModel()
+ {
+
+ _xInic = 0;
+ _yInic = 0;
+ _zInic = 900;
+ _xFin = 0;
+ _yFin = 0;
+ _zFin = 900;
+ }
+
+ //=========================================================================
+ GObjectModel::~GObjectModel()
+ {
+ }
+ //=========================================================================
+
+ void GObjectModel::getInicPoint(double& x, double& y, double& z)
+ {
+ x = _xInic;
+ y = _yInic;
+ z = _zInic;
+ }
+ //=========================================================================
+
+ void GObjectModel::getFinalPoint(double& x, double& y, double& z)
+ {
+ x = _xInic+BOX_SIDE;
+ y = _yInic+BOX_SIDE;
+ z = _zFin;
+ }
+ //=========================================================================
+
+ void GObjectModel::setInicPoint(double& x, double& y, double& z)
+ {
+ _xInic = x;
+ _yInic = y;
+ _zInic = z;
+
+ }
+ //=========================================================================
+
+ void GObjectModel::setFinalPoint(double& x, double& y, double& z)
+ {
+ _xFin = x;
+ _yFin = y;
+ _zFin = z;
+ }
+ //=========================================================================
+
+
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::GObjectModel : abstract black-box interface.
+*/
+
+/**
+* \class bbtk::GObjectModel
+* \brief
+*/
+
+#ifndef __GObjectModel_h__
+#define __GObjectModel_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+
+//Includes creaMaracasVisu
+
+//Includes std
+#include <iostream>
+
+namespace bbtk
+{
+
+ class GObjectModel
+ {
+
+ public:
+
+ //Constructors
+ GObjectModel();
+ ~GObjectModel();
+
+ //Public methods
+
+ void getInicPoint(double& x, double& y, double& z);
+ void getFinalPoint(double& x, double& y, double& z);
+ void setInicPoint(double& x, double& y, double& z);
+ void setFinalPoint(double& x, double& y, double& z);
+
+ private:
+
+ //Private Attributes
+
+ //Private Methods
+
+ protected:
+
+ //Protected Attributes
+
+ double _xInic;
+ double _yInic;
+ double _zInic;
+ double _xFin;
+ double _yFin;
+ double _zFin;
+
+ //Protected methods
+
+ };
+
+
+}
+// namespace bbtk
+#endif
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief bbtk::GlobalConstants
+*/
+
+
+
+#ifndef __GlobalConstants_h__
+#define __GlobalConstants_h__
+
+namespace bbtk
+{
+
+ // Object types
+ const int GBLACKBOX = 1;
+ const int GCONNECTOR = 2;
+ const int GPORT = 3;
+
+ // Object states
+ static const int NOTHING_HAPPENS = 101;
+ const int HIGHLIGHTED=102;
+ const int CLICKED=103;
+ const int DRAG=104;
+ const int SELECTED=105;
+
+ // Object dimensions
+ const double BOX_SIDE=1.0;
+}
+// namespace bbtk
+#endif
+
#include "wxVtkSceneManager.h"
-#include <vtkInteractorStyleBaseView2D.h>
-
-#include "vtkConeSource.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkActor.h"
-#include "vtkRenderer.h"
namespace bbtk
{
{
_baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(parent);
+ registerController(this);
- registerController(this);
configureBaseView();
- vtkRenderer *ren1 =_baseView->GetRenderer();
vtkConeSource *cone = vtkConeSource::New();
- cone->SetResolution(8);
+ cone->SetResolution(10);
vtkPolyDataMapper *map = vtkPolyDataMapper::New();
map->SetInput(cone->GetOutput());
act->SetMapper(map);
- ren1->AddActor(act);
+ /////////////////////
+
+
+ vtkPoints *_pts = vtkPoints::New();
+ _pts->SetNumberOfPoints(4);
+
+ _pts->SetPoint(0, -1 , -1 , 0 );
+ _pts->SetPoint(1, 1 , -1 , 0 );
+ _pts->SetPoint(2, 1 , 1 , 0 );
+ _pts->SetPoint(3, -1 , 1 , 0 );
+
+ vtkCellArray *lines = vtkCellArray::New();
+ lines->InsertNextCell(5);
+ lines->InsertCellPoint(0);
+ lines->InsertCellPoint(1);
+ lines->InsertCellPoint(2);
+ lines->InsertCellPoint(3);
+ lines->InsertCellPoint(0);
+
+ vtkPolyData *_pd = vtkPolyData::New();
+ _pd->SetPoints( _pts );
+ _pd->SetLines( lines );
+
+ vtkActor *_pointVtkActor = vtkActor::New();
+ vtkPolyDataMapper* _bboxMapper = vtkPolyDataMapper::New();
+
+ _bboxMapper->SetInput(_pd);
+ _pointVtkActor->SetMapper(_bboxMapper);
+
+ getRenderer()->AddActor(_pointVtkActor);
+
+
+
+ /////////////////////
+
+ //getRenderer()->AddActor(act);
- ren1->Render();
+ //getRenderer()->Render();
+
+
}
}
+ //=========================================================================
+ void wxVtkSceneManager::disconnectDrop()
+ {
+ _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(NULL);
+ }
//=========================================================================
wxVtkSceneManager::~wxVtkSceneManager()
{
- //_baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(NULL);
}
//=========================================================================
void wxVtkSceneManager::configureBaseView()
{
- vtkInteractorStyleBaseView2D *temp = new vtkInteractorStyleBaseView2D();
- _baseView->SetInteractorStyleBaseView(temp);
+ vtkInteractorStyleImage *temp = vtkInteractorStyleImage::New();
+ _baseView->GetWxVTKRenderWindowInteractor()->SetInteractorStyle(temp);
+ _baseView->GetRenderer()->SetActiveCamera(_baseView->GetCamera());
+ _baseView->GetRenderer()->ResetCamera ();
+ _baseView->GetCamera()->SetParallelProjection(true);
+ _baseView->Refresh();
+
}
//=========================================================================
- void wxVtkSceneManager::createGBlackBox()
+ void wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName, std::string boxName)
{
- InteractorStyleMaracas *toAdd = VTKGObjectsFactory::getInstance()->createGBlackBox(_baseView);
- registerController(toAdd);
+ int type = GBLACKBOX;
+
+ //Create the MVC Objects
+ GObjectModel *model = GObjectsMVCFactory::getInstance()->createGObjectModel(type);
+ vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
+ GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
+
+ //Prepares the initial model
+ double xx = x;
+ double yy = y;
+ double zz = 900;
+
+ _baseView->TransCoordScreenToWorld(xx,yy,zz);
+
+ //Associates the view with the correspondent renderer and the model.
+ //(NOTE: Refresh is only made by the view)
+ model->setInicPoint(xx,yy,zz);
+ view->setModel(model);
+ view->setRenderer(_baseView->GetRenderer());
+ view->initVtkObjects();
+
+ //Refresh renderwindow with new objects
+ refreshRenderWindow();
+
+ //Associates the controller with the correspondent model and view
+ controller->setModelAndView(model,view);
+
+ registerController((InteractorStyleMaracas*) controller);
}
//=========================================================================
return _baseView->GetRenWin();
}
//=========================================================================
-
+
+ void wxVtkSceneManager::refreshRenderWindow()
+ {
+ _baseView->GetRenWin()->Render();
+ }
+ //=========================================================================
//=========================================================================
} // EO namespace bbtk
#ifndef __wxVtkSceneManager_h__
#define __wxVtkSceneManager_h__
-//Includes Same project
-#include "VTKGObjectsFactory.h"
+//Includes same project
+#include "GObjectsMVCFactory.h"
//Includes creaMaracasVisu
#include <wxVtk3DBaseView.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
+#include <vtkInteractorStyleImage.h>
//Includes std
#include <iostream>
~wxVtkSceneManager();
void configureBaseView();
- void createGBlackBox();
+ void createGBlackBox(int x, int y,std::string packageName, std::string boxName);
void registerController(InteractorStyleMaracas *param);
vtkRenderWindow* getRenderWindow();
vtkRenderer* getRenderer();
+ void disconnectDrop();
+
private:
int _id;
wxVtk3DBaseView *_baseView;
+ void refreshRenderWindow();
protected:
};
ADD_LIBRARY(bbsVtkGUIEditorGraphic
${bbsVtkGUIEditorGraphic_CXX_SOURCES}
${bbsVtkGUIEditorGraphic_H_SOURCES} )
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::GBlackBoxController
+*/
+
+
+#include "GBlackBoxController.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ GBlackBoxController::GBlackBoxController()
+ {
+
+ }
+
+ //=========================================================================
+ GBlackBoxController::~GBlackBoxController()
+ {
+ }
+ //=========================================================================
+
+
+ //=========================================================================
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::GBlackBoxController :
+*/
+
+/**
+* \class bbtk::GBlackBoxController
+* \brief
+*/
+
+#ifndef __GBlackBoxController_h__
+#define __GBlackBoxController_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+#include "GObjectController.h"
+
+//Includes creaMaracasVisu
+
+//Includes std
+#include <iostream>
+
+
+namespace bbtk
+{
+
+ class GBlackBoxController : public GObjectController
+ {
+
+ public:
+
+ //Constructors
+ GBlackBoxController();
+ ~GBlackBoxController();
+
+ //Public methods
+
+
+ private:
+
+ //Attributes
+
+ //Private Methods
+
+ protected:
+
+ };
+
+
+}
+// namespace bbtk
+#endif
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::GObjectController
+*/
+
+
+#include "GObjectController.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ GObjectController::GObjectController()
+ {
+
+ }
+
+ //=========================================================================
+ GObjectController::~GObjectController()
+ {
+ }
+ //=========================================================================
+
+ void GObjectController::setModelAndView(GObjectModel* model, vtkGObjectView* view)
+ {
+ _model = model;
+ _view = view;
+ }
+ //=========================================================================
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::GObjectController :
+*/
+
+/**
+* \class bbtk::GObjectController
+* \brief
+*/
+
+#ifndef __GObjectController_h__
+#define __GObjectController_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+#include "GObjectModel.h"
+#include "vtkGObjectView.h"
+
+//Includes creaMaracasVisu
+#include <InteractorStyleMaracas.h>
+
+//Includes std
+#include <iostream>
+
+namespace bbtk
+{
+
+ class GObjectController : public InteractorStyleMaracas
+ {
+
+ public:
+
+ //Constructors
+ GObjectController();
+ ~GObjectController();
+
+ //Public methods
+
+ void setModelAndView(GObjectModel* model, vtkGObjectView* view);
+
+ private:
+
+ //Attributes
+ GObjectModel* _model;
+ vtkGObjectView* _view;
+
+
+ //Private Methods
+
+ protected:
+
+ };
+
+
+}
+// namespace bbtk
+#endif
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::GObjectsMVCFactory
+*/
+
+
+#include "GObjectsMVCFactory.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+
+ GObjectsMVCFactory* GObjectsMVCFactory:: instance = NULL;
+ GObjectsMVCFactory::GObjectsMVCFactory()
+ {
+
+ }
+
+ //=========================================================================
+ GObjectsMVCFactory::~GObjectsMVCFactory()
+ {
+ GObjectsMVCFactory::destroyInstance();
+ }
+ //=========================================================================
+
+
+ GObjectsMVCFactory* GObjectsMVCFactory :: getInstance()
+ {
+ if(instance == NULL){
+ instance = new GObjectsMVCFactory();
+ }
+ return instance;
+ }
+
+ //=========================================================================
+
+ void GObjectsMVCFactory :: destroyInstance()
+ {
+ instance=NULL;
+ }
+
+ //=========================================================================
+
+ vtkGObjectView* GObjectsMVCFactory :: createGObjectView(int type)
+ {
+ vtkGObjectView* view = NULL;
+ if (type == GBLACKBOX)
+ {
+ view = new vtkGBlackBoxView();
+ }
+ return view;
+ }
+
+ //=========================================================================
+
+ GObjectController* GObjectsMVCFactory :: createGObjectController(int type)
+ {
+ GObjectController *controller = NULL;
+ if (type == GBLACKBOX)
+ {
+ controller = new GBlackBoxController();
+ }
+ return controller;
+ }
+
+ //=========================================================================
+
+ GObjectModel* GObjectsMVCFactory :: createGObjectModel(int type)
+ {
+ GObjectModel *model = NULL;
+ if (type == GBLACKBOX)
+ {
+ model = new GBlackBoxModel();
+ }
+ return model;
+ }
+
+ //=========================================================================
+
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::GObjectsMVCFactory : abstract black-box interface.
+*/
+
+/**
+* \class bbtk::GObjectsMVCFactory
+* \brief
+*/
+
+#ifndef __GObjectsMVCFactory_h__
+#define __GObjectsMVCFactory_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+#include "GObjectController.h"
+#include "GObjectModel.h"
+#include "vtkGObjectView.h"
+
+#include "GBlackBoxController.h"
+#include "vtkGBlackBoxView.h"
+#include "GBlackBoxModel.h"
+
+//Includes creaMaracasVisu
+
+//Includes std
+#include <iostream>
+
+namespace bbtk
+{
+
+ class GObjectsMVCFactory
+ {
+
+ public:
+
+ //Constructors
+ GObjectsMVCFactory();
+ ~GObjectsMVCFactory();
+
+ //Public methods
+ static GObjectsMVCFactory* getInstance();
+ static void destroyInstance();
+ vtkGObjectView* createGObjectView(int type);
+ GObjectController* createGObjectController(int type);
+ GObjectModel* createGObjectModel(int type);
+
+ private:
+
+ //Attributes
+ static GObjectsMVCFactory* instance;
+
+ //Private Methods
+
+
+ protected:
+
+ };
+
+
+}
+// namespace bbtk
+#endif
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::vtkGBlackBoxView
+*/
+
+
+#include "vtkGBlackBoxView.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ vtkGBlackBoxView::vtkGBlackBoxView()
+ {
+ }
+
+ //=========================================================================
+ vtkGBlackBoxView::~vtkGBlackBoxView()
+ {
+ }
+
+ //=========================================================================
+ void vtkGBlackBoxView::refresh()
+ {
+ //paint();
+ }
+
+ //=========================================================================
+
+ void vtkGBlackBoxView::createVtkObjects() //virtual
+ {
+ vtkPoints *_pts = vtkPoints::New();
+ vtkCellArray *lines = vtkCellArray::New();
+ vtkPolyData *_pd = vtkPolyData::New();
+ vtkPolyDataMapper* _bboxMapper=vtkPolyDataMapper::New();
+ _objectActor=vtkActor::New();
+
+ _pts->SetNumberOfPoints(4);
+
+ double xInic, yInic,zInic,xFin, yFin,zFin;
+ _model->getInicPoint(xInic,yInic,zInic);
+ _model->getFinalPoint(xFin, yFin,zFin);
+ cout<<"RaC ----------"<<endl;
+ cout<<"RaC vtkGBlackBoxView::createVtkObjects() inic:"<<xInic<<" "<<yInic<<" "<<zInic<<endl;
+ cout<<"RaC vtkGBlackBoxView::createVtkObjects() fin:"<<xFin<<" "<<yFin<<" "<<zFin<<endl;
+
+ _pts->SetPoint(0, xInic, yInic, 0 );
+ _pts->SetPoint(1, xInic, yFin, 0 );
+ _pts->SetPoint(2, xFin, yFin, 0 );
+ _pts->SetPoint(3, xFin, yInic, 0 );
+
+ lines->InsertNextCell(5);
+ lines->InsertCellPoint(0);
+ lines->InsertCellPoint(1);
+ lines->InsertCellPoint(2);
+ lines->InsertCellPoint(3);
+ lines->InsertCellPoint(0);
+
+ _pd->SetPoints( _pts );
+ _pd->SetLines( lines );
+
+ _bboxMapper->SetInput(_pd);
+ _objectActor->SetMapper(_bboxMapper);
+
+ }
+
+ //=========================================================================
+
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::vtkGBlackBoxView : abstract black-box interface.
+*/
+
+/**
+* \class bbtk::vtkGBlackBoxView
+* \brief
+*/
+
+#ifndef __vtkGBlackBoxView_h__
+#define __vtkGBlackBoxView_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+#include "vtkGObjectView.h"
+
+//Includes creaMaracasVisu
+#include <wxVtk3DBaseView.h>
+
+//Includes vtk
+#include <vtkRenderer.h>
+
+#include "vtkPolyDataMapper.h"
+#include "vtkActor.h"
+
+#include "vtkRenderer.h"
+#include "vtkCellArray.h"
+
+
+//Includes std
+#include <iostream>
+
+
+namespace bbtk
+{
+
+ class vtkGBlackBoxView : public vtkGObjectView
+ {
+
+ public:
+
+ //Constructors
+ vtkGBlackBoxView();
+ ~vtkGBlackBoxView();
+
+ //Public methods
+
+ private:
+
+ //Private Attributes
+
+ //Private Methods
+
+ protected:
+
+ //Protected Attributes
+
+ //Protected Methods
+ virtual void createVtkObjects();
+ virtual void refresh();
+ };
+
+
+}
+// namespace bbtk
+#endif
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+/**
+* \file
+* \brief Class bbtk::vtkGObjectView
+*/
+
+
+#include "vtkGObjectView.h"
+
+namespace bbtk
+{
+
+
+ //=========================================================================
+ vtkGObjectView::vtkGObjectView()
+ {
+ _renderer=NULL;
+ _objectActor=NULL;
+ }
+
+ //=========================================================================
+ vtkGObjectView::~vtkGObjectView()
+ {
+ }
+ //=========================================================================
+
+ void vtkGObjectView::refresh()
+ {
+ //paint();
+ }
+
+ //=========================================================================
+
+ void vtkGObjectView::setModel(GObjectModel *model)
+ {
+ _model=model;
+ }
+
+ //=========================================================================
+
+ void vtkGObjectView::setRenderer(vtkRenderer* renderer)
+ {
+ _renderer=renderer;
+ }
+
+ //=========================================================================
+
+ void vtkGObjectView::initVtkObjects()
+ {
+ createVtkObjects();
+ addVtkActors();
+ }
+
+ //=========================================================================
+
+ void vtkGObjectView::createVtkObjects() //virtual
+ {
+ //virtual
+ }
+
+ //=========================================================================
+
+ void vtkGObjectView::addVtkActors()//virtual
+ {
+ _renderer->AddActor(_objectActor);
+ _renderer->Render();
+ }
+
+ //=========================================================================
+
+} // EO namespace bbtk
+
+// EOF
+
--- /dev/null
+/*=========================================================================
+Program: bbtk
+Module: $RCSfile$
+Language: C++
+Date: $Date$
+Version: $Revision$
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : 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,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* or in the file LICENSE.txt.
+*
+* As a counterpart to the access to the source code and rights to copy,
+* modify and redistribute granted by the license, users are provided only
+* with a limited warranty and the software's author, the holder of the
+* economic rights, and the successive licensors have only limited
+* liability.
+*
+* The fact that you are presently reading this means that you have had
+* knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */
+
+
+
+/**
+* \file
+* \brief Class bbtk::vtkGObjectView : abstract black-box interface.
+*/
+
+/**
+* \class bbtk::vtkGObjectView
+* \brief
+*/
+
+#ifndef __vtkGObjectView_h__
+#define __vtkGObjectView_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+#include "GObjectModel.h"
+
+//Includes creaMaracasVisu
+#include <wxVtk3DBaseView.h>
+
+//Includes vtk
+#include <vtkRenderer.h>
+
+#include "vtkConeSource.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkActor.h"
+
+
+//Includes std
+#include <iostream>
+
+
+namespace bbtk
+{
+
+ class vtkGObjectView
+ {
+
+ public:
+
+ //Constructors
+ vtkGObjectView();
+ ~vtkGObjectView();
+
+ //Public methods
+ void setModel(GObjectModel *model);
+ void setRenderer(vtkRenderer* renderer);
+ void initVtkObjects();
+
+ virtual void refresh();
+
+ private:
+
+ //Private Attributes
+
+ //Private Methods
+
+ protected:
+
+ //Protected Attributes
+ vtkRenderer *_renderer;
+ GObjectModel *_model;
+ vtkActor *_objectActor;
+
+ //Protected Methods
+ virtual void createVtkObjects();
+ virtual void addVtkActors();
+ };
+
+
+}
+// namespace bbtk
+#endif
+
//=========================================================================
wxGEditorTabPanel::~wxGEditorTabPanel()
{
- delete _sceneManager;
+ _sceneManager->disconnectDrop();
}
//=========================================================================
bool wxGEditorTabPanel::OnDropText(wxCoord x, wxCoord y, const wxString& data)
{
- _sceneManager->createGBlackBox();
+ std::string packageName="";
+ std::string boxName="";
+ _sceneManager->createGBlackBox(x,y,packageName, boxName);
cout<<"RaC DyD:"<<data<<" x:"<<x<<" y:"<<y<<endl;
return true;
-
+
}
//=========================================================================
#ifndef __wxGEditorTabPanel_h__
#define __wxGEditorTabPanel_h__
+//Includes same project
+#include "wxVtkSceneManager.h"
+
+//Includes wxWidgets
#include <wx/panel.h>
#include <wx/aui/aui.h>
#include <wx/dnd.h>
+//Includes creaMaracasVisu
#include <wxVtk3DBaseView.h>
+//Includes std
#include <iostream>
-#include "wxVtkSceneManager.h"
-#include "VTKGObjectsFactory.h"
+
namespace bbtk
{