wxVtk3DBaseView Class Reference

#include <wxVtk3DBaseView.h>

Inheritance diagram for wxVtk3DBaseView:
Inheritance graph
[legend]
Collaboration diagram for wxVtk3DBaseView:
Collaboration graph
[legend]

List of all members.

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])
wxVTKRenderWindowInteractorGetWxVTKRenderWindowInteractor () throw (char*)
virtual void RefreshView ()
virtual void TransFromCoordScreenToWorld (double &X, double &Y, double &Z, bool keepNormalDirection=false, int type=2)
void TransCoordScreenToWorld (double &X, double &Y, double &Z, int type=2)
void SetInteractorStyleBaseView (vtkInteractorStyleImage *interactorStyle)
vtkInteractorStyleImage * GetInteractorStyleBaseView ()

Private Attributes

bool _configure
vtkRenderer * _aRenderer
vtkRenderWindow * _renWin
vtkCamera * _aCamera

Detailed Description

Definition at line 10 of file wxVtk3DBaseView.h.


Constructor & Destructor Documentation

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 }


Member Function Documentation

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(), wxMaracas_ViewerWidget::ConfigureVTK(), 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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

vtkInteractorStyleImage * wxVtkBaseView::GetInteractorStyleBaseView (  )  [inherited]

Definition at line 166 of file wxVtkBaseView.cxx.

References wxVtkBaseView::_interactorStyle.

Referenced by wxWidgetMesure2D::ActiveMessureTool(), wxQuantificationWidgetCT::addManualContours(), wxMaracasRenderTabbedPanel::addMPROptions(), ManualPaintControler::Config(), 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().

00167 {
00168         return _interactorStyle;
00169 }

Here is the caller graph for this function:

vtkRenderer * wxVtk3DBaseView::GetRenderer (  )  [virtual]
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 }

Here is the caller graph for this function:

void wxVtk3DBaseView::GetSpacing ( double  spc[3]  )  [virtual]

Reimplemented from wxVtkBaseView.

Definition at line 101 of file wxVtk3DBaseView.cxx.

00102 {
00103         spc[0]=1;
00104         spc[1]=1;
00105         spc[2]=1;
00106 }

wxVTKRenderWindowInteractor * wxVtkBaseView::GetWxVTKRenderWindowInteractor (  )  throw (char*) [inherited]

Reimplemented in wxVtk2DView_TMP.

Definition at line 36 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(), vtkInteractorManualPaint::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().

00037 {
00038 
00039         if(_iren==NULL){
00040                 throw "wxVtkBaseView::GetWxVTKRenderWindowInteractor() _iren wxVTKRenderWindowInteractorPlus =NULL";
00041         }
00042    return _iren;
00043 }

void wxVtk3DBaseView::Refresh (  )  [virtual]

Reimplemented from wxVtkBaseView.

Definition at line 42 of file wxVtk3DBaseView.cxx.

References wxVtkBaseView::GetWxVTKRenderWindowInteractor().

Referenced by wxPanelCuttingImageData::Refresh(), wxEmptyPanelWidget::Refresh(), and wxMaracas_ViewerWidget::RefreshView().

00043 {
00044 //      _renWin->Render();
00045         vtkRenderWindowInteractor *vri = GetWxVTKRenderWindowInteractor();
00046         vri->vtkRenderWindowInteractor::Render();
00047 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView::RefreshView (  )  [virtual, inherited]
void wxVtkBaseView::SetInteractorStyleBaseView ( vtkInteractorStyleImage *  interactorStyle  )  [inherited]

Definition at line 173 of file wxVtkBaseView.cxx.

References wxVtkBaseView::_interactorStyle.

Referenced by Configure(), wxVtk2DView_TMP::Configure(), and wxVtk2DBaseView::SetInteractorStyleImage().

00174 {
00175         _interactorStyle = interactorStyle;
00176 }

Here is the caller graph for this function:

void wxVtkBaseView::TransCoordScreenToWorld ( double &  X,
double &  Y,
double &  Z,
int  type = 2 
) [inherited]

Definition at line 92 of file wxVtkBaseView.cxx.

References wxVtkBaseView::GetRenderer().

Referenced by wxVtkBaseView::TransFromCoordScreenToWorld().

00093 {
00094         GetRenderer()->SetDisplayPoint((int)X, (int)Y, (int)Z);
00095         GetRenderer()->DisplayToWorld();
00096         double fP[4];
00097         GetRenderer()->GetWorldPoint( fP );
00098         if ( fP[3] ){
00099                 fP[0] /= fP[3];
00100                 fP[1] /= fP[3];
00101                 fP[2] /= fP[3];
00102         }
00103 
00104         if (type!=0)
00105         {
00106                 X=fP[0];
00107         }
00108         if (type!=1)
00109         {
00110                 Y=fP[1];
00111         }
00112         if (type!=2)
00113         {
00114                 Z=fP[2];
00115         } 
00116 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView::TransFromCoordScreenToWorld ( double &  X,
double &  Y,
double &  Z,
bool  keepNormalDirection = false,
int  type = 2 
) [virtual, inherited]

Reimplemented in wxVtkMPR2DView.

Definition at line 119 of file wxVtkBaseView.cxx.

References wxVtkBaseView::GetInteractorStyleBaseView(), vtkInteractorStyleBaseView::GetWxVtk2DBaseView(), wxVtkBaseView::TransCoordScreenToWorld(), and wxVtk2DBaseView::TransformCoordinate_spacing_ViewToModel().

Referenced by manualViewPerpPlaneContour::ifTouchContour(), vtkInfoTextImageInteractor::OnMouseMove(), vtkInteractorManualPaint::OnMouseMove(), manualViewBaseContour::TransfromCoordViewWorld(), and vtkPlane2DView::TransfromCoordViewWorld2().

00120 {
00121         double xx = X;
00122         double yy = Y;
00123         double zz = Z;
00124 
00125         //RaC 03-2010
00126         TransCoordScreenToWorld(xx,yy,zz,type);
00127 
00128         X = xx;
00129         Y = yy;
00130         Z=zz;
00131 
00132 // EEDx5
00133         //JCP 13/05/2009
00134         vtkInteractorStyleBaseView* interactorstyle = (vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView();
00135     wxVtk2DBaseView* baseview = (wxVtk2DBaseView*)interactorstyle->GetWxVtk2DBaseView();
00136 
00137         double fP[3];
00138         fP[0] = X;
00139         fP[1] = Y;
00140         fP[2] = Z;
00141 
00142         baseview->TransformCoordinate_spacing_ViewToModel( fP[0] , fP[1] , fP[2] );
00143         //JCP 13/05/2009
00144 
00145         if (type!=0)
00146         {
00147                 X=fP[0];
00148         }
00149         if (type!=1)
00150         {
00151                 Y=fP[1];
00152         }
00153         if (type!=2)
00154         {
00155                 Z=fP[2];
00156         } 
00157 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

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().

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().


The documentation for this class was generated from the following files:

Generated on 20 Oct 2010 for creaMaracasVisu_lib by  doxygen 1.6.1