]> Creatis software - bbtkGEditor.git/commitdiff
It works !! Basic D&D and creation of VTK rectangle... Good work
authorcorredor <>
Fri, 26 Mar 2010 15:46:17 +0000 (15:46 +0000)
committercorredor <>
Fri, 26 Mar 2010 15:46:17 +0000 (15:46 +0000)
21 files changed:
appli/bbEditor/bbEditor.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/CMakeLists.txt
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h

index 57bd80ccec7262fe984642c282e5d80e61a300b5..3629d9bfae64d93ffc64dd6aed0894b9d0474a07 100644 (file)
@@ -5,17 +5,17 @@
 //==========================================================================
 
 #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);
diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx
new file mode 100644 (file)
index 0000000..aa3675e
--- /dev/null
@@ -0,0 +1,60 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.h
new file mode 100644 (file)
index 0000000..4c10551
--- /dev/null
@@ -0,0 +1,86 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx
new file mode 100644 (file)
index 0000000..d871e06
--- /dev/null
@@ -0,0 +1,99 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h
new file mode 100644 (file)
index 0000000..9f7a265
--- /dev/null
@@ -0,0 +1,98 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h
new file mode 100644 (file)
index 0000000..bdc66c1
--- /dev/null
@@ -0,0 +1,63 @@
+/*=========================================================================                                                                               
+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
+
index 1b87e2c766746a852a77ba18d83867761bc8e5b5..e476c03cf225682f21c2d718023058d3a18dedd0 100644 (file)
@@ -35,12 +35,6 @@ Version:   $Revision$
 
 
 #include "wxVtkSceneManager.h"
-#include <vtkInteractorStyleBaseView2D.h>
-
-#include "vtkConeSource.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkActor.h"
-#include "vtkRenderer.h"
 
 namespace bbtk
 {
@@ -55,14 +49,13 @@ 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());
@@ -71,31 +64,103 @@ namespace bbtk
                        
                   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);
        }
 
        //=========================================================================
@@ -120,7 +185,12 @@ namespace bbtk
                return _baseView->GetRenWin();
        }
        //=========================================================================
-
+       
+       void wxVtkSceneManager::refreshRenderWindow()
+       {
+               _baseView->GetRenWin()->Render();
+       }
+       //=========================================================================
 
        //=========================================================================
 }  // EO namespace bbtk
index f3383ed5600286c079a76898e64bcba9a93a76dc..92f4a60aec3b0d8f34e9be398e39f315a46e318d 100644 (file)
@@ -43,8 +43,8 @@ Version:   $Revision$
 #ifndef __wxVtkSceneManager_h__
 #define __wxVtkSceneManager_h__
 
-//Includes Same project
-#include "VTKGObjectsFactory.h"
+//Includes same project
+#include "GObjectsMVCFactory.h"
 
 //Includes creaMaracasVisu
 #include <wxVtk3DBaseView.h>
@@ -54,6 +54,7 @@ Version:   $Revision$
 #include <vtkRenderWindow.h>
 #include <vtkRenderWindowInteractor.h>
 #include <vtkRenderer.h>
+#include <vtkInteractorStyleImage.h>
 
 //Includes std
 #include <iostream>
@@ -68,17 +69,20 @@ namespace bbtk
                ~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:
 
        };
index 18d6e909248ee44e0fe7e8d6bada1bea18b225aa..654574c48f1fb08eb2c78110ee9e6a078546e693 100644 (file)
@@ -9,4 +9,5 @@ INCLUDE_DIRECTORIES(../bbsKernelEditorGraphic)
 ADD_LIBRARY(bbsVtkGUIEditorGraphic
                 ${bbsVtkGUIEditorGraphic_CXX_SOURCES}
                 ${bbsVtkGUIEditorGraphic_H_SOURCES}  )
+                               
 
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx
new file mode 100644 (file)
index 0000000..7cdf253
--- /dev/null
@@ -0,0 +1,61 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.h b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.h
new file mode 100644 (file)
index 0000000..a908f10
--- /dev/null
@@ -0,0 +1,85 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx
new file mode 100644 (file)
index 0000000..f00541c
--- /dev/null
@@ -0,0 +1,65 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.h b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.h
new file mode 100644 (file)
index 0000000..aea9ab9
--- /dev/null
@@ -0,0 +1,90 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.cxx
new file mode 100644 (file)
index 0000000..a03ae69
--- /dev/null
@@ -0,0 +1,116 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.h b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.h
new file mode 100644 (file)
index 0000000..d02e18b
--- /dev/null
@@ -0,0 +1,96 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.cxx
new file mode 100644 (file)
index 0000000..1dc1d76
--- /dev/null
@@ -0,0 +1,104 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.h b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.h
new file mode 100644 (file)
index 0000000..35a8c51
--- /dev/null
@@ -0,0 +1,100 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.cxx
new file mode 100644 (file)
index 0000000..0f748b8
--- /dev/null
@@ -0,0 +1,103 @@
+/*=========================================================================                                                                               
+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
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.h b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.h
new file mode 100644 (file)
index 0000000..d314081
--- /dev/null
@@ -0,0 +1,106 @@
+/*=========================================================================                                                                               
+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
+
index e5c437be980fae4303cf7578d12c805f110a6259..d6adae8528c1554746271ecc367f083529176dfa 100644 (file)
@@ -57,7 +57,7 @@ namespace bbtk
        //=========================================================================
        wxGEditorTabPanel::~wxGEditorTabPanel()
        {
-               delete _sceneManager;
+               _sceneManager->disconnectDrop();
        }
        
        //=========================================================================
@@ -76,10 +76,12 @@ namespace bbtk
 
        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;
-
        }
 
        //=========================================================================
index f84d193f61823030c597f56cd3cc57a79e30a4a3..7ae4841833b75f2ad359bd09b37950a48c835413 100644 (file)
@@ -43,16 +43,21 @@ Version:   $Revision$
 #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
 {