#include "volumerendererdata.h"
#include "vtkObjectFactory.h"
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkCxxRevisionMacro(VolumeRendererData, "$Revision: 1.11 $");
+#else
+ //...
+#endif
+
vtkStandardNewMacro(VolumeRendererData);
VolumeRendererData::VolumeRendererData()
{
public:
static VolumeRendererData *New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkTypeRevisionMacro(VolumeRendererData,vtkObject);
+#else
+ vtkTypeMacro(VolumeRendererData,vtkObject);
+#endif
+
//
vtkSetObjectMacro(ImageData, vtkImageData);
void ImagePlaneWidget::initializeImageActors(){
- int *w_ext = _img->GetWholeExtent();
//cout<<w_ext[0]<<" "<<w_ext[1]<<" "<<w_ext[2]<<" "<<w_ext[3]<<" "<<w_ext[4]<<" "<<w_ext[5]<<" "<<endl;
_imageactorx = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ int *w_ext = _img->GetWholeExtent();
_imageactorx->SetInput(_img);
+#else
+ int *w_ext = _img->GetExtent();
+ _imageactorx->SetInputData(_img);
+#endif
+
xslice = (w_ext[4] + w_ext[5])/2;
_imageactorx->SetDisplayExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], xslice, xslice);
_imageactory = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_imageactory->SetInput(_img);
+#else
+ _imageactory->SetInputData(_img);
+#endif
+
yslice = (w_ext[2] + w_ext[3])/2;
_imageactory->SetDisplayExtent(w_ext[0], w_ext[1], yslice, yslice, w_ext[4], w_ext[5]);
_imageactorz = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_imageactorz->SetInput(_img);
+#else
+ _imageactorz->SetInputData(_img);
+#endif
+
zslice = (w_ext[0] + w_ext[1])/2;
_imageactorz->SetDisplayExtent(zslice, zslice, w_ext[2], w_ext[3], w_ext[4], w_ext[5]);
// Set input X,Y and Z plane
_xwidget->Off( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_xwidget->SetInput( _img );
+#else
+ _xwidget->SetInputData( _img );
+#endif
+
_xwidget->SetPlaneOrientationToXAxes( );
_xwidget->SetSliceIndex( sliceX );
_xwidget->TextureInterpolateOff();
_xwidget->GetTextProperty()->SetColor(0.3, 0.3, 0.3);
_ywidget->Off( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_ywidget->SetInput( _img );
+#else
+ _ywidget->SetInputData( _img );
+#endif
+
_ywidget->SetPlaneOrientationToYAxes( );
_ywidget->SetSliceIndex( sliceY );
_ywidget->TextureInterpolateOff();
_ywidget->On( );
_zwidget->Off( );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_zwidget->SetInput( _img );
+#else
+ _zwidget->SetInputData( _img );
+#endif
+
+
_zwidget->SetPlaneOrientationToZAxes( );
_zwidget->SetSliceIndex( sliceZ );
_zwidget->TextureInterpolateOff();
}
-void ImagePlaneWidget::invariant(){
+void ImagePlaneWidget::invariant()
+{
if(_img == NULL){
throw "Image data is not initialized";
}
}
-void ImagePlaneWidget::setSliceXImageActor(int value){
+void ImagePlaneWidget::setSliceXImageActor(int value)
+{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
int *w_ext = _img->GetWholeExtent();
+#else
+ int *w_ext = _img->GetExtent();
+#endif
+
xslice = value;
_imageactorx->SetDisplayExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], xslice, xslice);
m_Interactor->Render();
}
-void ImagePlaneWidget::setSliceYImageActor(int value){
+
+void ImagePlaneWidget::setSliceYImageActor(int value)
+{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
int *w_ext = _img->GetWholeExtent();
+#else
+ int *w_ext = _img->GetExtent();
+#endif
yslice = value;
_imageactory->SetDisplayExtent(w_ext[0], w_ext[1], yslice, yslice, w_ext[4], w_ext[5]);
m_Interactor->Render();
}
-void ImagePlaneWidget::setSliceZImageActor(int value){
+
+
+void ImagePlaneWidget::setSliceZImageActor(int value)
+{
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
int *w_ext = _img->GetWholeExtent();
+#else
+ int *w_ext = _img->GetExtent();
+#endif
+
zslice = value;
_imageactorz->SetDisplayExtent(zslice, zslice, w_ext[2], w_ext[3], w_ext[4], w_ext[5]);
m_Interactor->Render();
vtkSmartPointer< vtkImageLuminance > luminance = vtkSmartPointer< vtkImageLuminance >::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
luminance->SetInput(img);
+#else
+ luminance->SetInputData(img);
+#endif
+
luminance->Update();
vtkSmartPointer< vtkImageAppendComponents > append = vtkSmartPointer< vtkImageAppendComponents >::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
append->SetInput(0, img);
append->SetInput(1, luminance->GetOutput());
+#else
+ append->SetInputData(0, img);
+ append->SetInputData(1, luminance->GetOutput());
+#endif
+
append->Update();
for(unsigned i = 0; i < img->GetNumberOfScalarComponents(); i++){
vectimg.push_back(vtkImageData::New());
- vectimg[i]->SetNumberOfScalarComponents(1);
vectimg[i]->SetExtent(img->GetExtent());
vectimg[i]->SetSpacing(img->GetSpacing());
vectimg[i]->SetOrigin(img->GetOrigin());
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ vectimg[i]->SetNumberOfScalarComponents(1);
vectimg[i]->SetScalarType(img->GetScalarType());
vectimg[i]->AllocateScalars();
+#else
+ vectimg[i]->AllocateScalars(img->GetScalarType(),1);
+#endif
+
}
int *extent = img->GetExtent();
vtkImageData* img = reader->GetOutput();
vtkImageCast* cast = vtkImageCast::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cast->SetInput(img);
+#else
+ cast->SetInputData(img);
+#endif
+
cast->SetOutputScalarTypeToUnsignedShort();
cast->Update();
//reader->Delete();
#include <vtkVolumeRayCastMapper.h>
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ //...
+#else
+#include <vtkGPUVolumeRayCastMapper.h>
+#endif
+
// EED This is code for Juan Carlos Prieto TESTES
//#if VTK_MAJOR_VERSION >= 5
// #if VTK_MINOR_VERSION >= 6
#endif
VolumeMapper->SetClippingPlanes( _volumePlanes );
_newvol->SetMapper(VolumeMapper );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
VolumeMapper->SetInput( _vol );
+#else
+ VolumeMapper->SetInputData( _vol );
+#endif
+
+
VolumeMapper->Update();
_newvol->Update();
}
BoxWidget->SetInteractor( interactor );
BoxWidget->SetPlaceFactor(1.01);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
BoxWidget->SetInput( _vol );
+#else
+ BoxWidget->SetInputData( _vol );
+#endif
+
BoxWidget->InsideOutOn();
BoxWidget->PlaceWidget();
// Description:
// Instantiate the object.
static vtkInteractorStyleCutter *New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkTypeRevisionMacro(vtkInteractorStyleCutter, vtkInteractorStyle);
+#else
+ vtkTypeMacro(vtkInteractorStyleCutter, vtkInteractorStyle);
+#endif
+
+
void PrintSelf(ostream& os, vtkIndent indent);
bool Finished();
table->SetRampToLinear();
table->Build();
- vtkImageMapToColors *mapperImage = vtkImageMapToColors::New();
+ vtkImageMapToColors *mapperImage = vtkImageMapToColors::New();
+ vtkImageActor *actorImage = vtkImageActor::New();
+
mapperImage->SetLookupTable(table);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
mapperImage->SetInput( imagedataMaskResult );
- vtkImageActor *actorImage = vtkImageActor::New();
actorImage->SetInput( mapperImage->GetOutput() );
+#else
+ mapperImage->SetInputData( imagedataMaskResult );
+ actorImage->SetInputData( mapperImage->GetOutput() );
+#endif
+
+
actorImage->SetOpacity(1);
wxvtkbaseview->GetRenderer()->AddActor(actorImage);
imagedataValueResult = vtkImageData::New();
// imagedataValueResult->SetScalarType(scalartype);
- imagedataValueResult->SetScalarTypeToUnsignedShort();
imagedataValueResult->SetSpacing(spc);
imagedataValueResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ imagedataValueResult->SetScalarTypeToUnsignedShort();
imagedataValueResult->AllocateScalars();
+#else
+ imagedataValueResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+
imagedataMaskResult = vtkImageData::New();
// imagedataMaskResult->SetScalarType(scalartype);
- imagedataMaskResult->SetScalarTypeToUnsignedShort();
imagedataMaskResult->SetSpacing(spc);
imagedataMaskResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ imagedataMaskResult->SetScalarTypeToUnsignedShort();
imagedataMaskResult->AllocateScalars();
+#else
+ imagedataMaskResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+
}
// RaC 20-11-09 Changes in InitLstContoursLinesYPoints
int ext[6];
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
this->imagedata->GetWholeExtent(ext);
+#else
+ this->imagedata->GetExtent(ext);
+#endif
+
_sizeImageY = ext[3]-ext[2]+1;
// init vtk image result : valuesImage maskImage
imagedataValueResult->Modified();
imagedataMaskResult->Modified();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imagedataValueResult->Update();
imagedataMaskResult->Update();
+#else
+ //...
+#endif
+
} // if
}
}
imagedataValueResult = vtkImageData::New();
// imagedataValueResult->SetScalarType(scalartype);
- imagedataValueResult->SetScalarTypeToUnsignedShort();
imagedataValueResult->SetSpacing(spc);
imagedataValueResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ imagedataValueResult->SetScalarTypeToUnsignedShort();
imagedataValueResult->AllocateScalars();
+#else
+ imagedataValueResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+
if (imagedataMaskResult!=NULL)
{
}
imagedataMaskResult = vtkImageData::New();
// imagedataMaskResult->SetScalarType(scalartype);
- imagedataMaskResult->SetScalarTypeToUnsignedShort();
imagedataMaskResult->SetSpacing(spc);
imagedataMaskResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ imagedataMaskResult->SetScalarTypeToUnsignedShort();
imagedataMaskResult->AllocateScalars();
+#else
+ imagedataMaskResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+
}
contour_mapped.push_back(vtkPolyDataMapper::New());
contour_mapped.back()->ImmediateModeRenderingOn();
contour_mapped.back()->ScalarVisibilityOff( );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
contour_mapped.back()->SetInput(contour);
+#else
+ contour_mapped.back()->SetInputData(contour);
+#endif
+
contour_actor.push_back(vtkActor::New());
contour_actor.back()->SetMapper(contour_mapped.back());
aLineGrid->Allocate(1,1);
aLineGrid->InsertNextCell(aLine->GetCellType(),aLine->GetPointIds());
aLineGrid->SetPoints(pointsLine);
-
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
contour_mapped.back()->SetInput(aLineGrid);
+#else
+ contour_mapped.back()->SetInputData(aLineGrid);
+#endif
+
contour_mapped.back()->ImmediateModeRenderingOn();
contour_actor.back()->SetMapper(contour_mapped.back());
point_mapped.push_back(vtkPolyDataMapper::New());
// point_mapped.back()->ImmediateModeRenderingOn();
//point_mapped.back()->ScalarVisibilityOff( );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
point_mapped.back()->SetInput(aSphere->GetOutput());
+#else
+ point_mapped.back()->SetInputData(aSphere->GetOutput());
+#endif
point_actor.push_back(vtkActor::New());
point_actor.back()->SetMapper(point_mapped.back());
//----------------------------------------------------------------------------
int ColorLayerImageView::GrayLevel_TO_colorTableIndex( double VALUE )
{
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
GetImage()->Update();
+#else
+ //...
+#endif
+
+
+
//EED 20 oct 2015
// GetImage()->GetScalarRange(_range);
spcBase[5]=0;
_image = image;
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_image->Update();
_image->GetWholeExtent(ext);
+#else
+ _image->GetExtent(ext);
+#endif
+
dimensionOriginalLayer[0] = ext[1]-ext[0]+1;
dimensionOriginalLayer[1] = ext[3]-ext[2]+1;
dimensionOriginalLayer[2] = ext[5]-ext[4]+1;
vtkImageData *imagebase = GetwxVtkBaseView()->GetVtkBaseData()->GetImageData();
if (imagebase!=NULL)
{
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imagebase->GetWholeExtent(ext);
+#else
+ imagebase->GetExtent(ext);
+#endif
+
dimBase[0]=ext[1]-ext[0]+1;
dimBase[1]=ext[3]-ext[2]+1;
dimBase[2]=ext[5]-ext[4]+1;
_image->GetScalarRange( _range );
_thresholdTable = vtkLookupTable::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_imageChangeInformation->SetInput(_image);
+#else
+ _imageChangeInformation->SetInputData(_image);
+#endif
+
}
//------------------------------------------------------------------------------
} // !GetActorPresent()
ConfigLookupTable(); // virtual method
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_imageReslicer->SetInput( GetImage() );
+#else
+ _imageReslicer->SetInputData( GetImage() );
+#endif
+
_imageReslicer->SetInformationInput( GetImage() );
if (directionViewer==0)
// img->UpdateInformation();
// _thresholdTable->Update();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_thresholdMapper->SetInput( img );
+#else
+ _thresholdMapper->SetInputData( img );
+#endif
+
_thresholdMapper->SetLookupTable( _thresholdTable );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_thresholdActor->SetInput( _thresholdMapper->GetOutput() );
+#else
+ _thresholdActor->SetInputData( _thresholdMapper->GetOutput() );
+#endif
+
_scalarbarActor->SetLookupTable( _thresholdTable );
// _scalarbarActor->SetLookupTable( _thresholdMapper->GetLookupTable() );
//NTU: For updating points
lstSourceSphere.push_back(vtksphere);
vtkPolyDataMapper *sphereMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
sphereMapper->SetInput( vtksphere->GetOutput() );
+#else
+ sphereMapper->SetInputData( vtksphere->GetOutput() );
+#endif
+
vtkActor *sphereActor = vtkActor::New();
sphereActor->SetMapper(sphereMapper);
sphereActor->SetOrigin(0, 0, 0);
vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_mCubes[i]->SetInput( imagedata );
+#else
+ _mCubes[i]->SetInputData( imagedata );
+#endif
} // for
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_volumeMapper->SetInput( imagedata );
+#else
+ _volumeMapper->SetInputData( imagedata );
+#endif
_volumerendererdata->SetImageData( imagedata );
}
{
// Visualisation - original volume
_mCubes[i] = vtkMarchingCubes::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_mCubes[i]->SetInput( imagedata );
+#else
+ _mCubes[i]->SetInputData( imagedata );
+#endif
+
_mCubes[i]->SetValue( 0, range[1]*(4+i) / 8 );
// _mCubes[i]->SetValue( 0, 1500 );
_tissueStripper[i] = vtkStripper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tissueStripper[i]->SetInput( _mCubes[i]->GetOutput( ) );
+#else
+ _tissueStripper[i]->SetInputData( _mCubes[i]->GetOutput( ) );
+#endif
+
_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);
_tissueClipper[i] = vtkClipPolyData::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
+#else
+ _tissueClipper[i]->SetInputData( _tissueStripper[i]->GetOutput() );
+#endif
+
_tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
_tissueClipper[i]->InsideOutOn( );
_tissueMapper[i] = vtkPolyDataMapper::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
+#else
+ _tissueMapper[i]->SetInputData( _tissueClipper[i]->GetOutput() );
+#endif
+
+
_tissueMapper[i]->ScalarVisibilityOff( );
// _tissueMapper[i]->Update();
} // for i
// EED 13/03/2011
// _volumeMapper = vtkVolumeRayCastMapper::New();
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_volumeMapper->SetInput( this->GetVtkMPRBaseData()->GetImageData() );
+#else
+ _volumeMapper->SetInputData( this->GetVtkMPRBaseData()->GetImageData() );
+#endif
+
_volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
// An outline provides context around the data.
//
_outlineData = vtkOutlineFilter::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
+#else
+ _outlineData->SetInputData((vtkDataSet *) _vtkmprbasedata->GetImageData() );
+#endif
+
_mapOutline = vtkPolyDataMapper::New();
//EED 4 nov 2015 Estelle
vtkDataSetReader *reader = vtkDataSetReader::New();
reader->SetFileName(namefile);
reader->Update();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tissueStripper[3]->SetInput( reader->GetPolyDataOutput() );
+#else
+ _tissueStripper[3]->SetInputData( reader->GetPolyDataOutput() );
+#endif
+
}
void vtkClipping3DDataViewer::setColorTransferFunction(vtkColorTransferFunction* colortable){
#include "vtkAppendPolyData.h"
#include "vtkCleanPolyData.h"
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkCxxRevisionMacro(vtkClosePolyData, "$Revision: 1.3 $");
+#else
+ //...
+#endif
+
vtkStandardNewMacro(vtkClosePolyData);
//----------------------------------------------------------------------------
{
}
+
//----------------------------------------------------------------------------
-// This method is much too long, and has to be broken up!
-// Furthermore we are loosing the normals !!!
-void vtkClosePolyData::Execute()
-{
- vtkPolyData *input = this->GetInput();
- vtkPolyData *output = this->GetOutput();
-
- //#closing the polydata see : close.py for details
- vtkFeatureEdges *boundary = vtkFeatureEdges::New();
- boundary->SetInput( input );
- boundary->BoundaryEdgesOn ();
- boundary->FeatureEdgesOff ();
- boundary->NonManifoldEdgesOff ();
- boundary->ManifoldEdgesOff ();
- //boundary->ColoringOff ();
-
- vtkStripper *stripper = vtkStripper::New();
- stripper->SetInput( boundary->GetOutput() );
- stripper->Update(); //important
- boundary->Delete();
-
- vtkPolyData *pd = vtkPolyData::New();
- pd->SetPoints ( stripper->GetOutput()->GetPoints() );
- pd->SetPolys ( stripper->GetOutput()->GetLines() );
- stripper->Delete();
-
- //vtkGLUTesselatorTriangleFilter *triangle = vtkGLUTesselatorTriangleFilter::New();
- vtkTriangleFilter *triangle = vtkTriangleFilter::New();
- triangle->SetInput( pd );
- pd->Delete();
-
- vtkAppendPolyData *append = vtkAppendPolyData::New();
- append->AddInput( input );
- append->AddInput( triangle->GetOutput());
- triangle->Delete();
-
- vtkCleanPolyData *clean = vtkCleanPolyData::New();
- clean->SetInput( append->GetOutput());
- append->Delete();
-
- // When all optimizations are complete, this squeeze will be unecessary.
- // (But it does not seem to cost much.)
- clean->Update(); //important before ShallowCopy
- output->ShallowCopy( clean->GetOutput() );
- clean->Delete();
-}
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // This method is much too long, and has to be broken up!
+ // Furthermore we are loosing the normals !!!
+ void vtkClosePolyData::Execute()
+ {
+ vtkPolyData *input = this->GetInput();
+ vtkPolyData *output = this->GetOutput();
+
+ //#closing the polydata see : close.py for details
+ vtkFeatureEdges *boundary = vtkFeatureEdges::New();
+ boundary->SetInput( input );
+ boundary->BoundaryEdgesOn ();
+ boundary->FeatureEdgesOff ();
+ boundary->NonManifoldEdgesOff ();
+ boundary->ManifoldEdgesOff ();
+ //boundary->ColoringOff ();
+
+ vtkStripper *stripper = vtkStripper::New();
+ stripper->SetInput( boundary->GetOutput() );
+ stripper->Update(); //important
+ boundary->Delete();
+
+ vtkPolyData *pd = vtkPolyData::New();
+ pd->SetPoints ( stripper->GetOutput()->GetPoints() );
+ pd->SetPolys ( stripper->GetOutput()->GetLines() );
+ stripper->Delete();
+
+ //vtkGLUTesselatorTriangleFilter *triangle = vtkGLUTesselatorTriangleFilter::New();
+ vtkTriangleFilter *triangle = vtkTriangleFilter::New();
+ triangle->SetInput( pd );
+ pd->Delete();
+
+ vtkAppendPolyData *append = vtkAppendPolyData::New();
+ append->AddInput( input );
+ append->AddInput( triangle->GetOutput());
+ triangle->Delete();
+
+ vtkCleanPolyData *clean = vtkCleanPolyData::New();
+ clean->SetInput( append->GetOutput());
+ append->Delete();
+
+ // When all optimizations are complete, this squeeze will be unecessary.
+ // (But it does not seem to cost much.)
+ clean->Update(); //important before ShallowCopy
+ output->ShallowCopy( clean->GetOutput() );
+ clean->Delete();
+ }
+
+#else
+ int vtkClosePolyData::ProcessRequest( vtkInformation *request,
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
+ {
+printf("EED Warning ERROR ! vtkClosePolyData::ProcessRequest not implemented VTK7 migration")
+ }
+
+#endif
//----------------------------------------------------------------------------
void vtkClosePolyData::PrintSelf(ostream& os, vtkIndent indent)
#ifndef __vtkClosePolyData_h
#define __vtkClosePolyData_h
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
#include "vtkPolyDataToPolyDataFilter.h"
+#else
+#include "vtkPolyDataAlgorithm.h"
+#endif
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
class vtkClosePolyData : public vtkPolyDataToPolyDataFilter
+#else
+class vtkClosePolyData : public vtkPolyDataAlgorithm
+#endif
{
public:
static vtkClosePolyData *New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkTypeRevisionMacro(vtkClosePolyData,vtkPolyDataToPolyDataFilter);
+#else
+ vtkTypeMacro(vtkClosePolyData,vtkPolyDataToPolyDataFilter);
+#endif
void PrintSelf(ostream& os, vtkIndent indent);
protected:
vtkClosePolyData();
~vtkClosePolyData();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
// Usual data generation method
void Execute();
+#else
+ int ProcessRequest( vtkInformation *request,
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector);
+#endif
+
private:
vtkClosePolyData(const vtkClosePolyData&); // Not implemented.
const wxSize &size = wxDefaultSize,
long style = wxWANTS_CHARS | wxNO_FULL_REPAINT_ON_RESIZE,
const wxString &name = wxPanelNameStr);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkTypeRevisionMacro(wxVTKRenderWindowInteractor,vtkRenderWindowInteractor);
+#else
+ vtkTypeMacro(wxVTKRenderWindowInteractor,vtkRenderWindowInteractor);
+#endif
+
static wxVTKRenderWindowInteractor * New();
void PrintSelf(ostream& os, vtkIndent indent);
if (event == vtkCommand::ResetWindowLevelEvent)
{
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
this->IV->GetInput()->UpdateInformation();
this->IV->GetInput()->SetUpdateExtent
(this->IV->GetInput()->GetWholeExtent());
this->IV->GetInput()->Update();
+#else
+ //..
+#endif
+
double *range = this->IV->GetInput()->GetScalarRange();
this->IV->SetColorWindow(range[1] - range[0]);
this->IV->SetColorLevel(0.5 * (range[1] + range[0]));