#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 00018 if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;} 00019 if (_aRenderer!=NULL) { _aRenderer -> Delete(); _aRenderer=NULL;} 00020 if (_renWin!=NULL) { 00021 if(_renWin->GetReferenceCount()==0){ 00022 _renWin -> Delete(); _renWin=NULL; 00023 } 00024 } 00025 }
void wxVtk3DBaseView::Configure | ( | ) | [virtual] |
Reimplemented from wxVtkBaseView.
Definition at line 49 of file wxVtk3DBaseView.cxx.
References _aCamera, _aRenderer, _configure, _renWin, wxVtkBaseView::GetWxVTKRenderWindowInteractor(), vtkInteractorStyleBaseView3D::New(), wxVtkBaseView::SetInteractorStyleBaseView(), and vtkInteractorStyleBaseView::SetwxVtkBaseView().
Referenced by wxMaracasRenderTabbedPanel::addMPROptions(), wxVtkMPR3DView::Configure(), wxVtkClipping3DView::Configure(), and wxEmptyPanelWidget::ConfigureVTK().
00050 { 00051 //printf("EED wxVtk3DBaseView::Configure A\n"); 00052 if (_configure==false) 00053 { 00054 //printf("EED wxVtk3DBaseView::Configure B\n"); 00055 _configure=true; 00056 //wxVtkBaseView::Configure(); 00057 _aRenderer = vtkRenderer::New(); 00058 _renWin = vtkRenderWindow::New(); 00059 _renWin->AddRenderer(_aRenderer); 00060 00061 _aRenderer->GradientBackgroundOn(); 00062 _aRenderer->SetBackground( 0.33 , 0.33 , 0.33 ); 00063 _aRenderer->SetBackground2( 0.66 , 0.66 , 0.66 ); 00064 00065 00066 // _renWin->SetStereoCapableWindow(1); 00067 // // //renderwindow->SetStereoTypeToCrystalEyes(); 00068 // _renWin->SetStereoTypeToRedBlue(); 00069 // _renWin->SetStereoRender(1); 00070 00071 GetWxVTKRenderWindowInteractor()->SetRenderWindow(_renWin); 00072 00073 vtkInteractorStyleBaseView3D *interactorStyleBaseView3D = vtkInteractorStyleBaseView3D::New(); 00074 00075 SetInteractorStyleBaseView( interactorStyleBaseView3D ); 00076 interactorStyleBaseView3D->SetInteractor ( GetWxVTKRenderWindowInteractor() ); 00077 GetWxVTKRenderWindowInteractor()->SetInteractorStyle( interactorStyleBaseView3D ); 00078 interactorStyleBaseView3D->SetwxVtkBaseView(this); 00079 00080 // It is convenient to create an initial view of the data. The 00081 // FocalPoint and Position form a vector direction. Later on 00082 // (ResetCamera() method) this vector is used to position the camera 00083 // to look at the data in this direction. 00084 _aCamera = vtkCamera::New(); 00085 00086 //EED 17Avril2009 00087 /* 00088 _aCamera->SetViewUp (0, 0, -1); 00089 _aCamera->SetPosition (0, 1, 0); 00090 */ 00091 _aCamera->SetViewUp (0, 1, 0); 00092 _aCamera->SetPosition (0, 0, 1); 00093 00094 _aCamera->SetFocalPoint (0, 0, 0); 00095 _aCamera->ComputeViewPlaneNormal(); 00096 00097 } 00098 }
vtkCamera * wxVtk3DBaseView::GetCamera | ( | ) |
Definition at line 27 of file wxVtk3DBaseView.cxx.
References _aCamera.
Referenced by wxVtkMPR3DView::Configure(), wxVtkClipping3DView::Configure(), and wxVtkMPR3DView::ResetCamera().
00028 { 00029 return _aCamera; 00030 }
vtkInteractorStyleImage * wxVtkBaseView::GetInteractorStyleBaseView | ( | ) | [inherited] |
Definition at line 134 of file wxVtkBaseView.cxx.
References wxVtkBaseView::_interactorStyle.
Referenced by wxWidgetMesure2D::ActiveMessureTool(), wxQuantificationWidgetCT::addManualContours(), wxMaracasRenderTabbedPanel::addMPROptions(), wxVtkMPR2DView::Configure(), wxVtk2DBaseView::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(), ContourVOIWidget::ConfigureVTK(), wxMaracasCoutourTool::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(), manualContourContainer::refreshWall(), and wxVtkBaseView::TransFromCoordScreenToWorld().
00135 { 00136 return _interactorStyle; 00137 }
vtkRenderer * wxVtk3DBaseView::GetRenderer | ( | ) | [virtual] |
Reimplemented from wxVtkBaseView.
Definition at line 32 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(), wxVtkMPR3DView::showOutlineActor(), wxVtkClipping3DView::VisibleActor(), wxVtkMPR3DView::VisibleImageActor(), and wxVtkClipping3DView::VisibleVolumeActor().
00033 { 00034 return _aRenderer; 00035 }
vtkRenderWindow * wxVtk3DBaseView::GetRenWin | ( | ) | [virtual] |
Reimplemented from wxVtkBaseView.
Definition at line 37 of file wxVtk3DBaseView.cxx.
References _renWin.
Referenced by wxVtkMPR3DView::Configure(), and wxVtkClipping3DView::Configure().
00038 { 00039 return _renWin; 00040 }
void wxVtk3DBaseView::GetSpacing | ( | double | spc[3] | ) | [virtual] |
Reimplemented from wxVtkBaseView.
Definition at line 101 of file wxVtk3DBaseView.cxx.
wxVTKRenderWindowInteractor * wxVtkBaseView::GetWxVTKRenderWindowInteractor | ( | ) | throw (char*) [inherited] |
Reimplemented in wxVtk2DView_TMP.
Definition at line 38 of file wxVtkBaseView.cxx.
References wxVtkBaseView::_iren.
Referenced by wxMaracasRenderTabbedPanel::addRemoveActorMPR(), 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(), wxVtkClipping3DViewVolCntrlPanel::OnBtnVolumeFunctions(), 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(), wxMaracasRenderTabbedPanel::OnRefreshView(), wxVtkClipping3DViewCntrlPanel::OnRepresentationSurfaceWireFrame(), manualContourBaseControler::OnRightButtonDown(), wxVtkMPR3DViewCntrlPanel::OnVisibleAxisX(), wxVtkMPR3DViewCntrlPanel::OnVisibleAxisY(), wxVtkMPR3DViewCntrlPanel::OnVisibleAxisZ(), wxVtkClipping3DViewCntrlPanel::OnVisibleSurface(), wxVtkClipping3DViewVolCntrlPanel::OnVisibleVolume(), wxVtkClipping3DViewCntrlPanel::OnVisibleVolume(), wxVtkBaseView::Refresh(), Refresh(), manualViewBaseContour::Refresh(), wxVtk2DBaseView::ResetView(), vtkInteractorStyle3DView::SelectMarchibCubePoint(), wxVtk2DBaseView::SetInteractorStyleImage(), wxVtkMPR3DViewCntrlPanel::SetVisibleX(), wxVtkMPR3DViewCntrlPanel::SetVisibleY(), wxVtkMPR3DViewCntrlPanel::SetVisibleZ(), and wxMaracas_ViewerWidget::wxMaracas_ViewerWidget().
void wxVtk3DBaseView::Refresh | ( | ) | [virtual] |
Reimplemented from wxVtkBaseView.
Definition at line 42 of file wxVtk3DBaseView.cxx.
References wxVtkBaseView::GetWxVTKRenderWindowInteractor().
Referenced by wxPanelCuttingImageData::Refresh(), and wxEmptyPanelWidget::Refresh().
00043 { 00044 // _renWin->Render(); 00045 vtkRenderWindowInteractor *vri = GetWxVTKRenderWindowInteractor(); 00046 vri->vtkRenderWindowInteractor::Render(); 00047 }
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::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 }
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::GetInteractorStyleBaseView(), wxVtkBaseView::GetRenderer(), vtkInteractorStyleBaseView::GetWxVtk2DBaseView(), and wxVtk2DBaseView::TransformCoordinate_spacing_ViewToModel().
Referenced by manualViewPerpPlaneContour::ifTouchContour(), vtkInfoTextImageInteractor::OnMouseMove(), 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 }
vtkCamera* wxVtk3DBaseView::_aCamera [private] |
Definition at line 25 of file wxVtk3DBaseView.h.
Referenced by Configure(), GetCamera(), wxVtk3DBaseView(), and ~wxVtk3DBaseView().
vtkRenderer* wxVtk3DBaseView::_aRenderer [private] |
Definition at line 23 of file wxVtk3DBaseView.h.
Referenced by Configure(), GetRenderer(), wxVtk3DBaseView(), and ~wxVtk3DBaseView().
bool wxVtk3DBaseView::_configure [private] |
Definition at line 22 of file wxVtk3DBaseView.h.
Referenced by Configure(), and wxVtk3DBaseView().
vtkRenderWindow* wxVtk3DBaseView::_renWin [private] |
Definition at line 24 of file wxVtk3DBaseView.h.
Referenced by Configure(), GetRenWin(), wxVtk3DBaseView(), and ~wxVtk3DBaseView().