]> Creatis software - bbtkGEditor.git/commitdiff
Vestion inestable .... It works but it must be changed the connector creation ...
authorcorredor <>
Wed, 21 Apr 2010 14:20:03 +0000 (14:20 +0000)
committercorredor <>
Wed, 21 Apr 2010 14:20:03 +0000 (14:20 +0000)
17 files changed:
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h
lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorController.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorController.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorView.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GPortController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GPortController.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourController.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourController.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourView.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourView.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx

diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx
new file mode 100644 (file)
index 0000000..05ce3b8
--- /dev/null
@@ -0,0 +1,117 @@
+/*=========================================================================                                                                               
+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::GConnectorModel 
+*/
+
+
+#include "GConnectorModel.h"
+
+namespace bbtk
+{
+
+       //=========================================================================
+
+       GConnectorModel::GConnectorModel()
+       {               
+               //_startPort = NULL;
+               //_endPort = NULL;
+       }
+
+       //=========================================================================
+
+       GConnectorModel::~GConnectorModel()
+       {
+       }
+
+       //=========================================================================
+
+       void GConnectorModel::setStartPort(GPortModel* startPort)
+       {
+               _startPort = startPort;
+               
+               double xCenter,yCenter,zCenter;
+               startPort->getCenter(xCenter,yCenter,zCenter);
+               double xFport,yFport,zFport;
+               startPort->getFinalPoint(xFport,yFport,zFport);
+
+               setInicPoint(xCenter,yFport,zCenter);
+       }
+
+       //=========================================================================
+       
+       void GConnectorModel::setEndPort(GPortModel* endPort)
+       {
+               _endPort = endPort;
+
+               double xCenter,yCenter,zCenter;         
+               endPort->getCenter(xCenter,yCenter,zCenter);
+               double xIport,yIport,zIport;
+               endPort->getInicPoint(xIport,yIport,zIport);
+
+               setFinalPoint(xCenter,yIport,zCenter);
+       }
+
+       //=========================================================================
+       
+       GPortModel* GConnectorModel::getStartPort()
+       {
+               return _startPort;
+       }
+
+       //=========================================================================
+       
+       GPortModel* GConnectorModel::getEndPort()
+       {
+               return _endPort;
+       }
+       
+       //=========================================================================
+
+       manualContourModel* GConnectorModel::getManualContourModel()
+       {
+               return _model;
+       }
+
+       //=========================================================================
+       
+       void GConnectorModel::setManualContourModel(manualContourModel* model)
+       {
+               _model = model;
+       }
+
+       //=========================================================================
+
+}  // EO namespace bbtk
+
+// EOF
+
diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.h
new file mode 100644 (file)
index 0000000..b6495c3
--- /dev/null
@@ -0,0 +1,97 @@
+/*=========================================================================                                                                               
+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::GConnectorModel : abstract black-box interface. 
+*/
+
+/**
+* \class bbtk::GConnectorModel
+* \brief 
+*/
+
+#ifndef __GConnectorModel_h__
+#define __GConnectorModel_h__
+
+//Includes same project
+#include "GlobalConstants.h"
+#include "GObjectModel.h"
+#include "GPortModel.h"
+
+//Includes creaMaracasVisu
+#include <manualContourModel.h>
+
+//Includes std
+#include <iostream>
+
+
+namespace bbtk
+{
+
+       class GConnectorModel : public GObjectModel 
+       {
+
+       public: 
+
+               //Constructors
+               GConnectorModel();
+               ~GConnectorModel();
+               
+               //Public methods                
+               void setStartPort(GPortModel* startPort);
+               void setEndPort(GPortModel* endPort);
+               void setManualContourModel(manualContourModel* model);
+
+               GPortModel* getStartPort();
+               GPortModel* getEndPort();               
+               manualContourModel* getManualContourModel();
+               
+       private:
+
+               //Attributes
+               GPortModel* _startPort;
+               GPortModel* _endPort;
+               manualContourModel* _model;
+
+               //Private Methods
+
+       protected:
+               //Protected methods
+               
+       };
+
+
+}
+// namespace bbtk
+#endif
+
index 50b0fd6c39c8aa4abc1ef6bd4900adde01ddb594..7cd922090d8942566e918bf94158adb28f4cc7f7 100644 (file)
@@ -75,11 +75,11 @@ namespace bbtk
                double posX=xInic,posY=yInic,posZ=zInic;
                if(_portType==GOUTPUTPORT)
                {
-                       posY = yInic+PORT_HEIGHT;
+                       posY = yFin;
                }
                else if(_portType==GINPUTPORT)
                {
-                       posY = yFin;
+                       posY = yInic+PORT_HEIGHT;
                }
 
                //Attribute '_posInBox' starts with value 0 and it represents the position of the port in the box from left to right
index 3d8d7558059ef1e9c54927952301bc4008b4cfbe..50770b858c72168febd332690011ff3b3e1528ba 100644 (file)
@@ -61,12 +61,13 @@ namespace bbtk
        // Object dimensions
        const double BOX_HEIGHT         =       15;
        const double BOX_WIDTH          =       100;
-       const double PORT_HEIGHT        =       2;
-       const double PORT_WIDTH         =       2;
+       const double PORT_HEIGHT        =       2.5;
+       const double PORT_WIDTH         =       2.5;
 
        // Commands
        const int REPAINT = 201;
        const int INIT_CREATION_CONTOUR= 202;
+       const int FIN_CREATION_CONTOUR= 203;
        
        // Colors (object_state_(R|G|B))
        const double BOXCONTOUR_NH_R=0.0;
@@ -84,6 +85,8 @@ namespace bbtk
        const double BOXCONTOUR_SELECTED_R=0.65;
        const double BOXCONTOUR_SELECTED_G=0.65;
        const double BOXCONTOUR_SELECTED_B=0.05;
+
+       // Id's
 }
 // namespace bbtk
 #endif
index a95d229934a5fdb81b3d3ccd6b6bdcd654c30fa3..4e337be93c3d97cc460fee84c9377324d2457934 100644 (file)
@@ -41,96 +41,23 @@ namespace bbtk
 
 
        //=========================================================================
-       wxVtkSceneManager::wxVtkSceneManager(wxDropTarget *parent, wxVtk3DBaseView *baseView,int id)
+       wxVtkSceneManager::wxVtkSceneManager(wxDropTarget *parent, wxVtk3DBaseView *baseView,int idManager)
        {
-               _id=id;
+               _numBoxes=0;
+               _idManager=idManager;
                _baseView=baseView;
+               _idLastController=0;
+
                if( _baseView!=NULL )
                {
-                       
                        _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(parent);
                        registerController(this);
                        configureBaseView();
-
-                       ///// ******* TO ERASE *******
-                       //JUST TO TEST
-                       //              
-                       /*
-                       vtkConeSource *cone = vtkConeSource::New();
-       
-                  cone->SetResolution(10);
-                       
-                  vtkPolyDataMapper *map = vtkPolyDataMapper::New();
-                  map->SetInput(cone->GetOutput());
-                       
-                  vtkActor *act = vtkActor::New();
-                       
-                  act->SetMapper(map);
-                       
-                  vtkPoints *_pts = vtkPoints::New();
-                       _pts->SetNumberOfPoints(4);
-
-                       _pts->SetPoint(0, -100  , -100  , 900 );
-                       _pts->SetPoint(1,  100  , -100  , 900 );
-                       _pts->SetPoint(2,  100  ,  100  , 900 );
-                       _pts->SetPoint(3, -100  ,  100  , 900 );
-       
-                       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);
-
-                       
-                       
-                                       
-                  vtkPoints *_pts2 = vtkPoints::New();
-                       _pts2->SetNumberOfPoints(4);
-
-                       _pts2->SetPoint(0, -105 , -100  , -50 );
-                       _pts2->SetPoint(1,  100 , -100  , -50 );
-                       _pts2->SetPoint(2,  100 ,  100  , -50 );
-                       _pts2->SetPoint(3, -105 ,  100  , -50 );
-       
-                       vtkCellArray *lines2 = vtkCellArray::New();
-                       lines2->InsertNextCell(5);
-                       lines2->InsertCellPoint(0);
-                       lines2->InsertCellPoint(1);
-                       lines2->InsertCellPoint(2);
-                       lines2->InsertCellPoint(3);
-                       lines2->InsertCellPoint(0);
-
-                       vtkPolyData *_pd2 = vtkPolyData::New();
-                       _pd2->SetPoints( _pts2 );
-                       _pd2->SetLines( lines2 );
-
-                       vtkActor *_pointVtkActor2       =       vtkActor::New();
-                       vtkPolyDataMapper* _bboxMapper2         =       vtkPolyDataMapper::New();
-
-                       _bboxMapper2->SetInput(_pd2);
-                       _pointVtkActor2->SetMapper(_bboxMapper2);
-
-                       getRenderer()->AddActor(_pointVtkActor2);
-
-                       */
-                       // ******* TO ERASE *******
-                       /////////////////////
+                       _worldState=NOTHING_HAPPENS;
                        
                }
+
+               
        }
 
 
@@ -199,17 +126,16 @@ namespace bbtk
                _baseView->TransCoordScreenToWorld(xx,yy,zz);
                model->setInicPoint(xx,yy,zz);
                
-               int cantObjects = _objects.size();
-               cantObjects++;
+               _numBoxes++;
                std::stringstream stream;
                
-               if(cantObjects<10)
+               if(_numBoxes<10)
                {
-                       stream << "Box0" << cantObjects;
+                       stream << "Box0" << _numBoxes;
                }
                else
                {
-                       stream << "Box" << cantObjects;
+                       stream << "Box" << _numBoxes;
                }
                std::string arraystring = stream.str();
 
@@ -261,8 +187,6 @@ namespace bbtk
                registerController((InteractorStyleMaracas*) controller);
 
                //Add the object to the objects list 
-               _objects.push_back(controller);
-
                int newId = _controllers.size();
                controller->setId(newId);
                _controllers[newId] = controller;
@@ -323,10 +247,19 @@ namespace bbtk
 
        void wxVtkSceneManager::createGConnector(GPortModel* startPort)
        {
-               manualContourControler* manContourControl       = new manualContourControler();
-               GConnectorView* manViewerContour        = new GConnectorView();
+               int type = GCONNECTOR;
+
+               manualConnectorContourController* manContourControl     = new manualConnectorContourController();
+               manualConnectorContourView* manViewerContour    = new manualConnectorContourView();
                manualContourModel* manContourModel     = new manualContourModel();
+
+               GConnectorController* connectorcontroller = new GConnectorController();                         
+               GConnectorModel* connectorModel = new GConnectorModel();
+               GConnectorView* connectorView = new GConnectorView();
+               connectorModel->setGObjectType(type);
+
                manContourModel->SetCloseContour(false);
+               connectorModel->setStartPort(startPort);
 
                manViewerContour->SetModel( manContourModel );
                manViewerContour->SetWxVtkBaseView( _baseView );
@@ -339,21 +272,14 @@ namespace bbtk
                manViewerContour->SetWidthLine(1);
 
                manContourControl->SetModelView( manContourModel , manViewerContour );
-               manContourControl->Configure();
-               int i,sizeLstPoints = manContourModel->GetSizeLstPoints();
-
-               for ( i=0; i<sizeLstPoints; i++ )
-               {
-                       manViewerContour->AddPoint();
-               }
-
+               
                manContourControl->CreateNewManualContour();
 
                manViewerContour->RefreshContour();
 
 
                double x,y,z;
-               startPort->getCenter(x,y,z);
+               connectorModel->getInicPoint(x,y,z);
 
                manContourControl->SetState(1);
                manContourModel->SetCloseContour(false);
@@ -370,7 +296,15 @@ namespace bbtk
 
                manContourControl->SetMoving( false );
 
-               registerController((InteractorStyleMaracas*) manContourControl);
+               registerController((InteractorStyleMaracas*) connectorcontroller);
+
+               connectorcontroller->setManualContourController(manContourControl);             
+               connectorModel->setManualContourModel(manContourModel);
+               connectorcontroller->setModelAndView(connectorModel,NULL);
+
+               int newId = _controllers.size();
+               connectorcontroller->setId(newId);
+               _controllers[newId] = connectorcontroller;
 
        }
 
@@ -407,22 +341,71 @@ namespace bbtk
        void wxVtkSceneManager::update(int idController,int command)
        {
                
-               if(command==INIT_CREATION_CONTOUR)
+               if(command == INIT_CREATION_CONTOUR)
                {       
                        GObjectController* cont = _controllers[idController];
                        if(cont->getGObjectType() == GPORT)
                        {
-                               GPortController* controller = (GPortController*)cont;
-                               vtkGPortView* view = (vtkGPortView*)controller->getView();
-
-                               if(view->getState() == CREATING_CONTOUR)
+                               GPortModel* startOutputPort = (GPortModel*)cont->getModel();
+                               createGConnector(startOutputPort);
+                       }
+                       // The last one is the controller of the connector
+                       for(int i=0;i<_controllers.size()-1;i++)
+                       {
+                               GObjectController* cont = _controllers[i];
+                               if(cont->getGObjectType() == GPORT )
                                {
-                                       //pre: The port in this state is an output port                                 
-                                       GPortModel* startOutputPort = (GPortModel*)controller->getModel();
-                                       createGConnector(startOutputPort);
+                                       GPortModel* port = (GPortModel*)cont->getModel();
+                                       if(port->getPortType()==GINPUTPORT)
+                                       {
+                                               cont->SetActive(true);
+                                       }
+                                       else
+                                       {
+                                               cont->getView()->setState(NOTHING_HAPPENS);
+                                               cont->SetActive(false);
+                                       }
                                }
+                               else
+                               {
+                                       cont->getView()->setState(NOTHING_HAPPENS);
+                                       cont->SetActive(false);
+                               }                               
                        }
+                       _worldState = CREATING_CONTOUR;
+               }
+               else if(command == FIN_CREATION_CONTOUR && _worldState == CREATING_CONTOUR)
+               {
+                       _worldState = NOTHING_HAPPENS;
+                       int id = _controllers.size()-1;
+                       GObjectController* cont = _controllers[id];                     
+                       GConnectorModel* modelContour = (GConnectorModel*)cont->getModel();
+
+                       GObjectController* finPort = _controllers[idController];
+                       if(cont->getGObjectType() == GPORT)
+                       {
+                               GPortModel* modelPort = (GPortModel*)finPort->getModel();
+                               modelContour->setEndPort(modelPort);
+                       }                       
+
+                       manualContourControler* manCont = ((GConnectorController*)cont)->getManualContourController();
                        
+                       //manCont->SetCompleteCreation( true );
+                       //manCont->SetKeyBoardMoving( false );
+                       //manCont->GetManualContourModel()->SetCloseContour(false);
+                       //manCont->SetEditable( false );
+                       //manCont->SetPosibleToMove( false );
+                       //manCont->SetState(0);
+
+                       for(int i=0;i<_controllers.size();i++)
+                       {
+                               GObjectController* cont = _controllers[i];
+                               if(cont->getView()!=NULL)
+                               {
+                                       cont->getView()->setState(NOTHING_HAPPENS);
+                               }
+                               cont->SetActive(true);                                                          
+                       }
                }
        }
 
index 38552dbe7fe0e3ff0860a1168fb190097becddaa..4a3f7e1a090320646cb33313b6bb03d9af1075e8 100644 (file)
@@ -47,8 +47,12 @@ Version:   $Revision$
 #include "GObjectsMVCFactory.h"
 #include "Observer.h"
 #include "GPortModel.h"
-#include "vtkGPortView.h"
 #include "GConnectorView.h"
+#include "GConnectorModel.h"
+#include "GConnectorController.h"
+#include "vtkGPortView.h"
+#include "manualConnectorContourView.h"
+#include "manualConnectorContourController.h"
 
 //Includes bbtk
 #include <bbtkBlackBoxInputDescriptor.h>
@@ -67,8 +71,6 @@ Version:   $Revision$
 #include <vtkRenderer.h>
 #include <vtkInteractorStyleImage.h>
 
-#include <vtkVectorText.h>
-#include <vtkLinearExtrusionFilter.h>
 
 //Includes std
 #include <iostream>
@@ -81,7 +83,7 @@ namespace bbtk
        class wxVtkSceneManager : public InteractorStyleMaracas , public Observer
        {
        public: 
-               wxVtkSceneManager(wxDropTarget *parent, wxVtk3DBaseView *baseView, int id);
+               wxVtkSceneManager(wxDropTarget *parent, wxVtk3DBaseView *baseView, int idManager);
                ~wxVtkSceneManager();
 
                void configureBaseView();
@@ -104,10 +106,19 @@ namespace bbtk
                
        private:
 
-               int _id;
+               // Last controller created
+               int _idLastController;
+
+               // Id of the manager, the same of the panel
+               int _idManager;
+
+               // Boxes number in the scene
+               int _numBoxes;
+
                wxVtk3DBaseView *_baseView;
 
-               std::vector<GObjectController*> _objects;
+               int _worldState;
+
                std::map<int,GObjectController*> _controllers;
 
        protected:
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorController.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorController.cxx
new file mode 100644 (file)
index 0000000..02c5fed
--- /dev/null
@@ -0,0 +1,195 @@
+/*=========================================================================                                                                               
+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::GConnectorController 
+*/
+
+
+#include "GConnectorController.h"
+
+namespace bbtk
+{
+
+
+       //=========================================================================
+       GConnectorController::GConnectorController()
+       {
+
+       }
+
+       //=========================================================================
+
+       GConnectorController::~GConnectorController()
+       {
+       }
+
+       //=========================================================================
+
+       bool GConnectorController::OnMouseMove()
+       {
+               
+               if ( _vtkInteractorStyleBaseView!=NULL)
+               {
+                       int X,Y;
+                       wxVTKRenderWindowInteractor *_wxVTKiren;
+                       _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+                       _wxVTKiren->GetEventPosition( X , Y );
+
+                       if ( (_vtkInteractorStyleBaseView->GetInteractor()->GetControlKey()==0) &&(_vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey()==0) ) 
+                       {
+                               _controller->MouseMove(X,Y);
+                       }
+                       
+               }
+               return true;
+       }
+
+       //=========================================================================
+       
+       bool GConnectorController::OnLeftButtonDown()
+       {
+               
+               if ( _vtkInteractorStyleBaseView!=NULL )
+               {
+                       int X,Y;
+                       wxVTKRenderWindowInteractor *wxVTKiren;
+                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+                       wxVTKiren->GetEventPosition(X,Y);
+                       
+                       _controller->SetKeyBoardMoving( false );
+                       _controller->MouseClickLeft(X,Y);
+
+               }
+               return true;
+       }
+
+       //=========================================================================
+
+       bool GConnectorController::OnLeftButtonUp()
+       {
+               if( _vtkInteractorStyleBaseView!= NULL )
+               {
+                       int X,Y;
+                       wxVTKRenderWindowInteractor *wxVTKiren;
+                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+                       wxVTKiren->GetEventPosition(X, Y);
+
+                       _controller->MouseReleaseLeft(X,Y);
+                       
+               }
+               return true;
+
+       }
+       
+       //=========================================================================
+       
+       bool GConnectorController::OnLeftDClick()
+       {
+
+               if ( _vtkInteractorStyleBaseView!=NULL )
+               {
+                       int X,Y;
+                       wxVTKRenderWindowInteractor *wxVTKiren;
+                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+                       wxVTKiren->GetEventPosition(X,Y);
+
+                       _controller->MouseDLeft(X,Y);
+
+               }
+               return true;
+       }
+       
+       //=========================================================================
+       
+       bool GConnectorController::OnRightButtonDown()
+       {
+               if( _vtkInteractorStyleBaseView!= NULL )
+               {
+                       int X,Y;
+                       wxVTKRenderWindowInteractor *wxVTKiren;
+                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+                       wxVTKiren->GetEventPosition(X, Y);
+                       
+                       _controller->MouseClickRight(X,Y);
+                       
+               }
+               return true;
+       }
+               
+       //=========================================================================
+
+       bool GConnectorController::OnRightButtonUp()
+       {
+               return true;
+       }
+
+       //=========================================================================
+
+       bool GConnectorController::OnMiddleButtonDown()
+       {
+               if ( _vtkInteractorStyleBaseView!=NULL )
+               {
+                       int X,Y,Z=900;
+                       wxVTKRenderWindowInteractor *wxVTKiren;
+                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+                       wxVTKiren->GetEventPosition(X, Y);
+                       _controller->GetManualViewBaseContour()->InitMove( X, Y,Z);
+               }
+               return true;
+       }
+       //=========================================================================
+       bool GConnectorController::OnMiddleButtonUp()
+       {
+               return true;
+       }
+
+       //=========================================================================
+
+       manualContourControler* GConnectorController::getManualContourController()
+       {
+               return _controller;
+       }
+
+       //=========================================================================
+       
+       void GConnectorController::setManualContourController(manualContourControler* controller)
+       {
+               _controller = controller;
+               _controller->SetVtkInteractorStyleBaseView(_vtkInteractorStyleBaseView);
+       }
+
+       //=========================================================================
+
+}  // EO namespace bbtk
+
+// EOF
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorController.h b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorController.h
new file mode 100644 (file)
index 0000000..fa92fc1
--- /dev/null
@@ -0,0 +1,97 @@
+/*=========================================================================                                                                               
+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::GConnectorController : abstract black-box interface. 
+*/
+
+/**
+* \class bbtk::GConnectorController
+* \brief 
+*/
+
+#ifndef __GConnectorController_h__
+#define __GConnectorController_h__
+
+//Includes same project
+#include "GObjectController.h"
+
+//Includes creaMaracasVisu
+#include <manualContourControler.h>
+
+//Includes std
+#include <iostream>
+
+
+namespace bbtk
+{
+
+       class GConnectorController : public GObjectController
+       {
+
+       public: 
+
+               //Constructors
+               GConnectorController();
+               ~GConnectorController();
+               
+               //Public methods                
+               virtual bool  OnMouseMove();
+               virtual bool  OnLeftButtonDown(); 
+               virtual bool  OnLeftButtonUp();
+               virtual bool  OnLeftDClick();
+               virtual bool  OnRightButtonDown();
+               virtual bool  OnRightButtonUp();
+               virtual bool  OnMiddleButtonDown();
+               virtual bool  OnMiddleButtonUp();
+
+               manualContourControler* getManualContourController();
+               void setManualContourController(manualContourControler* controller);
+
+       private:
+
+               //Attributes
+               manualContourControler* _controller;
+
+               //Private Methods
+
+       protected:
+               //Protected methods
+               
+       };
+
+
+}
+// namespace bbtk
+#endif
+
index ee86d3d2d9694078e2c289a5fdefb944d9c8b492..9c2388fc5262b6f02be4a77b07e51026b4eaecad 100644 (file)
@@ -53,7 +53,7 @@ namespace bbtk
 
        void GConnectorView::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type)
        {
-               _wxvtkbaseview->TransCoordScreenToWorld(X,Y,Z,type);
+               //_wxvtkbaseview->TransCoordScreenToWorld(X,Y,Z,type);
        }
 
 }  // EO namespace bbtk
index 3cd5c11011a0d328b10fa2a6b25a2e711345e76e..fb9825150557bd6df5465b121980311a9afabf34 100644 (file)
@@ -44,10 +44,9 @@ Version:   $Revision$
 #define __GConnectorView_h__
 
 //Includes same project
+#include "vtkGObjectView.h"
 
 //Includes creaMaracasVisu
-#include <manualViewContour.h>
-
 
 //Includes std
 #include <iostream>
@@ -56,7 +55,7 @@ Version:   $Revision$
 namespace bbtk
 {
 
-       class GConnectorView : public manualViewContour
+       class GConnectorView : public vtkGObjectView
        {
 
        public: 
index b2f863be11d9c522f89e343c1e2a4b70b3e138f4..66106085a683f60769a45836828ee37fd2c217f4 100644 (file)
@@ -43,7 +43,7 @@ namespace bbtk
        //=========================================================================
        GPortController::GPortController()
        {
-               
+               _isLeftClickDown=false;
        }
 
        //=========================================================================
@@ -64,57 +64,54 @@ namespace bbtk
 
                        int state  = _view->getState();
                        
-                       int portType = ((GPortModel*)_model)->getPortType();
-
                        //Evaluate new state
-                       if(!_model->hasChanged() && state==HIGHLIGHTED && portType==GOUTPUTPORT )
+                       if(state == HIGHLIGHTED)
                        {
-                               _view->setState(CREATING_CONTOUR);
-                               _model->setChanged();
+                               _isLeftClickDown=true;
                        }
 
-                       _model->notifyObservers(_id);
-
                }
                return true;
        }
        //=========================================================================
        bool GPortController::OnLeftButtonUp()
        {
-               if ( _vtkInteractorStyleBaseView!=NULL )
+               int state  = _view->getState();
+               if(state == HIGHLIGHTED && _isLeftClickDown)
                {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
-                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       wxVTKiren->GetEventPosition(X,Y);
+                       _isLeftClickDown=false;                 
 
-                       int state  = _view->getState();
-                       
-                       //Evaluate new state
-                       if(!_model->hasChanged() && state==CREATING_CONTOUR)
+                       if ( _vtkInteractorStyleBaseView!=NULL )
                        {
-                               if(_view->isPointInside(X,Y))
+                               int X,Y;
+                               wxVTKRenderWindowInteractor *wxVTKiren;
+                               wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+                               wxVTKiren->GetEventPosition(X,Y);
+
+                               int portType = ((GPortModel*)_model)->getPortType();
+
+                               //Evaluate new state
+                               if(portType==GOUTPUTPORT)
                                {
-                                       _view->setState(CREATING_CONTOUR);
                                        _model->setChanged();
                                        _model->notifyObservers(_id,INIT_CREATION_CONTOUR);
                                }
-                               else
+                               else if (portType==GINPUTPORT)
                                {
-                                       _view->setState(NOTHING_HAPPENS);
                                        _model->setChanged();
-                                       _model->notifyObservers(_id);
+                                       _model->notifyObservers(_id,FIN_CREATION_CONTOUR);
                                }
+                                       
                        }
-
-                       
-
                }
+
                return true;
        }
 
        //=========================================================================
 
+       
+
 }  // EO namespace bbtk
 
 // EOF
index fdc8a246dce53dc5239554c61c0f523e57836abb..de343eab45c947e53b368e7c96dccb572fb28b28 100644 (file)
@@ -74,6 +74,7 @@ namespace bbtk
        private:
 
                //Attributes
+               bool _isLeftClickDown;
 
                //Private Methods
 
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourController.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourController.cxx
new file mode 100644 (file)
index 0000000..6a7c068
--- /dev/null
@@ -0,0 +1,162 @@
+/*=========================================================================                                                                               
+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::manualConnectorContourController 
+*/
+
+
+#include "manualConnectorContourController.h"
+
+namespace bbtk
+{
+
+
+       //=========================================================================
+       manualConnectorContourController::manualConnectorContourController()
+       {               
+       }
+
+       //=========================================================================
+       manualConnectorContourController::~manualConnectorContourController()
+       {
+       }
+       //=========================================================================
+
+       void manualConnectorContourController::MouseClickRight(int x, int y)
+       {
+               SetCompleteCreation( true );
+               SetKeyBoardMoving( false );
+               GetManualContourModel()->SetCloseContour(false);
+
+               SetEditable( false );
+               SetPosibleToMove( false );
+               SetState(0);
+
+               if(!_created)
+               {
+                       //DeleteContour();
+               }
+       }
+
+       //=========================================================================
+       void manualConnectorContourController::MouseClickLeft(int x, int y){
+
+               bool ok = false;
+               int z   = GetZ();
+               int size= GetManualViewBaseContour()->GetNumberOfPoints();
+
+               // Insert a Control Point with shift+ClickLeft
+               vtkRenderWindowInteractor *vtkrenderwindowinteractor = _vtkInteractorStyleBaseView->GetInteractor();
+               if( IsEditable() )
+               {
+                       if ( (_vtkInteractorStyleBaseView!=NULL) && (GetState()==0) && ( (vtkrenderwindowinteractor!=NULL) && (vtkrenderwindowinteractor->GetShiftKey()==1) ) )
+                       {
+                               ok=true;
+                               InsertPoint(x,y,z);
+                               size++;
+                       }
+                       // Start to Insert Control Points with ClickLeft (Empty contour)
+                       if ((GetState()==0) && (size==0) && (_easyCreation==true) )
+                       {
+                               ok=true;
+                               SetState(1);
+                               GetManualContourModel()->SetCloseContour(false);
+                               AddPoint(x,y,z);
+                       }
+
+                       // RaC Just create 2 points
+                       if ((GetState()==1) && (_easyCreation==true) && GetNumberOfPointsManualContour()==2)
+                       {
+                               ok=true;
+
+                               SetCompleteCreation( true );
+                               SetKeyBoardMoving( false );
+                               GetManualContourModel()->SetCloseContour(false);
+
+                               SetEditable( false );
+                               SetPosibleToMove( false );
+                               SetState(0);
+                       }
+
+                       // Continue to Insert Control Points with ClickLeft (After being empty the contour)
+                       if ((GetState()==1) && (_easyCreation==true) )
+                       {
+                               ok=true;
+                               AddPoint(x,y,z);
+                               _bakIdPoint=GetNumberOfPointsManualContour() - 1;
+                       }
+
+                       // Insert Control Points IF Contour si Selected
+                       if ((GetState()==0) && GetManualViewBaseContour()->GetPosibleSelected() )
+                       {
+                               ok=true;
+                               InsertPoint(x,y,z);
+                               _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+                               SetState(6);
+                       }
+                       // Chose id of Control Point to be move
+                       if ( (GetState()==0 || GetState()==6) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) )
+                       {
+                               ok=true;
+                               _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+                               SetState(5);
+                       }
+                       // If nothing selected _state=7
+                       if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)==-1 ) )
+                       {
+                               //ok=true;
+                               _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+                               SetState(7);
+                       }
+               }else{
+                       SetPosibleToMove( true );
+                       GetManualViewBaseContour()->SetSelected( GetManualViewBaseContour()->GetPosibleSelected() );
+               } // IsEditable
+               
+               if ( GetState() == 0 && GetManualViewBaseContour()->GetPosibleSelected() )
+               {
+                       SetMoving( true );
+                       ok=true;
+                       GetManualViewBaseContour()->InitMove(x,y,z);
+                       SetState(6);
+               }
+               if (ok==true)
+               {
+                       GetManualViewBaseContour()->Refresh();
+               }
+       }
+       //=========================================================================
+
+}  // EO namespace bbtk
+
+// EOF
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourController.h b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourController.h
new file mode 100644 (file)
index 0000000..cb404e0
--- /dev/null
@@ -0,0 +1,89 @@
+/*=========================================================================                                                                               
+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::manualConnectorContourController : abstract black-box interface. 
+*/
+
+/**
+* \class bbtk::manualConnectorContourController
+* \brief 
+*/
+
+#ifndef __manualConnectorContourController_h__
+#define __manualConnectorContourController_h__
+
+//Includes same project
+#include "manualContourControler.h"
+
+//Includes creaMaracasVisu
+#include <manualContourControler.h>
+
+
+//Includes std
+#include <iostream>
+
+
+namespace bbtk
+{
+
+       class manualConnectorContourController : public manualContourControler
+       {
+
+       public: 
+
+               //Constructors
+               manualConnectorContourController();
+               ~manualConnectorContourController();
+               
+               //Public methods                
+               virtual void MouseClickRight(int x, int y);
+               virtual void MouseClickLeft(int x, int y);
+
+       private:
+
+               //Attributes
+               
+
+               //Private Methods
+
+       protected:
+               //Protected methods
+               
+       };
+
+
+}
+// namespace bbtk
+#endif
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourView.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourView.cxx
new file mode 100644 (file)
index 0000000..e361e63
--- /dev/null
@@ -0,0 +1,74 @@
+/*=========================================================================                                                                               
+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::manualConnectorContourView 
+*/
+
+
+#include "manualConnectorContourView.h"
+
+namespace bbtk
+{
+
+
+       //=========================================================================
+       manualConnectorContourView::manualConnectorContourView()
+       {
+       }
+
+       //=========================================================================
+       manualConnectorContourView::~manualConnectorContourView()
+       {
+       }
+       //=========================================================================
+
+       void manualConnectorContourView::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type)
+       {
+               _wxvtkbaseview->TransCoordScreenToWorld(X,Y,Z,type);
+       }
+
+       //=========================================================================
+
+       void manualConnectorContourView::removeStartAndEnd()
+       {
+               _wxvtkbaseview->GetRenderer()->RemoveActor( _lstViewPoints[0]->GetVtkActor() );
+
+               _wxvtkbaseview->GetRenderer()->RemoveActor( _lstViewPoints[_lstViewPoints.size()-1]->GetVtkActor() );
+       }
+
+       //=========================================================================
+
+
+}  // EO namespace bbtk
+
+// EOF
+
diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourView.h b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/manualConnectorContourView.h
new file mode 100644 (file)
index 0000000..bcc076f
--- /dev/null
@@ -0,0 +1,88 @@
+/*=========================================================================                                                                               
+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::manualConnectorContourView : abstract black-box interface. 
+*/
+
+/**
+* \class bbtk::manualConnectorContourView
+* \brief 
+*/
+
+#ifndef __manualConnectorContourView_h__
+#define __manualConnectorContourView_h__
+
+//Includes same project
+
+//Includes creaMaracasVisu
+#include <manualViewContour.h>
+
+
+//Includes std
+#include <iostream>
+
+
+namespace bbtk
+{
+
+       class manualConnectorContourView : public manualViewContour
+       {
+
+       public: 
+
+               //Constructors
+               manualConnectorContourView();
+               ~manualConnectorContourView();
+               
+               //Public methods                
+               virtual void TransfromCoordViewWorld(double &X, double &Y, double &Z, int type=2);
+               void removeStartAndEnd();
+
+       private:
+
+               //Attributes
+               
+
+               //Private Methods
+
+       protected:
+               //Protected methods
+               
+       };
+
+
+}
+// namespace bbtk
+#endif
+
index 035997846f91ad441ceacce710bff85237ea08af..b4f631dcd2abdffc8abbfb69494f1d4afc223582 100644 (file)
@@ -62,10 +62,11 @@ namespace bbtk
 
                // RaC In the actual version, zInic=zFin=900
 
+               double mid = (xInic+xFin)/2;
+
                _pts->SetPoint(0, xInic, yInic, zInic );
-               _pts->SetPoint(1, xInic, yFin, zInic );
-               _pts->SetPoint(2, xFin, yFin, zFin );
-               _pts->SetPoint(3, xFin, yInic, zFin );
+               _pts->SetPoint(1, mid, yFin, zInic );
+               _pts->SetPoint(2, xFin, yInic, zFin );
                
                setRefreshWaiting();
        }
@@ -80,7 +81,7 @@ namespace bbtk
                vtkPolyDataMapper* _bboxMapper=vtkPolyDataMapper::New();
                _objectActor=vtkActor::New();
                
-               _pts->SetNumberOfPoints(4);
+               _pts->SetNumberOfPoints(3);
 
                double xInic, yInic,zInic,xFin, yFin,zFin;
 
@@ -88,16 +89,17 @@ namespace bbtk
                _model->getFinalPoint(xFin, yFin,zFin);
 
                // RaC In the actual version, zInic=zFin=900
+
+               double mid = (xInic+xFin)/2;
+
                _pts->SetPoint(0, xInic, yInic, zInic );
-               _pts->SetPoint(1, xInic, yFin, zInic );
-               _pts->SetPoint(2, xFin, yFin, zFin );
-               _pts->SetPoint(3, xFin, yInic, zFin );
+               _pts->SetPoint(1, mid, yFin, zInic );
+               _pts->SetPoint(2, xFin, yInic, zFin );
                                
-               lines->InsertNextCell(5);
+               lines->InsertNextCell(4);
                lines->InsertCellPoint(0);
                lines->InsertCellPoint(1);
                lines->InsertCellPoint(2);
-               lines->InsertCellPoint(3);
                lines->InsertCellPoint(0);
                        
                _pd->SetPoints( _pts );