vtkmyPWCallback_3DPointWidget Class Reference

#include <vtkmyPWCallback_3DPointWidget.h>

Collaboration diagram for vtkmyPWCallback_3DPointWidget:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void Execute (vtkObject *caller, unsigned long, void *)
 vtkmyPWCallback_3DPointWidget ()
void SetWxVtkMPR3DView (wxVtkMPR3DView *wxvtkmpr3Dview)
void SetVtkPointWidget (vtkPointWidget *pointWidget)
void SetVtkPlaneWidget (vtkPlaneWidget *planeWidget)

Static Public Member Functions

static
vtkmyPWCallback_3DPointWidget
New ()

Private Attributes

double _backNormal [3]
vtkPlaneWidget * _planeWidget
vtkPointWidget * _pointWidget
wxVtkMPR3DView_wxvtkmpr3Dview

Detailed Description

Definition at line 11 of file vtkmyPWCallback_3DPointWidget.h.


Constructor & Destructor Documentation

vtkmyPWCallback_3DPointWidget::vtkmyPWCallback_3DPointWidget (  )  [inline]

Definition at line 17 of file vtkmyPWCallback_3DPointWidget.h.

00017 {}


Member Function Documentation

void vtkmyPWCallback_3DPointWidget::Execute ( vtkObject *  caller,
unsigned  long,
void *   
) [virtual]

Definition at line 7 of file vtkmyPWCallback_3DPointWidget.cxx.

References _backNormal, _planeWidget, _pointWidget, _wxvtkmpr3Dview, vtkInteractorStyleBaseView::BlockRefresh(), vtkInteractorStyleBaseView::EvaluateToRefresh(), vtkBaseData::GetImageData(), wxVtkBaseView::GetInteractorStyleBaseView(), wxVtkMPR3DView::GetVtkMPR3DDataViewer(), vtkMPR3DDataViewer::GetVtkMPRBaseData(), wxVtkMPR3DView::GetWxvtk3Dbaseview(), vtkMPRBaseData::GetX(), vtkMPRBaseData::GetY(), vtkBaseData::GetZ(), vtkMPRBaseData::SetNormal(), vtkInteractorStyleBaseView::SetParent_refresh_waiting(), vtkMPRBaseData::SetX(), vtkMPRBaseData::SetY(), vtkBaseData::SetZ(), and vtkInteractorStyleBaseView::UnBlockRefresh().

00008 {
00009         double n[3];
00010         double p[3];
00011         double delta = 0.000000001;
00012 
00013         vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetInteractorStyleBaseView();
00014 
00015         if (caller==_pointWidget)
00016         {
00017                 _pointWidget->GetPosition(p);
00018         }
00019         if (caller==_planeWidget)
00020         {
00021                 _planeWidget->GetCenter(p);
00022                 _planeWidget->GetNormal(n);
00023                 _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetNormal(n[0],n[1],n[2]);
00024         }
00025 
00026         double spc[3];
00027         _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData()->GetSpacing(spc);
00028         p[0]=p[0]/spc[0];
00029         p[1]=p[1]/spc[1];
00030         p[2]=p[2]/spc[2];
00031 
00032         // Orientation change
00033         if ( (fabs(n[0]-_backNormal[0])>delta) || (fabs(n[1]-_backNormal[1])>delta) || (fabs(n[2]-_backNormal[2])>delta) )
00034         {
00035                 _backNormal[0] = n[0];
00036                 _backNormal[1] = n[1];
00037                 _backNormal[2] = n[2];
00038                 isbv->SetParent_refresh_waiting();
00039         }
00040 
00041         // ----------
00042 
00043         double tx = _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetX();
00044         double ty = _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetY();
00045         double tz = _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetZ();
00046 
00047         // Position Change
00048         if ( (fabs(tx-p[0])>delta) || (fabs(ty-p[1])>delta) || (fabs(tz-p[2])>delta) )
00049         {
00050                 _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX( p[0] );
00051                 _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY( p[1] );
00052                 _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ( p[2] );
00053                 vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetInteractorStyleBaseView();
00054                 isbv->BlockRefresh();
00055                 isbv->vtkInteractorStyleBaseView::OnLeftButtonDown();
00056                 isbv->SetParent_refresh_waiting();
00057                 isbv->vtkInteractorStyleBaseView::OnMouseMove();
00058                 isbv->UnBlockRefresh();
00059         } 
00060         isbv->EvaluateToRefresh();
00061 }

Here is the call graph for this function:

static vtkmyPWCallback_3DPointWidget* vtkmyPWCallback_3DPointWidget::New (  )  [inline, static]

Definition at line 14 of file vtkmyPWCallback_3DPointWidget.h.

Referenced by wxVtkMPR3DView::Configure().

00015     { return new vtkmyPWCallback_3DPointWidget; }

Here is the caller graph for this function:

void vtkmyPWCallback_3DPointWidget::SetVtkPlaneWidget ( vtkPlaneWidget *  planeWidget  ) 

Definition at line 73 of file vtkmyPWCallback_3DPointWidget.cxx.

References _planeWidget.

Referenced by wxVtkMPR3DView::Configure().

00074 {
00075         _planeWidget=planeWidget;
00076 }

Here is the caller graph for this function:

void vtkmyPWCallback_3DPointWidget::SetVtkPointWidget ( vtkPointWidget *  pointWidget  ) 

Definition at line 68 of file vtkmyPWCallback_3DPointWidget.cxx.

References _pointWidget.

Referenced by wxVtkMPR3DView::Configure().

00069 {
00070         _pointWidget=pointWidget;
00071 }

Here is the caller graph for this function:

void vtkmyPWCallback_3DPointWidget::SetWxVtkMPR3DView ( wxVtkMPR3DView wxvtkmpr3Dview  ) 

Definition at line 63 of file vtkmyPWCallback_3DPointWidget.cxx.

References _wxvtkmpr3Dview.

Referenced by wxVtkMPR3DView::Configure().

00064 {
00065         _wxvtkmpr3Dview=wxvtkmpr3Dview;
00066 }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 23 of file vtkmyPWCallback_3DPointWidget.h.

Referenced by Execute().

Definition at line 24 of file vtkmyPWCallback_3DPointWidget.h.

Referenced by Execute(), and SetVtkPlaneWidget().

Definition at line 25 of file vtkmyPWCallback_3DPointWidget.h.

Referenced by Execute(), and SetVtkPointWidget().

Definition at line 26 of file vtkmyPWCallback_3DPointWidget.h.

Referenced by Execute(), and SetWxVtkMPR3DView().


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

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1