X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FwxVtkSceneManager.cxx;fp=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FwxVtkSceneManager.cxx;h=af87221b5d01c3da0f519edf9f6df0b8631b6bff;hb=67a6b56195db640eb7f2a478440c6aa39ccb59ae;hp=95a2454c22ff447cf2ec8b5e21ee29bede39abf0;hpb=db7d4391e42d1af64599a2bbdc79c5d688ce24da;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index 95a2454..af87221 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -1780,23 +1780,45 @@ void wxVtkSceneManager::refresh() { } //========================================================================= -void wxVtkSceneManager::refreshScene() { +void wxVtkSceneManager::refreshScene() +{ _baseView->RefreshView(); } //========================================================================= -void wxVtkSceneManager::centerView() { +void wxVtkSceneManager::centerView() +{ + double bb[6]; + _baseView->GetRenderer()->ComputeVisiblePropBounds(bb); + double temp[3]; _baseView->GetRenderer()->GetActiveCamera()->GetFocalPoint(temp); _baseView->GetRenderer()->GetActiveCamera()->SetFocalPoint(0, 0, temp[2]); _baseView->GetRenderer()->GetActiveCamera()->GetPosition(temp); _baseView->GetRenderer()->GetActiveCamera()->SetPosition(0, 0, temp[2]); + + _baseView->GetRenderer()->ResetCamera(); + _baseView->GetRenderer()->ResetCameraClippingRange(); + +/* + double tt=_baseView->GetRenderer()->GetNearClippingPlaneTolerance(); + printf("EED wxVtkSceneManager::centerView() tolerance=%f\n",tt); + double cr1,cr2; + _baseView->GetRenderer()->GetActiveCamera()->GetClippingRange(cr1,cr2); + printf("EED wxVtkSceneManager::centerView() cr1=%f cr2=%f\n",cr1,cr2); + _baseView->GetRenderer()->GetActiveCamera()->SetClippingRange(0.01,100000); + _baseView->GetRenderer()->GetActiveCamera()->GetClippingRange(cr1,cr2); + printf("EED wxVtkSceneManager::centerView() cr1=%f cr2=%f\n",cr1,cr2); +*/ + + _baseView->GetRenderer()->Render(); } //========================================================================= -void wxVtkSceneManager::saveDiagram(std::string &content) { +void wxVtkSceneManager::saveDiagram(std::string &content) +{ char buffer[50]; content += "CATEGORY:"; @@ -1928,7 +1950,6 @@ void wxVtkSceneManager::getCleanLine(stringstream &inputStream, std::string &lin //========================================================================= void wxVtkSceneManager::loadDiagram(stringstream &inputStream) { - int size; std::string version = ""; std::string line = "";