#include <wxVtk3DBaseView.h>
Public Member Functions | |
wxVtk3DBaseView (wxWindow *parent) | |
virtual | ~wxVtk3DBaseView () |
vtkCamera * | GetCamera () |
virtual vtkRenderer * | GetRenderer () |
virtual vtkRenderWindow * | GetRenWin () |
void | Refresh () |
void | Configure () |
virtual void | GetSpacing (double spc[3]) |
wxVTKRenderWindowInteractor * | GetWxVTKRenderWindowInteractor () throw (char*) |
virtual void | RefreshView () |
virtual void | TransFromCoordScreenToWorld (double &X, double &Y, double &Z, bool keepNormalDirection=false, int type=2) |
void | SetInteractorStyleBaseView (vtkInteractorStyleImage *interactorStyle) |
vtkInteractorStyleImage * | GetInteractorStyleBaseView () |
Private Attributes | |
bool | _configure |
vtkRenderer * | _aRenderer |
vtkRenderWindow * | _renWin |
vtkCamera * | _aCamera |
Definition at line 10 of file wxVtk3DBaseView.h.
wxVtk3DBaseView::wxVtk3DBaseView | ( | wxWindow * | parent | ) |
Definition at line 6 of file wxVtk3DBaseView.cxx.
References _aCamera, _aRenderer, _configure, and _renWin.
00007 :wxVtkBaseView( parent ) 00008 { 00009 _configure = false; 00010 _aRenderer = NULL; 00011 _renWin = NULL; 00012 _aCamera = NULL; 00013 }
wxVtk3DBaseView::~wxVtk3DBaseView | ( | ) | [virtual] |
Definition at line 15 of file wxVtk3DBaseView.cxx.
References _aCamera, _aRenderer, and _renWin.
00016 { 00017 if (_aCamera!=NULL) { _aCamera -> Delete(); } 00018 if (_aRenderer!=NULL) { _aRenderer -> Delete(); } 00019 if (_renWin!=NULL) { _renWin -> Delete(); } 00020 }
vtkCamera * wxVtk3DBaseView::GetCamera | ( | ) |
Definition at line 22 of file wxVtk3DBaseView.cxx.
References _aCamera.
Referenced by wxVtkMPR3DView::Configure(), wxVtkClipping3DView::Configure(), and wxVtkMPR3DView::ResetCamera().
00023 { 00024 return _aCamera; 00025 }
vtkRenderer * wxVtk3DBaseView::GetRenderer | ( | ) | [virtual] |
Reimplemented from wxVtkBaseView.
Definition at line 27 of file wxVtk3DBaseView.cxx.
References _aRenderer.
Referenced by wxVtkMPR3DView::Configure(), wxVtkClipping3DView::Configure(), wxPanelCuttingImageData::Configure(), wxSTLWidget_02::ConfigureSTL(), wxSTLWidget_03::ConfigureSTL(), wxEmptyPanelWidget::ConfigureVTK(), wxSTLWidget_03::ExtractSurface(), wxSTLWidget_02::ExtractTree2_JF(), wxManualSegmentation_MPRWidget::GetRenderer(), wxSegmentationFM3DWidget::OnBtnSegment(), wxSTLWidget_02::OnBtnSTLFileLoad(), wxSTLWidget_03::OnBtnSTLFileLoad(), wxSegmentationFM3DWidget::OnBtnUndo(), wxSTLWidget_02::OnJoinRegions(), wxPanelCuttingImageData::OnTypeFig(), wxVtkMPR3DView::RemoveActor(), wxPanelCuttingImageData::RemoveActors(), wxSTLWidget_02::Reset_vtk_STLFile(), wxSTLWidget_03::Reset_vtk_STLFile(), wxVtkMPR3DView::ResetCamera(), wxSTLWidget_02::ResetTree2_JF(), wxSTLWidget_03::ResetTree2_JF(), wxVtkClipping3DView::VisibleActor(), wxVtkMPR3DView::VisibleImageActor(), and wxVtkClipping3DView::VisibleVolumeActor().
00028 { 00029 return _aRenderer; 00030 }
vtkRenderWindow * wxVtk3DBaseView::GetRenWin | ( | ) | [virtual] |
Reimplemented from wxVtkBaseView.
Definition at line 32 of file wxVtk3DBaseView.cxx.
References _renWin.
Referenced by wxVtkMPR3DView::Configure(), and wxVtkClipping3DView::Configure().
00033 { 00034 return _renWin; 00035 }
void wxVtk3DBaseView::Refresh | ( | ) | [virtual] |
Reimplemented from wxVtkBaseView.
Definition at line 37 of file wxVtk3DBaseView.cxx.
References wxVtkBaseView::GetWxVTKRenderWindowInteractor().
Referenced by wxPanelCuttingImageData::Refresh(), and wxEmptyPanelWidget::Refresh().
00038 { 00039 // _renWin->Render(); 00040 vtkRenderWindowInteractor *vri = GetWxVTKRenderWindowInteractor(); 00041 vri->vtkRenderWindowInteractor::Render(); 00042 }
void wxVtk3DBaseView::Configure | ( | ) | [virtual] |
Reimplemented from wxVtkBaseView.
Definition at line 44 of file wxVtk3DBaseView.cxx.
References _aCamera, _aRenderer, _configure, _renWin, wxVtkBaseView::GetWxVTKRenderWindowInteractor(), vtkInteractorStyleBaseView3D::New(), wxVtkBaseView::SetInteractorStyleBaseView(), and vtkInteractorStyleBaseView::SetwxVtkBaseView().
Referenced by wxVtkMPR3DView::Configure(), wxVtkClipping3DView::Configure(), and wxEmptyPanelWidget::ConfigureVTK().
00045 { 00046 if (_configure==false) 00047 { 00048 _configure=true; 00049 //wxVtkBaseView::Configure(); 00050 _aRenderer = vtkRenderer::New(); 00051 _renWin = vtkRenderWindow::New(); 00052 _renWin->AddRenderer(_aRenderer); 00053 00054 _aRenderer->GradientBackgroundOn(); 00055 _aRenderer->SetBackground( 0.33 , 0.33 , 0.33 ); 00056 _aRenderer->SetBackground2( 0.66 , 0.66 , 0.66 ); 00057 00058 00059 // _renWin->SetStereoCapableWindow(1); 00060 // // //renderwindow->SetStereoTypeToCrystalEyes(); 00061 // _renWin->SetStereoTypeToRedBlue(); 00062 // _renWin->SetStereoRender(1); 00063 00064 GetWxVTKRenderWindowInteractor()->SetRenderWindow(_renWin); 00065 00066 00067 // EED Borrame 00068 // vtkInteractorStyle3DMaracas *interactorStyle3DMaracas = vtkInteractorStyle3DMaracas::New(); 00069 vtkInteractorStyleBaseView3D *interactorStyleBaseView3D = vtkInteractorStyleBaseView3D::New(); 00070 00071 SetInteractorStyleBaseView( interactorStyleBaseView3D ); 00072 interactorStyleBaseView3D->SetInteractor ( GetWxVTKRenderWindowInteractor() ); 00073 GetWxVTKRenderWindowInteractor()->SetInteractorStyle( interactorStyleBaseView3D ); 00074 interactorStyleBaseView3D->SetwxVtkBaseView(this); 00075 00076 00077 /* EED Borrame 00078 vtkInteractorStyleSwitch *iss = dynamic_cast<vtkInteractorStyleSwitch*>(_iren->GetInteractorStyle()); 00079 iss->SetCurrentStyleToTrackballCamera(); 00080 */ 00081 00082 // It is convenient to create an initial view of the data. The 00083 // FocalPoint and Position form a vector direction. Later on 00084 // (ResetCamera() method) this vector is used to position the camera 00085 // to look at the data in this direction. 00086 _aCamera = vtkCamera::New(); 00087 00088 //EED 17Avril2009 00089 /* 00090 _aCamera->SetViewUp (0, 0, -1); 00091 _aCamera->SetPosition (0, 1, 0); 00092 */ 00093 _aCamera->SetViewUp (0, 1, 0); 00094 _aCamera->SetPosition (0, 0, 1); 00095 00096 _aCamera->SetFocalPoint (0, 0, 0); 00097 _aCamera->ComputeViewPlaneNormal(); 00098 00099 } 00100 }
void wxVtk3DBaseView::GetSpacing | ( | double | spc[3] | ) | [virtual] |
wxVTKRenderWindowInteractor * wxVtkBaseView::GetWxVTKRenderWindowInteractor | ( | ) | throw (char*) [inherited] |
Reimplemented in wxVtk2DView_TMP.
Definition at line 38 of file wxVtkBaseView.cxx.
References wxVtkBaseView::_iren.
Referenced by wxVtkClipping3DView::Configure(), Configure(), wxVtk2DBaseView::Configure(), vtkPlane2DView::Configure(), wxWidgetMesure2D::ConfigureA(), wxManualRegistration3D::Create3DView(), wxManualTree_MPRWidget::Create3DViewContour(), wxSegmentationFM3DWidget::Create3DViewContour(), wxManualSegmentation_MPRWidget::Create3DViewContour(), wxMPRWidget::CreateMPRPanel4View(), wxPanelCuttingImageData::CreatePlotHistogrammeInterface(), wxMaracas_ManualContour_Panel::CreateSplitePanel(), wxMPRWidget::CreateView(), wxQuantificationWidgetCT::CreateView2DPanel(), wxProcessingCTWidget::CreateViewPanel(), wxEmptyPanelWidget::CreateViewPanel(), wxEmptyPanel_3_Widget::CreateViewPanel(), vtkInteractorStyleBaseView::EvaluateToRefresh(), wxMaracasImageBrowser02::LoadData(), wxVtkClipping3DViewCntrlPanel::OnBtnMeshVTKLoad(), wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(), manualContourBaseControler::OnChar(), wxVtkClipping3DViewCntrlPanel::OnColor(), wxPanelCuttingImageData::OnExtract(), wxVtkClipping3DViewCntrlPanel::OnIsoValue(), manualContourBaseControler::OnLeftButtonDown(), manualContour3DControler::OnLeftButtonDown(), vtkInteractorStyleSphere::OnLeftButtonUp(), manualContourBaseControler::OnLeftButtonUp(), vtkInteractorStyleMPRView::OnLeftDClick(), manualContourBaseControler::OnLeftDClick(), manualInteractorWindowLevel::OnMiddleButtonDown(), manualContourBaseControler::OnMiddleButtonDown(), vtkInfoTextImageInteractorPlane2D::OnMouseMove(), vtkInfoTextImageInteractor::OnMouseMove(), manualInteractorWindowLevel::OnMouseMove(), manualContourBaseControler::OnMouseMove(), wxVtkClipping3DViewCntrlPanel::OnOpacity(), wxVtkMPR3DViewCntrlPanel::OnPositionX(), wxVtkMPR3DViewCntrlPanel::OnPositionY(), wxVtkMPR3DViewCntrlPanel::OnPositionZ(), wxVtkClipping3DViewCntrlPanel::OnRepresentationSurfaceWireFrame(), manualContourBaseControler::OnRightButtonDown(), wxVtkMPR3DViewCntrlPanel::OnVisibleAxisX(), wxVtkMPR3DViewCntrlPanel::OnVisibleAxisY(), wxVtkMPR3DViewCntrlPanel::OnVisibleAxisZ(), wxVtkClipping3DViewCntrlPanel::OnVisibleSurface(), wxVtkClipping3DViewCntrlPanel::OnVisibleVolume(), wxVtkBaseView::Refresh(), Refresh(), manualViewBaseContour::Refresh(), wxVtk2DBaseView::ResetView(), vtkInteractorStyle3DView::SelectMarchibCubePoint(), wxVtk2DBaseView::SetInteractorStyleImage(), and wxMaracas_ViewerWidget::wxMaracas_ViewerWidget().
00039 { 00040 00041 if(_iren==NULL){ 00042 throw "wxVtkBaseView::GetWxVTKRenderWindowInteractor() _iren wxVTKRenderWindowInteractorPlus =NULL"; 00043 } 00044 return _iren; 00045 }
void wxVtkBaseView::RefreshView | ( | ) | [virtual, inherited] |
Reimplemented in wxSphereView.
Definition at line 70 of file wxVtkBaseView.cxx.
References wxVtkBaseView::GetRenWin().
Referenced by wxQuantificationWidgetCT::CreateManualContours(), wxWidgetMesure2D_Plane::OnActiveCirlcle(), wxWidgetMesure2D_Plane::OnActiveLine(), wxWidgetMesure2D_Plane_in_MPR::OnActiveLink(), wxWidgetMesure2D::OnActiveMessureTool(), wxWidgetMesure2D::OnCloseContour(), wxMaracas_ManualContour_Panel::OnRefreshView(), wxQuantificationWidgetCT::OnShowCalc(), wxQuantificationWidgetCT::OnShowHypo(), wxQuantificationWidgetCT::OnShowLumen(), wxQuantificationWidgetCT::OnShowWall(), wxWidgetMesure2D::OnVisibleInformation(), wxWidgetMesure2D::OnVisibleMessureTool(), and wxProcessingCTWidget::Refresh().
00071 { 00072 // EED 10 Oct 2007 00073 00074 #if defined(WIN32) 00075 GetRenWin()->Render(); 00076 #else 00077 //GetRenWin()->Render(); 00078 #endif 00079 00080 }
void wxVtkBaseView::TransFromCoordScreenToWorld | ( | double & | X, | |
double & | Y, | |||
double & | Z, | |||
bool | keepNormalDirection = false , |
|||
int | type = 2 | |||
) | [virtual, inherited] |
Reimplemented in wxVtkMPR2DView.
Definition at line 94 of file wxVtkBaseView.cxx.
References wxVtkBaseView::GetRenderer(), vtkInteractorStyleBaseView::GetWxVtk2DBaseView(), and wxVtk2DBaseView::TransformCoordinate_spacing_ViewToModel().
Referenced by manualViewPerpPlaneContour::ifTouchContour(), vtkInfoTextImageInteractor::OnMouseMove(), wxVtkMPR2DView::TransFromCoordScreenToWorld(), manualViewBaseContour::TransfromCoordViewWorld(), and vtkPlane2DView::TransfromCoordViewWorld2().
00095 { 00096 GetRenderer()->SetDisplayPoint((int)X, (int)Y, (int)Z); 00097 GetRenderer()->DisplayToWorld(); 00098 double fP[4]; 00099 GetRenderer()->GetWorldPoint( fP ); 00100 if ( fP[3] ){ 00101 fP[0] /= fP[3]; 00102 fP[1] /= fP[3]; 00103 fP[2] /= fP[3]; 00104 } 00105 00106 // EEDx5 00107 //JCP 13/05/2009 00108 vtkInteractorStyleBaseView* interactorstyle = (vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView(); 00109 wxVtk2DBaseView* baseview = (wxVtk2DBaseView*)interactorstyle->GetWxVtk2DBaseView(); 00110 baseview->TransformCoordinate_spacing_ViewToModel( fP[0] , fP[1] , fP[2] ); 00111 //JCP 13/05/2009 00112 00113 if (type!=0) 00114 { 00115 X=fP[0]; 00116 } 00117 if (type!=1) 00118 { 00119 Y=fP[1]; 00120 } 00121 if (type!=2) 00122 { 00123 Z=fP[2]; 00124 } 00125 }
void wxVtkBaseView::SetInteractorStyleBaseView | ( | vtkInteractorStyleImage * | interactorStyle | ) | [inherited] |
Definition at line 142 of file wxVtkBaseView.cxx.
References wxVtkBaseView::_interactorStyle.
Referenced by Configure(), wxVtk2DView_TMP::Configure(), and wxVtk2DBaseView::SetInteractorStyleImage().
00143 { 00144 _interactorStyle = interactorStyle; 00145 }
vtkInteractorStyleImage * wxVtkBaseView::GetInteractorStyleBaseView | ( | ) | [inherited] |
Definition at line 134 of file wxVtkBaseView.cxx.
References wxVtkBaseView::_interactorStyle.
Referenced by wxWidgetMesure2D::ActiveMessureTool(), wxQuantificationWidgetCT::addManualContours(), wxVtkMPR2DView::Configure(), wxSphereView::Configure(), vtkPlane2DView::Configure(), wxWidgetMesure2D::ConfigureA(), wxManualTree_MPRWidget::ConfigureContour(), wxMPRWidget::ConfigureVTK(), wxManualTree_MPRWidget::ConfigureVTK(), wxSegmentationFM3DWidget::ConfigureVTK(), wxManualSegmentation_MPRWidget::ConfigureVTK(), wxManualRegistration3D::ConfigureVTK(), wxEmptyPanel_3_Widget::ConfigureVTK(), wxManualRegistration3D::ConfigureVTK_B(), wxImageViewerWidget::ConstructVTK(), vtkmyPWCallback_3DPointWidget::Execute(), wxMaracasImageBrowser02::LoadData(), wxQuantificationWidgetCT::OnContourLumen(), wxQuantificationWidgetCT::OnContourWall(), wxVTKRenderWindowInteractorPlus::OnLeftDClick(), wxVTKRenderWindowInteractorPlus::OnMiddleDClick(), wxVTKRenderWindowInteractorPlus::OnMouseWheel(), wxVTKRenderWindowInteractorPlus::OnRightDClick(), manualContourContainer::refreshCalc(), manualContourContainer::refreshHypo(), manualContourContainer::refreshLumen(), and manualContourContainer::refreshWall().
00135 { 00136 return _interactorStyle; 00137 }
bool wxVtk3DBaseView::_configure [private] |
vtkRenderer* wxVtk3DBaseView::_aRenderer [private] |
Definition at line 23 of file wxVtk3DBaseView.h.
Referenced by Configure(), GetRenderer(), wxVtk3DBaseView(), and ~wxVtk3DBaseView().
vtkRenderWindow* wxVtk3DBaseView::_renWin [private] |
Definition at line 24 of file wxVtk3DBaseView.h.
Referenced by Configure(), GetRenWin(), wxVtk3DBaseView(), and ~wxVtk3DBaseView().
vtkCamera* wxVtk3DBaseView::_aCamera [private] |
Definition at line 25 of file wxVtk3DBaseView.h.
Referenced by Configure(), GetCamera(), wxVtk3DBaseView(), and ~wxVtk3DBaseView().