1 /*=========================================================================
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
33 * \brief Class bbtk::GObjectController
37 #include "GObjectController.h"
43 //=========================================================================
44 GObjectController::GObjectController()
49 //=========================================================================
50 GObjectController::~GObjectController()
53 //=========================================================================
55 void GObjectController::setModelAndView(GObjectModel* model, vtkGObjectView* view)
60 //=========================================================================
62 bool GObjectController::OnMouseMove()
64 cout<<"RaC GObjectController::OnMouseMove "<<endl;
65 if ( _vtkInteractorStyleBaseView!=NULL)
68 wxVTKRenderWindowInteractor *_wxVTKiren;
69 _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
70 _wxVTKiren->GetEventPosition( X , Y );
72 int state = _model->getState();
77 _model->setState(DRAG);
86 if(state == NOTHING_HAPPENS)
88 if(_view->isPointInside(X,Y))
90 _model->setState(HIGHLIGHTED);
98 //=========================================================================
99 bool GObjectController::OnLeftButtonDown()
102 if ( _vtkInteractorStyleBaseView!=NULL )
105 wxVTKRenderWindowInteractor *wxVTKiren;
106 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
107 wxVTKiren->GetEventPosition(X,Y);
109 //MouseClickLeft(X,Y);
113 //=========================================================================
114 bool GObjectController::OnLeftButtonUp()
116 if ( _vtkInteractorStyleBaseView!=NULL )
119 wxVTKRenderWindowInteractor *wxVTKiren;
120 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
121 wxVTKiren->GetEventPosition(X,Y);
122 //MouseReleaseLeft(X,Y);
126 //=========================================================================
127 bool GObjectController::OnLeftDClick()
129 if ( _vtkInteractorStyleBaseView!=NULL )
132 wxVTKRenderWindowInteractor *wxVTKiren;
133 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
134 wxVTKiren->GetEventPosition(X,Y);
136 //this->MouseDLeft(X,Y);
140 //=========================================================================
141 bool GObjectController::OnMiddleButtonDown()
143 if ( _vtkInteractorStyleBaseView!=NULL )
146 wxVTKRenderWindowInteractor *wxVTKiren;
147 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
148 wxVTKiren->GetEventPosition(X,Y);
149 //GetManualViewBaseContour()->InitMove( X, Y,GetZ());
153 //=========================================================================
154 bool GObjectController::OnMiddleButtonUp()
158 //=========================================================================
159 bool GObjectController::OnRightButtonDown()
161 if( _vtkInteractorStyleBaseView!= NULL )
164 wxVTKRenderWindowInteractor *wxVTKiren;
165 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
166 wxVTKiren->GetEventPosition(X, Y);
168 //SetCompleteCreation( true );
169 //SetKeyBoardMoving( false );
170 //this->GetManualContourModel()->SetCloseContour(true);
171 //MouseClickRight(X,Y);
175 //=========================================================================
176 bool GObjectController::OnRightButtonUp()
180 //=========================================================================
182 } // EO namespace bbtk