_tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
#else
_tissueClipper[i]->SetInputData( _tissueStripper[i]->GetOutput() );
- printf("EED vtkClipping3DDataViewer::Configure_Tissue Update\n");
_tissueClipper[i]->Update();
#endif
_planeWidget->GetCenter(p);
_planeWidget->GetNormal(n);
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetNormal(n[0],n[1],n[2]);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ //..
+#else
+ _planeWidget->GetPolyData(_vtkplane);
+ _probe->Update();
+#endif
+
}
double spc[3];
_planeWidget=planeWidget;
}
+//-------------------------------------------------------------------
+ void vtkmyPWCallback_3DPointWidget::SetVtkPolyData( vtkPolyData *vtkplane)
+{
+ _vtkplane=vtkplane;
+}
+
+//-------------------------------------------------------------------
+void vtkmyPWCallback_3DPointWidget::SetVtkProbeFilter( vtkProbeFilter *probe)
+{
+ _probe=probe;
+}
+
+
+
void SetWxVtkMPR3DView( wxVtkMPR3DView *wxvtkmpr3Dview );
void SetVtkPointWidget( vtkPointWidget *pointWidget );
void SetVtkPlaneWidget( vtkPlaneWidget *planeWidget );
+
+ void SetVtkPolyData( vtkPolyData *vtkplane);
+ void SetVtkProbeFilter( vtkProbeFilter *probe);
+
private:
double _backNormal[3];
vtkPlaneWidget *_planeWidget;
+
vtkPointWidget *_pointWidget;
- wxVtkMPR3DView *_wxvtkmpr3Dview;
+ vtkPolyData *_vtkplane;
+ vtkProbeFilter *_probe;
+
+ wxVtkMPR3DView *_wxvtkmpr3Dview;
};
-
#endif /*VTKMYPWCALLBACK_3DPOINTWIDGET_H_*/
//-------------------------------------------------------------------
wxVtkMPR2DView::~wxVtkMPR2DView()
{
- if (_ptsA!=NULL) { _ptsA -> Delete(); }
- if (_lineAActor!=NULL) { _lineAActor -> Delete(); }
- if (_lineAMapper!=NULL) { _lineAMapper -> Delete(); }
- if (_pdA!=NULL) { _pdA -> Delete(); }
- if (_ptsB!=NULL) { _ptsB -> Delete(); }
- if (_lineBActor!=NULL) { _lineBActor -> Delete(); }
- if (_lineBMapper!=NULL) { _lineBMapper -> Delete(); }
- if (_pdB!=NULL) { _pdB -> Delete(); }
+ if (_ptsA!=NULL) { _ptsA->Delete(); }
+ if (_lineAActor!=NULL) { _lineAActor->Delete(); }
+ if (_lineAMapper!=NULL) { _lineAMapper->Delete(); }
+ if (_pdA!=NULL) { _pdA->Delete(); }
+ if (_ptsB!=NULL) { _ptsB->Delete(); }
+ if (_lineBActor!=NULL) { _lineBActor->Delete(); }
+ if (_lineBMapper!=NULL) { _lineBMapper->Delete(); }
+ if (_pdB!=NULL) { _pdB->Delete(); }
}
//-------------------------------------------------------------------
vtkMPRBaseData *wxVtkMPR2DView::GetVtkmprbasedata()
} // if back
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ _ptsA->Modified();
+ _ptsB->Modified();
+#endif
+
_backX=xx;
_backY=yy;
_backZ=zz;
vtkMPRBaseData *GetVtkmprbasedata();
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 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 int GetDirection();
-
-
private:
-
int _backX;
int _backY;
int _backZ;
-
bool _visibleAxis;
-
int _direction;
vtkPoints *_ptsA;
vtkActor *_lineAActor;
vtkInteractorStyleMPRView *_interactorstylemprview;
};
-
#endif /*WXVTKMPR2DVIEW_H_*/
void wxVtkMPR3DView::Configure()
{
vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
-
_wxvtk3Dbaseview->Configure();
_wxvtkmpr3DviewCntrlPanel->UpdateControlPanel();
-
-//EED 27 Mai 2009
-// _wxvtk3Dbaseview->GetRenderer()->Clear();
-
// Actors are added to the renderer.
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
-
-
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
-
-// _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);
-
-
if(imageData){
- if(_pointWidget==NULL){
+ if(_pointWidget==NULL)
+ {
_pointWidget = vtkPointWidget::New();
}
//EED 2017-01-01 Migration VTK7
_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();
-
+ _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
+ _myCallback->SetVtkPolyData(_vtkplane);
+ _myCallback->SetVtkProbeFilter(_probe);
+ _planeWidget->GetPolyData(_vtkplane);
_probe->SetInputData(_vtkplane);
+ _probe->SetSourceData(imageData);
+// _probe->Update();
_contourMapper->SetInputData( _probe->GetPolyDataOutput() );
#endif
_planeWidget->SetCenter( x,y,z );
_planeWidget->UpdatePlacement();
_planeWidget->GetPolyData(_vtkplane);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ _probe->Update();
+#endif
}
if (_wxvtkmpr3DviewCntrlPanel!=NULL)
// step 5 Refresh
_wxvtk3Dbaseview->GetRenderer()->GetRenderWindow()->Render();
- }
+ } // if visible
_vtkmpr3Ddataviewer->SetVisiblePosition(idPosition,visible);
- }
+ } // if visible
}
_pointWidget->On();
} else {
_pointWidget->Off();
- }
- }
+ } // visible
+ } // _pointWidget
}
//-------------------------------------------------------------------
} else {
_planeWidget->Off();
- _contourPlaneActor->VisibilityOff();
- }
- }
+ _contourPlaneActor->VisibilityOff();
+ } // if visible
+ _wxvtk3Dbaseview->GetRenderer()->GetRenderWindow()->Render();
+ } // _planeWidget
}
//CPR: Method added 30 Nov 2009
if(value == true)
{
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
- }
- else
- {
+ } else {
_wxvtk3Dbaseview->GetRenderer()->RemoveActor( _outlineActor );
- }
+ } // value
}
void setColorTransferFunction(vtkColorTransferFunction* colortable);
-
//Free planes
//-------------------------------------------------------------------
void ConfigureFreePlanes();
void SetColorWindow(double colorWindow);
void SetColorLevel(double colorLevel);
-
private:
wxVtk3DBaseView *_wxvtk3Dbaseview;
vtkMPR3DDataViewer *_vtkmpr3Ddataviewer;
vtkPolyDataMapper *_contourMapper;
//Free planes
- vtkImagePlaneWidget *_planeWidgetX;
- vtkImagePlaneWidget *_planeWidgetY;
- vtkImagePlaneWidget *_planeWidgetZ;
+ vtkImagePlaneWidget *_planeWidgetX;
+ vtkImagePlaneWidget *_planeWidgetY;
+ vtkImagePlaneWidget *_planeWidgetZ;
-
protected:
};
void wxVtkMPR3DViewCntrlPanel::OnVisiblePlane(wxCommandEvent& event)
{
_wxvtkmpr3Dview->VisiblePlaneWidget(event.IsChecked());
-
}
//-------------------------------------------------------------------