wxVtkMPR2DView Class Reference

#include <wxVtkMPR2DView.h>

Inheritance diagram for wxVtkMPR2DView:

Inheritance graph
[legend]
Collaboration diagram for wxVtkMPR2DView:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxVtkMPR2DView (wxWindow *parent, int direction)
 ~wxVtkMPR2DView ()
void Configure ()
virtual void Refresh ()
vtkMPRBaseDataGetVtkmprbasedata ()
virtual int GetActualSlice ()
virtual void SetActualSlice (int slice)
bool IfMouseTouchX (double x, double y, double z)
bool IfMouseTouchY (double x, double y, double z)
bool IfMouseTouchZ (double x, double y, double z)
void MoveX (double x, double y, double z)
void MoveY (double x, double y, double z)
void MoveZ (double x, double y, double z)
void ChangeAxisColor (double x, double y, double z)
virtual void TransFromCoordScreenToWorld (double &X, double &Y, double &Z, bool keepNormalDirection=false, int type=2)
void SetVisibleAxis (bool ok)
virtual void Configure (bool okimage=true)
vtkBaseDataGetVtkBaseData ()
void SetVtkBaseData (vtkBaseData *vtkbasedata)
virtual void ResetView ()
void SetInteractorStyleImage (vtkInteractorStyleBaseView *interactorstylebaseview)
virtual vtkRenderer * GetRenderer ()
virtual vtkRenderWindow * GetRenWin ()
virtual void TransformCoordinate_spacing_ViewToModel (double &X, double &Y, double &Z)
virtual void TransformCoordinate_spacing_ModelToView (double &X, double &Y, double &Z)
virtual void GetSpacing (double spc[3])
wxVTKRenderWindowInteractorGetWxVTKRenderWindowInteractor () throw (char*)
virtual void RefreshView ()
void SetInteractorStyleBaseView (vtkInteractorStyleImage *interactorStyle)
vtkInteractorStyleImage * GetInteractorStyleBaseView ()

Public Attributes

vtkImageViewer2_XYZ_imageViewer2XYZ

Private Attributes

int _backX
int _backY
int _backZ
bool _visibleAxis
int _direction
vtkPoints * _ptsA
vtkActor * _lineAActor
vtkPolyDataMapper * _lineAMapper
vtkPolyData * _pdA
vtkPoints * _ptsB
vtkActor * _lineBActor
vtkPolyDataMapper * _lineBMapper
vtkPolyData * _pdB
vtkInteractorStyleMPRView_interactorstylemprview


Detailed Description

Definition at line 14 of file wxVtkMPR2DView.h.


Constructor & Destructor Documentation

wxVtkMPR2DView::wxVtkMPR2DView ( wxWindow *  parent,
int  direction 
)

Definition at line 7 of file wxVtkMPR2DView.cxx.

References _backX, _backY, _backZ, _direction, _lineAActor, _lineAMapper, _lineBActor, _lineBMapper, _pdA, _pdB, _ptsA, and _ptsB.

00008  :wxVtk2DBaseView(parent)
00009 {
00010         _backX                  = -99999;
00011         _backY                  = -99999;
00012         _backZ                  = -99999;
00013         _direction              = direction;
00014         _ptsA                   = NULL;
00015         _lineAActor             = NULL;
00016         _lineAMapper    = NULL;
00017         _pdA                    = NULL;
00018         _ptsB                   = NULL;
00019         _lineBActor             = NULL;
00020         _lineBMapper    = NULL;
00021         _pdB                    = NULL;
00022 }

wxVtkMPR2DView::~wxVtkMPR2DView (  ) 

Definition at line 25 of file wxVtkMPR2DView.cxx.

References _lineAActor, _lineAMapper, _lineBActor, _lineBMapper, _pdA, _pdB, _ptsA, and _ptsB.

00026 {
00027         if (_ptsA!=NULL)        { _ptsA         -> Delete(); }
00028         if (_lineAActor!=NULL)  { _lineAActor   -> Delete(); }
00029         if (_lineAMapper!=NULL) { _lineAMapper  -> Delete(); }
00030         if (_pdA!=NULL)         { _pdA          -> Delete(); }
00031         if (_ptsB!=NULL)        { _ptsB         -> Delete(); }
00032         if (_lineBActor!=NULL)  { _lineBActor   -> Delete(); }
00033         if (_lineBMapper!=NULL) { _lineBMapper  -> Delete(); }
00034         if (_pdB!=NULL)         { _pdB          -> Delete(); }
00035 }


Member Function Documentation

void wxVtkMPR2DView::ChangeAxisColor ( double  x,
double  y,
double  z 
)

Definition at line 411 of file wxVtkMPR2DView.cxx.

References _direction, _lineAActor, _lineBActor, IfMouseTouchX(), IfMouseTouchY(), IfMouseTouchZ(), and Refresh().

Referenced by vtkInteractorStyleMPRView::OnMouseMove().

00412 {
00413         double c1r=1,c1g=1,c1b=0;
00414         double c2r=1,c2g=0,c2b=0;
00415 
00416         if (_direction==0) 
00417         { 
00418                 if (IfMouseTouchY(x,y,z)==true)
00419                 {
00420                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
00421                 } else {
00422                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
00423                 }
00424                 if (IfMouseTouchZ(x,y,z)==true)
00425                 {
00426                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
00427                 } else {
00428                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
00429                 }
00430         }
00431 
00432         if (_direction==1) 
00433         { 
00434                 if (IfMouseTouchX(x,y,z)==true)
00435                 {
00436                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
00437                 } else {
00438                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
00439                 }
00440                 if (IfMouseTouchZ(x,y,z)==true)
00441                 {
00442                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
00443                 } else {
00444                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
00445                 }
00446         }
00447 
00448         if (_direction==2) 
00449         { 
00450                 if (IfMouseTouchX(x,y,z)==true)
00451                 {
00452                         _lineBActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
00453                 } else {
00454                         _lineBActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
00455                 }
00456                 if (IfMouseTouchY(x,y,z)==true)
00457                 {
00458                         _lineAActor->GetProperty()->SetDiffuseColor(c1r,c1g,c1b);
00459                 } else {
00460                         _lineAActor->GetProperty()->SetDiffuseColor(c2r,c2g,c2b);
00461                 }
00462         }
00463         Refresh();
00464 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtk2DBaseView::Configure ( bool  okimage = true  )  [virtual, inherited]

Definition at line 84 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, wxVtk2DBaseView::_vtkIinfoTextImage, wxVtk2DBaseView::_vtkIinfoTextImageInteractor, vtkInfoTextImage::Configure(), wxVtkBaseView::Configure(), marImageData::GetImageData(), wxVtkBaseView::GetInteractorStyleBaseView(), vtkBaseData::GetMarImageData(), wxVtk2DBaseView::GetVtkBaseData(), vtkImageViewer2_XYZ::GetVtkImageViewer2(), wxVtkBaseView::GetWxVTKRenderWindowInteractor(), vtkInteractorStyleBaseView2D::New(), vtkImageViewer2_XYZ::SetExtentDimension(), wxVtk2DBaseView::SetInteractorStyleImage(), vtkInfoTextImage::SetMarImageData(), vtkInfoTextImageInteractor::SetModelVtkInfoTextImage(), and vtkInfoTextImage::SetWxVtk2DBaseView().

Referenced by wxQuantificationWidgetCT::ConfigureVTK(), wxProcessingCTWidget::ConfigureVTK(), wxEmptyPanel_3_Widget::ConfigureVTK(), and wxMaracasImageBrowser02::LoadData().

00085 {
00086         double spx,spy,spz;
00087         int x1,x2,y1,y2,z1,z2;
00088         wxVtkBaseView::Configure();
00089 
00090 // EED 17 Oct 2007
00091                         if (_imageViewer2XYZ==NULL)
00092                         {
00093                                 _imageViewer2XYZ = new vtkImageViewer2_XYZ();
00094                                 wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
00095                                 _imageViewer2XYZ -> GetVtkImageViewer2()->SetupInteractor ( iren );
00096                                 SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() );
00097                         }
00098 
00099 
00100         vtkImageData *imageData = GetVtkBaseData()->GetMarImageData()->GetImageData();
00101         if (imageData!=NULL){
00102                 imageData->UpdateInformation();
00103                 imageData->SetUpdateExtent( imageData->GetWholeExtent());
00104                 imageData->Update();
00105                 if (okimage==true){
00106                         imageData->GetSpacing (spx,spy,spz);
00107                         imageData->GetExtent (x1,x2,y1,y2,z1,z2);
00108 
00109 
00110                         _imageViewer2XYZ->GetVtkImageViewer2()->SetInput(imageData );
00111                         _imageViewer2XYZ->SetExtentDimension(x1,x2,y1,y2,z1,z2);
00112                         double range[2];
00113                           imageData->GetScalarRange(range);
00114                           if (range[1]<20000){
00115                                  _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow( (range[1]-range[0])/2 );
00116                                  _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel( (range[1]+range[0])/4 );
00117                           } else {
00118                                  _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow( 1000 );
00119                                  _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel( 500 );
00120                           }
00121 // EED 31 Janvier 2007
00122 //vtkImageActor *vtkimageactor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor ();
00123 //vtkimageactor->InterpolateOff ();
00124 //vtkLookupTable * _collookup = vtkLookupTable::New( );
00125 //_collookup->SetNumberOfColors( 256 );
00126 //_collookup->SetTableRange( 0 , 255 );
00127 //_collookup->Build( );
00128 //_collookup->SetTableValue( 0  , 1 , 0 , 0 , 1 );
00129 //_collookup->SetTableValue(128 , 0 , 0 , 1 , 1 );
00130 //_collookup->SetTableValue(255 , 0 , 1 , 0 , 1 );
00131 //_imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel ()->SetLookupTable(_collookup );
00132 
00133 
00134 // EED 17 Oct 2007
00135 //                      SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() );
00136 
00137 
00138                         vtkImageViewer2 *IV2=_imageViewer2XYZ->GetVtkImageViewer2();
00139                         vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera();
00140 
00141 //EED 17Avril2009       
00142 /*                      
00143                         camera->SetViewUp               ( spx*0                 , -spy*1                        , spz*0         );
00144                         camera->SetPosition             ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , -spz*10000    ); 
00145                         camera->SetFocalPoint   ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0         ); 
00146 */ 
00147                         camera->SetViewUp               ( spx*0                 , spy*1                 , spz*0         );
00148                         camera->SetPosition             ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*10000     ); 
00149                         camera->SetFocalPoint   ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0         ); 
00150                         
00151                         
00152                         camera->SetClippingRange( 0.01                  , 1000000 );
00153                         camera->ComputeViewPlaneNormal();
00154                         camera->SetParallelScale( spx*(x2-x1)/3.0 );
00155                         
00156                         // text information over the graphic window
00157                         _vtkIinfoTextImage                              = new vtkInfoTextImage();
00158                         _vtkIinfoTextImageInteractor    = new vtkInfoTextImageInteractor();
00159                         _vtkIinfoTextImage->SetWxVtk2DBaseView(this);
00160                         _vtkIinfoTextImage->SetMarImageData( GetVtkBaseData()->GetMarImageData() );
00161                         _vtkIinfoTextImageInteractor->SetModelVtkInfoTextImage(_vtkIinfoTextImage);     
00162                         _vtkIinfoTextImage->Configure();
00163                         ((vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView())->AddInteractorStyleMaracas(_vtkIinfoTextImageInteractor);
00164                 } // okimage
00165         } // imageData
00166 
00167 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkMPR2DView::Configure (  )  [virtual]

Reimplemented from wxVtkBaseView.

Definition at line 42 of file wxVtkMPR2DView.cxx.

References _direction, wxVtk2DBaseView::_imageViewer2XYZ, _interactorstylemprview, _lineAActor, _lineAMapper, _lineBActor, _lineBMapper, _pdA, _pdB, _ptsA, _ptsB, _visibleAxis, vtkBaseData::GetImageData(), wxVtkBaseView::GetInteractorStyleBaseView(), vtkImageViewer2_XYZ::GetVtkImageViewer2(), and GetVtkmprbasedata().

00042                               {
00043         wxVtk2DBaseView::Configure();
00044 
00045         _interactorstylemprview = new vtkInteractorStyleMPRView();
00046         ((vtkInteractorStyleBaseView*)GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _interactorstylemprview );
00047 
00048         int x1,x2,y1,y2,z1,z2;
00049         GetVtkmprbasedata()     -> GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
00050 
00051         double spc[3];
00052         vtkImageData* img =  GetVtkmprbasedata()->GetImageData();
00053         if(img!=NULL){
00054                 img->GetSpacing(spc);
00055                 x1 = (int)(x1*spc[0]);
00056                 y1 = (int)(y1*spc[1]);
00057                 z1 = (int)(z1*spc[2]);
00058 
00059                 x2 = (int)(x2*spc[0]);
00060                 y2 = (int)(y2*spc[1]);
00061                 z2 = (int)(z2*spc[2]);
00062 
00063                 _visibleAxis = true;
00064 
00065         // Axe A
00066                 _ptsA = vtkPoints::New();
00067                 _ptsA->SetNumberOfPoints(2);
00068                 _ptsA->SetPoint(0, -1000        , -1000 , -1000 );
00069                 _ptsA->SetPoint(1,  1000        ,  1000 ,  1000 );
00070                 vtkCellArray *linesA;
00071                 linesA = vtkCellArray::New();
00072                 linesA->InsertNextCell(2);
00073                 linesA->InsertCellPoint(0);
00074                 linesA->InsertCellPoint(1);
00075                 _pdA = vtkPolyData::New();
00076                 _pdA->SetPoints( _ptsA );
00077                 _pdA->SetLines( linesA );
00078                 linesA->Delete();  //do not delete lines ??
00079                 _lineAActor                                             =       vtkActor::New();
00080                 _lineAMapper                                    =       vtkPolyDataMapper::New();
00081                 _lineAMapper->SetInput(_pdA);
00082                 _lineAMapper->ImmediateModeRenderingOn();
00083                 _lineAActor->SetMapper(_lineAMapper);
00084 //              _lineAActor->GetProperty()->BackfaceCullingOn();
00085                 _lineAActor->GetProperty()->SetDiffuseColor(1,0,0);
00086                 _lineAActor->GetProperty()->SetLineWidth(2);
00087                 _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
00088 
00089         // Axe B
00090                 _ptsB = vtkPoints::New();
00091                 _ptsB->SetNumberOfPoints(2);
00092                 _ptsB->SetPoint(0, -1000        , -1000 , -1000 );
00093                 _ptsB->SetPoint(1,  1000        ,  1000 ,  1000 );
00094                 vtkCellArray *linesB;
00095                 linesB = vtkCellArray::New();
00096                 linesB->InsertNextCell(2);
00097                 linesB->InsertCellPoint(0);
00098                 linesB->InsertCellPoint(1);
00099                 _pdB = vtkPolyData::New();
00100                 _pdB->SetPoints( _ptsB );
00101                 _pdB->SetLines( linesB );
00102                 linesB->Delete();  //do not delete lines ??
00103                 _lineBActor                                             =       vtkActor::New();
00104                 _lineBMapper                                    =       vtkPolyDataMapper::New();
00105                 _lineBMapper->SetInput(_pdB);
00106                 _lineBMapper->ImmediateModeRenderingOn();
00107                 _lineBActor->SetMapper(_lineBMapper);
00108 //              _lineBActor->GetProperty()->BackfaceCullingOn();
00109                 _lineBActor->GetProperty()->SetDiffuseColor(1,0,0);
00110                 _lineBActor->GetProperty()->SetLineWidth(2);
00111                 _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineBActor );
00112 
00113         
00114                 vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera();
00115                 
00116 //EED 17Avril2009
00117 /*              
00118                 if (_direction==0) {
00119                         camera->SetViewUp               (   0   ,    -1         ,     0         );
00120                         camera->SetPosition             ( -10000,(y1+y2)/2      , (z1+z2)/2     ); 
00121                         camera->SetFocalPoint   (   0   , (y1+y2)/2     , (z1+z2)/2     );
00122                         camera->SetParallelScale( (z2-z1)/3.0 );
00123                 }
00124 
00125                 if (_direction==1) { 
00126                         camera->SetViewUp               (       0               ,       0       ,       -1              );
00127                         camera->SetPosition             ((x1+x2)/2      , 10000 , (z1+z2)/2     ); 
00128                         camera->SetFocalPoint   ((x1+x2)/2      ,   0   , (z1+z2)/2     );
00129                         camera->SetParallelScale( (x2-x1)/3.0 );
00130                 }
00131 
00132                 if (_direction==2) { 
00133                         camera->SetViewUp               (       0               ,       -1              ,       0       );
00134                         camera->SetPosition             ((x1+x2)/2      , (y1+y2)/2     , -10000); 
00135                         camera->SetFocalPoint   ((x1+x2)/2      , (y1+y2)/2     ,       0       ); 
00136                         camera->SetParallelScale( (x2-x1)/3.0 );
00137                 }
00138  */
00139 
00140                 if (_direction==0) {    // YZ
00141                         camera->SetViewUp               (   0   ,     1         ,     0         );
00142                         camera->SetPosition             (  10000,(y1+y2)/2      , (z1+z2)/2     ); 
00143                         camera->SetFocalPoint   (   0   , (y1+y2)/2     , (z1+z2)/2     );
00144                         camera->SetParallelScale( (z2-z1)/3.0 );
00145                 }
00146                 
00147                 if (_direction==1) {    // XZ
00148                         camera->SetViewUp               (       0               ,       0       ,       -1              );
00149                         camera->SetPosition             ((x1+x2)/2      , 10000 , (z1+z2)/2     ); 
00150                         camera->SetFocalPoint   ((x1+x2)/2      ,   0   , (z1+z2)/2     );
00151                         camera->SetParallelScale( (x2-x1)/3.0 );
00152                 }
00153                 
00154                 if (_direction==2) {    // XY
00155                         camera->SetViewUp               (       0               ,       1               ,       0       );
00156                         camera->SetPosition             ((x1+x2)/2      , (y1+y2)/2     ,  10000); 
00157                         camera->SetFocalPoint   ((x1+x2)/2      , (y1+y2)/2     ,       0       ); 
00158                         camera->SetParallelScale( (x2-x1)/3.0 );
00159                 }
00160                 
00161                 
00162                 
00163         }
00164 
00165 //      _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow (160);
00166 //      _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel (800);
00167 
00168 }

Here is the call graph for this function:

int wxVtkMPR2DView::GetActualSlice (  )  [virtual]

Reimplemented from wxVtk2DBaseView.

Definition at line 260 of file wxVtkMPR2DView.cxx.

References _direction, GetVtkmprbasedata(), vtkMPRBaseData::GetX(), vtkMPRBaseData::GetY(), and vtkBaseData::GetZ().

00261 {
00262         int result;
00263         if (_direction==0) 
00264         { 
00265                 result = (int)(GetVtkmprbasedata()->GetX());
00266         }
00267         if (_direction==1) 
00268         { 
00269                 result = (int)(GetVtkmprbasedata()->GetY());
00270         }
00271         if (_direction==2) 
00272         { 
00273                 result = (int)(GetVtkmprbasedata()->GetZ());
00274         }
00275         return result;
00276 }

Here is the call graph for this function:

vtkInteractorStyleImage * wxVtkBaseView::GetInteractorStyleBaseView (  )  [inherited]

vtkRenderer * wxVtk2DBaseView::GetRenderer (  )  [virtual, inherited]

Reimplemented from wxVtkBaseView.

Definition at line 226 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

Referenced by vtkInfoTextImage::Create_Text_Label().

00227 {
00228         return  _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer();
00229 }

Here is the call graph for this function:

Here is the caller graph for this function:

vtkRenderWindow * wxVtk2DBaseView::GetRenWin (  )  [virtual, inherited]

Reimplemented from wxVtkBaseView.

Definition at line 231 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

Referenced by wxMaracasSuperpositionPanel::Refresh().

00232 {
00233         return  _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderWindow();
00234 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtk2DBaseView::GetSpacing ( double  spc[3]  )  [virtual, inherited]

Reimplemented from wxVtkBaseView.

Definition at line 238 of file wxVtk2DBaseView.cxx.

References vtkBaseData::GetImageData(), and wxVtk2DBaseView::GetVtkBaseData().

00239 {
00240         vtkImageData *imageData = GetVtkBaseData()->GetImageData();
00241         imageData->GetSpacing(spc);
00242 }

Here is the call graph for this function:

vtkBaseData * wxVtk2DBaseView::GetVtkBaseData (  )  [inherited]

vtkMPRBaseData * wxVtkMPR2DView::GetVtkmprbasedata (  ) 

Definition at line 37 of file wxVtkMPR2DView.cxx.

References wxVtk2DBaseView::GetVtkBaseData().

Referenced by Configure(), GetActualSlice(), wxMaracasSuperpositionPanel::GetX(), wxMaracasSuperpositionPanel::GetY(), wxMaracasSuperpositionPanel::GetZ(), IfMouseTouchX(), IfMouseTouchY(), IfMouseTouchZ(), MoveX(), MoveY(), MoveZ(), Refresh(), and SetActualSlice().

00038 {
00039         return (vtkMPRBaseData*)GetVtkBaseData();
00040 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

bool wxVtkMPR2DView::IfMouseTouchX ( double  x,
double  y,
double  z 
)

Definition at line 294 of file wxVtkMPR2DView.cxx.

References _direction, and GetVtkmprbasedata().

Referenced by ChangeAxisColor(), and vtkInteractorStyleMPRView::OnLeftButtonDown().

00295 {
00296         double delta=5;
00297         bool result=false;
00298         if (_direction==0) 
00299         { 
00300         }
00301         if (_direction==1) 
00302         { 
00303                 if (( x<GetVtkmprbasedata()->GetX()+delta ) && ( x>GetVtkmprbasedata()->GetX()-delta ))
00304                 {
00305                         result = true;
00306                 }
00307         }
00308         if (_direction==2) 
00309         { 
00310                 if (( x<GetVtkmprbasedata()->GetX()+delta ) && ( x>GetVtkmprbasedata()->GetX()-delta ))
00311                 {
00312                         result = true;
00313                 }
00314         }
00315         return result;
00316 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool wxVtkMPR2DView::IfMouseTouchY ( double  x,
double  y,
double  z 
)

Definition at line 318 of file wxVtkMPR2DView.cxx.

References _direction, and GetVtkmprbasedata().

Referenced by ChangeAxisColor(), and vtkInteractorStyleMPRView::OnLeftButtonDown().

00319 {
00320         double delta=5;
00321         bool result=false;
00322         if (_direction==0) 
00323         { 
00324                 if (( y<GetVtkmprbasedata()->GetY()+delta ) && ( y>GetVtkmprbasedata()->GetY()-delta ))
00325                 {
00326                         result = true;
00327                 }
00328         }
00329         if (_direction==1) 
00330         { 
00331         }
00332         if (_direction==2) 
00333         { 
00334                 if (( y<GetVtkmprbasedata()->GetY()+delta ) && ( y>GetVtkmprbasedata()->GetY()-delta ))
00335                 {
00336                         result = true;
00337                 }
00338         }
00339         return result;
00340 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool wxVtkMPR2DView::IfMouseTouchZ ( double  x,
double  y,
double  z 
)

Definition at line 342 of file wxVtkMPR2DView.cxx.

References _direction, and GetVtkmprbasedata().

Referenced by ChangeAxisColor(), and vtkInteractorStyleMPRView::OnLeftButtonDown().

00343 {
00344         double delta=5;
00345         bool result=false;
00346         if (_direction==0) 
00347         { 
00348                 if (( z<GetVtkmprbasedata()->GetZ()+delta ) && ( z>GetVtkmprbasedata()->GetZ()-delta ))
00349                 {
00350                         result = true;
00351                 }
00352         }
00353         if (_direction==1) 
00354         { 
00355                 if (( z<GetVtkmprbasedata()->GetZ()+delta ) && ( z>GetVtkmprbasedata()->GetZ()-delta ))
00356                 {
00357                         result = true;
00358                 }
00359         }
00360         if (_direction==2) 
00361         { 
00362         }
00363         return result;
00364 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkMPR2DView::MoveX ( double  x,
double  y,
double  z 
)

Definition at line 366 of file wxVtkMPR2DView.cxx.

References _direction, GetVtkmprbasedata(), and vtkMPRBaseData::SetX().

Referenced by vtkInteractorStyleMPRView::OnLeftDClick().

00367 {
00368         if (_direction==0) 
00369         { 
00370         }
00371         if (_direction==1) 
00372         { 
00373                 GetVtkmprbasedata()->SetX(x);
00374         }
00375         if (_direction==2) 
00376         { 
00377                 GetVtkmprbasedata()->SetX(x);
00378         }
00379 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkMPR2DView::MoveY ( double  x,
double  y,
double  z 
)

Definition at line 381 of file wxVtkMPR2DView.cxx.

References _direction, GetVtkmprbasedata(), and vtkMPRBaseData::SetY().

Referenced by vtkInteractorStyleMPRView::OnLeftDClick(), and vtkInteractorStyleMPRView::OnMouseMove().

00382 {
00383         if (_direction==0) 
00384         { 
00385                 GetVtkmprbasedata()->SetY(y);
00386         }
00387         if (_direction==1) 
00388         { 
00389         }
00390         if (_direction==2) 
00391         { 
00392                 GetVtkmprbasedata()->SetY(y);
00393         }
00394 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkMPR2DView::MoveZ ( double  x,
double  y,
double  z 
)

Definition at line 396 of file wxVtkMPR2DView.cxx.

References _direction, GetVtkmprbasedata(), and vtkBaseData::SetZ().

Referenced by vtkInteractorStyleMPRView::OnLeftDClick(), and vtkInteractorStyleMPRView::OnMouseMove().

00397 {
00398         if (_direction==0) 
00399         { 
00400                 GetVtkmprbasedata()->SetZ(z);
00401         }
00402         if (_direction==1) 
00403         { 
00404                 GetVtkmprbasedata()->SetZ(z);
00405         }
00406         if (_direction==2) 
00407         { 
00408         }
00409 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkMPR2DView::Refresh (  )  [virtual]

Reimplemented from wxVtk2DBaseView.

Definition at line 190 of file wxVtkMPR2DView.cxx.

References _backX, _backY, _backZ, _direction, wxVtk2DBaseView::_imageViewer2XYZ, _ptsA, _ptsB, vtkMPRBaseData::GetDimensionExtention(), vtkBaseData::GetImageData(), GetVtkmprbasedata(), vtkMPRBaseData::GetX(), vtkMPRBaseData::GetY(), vtkBaseData::GetZ(), vtkImageViewer2_XYZ::SetXSlice(), vtkImageViewer2_XYZ::SetYSlice(), and vtkImageViewer2_XYZ::SetZSlice().

Referenced by ChangeAxisColor().

00191 {
00192         //wxVtk2DBaseView::Refresh();
00193 
00194 
00195         //vtkImageViewer2 *IV2=_imageViewer2XYZ->GetVtkImageViewer2(); // JPRx
00196         //vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera(); // JPRx
00197 
00198 
00199 
00200         int x1,x2,y1,y2,z1,z2;
00201         GetVtkmprbasedata()->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
00202         double spc[3];
00203         
00204         vtkImageData* img = GetVtkmprbasedata()->GetImageData();
00205         if(img!=NULL){
00206                 img->GetSpacing(spc);
00207                 x1 =  (int)(x1*spc[0]);
00208                 y1 =  (int)(y1*spc[1]);
00209                 z1 =  (int)(z1*spc[2]);
00210 
00211                 x2 =  (int)(x2*spc[0]);
00212                 y2 =  (int)(y2*spc[1]);
00213                 z2 =  (int)(z2*spc[2]);
00214 
00215                 int x = (int)(GetVtkmprbasedata()->GetX());
00216                 int y = (int)(GetVtkmprbasedata()->GetY());
00217                 int z = (int)(GetVtkmprbasedata()->GetZ());
00218 
00219                 x =  (int)(x*spc[0]);
00220                 y =  (int)(y*spc[1]);
00221                 z =  (int)(z*spc[2]);
00222 
00223                 if ((x!=_backX) || (y!=_backY) || (z!=_backZ)) {
00224 
00225                         if (_direction==0) {    // YZ 
00226                                 _imageViewer2XYZ->SetXSlice( (int)(GetVtkmprbasedata()->GetX()) ); 
00227                                 _ptsA->SetPoint(0, x2, y1  , z );
00228                                 _ptsA->SetPoint(1, x2, y2  , z );
00229                                 _ptsB->SetPoint(0, x2, y   , z1);
00230                                 _ptsB->SetPoint(1, x2, y   , z2);
00231                         }
00232                         if (_direction==1) {    // XZ
00233                                 _imageViewer2XYZ->SetYSlice( (int)(GetVtkmprbasedata()->GetY()) ); 
00234                             _ptsA->SetPoint(0, x1 , y2 , z );
00235                                 _ptsA->SetPoint(1, x2 , y2 , z );
00236                                 _ptsB->SetPoint(0, x  , y2 , z1);
00237                                 _ptsB->SetPoint(1, x  , y2 , z2);
00238                         }
00239                         if (_direction==2) {    // XY
00240                                 _imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) ); 
00241                                 _imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) ); 
00242                         //      _ptsA->SetPoint(0, x1 , y , -z2 );
00243                         //      _ptsA->SetPoint(1, x2 , y , -z2 );
00244                         //      _ptsB->SetPoint(0, x  , y1, -z2 );
00245                         //      _ptsB->SetPoint(1, x  , y2, -z2 );
00246                                 
00247                                 _ptsA->SetPoint(0, x1 , y , z2 );
00248                                 _ptsA->SetPoint(1, x2 , y , z2 );
00249                                 _ptsB->SetPoint(0, x  , y1, z2 );
00250                                 _ptsB->SetPoint(1, x  , y2, z2 );
00251                         }
00252                         _backX=x;
00253                         _backY=y;
00254                         _backZ=z;
00255                 }
00256                 wxVtkBaseView::Refresh();
00257         }
00258 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView::RefreshView (  )  [virtual, inherited]

void wxVtk2DBaseView::ResetView (  )  [virtual, inherited]

Definition at line 59 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, wxVtkBaseView::Configure(), vtkBaseData::GetImageData(), wxVtk2DBaseView::GetVtkBaseData(), vtkImageViewer2_XYZ::GetVtkImageViewer2(), wxVtkBaseView::GetWxVTKRenderWindowInteractor(), vtkInteractorStyleBaseView2D::New(), and wxVtk2DBaseView::SetInteractorStyleImage().

Referenced by wxQuantificationWidgetCT::RefreshView().

00060 {
00061         double spx,spy,spz;
00062         int x1,x2,y1,y2,z1,z2;
00063         wxVtkBaseView::Configure();
00064         
00065         wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
00066         vtkImageData *imageData = GetVtkBaseData()->GetImageData();
00067         imageData->UpdateInformation();
00068         imageData->SetUpdateExtent( imageData->GetWholeExtent());
00069         imageData->Update();
00070 
00071         _imageViewer2XYZ->GetVtkImageViewer2()->SetInput(imageData );
00072         imageData->GetSpacing (spx,spy,spz);
00073         imageData->GetExtent (x1,x2,y1,y2,z1,z2);
00074         _imageViewer2XYZ -> SetExtentDimension(x1,x2,y1,y2,z1,z2);
00075         _imageViewer2XYZ -> GetVtkImageViewer2()->SetupInteractor ( iren );
00076 
00077         _imageViewer2XYZ->GetVtkImageViewer2()->Render();
00078         SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() );
00079         
00080 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkMPR2DView::SetActualSlice ( int  slice  )  [virtual]

Reimplemented from wxVtk2DBaseView.

Definition at line 278 of file wxVtkMPR2DView.cxx.

References _direction, GetVtkmprbasedata(), vtkMPRBaseData::SetX(), vtkMPRBaseData::SetY(), and vtkBaseData::SetZ().

00279 {
00280         if (_direction==0) 
00281         { 
00282                 GetVtkmprbasedata()->SetX(slice);
00283         }
00284         if (_direction==1) 
00285         { 
00286                 GetVtkmprbasedata()->SetY(slice);
00287         }
00288         if (_direction==2) 
00289         { 
00290                 GetVtkmprbasedata()->SetZ(slice);
00291         }
00292 }

Here is the call graph for this function:

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

Definition at line 142 of file wxVtkBaseView.cxx.

References wxVtkBaseView::_interactorStyle.

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

00143 {
00144         _interactorStyle = interactorStyle;
00145 }

Here is the caller graph for this function:

void wxVtk2DBaseView::SetInteractorStyleImage ( vtkInteractorStyleBaseView interactorstylebaseview  )  [inherited]

Definition at line 208 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, vtkImageViewer2_XYZ::GetVtkImageViewer2(), wxVtkBaseView::GetWxVTKRenderWindowInteractor(), vtkMaracasImageViewer2Callback::IV, vtkMaracasImageViewer2Callback::New(), wxVtkBaseView::SetInteractorStyleBaseView(), and vtkInteractorStyleBaseView::SetwxVtkBaseView().

Referenced by wxVtk2DBaseView::Configure(), vtkPlane2DView::Configure(), and wxVtk2DBaseView::ResetView().

00209 {
00210         SetInteractorStyleBaseView(interactorstylebaseview);
00211 
00212         wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
00213         interactorstylebaseview->SetInteractor ( iren );
00214         iren->SetInteractorStyle(interactorstylebaseview);
00215         interactorstylebaseview->SetwxVtkBaseView(this);        
00216 
00217         vtkMaracasImageViewer2Callback * cbk = vtkMaracasImageViewer2Callback::New();
00218         cbk->IV = _imageViewer2XYZ->GetVtkImageViewer2();
00219         interactorstylebaseview->AddObserver( vtkCommand::WindowLevelEvent, cbk );
00220         interactorstylebaseview->AddObserver( vtkCommand::StartWindowLevelEvent, cbk );
00221         interactorstylebaseview->AddObserver( vtkCommand::ResetWindowLevelEvent, cbk );
00222         cbk->Delete();
00223 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkMPR2DView::SetVisibleAxis ( bool  ok  ) 

Definition at line 170 of file wxVtkMPR2DView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, _lineAActor, _lineBActor, _visibleAxis, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

Referenced by wxMaracasSuperpositionPanel::SetVisibleAxis().

00171 {
00172         if (ok!=_visibleAxis)
00173         {
00174                 _visibleAxis=ok;
00175                 if (_visibleAxis==true)
00176                 {
00177                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
00178                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineBActor );
00179                 }
00180                 if (_visibleAxis==false)
00181                 {
00182                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->RemoveActor( _lineAActor );
00183                         _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->RemoveActor( _lineBActor );
00184                 }
00185 
00186         }
00187 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtk2DBaseView::SetVtkBaseData ( vtkBaseData vtkbasedata  )  [inherited]

void wxVtk2DBaseView::TransformCoordinate_spacing_ModelToView ( double &  X,
double &  Y,
double &  Z 
) [virtual, inherited]

Definition at line 45 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

00046 {
00047 //EEDx5
00048         double spc[3];
00049 //      GetVtkBaseData()->GetImageData()->GetSpacing(spc);
00050         this->_imageViewer2XYZ->GetVtkImageViewer2()->GetInput()->GetSpacing(spc);
00051 
00052         X=X*spc[0];
00053         Y=Y*spc[1];
00054         Z=Z*spc[2];
00055 
00056 }

Here is the call graph for this function:

void wxVtk2DBaseView::TransformCoordinate_spacing_ViewToModel ( double &  X,
double &  Y,
double &  Z 
) [virtual, inherited]

Definition at line 31 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

Referenced by wxVtkBaseView::TransFromCoordScreenToWorld().

00032 {
00033 //EEDx5
00034         double spc[3];
00035 //      GetVtkBaseData()->GetImageData()->GetSpacing(spc);
00036         this->_imageViewer2XYZ->GetVtkImageViewer2()->GetInput()->GetSpacing(spc);
00037 
00038         X = X / spc[0];
00039         Y = Y / spc[1];
00040         Z = Z / spc[2];
00041 
00042 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from wxVtkBaseView.

Definition at line 469 of file wxVtkMPR2DView.cxx.

References _direction, and wxVtk2DBaseView::GetVtkBaseData().

00470 {
00471                 
00472         wxVtkBaseView::TransFromCoordScreenToWorld(X,Y,Z,keepNormalDirection,_direction);
00473 
00474         if ((_direction==0) && (keepNormalDirection==true) )
00475         {
00476                 X = ((vtkMPRBaseData*)GetVtkBaseData())->GetX();
00477         }
00478         
00479         if ((_direction==1) && (keepNormalDirection==true) )
00480         {
00481                 Y = ((vtkMPRBaseData*)GetVtkBaseData())->GetY();
00482         }
00483         
00484         if ((_direction==2) && (keepNormalDirection==true) )
00485         {
00486                 Z = ((vtkMPRBaseData*)GetVtkBaseData())->GetZ();
00487         }
00488         
00489 }

Here is the call graph for this function:


Member Data Documentation

int wxVtkMPR2DView::_backX [private]

Definition at line 39 of file wxVtkMPR2DView.h.

Referenced by Refresh(), and wxVtkMPR2DView().

int wxVtkMPR2DView::_backY [private]

Definition at line 40 of file wxVtkMPR2DView.h.

Referenced by Refresh(), and wxVtkMPR2DView().

int wxVtkMPR2DView::_backZ [private]

Definition at line 41 of file wxVtkMPR2DView.h.

Referenced by Refresh(), and wxVtkMPR2DView().

Definition at line 55 of file wxVtkMPR2DView.h.

Referenced by Configure().

vtkActor* wxVtkMPR2DView::_lineAActor [private]

vtkPolyDataMapper* wxVtkMPR2DView::_lineAMapper [private]

Definition at line 48 of file wxVtkMPR2DView.h.

Referenced by Configure(), wxVtkMPR2DView(), and ~wxVtkMPR2DView().

vtkActor* wxVtkMPR2DView::_lineBActor [private]

vtkPolyDataMapper* wxVtkMPR2DView::_lineBMapper [private]

Definition at line 52 of file wxVtkMPR2DView.h.

Referenced by Configure(), wxVtkMPR2DView(), and ~wxVtkMPR2DView().

vtkPolyData* wxVtkMPR2DView::_pdA [private]

Definition at line 49 of file wxVtkMPR2DView.h.

Referenced by Configure(), wxVtkMPR2DView(), and ~wxVtkMPR2DView().

vtkPolyData* wxVtkMPR2DView::_pdB [private]

Definition at line 53 of file wxVtkMPR2DView.h.

Referenced by Configure(), wxVtkMPR2DView(), and ~wxVtkMPR2DView().

vtkPoints* wxVtkMPR2DView::_ptsA [private]

Definition at line 46 of file wxVtkMPR2DView.h.

Referenced by Configure(), Refresh(), wxVtkMPR2DView(), and ~wxVtkMPR2DView().

vtkPoints* wxVtkMPR2DView::_ptsB [private]

Definition at line 50 of file wxVtkMPR2DView.h.

Referenced by Configure(), Refresh(), wxVtkMPR2DView(), and ~wxVtkMPR2DView().

Definition at line 43 of file wxVtkMPR2DView.h.

Referenced by Configure(), and SetVisibleAxis().


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

Generated on Fri Jun 12 00:08:59 2009 for creaMaracasVisu by  doxygen 1.5.7.1