_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY(xyzv[1]);
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ(xyzv[2]);
} else {
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY(xyzv[1]);
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ(xyzv[2]);
} else {
if (needRefresh)
{
vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetInteractorStyleBaseView();
isbv->SetParent_refresh_waiting();
isbv->EvaluateToRefresh();
}
if (needRefresh)
{
vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetInteractorStyleBaseView();
isbv->SetParent_refresh_waiting();
isbv->EvaluateToRefresh();
}
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
wxVtkMPR3DView::wxVtkMPR3DView( wxVtk3DBaseView *wxvtk3Dbaseview )
{
_wxvtk3Dbaseview = wxvtk3Dbaseview;
wxVtkMPR3DView::wxVtkMPR3DView( wxVtk3DBaseView *wxvtk3Dbaseview )
{
_wxvtk3Dbaseview = wxvtk3Dbaseview;
//-------------------------------------------------------------------
wxVtkMPR3DView::~wxVtkMPR3DView()
{
VisiblePointWidget( false );
//-------------------------------------------------------------------
wxVtkMPR3DView::~wxVtkMPR3DView()
{
VisiblePointWidget( false );
//-------------------------------------------------------------------
void wxVtkMPR3DView::Configure()
{
vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
//-------------------------------------------------------------------
void wxVtkMPR3DView::Configure()
{
vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
// Actors are added to the renderer.
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
// Actors are added to the renderer.
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
-// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(0) ); // _saggital
-// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(1) ); // _axial
-// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(2) ); // _coronal
-
-
-
- // vtkPointWidget
- //if(_myCallback!=NULL){
- //_myCallback->Delete();
-
- //}
vtkmyPWCallback_3DPointWidget *_myCallback = vtkmyPWCallback_3DPointWidget::New();
_myCallback->SetWxVtkMPR3DView(this);
vtkmyPWCallback_3DPointWidget *_myCallback = vtkmyPWCallback_3DPointWidget::New();
_myCallback->SetWxVtkMPR3DView(this);
_pointWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
_pointWidget->AllOff();
_pointWidget->PlaceWidget();
_pointWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
_pointWidget->AllOff();
_pointWidget->PlaceWidget();
_planeWidget->NormalToXAxisOn();
_planeWidget->SetResolution(50);
_planeWidget->SetRepresentationToOutline();
_planeWidget->NormalToXAxisOn();
_planeWidget->SetResolution(50);
_planeWidget->SetRepresentationToOutline();
imageData->GetDimensions(dim);
int px=(dim[0]/2);
int py=(dim[1]/2);
int pz=(dim[2]/2);
int dd=20;
_planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd );
imageData->GetDimensions(dim);
int px=(dim[0]/2);
int py=(dim[1]/2);
int pz=(dim[2]/2);
int dd=20;
_planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd );
-
- if(_vtkplane==NULL){
- _vtkplane = vtkPolyData::New();
-
- _probe = vtkProbeFilter::New();
- _contourMapper = vtkPolyDataMapper::New();
-
+ if(_vtkplane==NULL)
+ {
+ _vtkplane = vtkPolyData::New();
+ _probe = vtkProbeFilter::New();
+ _contourMapper = vtkPolyDataMapper::New();
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
_probe->SetInput(_vtkplane);
_contourMapper->SetInput( _probe->GetPolyDataOutput() );
#else
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
_probe->SetInput(_vtkplane);
_contourMapper->SetInput( _probe->GetPolyDataOutput() );
#else
_contourMapper->SetInputData( _probe->GetPolyDataOutput() );
#endif
_contourPlaneActor = vtkActor::New();
_contourPlaneActor->SetMapper(_contourMapper);
_contourMapper->SetInputData( _probe->GetPolyDataOutput() );
#endif
_contourPlaneActor = vtkActor::New();
_contourPlaneActor->SetMapper(_contourMapper);
_planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
_planeWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback);
_planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
_planeWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback);
// render window (expressed in pixels).
_wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.36 , 0.36 , 0.36 );
//EED 23oct2010 _wxvtk3Dbaseview->GetRenWin()->SetSize(400, 400);
// render window (expressed in pixels).
_wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.36 , 0.36 , 0.36 );
//EED 23oct2010 _wxvtk3Dbaseview->GetRenWin()->SetSize(400, 400);
}
//-------------------------------------------------------------------
void wxVtkMPR3DView::ConfigureFreePlanes()
{
}
//-------------------------------------------------------------------
void wxVtkMPR3DView::ConfigureFreePlanes()
{
// The shared picker enables us to use 3 planes at one time
// and gets the picking order right
vtkCellPicker* picker = vtkCellPicker::New();
picker->SetTolerance(0.005);
// The shared picker enables us to use 3 planes at one time
// and gets the picking order right
vtkCellPicker* picker = vtkCellPicker::New();
picker->SetTolerance(0.005);
// The 3 image plane widgets
_planeWidgetX = GetPlaneWidget('x', 1, 0, 0, picker);
_planeWidgetY = GetPlaneWidget('y', 1, 1, 0, picker);
_planeWidgetZ = GetPlaneWidget('z', 0, 0, 1, picker);
// The 3 image plane widgets
_planeWidgetX = GetPlaneWidget('x', 1, 0, 0, picker);
_planeWidgetY = GetPlaneWidget('y', 1, 1, 0, picker);
_planeWidgetZ = GetPlaneWidget('z', 0, 0, 1, picker);
_planeWidgetY->SetLookupTable(_planeWidgetX->GetLookupTable());
_planeWidgetZ->SetLookupTable(_planeWidgetX->GetLookupTable());
_planeWidgetY->SetLookupTable(_planeWidgetX->GetLookupTable());
_planeWidgetZ->SetLookupTable(_planeWidgetX->GetLookupTable());
_planeWidget->SetCenter( x,y,z );
_planeWidget->UpdatePlacement();
_planeWidget->GetPolyData(_vtkplane);
_planeWidget->SetCenter( x,y,z );
_planeWidget->UpdatePlacement();
_planeWidget->GetPolyData(_vtkplane);
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
if(value == true)
{
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
if(value == true)
{
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );