]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.cxx
It is possible to center the view to the original point
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / wxVtkSceneManager.cxx
index 1e325329ed126f41586323d971cd538c3ca15307..57a0358507298ace767884de7f363bc98f33790a 100644 (file)
@@ -921,7 +921,7 @@ namespace bbtk
        //=========================================================================
 
        void wxVtkSceneManager::deleteAllBoxes()
-       {
+       {               
                std::map<int, GObjectController*>::iterator it;
                for(it = _controllers.begin(); it != _controllers.end(); ++it)
                {
@@ -942,6 +942,21 @@ namespace bbtk
        }
 
        //=========================================================================
+       
+       void wxVtkSceneManager::centerView()
+       {
+               double temp[3];
+               _baseView->GetRenderer()->GetActiveCamera()->GetFocalPoint(temp);
+               printf("RaC wxVtkSceneManager::deleteAllBoxes() GetFocalPoint x:%f y:%f z:%f \n",temp[0],temp[1],temp[2]);
+               _baseView->GetRenderer()->GetActiveCamera()->SetFocalPoint(0,0,temp[2]);
+               _baseView->GetRenderer()->GetActiveCamera()->GetPosition(temp);
+               printf("RaC wxVtkSceneManager::deleteAllBoxes() GetPosition x:%f y:%f z:%f \n",temp[0],temp[1],temp[2]);
+               _baseView->GetRenderer()->GetActiveCamera()->SetPosition(0,0,temp[2]);
+               _baseView->RefreshView();
+
+       }
+
+       //=========================================================================
 
 }  // EO namespace bbtk