2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
8 # This software is governed by the CeCILL-B license under French law and
9 # abiding by the rules of distribution of free software. You can use,
10 # modify and/ or redistribute the software under the terms of the CeCILL-B
11 # license as circulated by CEA, CNRS and INRIA at the following URL
12 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
13 # or in the file LICENSE.txt.
15 # As a counterpart to the access to the source code and rights to copy,
16 # modify and redistribute granted by the license, users are provided only
17 # with a limited warranty and the software's author, the holder of the
18 # economic rights, and the successive licensors have only limited
21 # The fact that you are presently reading this means that you have had
22 # knowledge of the CeCILL-B license and that you accept its terms.
23 # ------------------------------------------------------------------------
27 /*=========================================================================
33 =========================================================================*/
35 /* ---------------------------------------------------------------------
37 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
38 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
40 * This software is governed by the CeCILL-B license under French law and
41 * abiding by the rules of distribution of free software. You can use,
42 * modify and/ or redistribute the software under the terms of the CeCILL-B
43 * license as circulated by CEA, CNRS and INRIA at the following URL
44 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
45 * or in the file LICENSE.txt.
47 * As a counterpart to the access to the source code and rights to copy,
48 * modify and redistribute granted by the license, users are provided only
49 * with a limited warranty and the software's author, the holder of the
50 * economic rights, and the successive licensors have only limited
53 * The fact that you are presently reading this means that you have had
54 * knowledge of the CeCILL-B license and that you accept its terms.
55 * ------------------------------------------------------------------------ */
59 * \brief Class bbtk::vtkGObjectView
63 #include "vtkGObjectView.h"
69 //=========================================================================
70 vtkGObjectView::vtkGObjectView()
73 _borderObjectActor = NULL;
74 _fillObjectActor = NULL;
75 _isStartDragging = false;
77 _state = NOTHING_HAPPENS;
80 //=========================================================================
81 vtkGObjectView::~vtkGObjectView()
84 //=========================================================================
86 void vtkGObjectView::update(int idController,int command)//virtual
91 //=========================================================================
93 void vtkGObjectView::setModel(GObjectModel *model)
98 //=========================================================================
100 void vtkGObjectView::setBaseView(wxVtkBaseView* baseView)
102 _baseView = baseView;
105 //=========================================================================
107 void vtkGObjectView::initVtkObjects()
113 //=========================================================================
115 void vtkGObjectView::createVtkObjects() //virtual
120 //=========================================================================
122 void vtkGObjectView::updateColors() //virtual
127 //=========================================================================
129 void vtkGObjectView::addVtkActors()//virtual
131 _baseView->GetRenderer()->AddActor(_fillObjectActor);
132 _baseView->GetRenderer()->Render();
135 //=========================================================================
137 void vtkGObjectView::removeVtkActors()//virtual
139 _baseView->GetRenderer()->RemoveActor(_fillObjectActor);
140 _baseView->GetRenderer()->Render();
143 //=========================================================================
145 bool vtkGObjectView::isPointInside(int X,int Y) //virtual
147 // RaC In the actual version, always z=GPOSITION_Z
148 double xx=X,yy=Y,zz=GPOSITION_Z;
149 _baseView->TransCoordScreenToWorld(xx,yy,zz);
150 return _model->isPointInside(xx,yy,zz);
153 //=========================================================================
155 void vtkGObjectView::moveObject(int X,int Y) //virtual
157 // RaC In the actual version, always z=GPOSITION_Z
158 double xx=X,yy=Y,zz=GPOSITION_Z;
159 _baseView->TransCoordScreenToWorld(xx,yy,zz);
163 _isStartDragging=false;
165 double xInic,yInic,zInic;
166 _model->getInicPoint(xInic,yInic,zInic);
170 _model->move(xx-dragDifX,yy-dragDifY,zz);
174 //=========================================================================
176 void vtkGObjectView::setStartDragging(bool param)
178 _isStartDragging=param;
183 //=========================================================================
185 void vtkGObjectView::setState(int state)
190 //=========================================================================
192 int vtkGObjectView::getState()
197 //=========================================================================
199 void vtkGObjectView::setRefreshWaiting()
201 ((vtkInteractorStyleBaseView*)_baseView->GetInteractorStyleBaseView())->SetRefresh_waiting();
204 //=========================================================================
206 void vtkGObjectView::removeFromScene()
212 //=========================================================================
215 } // EO namespace bbtk