X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FEditorGraphicBBS%2FbbsVtkGUIEditorGraphic%2FvtkGObjectView.cxx;h=964c38825ef73075dfd98672338904c0c4a778e2;hb=062ee1e352a911991a120c5bf95ba836a6b0871b;hp=4e92f740266fb4bcd745c0e1b69145f9342e7b64;hpb=0b3b25440d23eabf549ebdfa0a4a39ea91ea2f23;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.cxx index 4e92f74..964c388 100644 --- a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.cxx +++ b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.cxx @@ -44,8 +44,11 @@ namespace bbtk vtkGObjectView::vtkGObjectView() { _baseView=NULL; - _objectActor=NULL; - _isFirstDragging=false; + _borderObjectActor=NULL; + _fillObjectActor=NULL; + _isStartDragging=false; + + _state = NOTHING_HAPPENS; } //========================================================================= @@ -54,7 +57,7 @@ namespace bbtk } //========================================================================= - void vtkGObjectView::update(int command)//virtual + void vtkGObjectView::update(int idController,int command)//virtual { //virtual } @@ -90,9 +93,26 @@ namespace bbtk //========================================================================= + void vtkGObjectView::updateColors() //virtual + { + //virtual + } + + //========================================================================= + void vtkGObjectView::addVtkActors()//virtual { - _baseView->GetRenderer()->AddActor(_objectActor); + _baseView->GetRenderer()->AddActor(_borderObjectActor); + _baseView->GetRenderer()->AddActor(_fillObjectActor); + _baseView->GetRenderer()->Render(); + } + + //========================================================================= + + void vtkGObjectView::removeVtkActors()//virtual + { + _baseView->GetRenderer()->RemoveActor(_borderObjectActor); + _baseView->GetRenderer()->RemoveActor(_fillObjectActor); _baseView->GetRenderer()->Render(); } @@ -100,7 +120,8 @@ namespace bbtk bool vtkGObjectView::isPointInside(int X,int Y) //virtual { - double xx=X,yy=Y,zz=0; + // RaC In the actual version, always z=900 + double xx=X,yy=Y,zz=900; _baseView->TransCoordScreenToWorld(xx,yy,zz); return _model->isPointInside(xx,yy,zz); } @@ -109,36 +130,64 @@ namespace bbtk void vtkGObjectView::moveObject(int X,int Y) //virtual { - double xx=X,yy=Y,zz=0; + // RaC In the actual version, always z=900 + double xx=X,yy=Y,zz=900; _baseView->TransCoordScreenToWorld(xx,yy,zz); - - - if(_isFirstDragging) + if(_isStartDragging) { - _isFirstDragging=false; + _isStartDragging=false; double xInic,yInic,zInic; _model->getInicPoint(xInic,yInic,zInic); dragDifX=xx-xInic; dragDifY=yy-yInic; } - _model->move(xx-dragDifX,yy-dragDifY,zz); } //========================================================================= - void vtkGObjectView::isFirstDragging(bool param) + void vtkGObjectView::setStartDragging(bool param) { - _isFirstDragging=param; + _isStartDragging=param; dragDifX=0; dragDifX=0; } //========================================================================= + void vtkGObjectView::setState(int state) + { + _state = state; + } + + //========================================================================= + + int vtkGObjectView::getState() + { + return _state; + } + + //========================================================================= + + void vtkGObjectView::setRefreshWaiting() + { + ((vtkInteractorStyleBaseView*)_baseView->GetInteractorStyleBaseView())->SetRefresh_waiting(); + } + + //========================================================================= + + void vtkGObjectView::removeFromScene() + { + removeVtkActors(); + setRefreshWaiting(); + } + + //========================================================================= + + } // EO namespace bbtk // EOF