vtkBoxWidget *boxwidget = reinterpret_cast<vtkBoxWidget*>(wdg);
boxwidget->GetPlanes(_planes);
+ if ((_mCubes!=NULL)&&(_tissueStripper!=NULL)&&(_tissueClipper!=NULL))
+ {
+ _mCubes->Update();
+ _tissueStripper->Update();
+ _tissueClipper->Update();
+ } // if surface
+
+
if ( _vtkVolumeRayCastMapper != NULL )
{
_vtkVolumeRayCastMapper->RemoveAllClippingPlanes();
// boxwidget->GetPlanes(planes);
// _vtkVolumeRayCastMapper->SetClippingPlanes(planes);
_vtkVolumeRayCastMapper->SetClippingPlanes(_planes);
- }
+ } // if volume
+
// _actor->VisibilityOn();
{
_vtkVolumeRayCastMapper = vtkvolumeraycastmapper;
}
+
+//-------------------------------------------------------------------
+void boxSurfaceObserver::SetFilters(vtkAlgorithm *mCubes , vtkAlgorithm *tissueStripper , vtkAlgorithm *tissueClipper)
+{
+ _mCubes = mCubes;
+ _tissueStripper = tissueStripper;
+ _tissueClipper = tissueClipper;
+
+
+}
+
_tissuePlanes[i] = vtkPlanes::New();
int x1,x2,y1,y2,z1,z2;
imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
- _tissuePlanes[i]->SetBounds (x1,x2,y1,y2,z1,z2);
+ _tissuePlanes[i]->SetBounds(x1,x2,y1,y2,z1,z2);
_tissueClipper[i] = vtkClipPolyData::New();
_tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
_tissueClipper[i]->InsideOutOn( );
_tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
#else
_tissueClipper[i]->SetInputData( _tissueStripper[i]->GetOutput() );
- _tissueClipper[i]->Update();
#endif
_tissueMapper[i] = vtkPolyDataMapper::New( );
#if VTK_MAJOR_VERSION <= 5
_tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
#else
+ _mCubes[i]->Update();
+ _tissueStripper[i]->Update();
+ _tissueClipper[i]->Update();
_tissueMapper[i]->SetInputData( _tissueClipper[i]->GetOutput() );
_tissueMapper[i]->Update();
#endif
_tissue[i]->GetProperty()->SetSpecular(.3);
_tissue[i]->GetProperty()->SetSpecularPower(20);
_tissue[i]->GetProperty()->SetOpacity(0.5);
- if (i==0) _tissue[i]->GetProperty()->SetColor(0.85, 0.85 , 0.85 );
- if (i==1) _tissue[i]->GetProperty()->SetColor(0, 0 , 1 );
- if (i==2) _tissue[i]->GetProperty()->SetColor(0.85, 0.20 , 0.20 );
- if (i==3) _tissue[i]->GetProperty()->SetColor(0, 1 , 0 );
- }
+ if (i==0) { _tissue[i]->GetProperty()->SetColor(0.85, 0.85 , 0.85 ); }
+ if (i==1) { _tissue[i]->GetProperty()->SetColor(0, 0 , 1 ); }
+ if (i==2) { _tissue[i]->GetProperty()->SetColor(0.85, 0.20 , 0.20 ); }
+ if (i==3) { _tissue[i]->GetProperty()->SetColor(0, 1 , 0 ); }
+ } // for
for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
{
_observerS[i] = boxSurfaceObserver::New();
_observerS[i]->SetPlanes( GetTissuePlanes(i) );
_observerS[i]->SetActor( _tissue[i] );
- }
-
+ _observerS[i]->SetFilters( _mCubes[i], _tissueStripper[i] ,_tissueClipper[i] );
+ } // for
}
//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::SetIsovalue(int idTissue, int isoValue)
{
_mCubes[idTissue]->SetValue(0, isoValue);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ _mCubes[idTissue]->Update();
+ _tissueStripper[idTissue]->Update();
+ _tissueClipper[idTissue]->Update();
+#endif
}
//-------------------------------------------------------------------
double vtkClipping3DDataViewer::GetIsovalue(int idTissue)
_boxWidgetS1->SetInteractor( _wxvtk3Dbaseview->GetWxVTKRenderWindowInteractor() );
_boxWidgetS1->SetPlaceFactor(1.25);
-
-
vtkStripper *stripper=_vtkclipping3Ddataviewer->GetTissueStripper(0);
vtkPolyData *polydata= stripper->GetOutput();
#if VTK_MAJOR_VERSION <= 5
_boxWidgetS1->SetInput( polydata );
#else
+ stripper->Update();
_boxWidgetS1->SetInputData( polydata );
#endif
_vtkclipping3Ddataviewer->SetRenderer(this->GetWxvtk3Dbaseview()->GetRenderer());
_vtkclipping3Ddataviewer->SetInteractor(this->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor());
}
+
//-------------------------------------------------------------------
void wxVtkClipping3DView::SetVtkClipping3DDataViewer(vtkClipping3DDataViewer *vtkclipping3Ddataviewer)
{