From: ouv Date: Wed, 23 Jan 2013 15:34:10 +0000 (+0000) Subject: Porting to VTK 6. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=06ed9a0b672d17e6378fb3f12d7c405edc003b6e;p=modules%2Fgui.git Porting to VTK 6. First compilable version of KERNEL and GUI modules. --- diff --git a/src/SALOME_PY/Makefile.am b/src/SALOME_PY/Makefile.am index a9292e6b3..2e036236d 100755 --- a/src/SALOME_PY/Makefile.am +++ b/src/SALOME_PY/Makefile.am @@ -40,4 +40,4 @@ libSalomePy_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \ libSalomePy_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) \ ../LightApp/libLightApp.la \ - -lvtkCommonPythonD -lvtkGraphicsPythonD -lvtkImagingPythonD -lvtkPythonCore + -lvtkWrappingPython26 diff --git a/src/SVTK/Makefile.am b/src/SVTK/Makefile.am index ad697f4fa..6fc34fed2 100755 --- a/src/SVTK/Makefile.am +++ b/src/SVTK/Makefile.am @@ -88,11 +88,12 @@ dist_libSVTK_la_SOURCES= \ SVTK_RecorderDlg.cxx \ SVTK_ImageWriter.cxx \ SVTK_ImageWriterMgr.cxx \ - SVTK_Utils.cxx \ - vtkPVAxesActor.h \ - vtkPVAxesActor.cxx \ - vtkPVAxesWidget.h \ - vtkPVAxesWidget.cxx + SVTK_Utils.cxx +# OUV_PORTING_VTK6: to do +# vtkPVAxesActor.h \ +# vtkPVAxesActor.cxx \ +# vtkPVAxesWidget.h \ +# vtkPVAxesWidget.cxx # internal headers @@ -148,7 +149,8 @@ libSVTK_la_CPPFLAGS = \ -I$(srcdir)/../OBJECT \ -I$(srcdir)/../Prs \ -I$(srcdir)/../VTKViewer \ - -I$(srcdir)/../OpenGLUtils + -I$(srcdir)/../OpenGLUtils \ + -DvtkRenderingCore_AUTOINIT="2(vtkInteractionStyle,vtkRenderingOpenGL)" libSVTK_la_LDFLAGS = \ $(VTK_LIBS) $(OGL_LIBS) \ diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index 74c57f9e9..705025e50 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -185,7 +185,7 @@ SALOME_Actor myOutline->Delete(); vtkPolyDataMapper* anOutlineMapper = vtkPolyDataMapper::New(); - anOutlineMapper->SetInput(myOutline->GetOutput()); + anOutlineMapper->SetInputConnection(myOutline->GetOutputPort()); myOutlineActor->Delete(); myOutlineActor->SetMapper( anOutlineMapper ); diff --git a/src/SVTK/SVTK_CubeAxesActor2D.cxx b/src/SVTK/SVTK_CubeAxesActor2D.cxx index 0364c257a..2606eafb3 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.cxx +++ b/src/SVTK/SVTK_CubeAxesActor2D.cxx @@ -61,9 +61,9 @@ SVTK_CubeAxesActor2D::SVTK_CubeAxesActor2D() this->rgridMapperYZ = vtkPolyDataMapper::New(); this->rgridMapperXZ = vtkPolyDataMapper::New(); - this->rgridMapperXY->SetInput(this->planeXY->GetOutput()); - this->rgridMapperYZ->SetInput(this->planeYZ->GetOutput()); - this->rgridMapperXZ->SetInput(this->planeXZ->GetOutput()); + this->rgridMapperXY->SetInputConnection(this->planeXY->GetOutputPort()); + this->rgridMapperYZ->SetInputConnection(this->planeYZ->GetOutputPort()); + this->rgridMapperXZ->SetInputConnection(this->planeXZ->GetOutputPort()); this->wireActorXY->SetMapper(rgridMapperXY); this->wireActorYZ->SetMapper(rgridMapperYZ); @@ -467,9 +467,9 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) rgrid->SetYCoordinates(YCoords); rgrid->SetZCoordinates(ZCoords); - this->planeXY->SetInput(rgrid); - this->planeYZ->SetInput(rgrid); - this->planeXZ->SetInput(rgrid); + this->planeXY->SetInputData(rgrid); + this->planeYZ->SetInputData(rgrid); + this->planeXZ->SetInputData(rgrid); rgrid->Delete(); diff --git a/src/SVTK/SVTK_CubeAxesActor2D.h b/src/SVTK/SVTK_CubeAxesActor2D.h index 51b315903..5f86853e7 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.h +++ b/src/SVTK/SVTK_CubeAxesActor2D.h @@ -47,7 +47,7 @@ class VTKViewer_Transform; #endif #ifndef WIN32 -class VTK_HYBRID_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D +class VTKRENDERINGANNOTATION_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D #else class SVTK_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D #endif diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index 4a803ccc5..fc9d06592 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -120,28 +120,29 @@ SVTK_DeviceActor { if(theMapper){ int anId = 0; - myPassFilter[ anId ]->SetInput( theMapper->GetInput() ); - myPassFilter[ anId + 1]->SetInput( myPassFilter[ anId ]->GetOutput() ); + myPassFilter[ anId ]->SetInputData( theMapper->GetInput() ); + myPassFilter[ anId + 1]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 1 - myGeomFilter->SetInput( myPassFilter[ anId ]->GetOutput() ); + myGeomFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 2 - myPassFilter[ anId ]->SetInput( myGeomFilter->GetOutput() ); - myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() ); + myPassFilter[ anId ]->SetInputConnection( myGeomFilter->GetOutputPort() ); + myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 3 - myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() ); + myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 4 - myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() ); - myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() ); + myPassFilter[ anId ]->SetInputConnection( myTransformFilter->GetOutputPort() ); + myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 5 + // OUV_PORTING_VTK6: to check if(VTKViewer_DataSetMapper* aMapper = dynamic_cast(theMapper)){ - aMapper->SetInput(myPassFilter[anId]->GetOutput()); + aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort()); }else if(VTKViewer_PolyDataMapper* aMapper = dynamic_cast(theMapper)){ - aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput()); + aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort()); } } Superclass::SetMapper(theMapper); @@ -164,7 +165,7 @@ void SVTK_DeviceActor ::SetInput(vtkDataSet* theDataSet) { - myMapper->SetInput(theDataSet); + myMapper->SetInputData(theDataSet); InitPipeLine(myMapper); } @@ -256,16 +257,19 @@ SVTK_DeviceActor if ( !myIsShrinkable ) return; - if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() ) + if ( vtkAlgorithmOutput* aDataSet = myPassFilter[ 0 ]->GetOutputPort() ) { - aDataSet->Update(); + myPassFilter[ 0 ]->Update(); + // OUV_PORTING_VTK6: to do + /* int numCells=aDataSet->GetNumberOfCells(); int numPts = aDataSet->GetNumberOfPoints(); //It's impossible to use to apply "shrink" for "empty" dataset if (numCells < 1 || numPts < 1) return; - myShrinkFilter->SetInput( aDataSet ); - myPassFilter[ 1 ]->SetInput( myShrinkFilter->GetOutput() ); + */ + myShrinkFilter->SetInputConnection( aDataSet ); + myPassFilter[ 1 ]->SetInputConnection( myShrinkFilter->GetOutputPort() ); myIsShrunk = true; } } @@ -278,9 +282,9 @@ SVTK_DeviceActor ::UnShrink() { if ( !myIsShrunk ) return; - if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() ) + if ( vtkAlgorithmOutput* aDataSet = myPassFilter[ 0 ]->GetOutputPort() ) { - myPassFilter[ 1 ]->SetInput( aDataSet ); + myPassFilter[ 1 ]->SetInputConnection( aDataSet ); myIsShrunk = false; } } @@ -348,18 +352,18 @@ SVTK_DeviceActor if ( !myIsFeatureEdgesAllowed || myIsFeatureEdgesEnabled == theIsFeatureEdgesEnabled ) return; - if ( vtkPolyData* aPolyData = myPassFilter[ 2 ]->GetPolyDataOutput() ) + if ( vtkAlgorithmOutput* aPolyData = myPassFilter[ 2 ]->GetOutputPort() ) { if( theIsFeatureEdgesEnabled ) { - aPolyData->Update(); - myFeatureEdges->SetInput( aPolyData ); - myPassFilter[ 3 ]->SetInput( myFeatureEdges->GetOutput() ); + myPassFilter[ 2 ]->Update(); + myFeatureEdges->SetInputConnection( aPolyData ); + myPassFilter[ 3 ]->SetInputConnection( myFeatureEdges->GetOutputPort() ); myIsFeatureEdgesEnabled = true; } else { - myPassFilter[3]->SetInput( aPolyData ); + myPassFilter[3]->SetInputConnection( aPolyData ); myIsFeatureEdgesEnabled = false; } myIsFeatureEdgesEnabled = theIsFeatureEdgesEnabled; diff --git a/src/SVTK/SVTK_ImageWriter.cxx b/src/SVTK/SVTK_ImageWriter.cxx index 581111ba6..35455be0d 100755 --- a/src/SVTK/SVTK_ImageWriter.cxx +++ b/src/SVTK/SVTK_ImageWriter.cxx @@ -62,13 +62,16 @@ SVTK_ImageWriter ::run() { vtkJPEGWriter *aWriter = vtkJPEGWriter::New(); - vtkImageData *anImageData = myImageData; + vtkAlgorithmOutput *anImageData = 0; vtkSmartPointer anImageClip; // if(myConstraint16Flag){ int uExtent[6]; + // OUV_PORTING_VTK6: to do + /* myImageData->UpdateInformation(); myImageData->GetUpdateExtent(uExtent); + */ unsigned int width = uExtent[1] - uExtent[0] + 1; unsigned int height = uExtent[3] - uExtent[2] + 1; width = (width / 16) * 16; @@ -79,17 +82,20 @@ SVTK_ImageWriter anImageClip = vtkImageClip::New(); anImageClip->Delete(); - anImageClip->SetInput(myImageData); + anImageClip->SetInputData(myImageData); anImageClip->SetOutputWholeExtent(uExtent); anImageClip->ClipDataOn(); - anImageData = anImageClip->GetOutput(); + anImageData = anImageClip->GetOutputPort(); } // aWriter->WriteToMemoryOff(); aWriter->SetFileName(myName.c_str()); aWriter->SetQuality(myQuality); aWriter->SetProgressive(myProgressive); - aWriter->SetInput(anImageData); + if(myConstraint16Flag) + aWriter->SetInputConnection(anImageData); + else + aWriter->SetInputData(myImageData); aWriter->Write(); aWriter->Delete(); diff --git a/src/SVTK/SVTK_Recorder.cxx b/src/SVTK/SVTK_Recorder.cxx index 0be0147b3..6438a70fc 100755 --- a/src/SVTK/SVTK_Recorder.cxx +++ b/src/SVTK/SVTK_Recorder.cxx @@ -396,12 +396,15 @@ SVTK_Recorder myErrorStatus = 20; return; } + // OUV_PORTING_VTK6: to do + /* anImageData->UpdateInformation(); int *anExtent = anImageData->GetWholeExtent(); anImageData->SetUpdateExtent(anExtent[0], anExtent[1], anExtent[2], anExtent[3], 0,0); anImageData->UpdateData(); + */ } diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index 271aa4c93..9aeea12b3 100755 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -91,8 +91,9 @@ #include "SVTK_Recorder.h" #include "SVTK_RecorderDlg.h" -#include "vtkPVAxesWidget.h" -#include "vtkPVAxesActor.h" +// OUV_PORTING_VTK6: to do +//#include "vtkPVAxesWidget.h" +//#include "vtkPVAxesActor.h" #include "SALOME_ListIteratorOfListIO.hxx" @@ -200,6 +201,8 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel) setCentralWidget(myInteractor); + // OUV_PORTING_VTK6: to do + /* myAxesWidget = vtkPVAxesWidget::New(); myAxesWidget->SetParentRenderer(aRenderer->GetDevice()); myAxesWidget->SetViewport(0, 0, 0.25, 0.25); @@ -217,6 +220,7 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel) anAxesActor->GetZAxisTipProperty()->SetColor( 0.0, 0.0, 1.0 ); anAxesActor->GetZAxisShaftProperty()->SetColor( 0.0, 0.0, 1.0 ); anAxesActor->GetZAxisLabelProperty()->SetColor( 0.0, 0.0, 1.0 ); + */ myView = new SVTK_View(this); Initialize(myView,theModel); @@ -270,7 +274,8 @@ void SVTK_ViewWindow::Initialize(SVTK_View* theView, SVTK_ViewWindow::~SVTK_ViewWindow() { myRecorder->Delete(); - myAxesWidget->Delete(); + // OUV_PORTING_VTK6: to do + //myAxesWidget->Delete(); } @@ -1244,7 +1249,9 @@ void SVTK_ViewWindow::SetSelectionTolerance(const double& theTolNodes, */ bool SVTK_ViewWindow::IsStaticTrihedronVisible() const { - return (bool)myAxesWidget->GetEnabled(); + // OUV_PORTING_VTK6: to do + //return (bool)myAxesWidget->GetEnabled(); + return false; } /*! @@ -1252,7 +1259,8 @@ bool SVTK_ViewWindow::IsStaticTrihedronVisible() const */ void SVTK_ViewWindow::SetStaticTrihedronVisible( const bool theIsVisible ) { - myAxesWidget->SetEnabled( (int)theIsVisible ); + // OUV_PORTING_VTK6: to do + //myAxesWidget->SetEnabled( (int)theIsVisible ); } /*! diff --git a/src/SVTK/SVTK_ViewWindow.h b/src/SVTK/SVTK_ViewWindow.h index abb6c0968..abca4207a 100755 --- a/src/SVTK/SVTK_ViewWindow.h +++ b/src/SVTK/SVTK_ViewWindow.h @@ -66,7 +66,8 @@ class SVTK_KeyFreeInteractorStyle; class SVTK_ViewParameterDlg; class SVTK_Recorder; -class vtkPVAxesWidget; +// OUV_PORTING_VTK6: to do +//class vtkPVAxesWidget; class vtkObject; class QtxAction; @@ -446,7 +447,8 @@ protected: int myToolBar; int myRecordingToolBar; - vtkPVAxesWidget* myAxesWidget; + // OUV_PORTING_VTK6: to do + //vtkPVAxesWidget* myAxesWidget; Qtx::BackgroundData myBackground; private: diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index fc8eda9a2..d206110c9 100755 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -180,29 +180,30 @@ VTKViewer_Actor { if(theMapper){ int anId = 0; - myPassFilter[ anId ]->SetInput( theMapper->GetInput() ); - myPassFilter[ anId + 1]->SetInput( myPassFilter[ anId ]->GetOutput() ); + myPassFilter[ anId ]->SetInputData( theMapper->GetInput() ); + myPassFilter[ anId + 1]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 1 myGeomFilter->SetStoreMapping( myStoreMapping ); - myGeomFilter->SetInput( myPassFilter[ anId ]->GetOutput() ); + myGeomFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 2 - myPassFilter[ anId ]->SetInput( myGeomFilter->GetOutput() ); - myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() ); + myPassFilter[ anId ]->SetInputConnection( myGeomFilter->GetOutputPort() ); + myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 3 - myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() ); + myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 4 - myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() ); - myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() ); + myPassFilter[ anId ]->SetInputConnection( myTransformFilter->GetOutputPort() ); + myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 5 + // OUV_PORTING_VTK6: to check if(vtkDataSetMapper* aMapper = dynamic_cast(theMapper)){ - aMapper->SetInput(myPassFilter[anId]->GetOutput()); + aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort()); }else if(vtkPolyDataMapper* aMapper = dynamic_cast(theMapper)){ - aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput()); + aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort()); } } Superclass::SetMapper(theMapper); diff --git a/src/VTKViewer/VTKViewer_ArcBuilder.cxx b/src/VTKViewer/VTKViewer_ArcBuilder.cxx index 26df8dbdc..8fec33a8d 100644 --- a/src/VTKViewer/VTKViewer_ArcBuilder.cxx +++ b/src/VTKViewer/VTKViewer_ArcBuilder.cxx @@ -292,7 +292,7 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1, vtkUnstructuredGrid* aTransformedGrid; if(needRotation) { aTransformedGrid = TransformGrid(aGrid,aAxis,anAngle); - aTransformedGrid->Update(); + //aTransformedGrid->Update(); // OUV_PORTING_VTK6: seems to be useless #ifdef _MY_DEBUG_ cout<<"Need Rotation!!!"<Update(); + //anTransArc->Update(); // OUV_PORTING_VTK6: seems to be useless } else anTransArc = anArc; @@ -335,7 +335,7 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1, aList.push_back(thePnt2); aList.push_back(thePnt3); vtkUnstructuredGrid* aGrid = BuildGrid(aList); - aGrid->Update(); + //aGrid->Update(); // OUV_PORTING_VTK6: seems to be useless myPoints = aGrid->GetPoints(); myScalarValues.clear(); @@ -397,7 +397,7 @@ VTKViewer_ArcBuilder::TransformGrid(vtkUnstructuredGrid* theGrid, aTransform->RotateWXYZ(angle, theAxis.GetXYZ().X(), theAxis.GetXYZ().Y(), theAxis.GetXYZ().Z()); vtkTransformFilter* aTransformFilter = vtkTransformFilter::New(); aTransformFilter->SetTransform(aTransform); - aTransformFilter->SetInput(theGrid); + aTransformFilter->SetInputData(theGrid); aTransform->Delete(); return aTransformFilter->GetUnstructuredGridOutput(); } @@ -472,8 +472,8 @@ vtkUnstructuredGrid* VTKViewer_ArcBuilder::BuildArc(std::vector& theScal /* double aTotalAngle = fabs(angle3 - angle1); - if (aTotalAngle > vtkMath::DoublePi()) - aTotalAngle = 2*vtkMath::DoublePi()-aTotalAngle; + if (aTotalAngle > vtkMath::Pi()) + aTotalAngle = 2*vtkMath::Pi()-aTotalAngle; */ double aTotalAngle = 0; @@ -541,8 +541,8 @@ GetPointAngleOnCircle(const double theXCenter, const double theYCenter, const double theXPoint, const double theYPoint){ double result = atan2(theYCenter - theYPoint, theXPoint - theXCenter); if(result < 0 ) - result = result+vtkMath::DoublePi()*2; - return vtkMath::DoublePi()*2-result; + result = result+vtkMath::Pi()*2; + return vtkMath::Pi()*2-result; return result; } @@ -562,11 +562,11 @@ VTKViewer_ArcBuilder::IncOrder VTKViewer_ArcBuilder::GetArcAngle( const double& aResult = VTKViewer_ArcBuilder::PLUS; } else if((P1 < P3 && P3 < P2) || (P2 < P1 && P1 < P3)){ - *Ang = 2*vtkMath::DoublePi() - P3 + P1; + *Ang = 2*vtkMath::Pi() - P3 + P1; aResult = VTKViewer_ArcBuilder::MINUS; } else if((P2 < P3 && P3 < P1) || (P3 < P1 && P1 < P2)){ - *Ang = 2*vtkMath::DoublePi() - P1 + P3; + *Ang = 2*vtkMath::Pi() - P1 + P3; aResult = VTKViewer_ArcBuilder::PLUS; } else if(P3 < P2 && P2 < P1){ diff --git a/src/VTKViewer/VTKViewer_ConvexTool.cxx b/src/VTKViewer/VTKViewer_ConvexTool.cxx index 3cd96908a..519227de9 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.cxx +++ b/src/VTKViewer/VTKViewer_ConvexTool.cxx @@ -697,8 +697,8 @@ VTKViewer_DelaunayTriangulator myUnstructuredGrid->Allocate(); myUnstructuredGrid->SetPoints(myPoints); - myDelaunay3D->SetInput(myUnstructuredGrid); - myGeometryFilter->SetInput(myDelaunay3D->GetOutput()); + myDelaunay3D->SetInputData(myUnstructuredGrid); + myGeometryFilter->SetInputConnection(myDelaunay3D->GetOutputPort()); myPolyData = myGeometryFilter->GetOutput(); } diff --git a/src/VTKViewer/VTKViewer_DataSetMapper.cxx b/src/VTKViewer/VTKViewer_DataSetMapper.cxx index fad3d9179..8394ed9f7 100644 --- a/src/VTKViewer/VTKViewer_DataSetMapper.cxx +++ b/src/VTKViewer/VTKViewer_DataSetMapper.cxx @@ -48,7 +48,7 @@ void VTKViewer_DataSetMapper::Render(vtkRenderer *ren, vtkActor *act) { vtkDataSetSurfaceFilter *gf = vtkDataSetSurfaceFilter::New(); VTKViewer_PolyDataMapper *pm = VTKViewer_PolyDataMapper::New(); - pm->SetInput(gf->GetOutput()); + pm->SetInputConnection(gf->GetOutputPort()); pm->SetMarkerEnabled( this->MarkerEnabled ); if( this->MarkerType != VTK::MT_USER ) diff --git a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx index 25ca840fb..076f1bc3c 100755 --- a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx +++ b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx @@ -178,15 +178,10 @@ inline void InsertPointCell(vtkCellArray *theConnectivity, } -// int VTKViewer_ExtractUnstructuredGrid::RequestData( -// vtkInformation *vtkNotUsed(request), -// vtkInformationVector **inputVector, -// vtkInformationVector *outputVector) -void VTKViewer_ExtractUnstructuredGrid::Execute() +int VTKViewer_ExtractUnstructuredGrid::RequestData(vtkInformation *vtkNotUsed(request), + vtkInformationVector **inputVector, + vtkInformationVector *outputVector) { - /* - not ported yet to the new executive-based pipeline architecture. - // get the info objects vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); vtkInformation *outInfo = outputVector->GetInformationObject(0); @@ -196,9 +191,9 @@ void VTKViewer_ExtractUnstructuredGrid::Execute() inInfo->Get(vtkDataObject::DATA_OBJECT())); vtkUnstructuredGrid *anOutput = vtkUnstructuredGrid::SafeDownCast( outInfo->Get(vtkDataObject::DATA_OBJECT())); - */ - vtkUnstructuredGrid *anInput = this->GetInput(); - vtkUnstructuredGrid *anOutput = this->GetOutput(); + + //vtkUnstructuredGrid *anInput = this->GetInput(); + //vtkUnstructuredGrid *anOutput = this->GetOutput(); myOut2InId.clear(); myIn2OutId.clear(); @@ -414,5 +409,5 @@ void VTKViewer_ExtractUnstructuredGrid::Execute() MESSAGE("Execute - myIn2OutId.size() = "< +#include #include #include @@ -35,17 +35,17 @@ #pragma warning ( disable:4251 ) #endif -/*! \class vtkUnstructuredGridToUnstructuredGridFilter +/*! \class vtkUnstructuredGridAlgorithm * \brief For more information see VTK documentation */ -/*! \class vtkUnstructuredGridToUnstructuredGridFilter +/*! \class vtkUnstructuredGridAlgorithm * \brief For more information see VTK documentation. */ -class VTKVIEWER_EXPORT VTKViewer_ExtractUnstructuredGrid : public vtkUnstructuredGridToUnstructuredGridFilter +class VTKVIEWER_EXPORT VTKViewer_ExtractUnstructuredGrid : public vtkUnstructuredGridAlgorithm { public: //! VTK type macros. - vtkTypeMacro( VTKViewer_ExtractUnstructuredGrid, vtkUnstructuredGridToUnstructuredGridFilter ); + vtkTypeMacro( VTKViewer_ExtractUnstructuredGrid, vtkUnstructuredGridAlgorithm ); //! \brief Construct with all types of clipping turned off. static VTKViewer_ExtractUnstructuredGrid *New(); @@ -107,11 +107,7 @@ protected: VTKViewer_ExtractUnstructuredGrid(); ~VTKViewer_ExtractUnstructuredGrid(); - //! Main method, which calculate output - // not ported yet to the new executive-based pipeline architecture. - // see http://www.vtk.org/cgi-bin/viewcvs.cgi/Filtering/vtkUnstructuredGridToUnstructuredGridFilter.h?rev=1.19&view=log - // virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); - virtual void Execute(); + virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); EExtraction myExtractionMode; diff --git a/src/VTKViewer/VTKViewer_FramedTextActor.cxx b/src/VTKViewer/VTKViewer_FramedTextActor.cxx index 328d7fd07..cf863eac7 100644 --- a/src/VTKViewer/VTKViewer_FramedTextActor.cxx +++ b/src/VTKViewer/VTKViewer_FramedTextActor.cxx @@ -53,7 +53,7 @@ VTKViewer_FramedTextActor::VTKViewer_FramedTextActor() myTransparency=0.; myBar = vtkPolyData::New(); myBarMapper = vtkPolyDataMapper2D::New(); - myBarMapper->SetInput(myBar); + myBarMapper->SetInputData(myBar); myBarActor = vtkActor2D::New(); myBarActor->SetMapper(myBarMapper); myBarActor->GetProperty()->SetOpacity(1.-myTransparency); diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index 7d139de07..2501ee83d 100755 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -190,7 +190,7 @@ VTKViewer_GeometryFilter // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON vtkIdType aNewPts[VTK_CELL_SIZE]; // ghost cell stuff - unsigned char updateLevel = (unsigned char)(output->GetUpdateGhostLevel()); + unsigned char updateLevel = (unsigned char)(GetUpdateGhostLevel()); unsigned char *cellGhostLevels = 0; PixelConvert[0] = 0; diff --git a/src/VTKViewer/VTKViewer_MarkerUtils.cxx b/src/VTKViewer/VTKViewer_MarkerUtils.cxx index f21af7dc8..64959af30 100755 --- a/src/VTKViewer/VTKViewer_MarkerUtils.cxx +++ b/src/VTKViewer/VTKViewer_MarkerUtils.cxx @@ -92,9 +92,10 @@ namespace VTK anImageData->Delete(); anImageData->SetExtent( 0, aWidth-1, 0, aHeight-1, 0, 0 ); - anImageData->SetScalarTypeToUnsignedChar(); - anImageData->SetNumberOfScalarComponents( 4 ); - anImageData->AllocateScalars(); + // OUV_PORTING_VTK6: to do (see Scalars Manipulation Functions) + //anImageData->SetScalarTypeToUnsignedChar(); + //anImageData->SetNumberOfScalarComponents( 4 ); + //anImageData->AllocateScalars(); unsigned char* aDataPtr = (unsigned char*)anImageData->GetScalarPointer(); @@ -109,7 +110,7 @@ namespace VTK aDataPtr[ anId++ ] = aValue * aCoef; aDataPtr[ anId++ ] = aValue; } - anImageData->Update(); + //anImageData->Update(); // OUV_PORTING_VTK6: seems to be useless return anImageData; } diff --git a/src/VTKViewer/VTKViewer_Trihedron.cxx b/src/VTKViewer/VTKViewer_Trihedron.cxx index 9f279af67..e5701d6f5 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.cxx +++ b/src/VTKViewer/VTKViewer_Trihedron.cxx @@ -89,7 +89,7 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer) int* aSize = theRenderer->GetRenderWindow()->GetSize(); vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1])); vtkDataSet* aDataSet = GetMapper()->GetInput(); - aDataSet->Update(); + GetMapper()->Update(); vtkFloatingPointType aLength = aDataSet->GetLength(); vtkFloatingPointType aPrecision = 1.0E-3; vtkFloatingPointType aZeroTol = 1.0E-12; @@ -140,7 +140,7 @@ VTKViewer_Axis::VTKViewer_Axis() myLineSource->SetPoint1(0.0,0.0,0.0); myMapper[0] = vtkPolyDataMapper::New(); - myMapper[0]->SetInput(myLineSource->GetOutput()); + myMapper[0]->SetInputConnection(myLineSource->GetOutputPort()); myLineActor = VTKViewer_LineActor::New(); myLineActor->SetMapper(myMapper[0]); @@ -153,7 +153,7 @@ VTKViewer_Axis::VTKViewer_Axis() myConeSource->SetCenter(-0.5,0.0,0.0); myMapper[1] = vtkPolyDataMapper::New(); - myMapper[1]->SetInput(myConeSource->GetOutput()); + myMapper[1]->SetInputConnection(myConeSource->GetOutputPort()); myArrowActor = vtkFollower::New(); myArrowActor->SetMapper(myMapper[1]); @@ -179,7 +179,7 @@ VTKViewer_Axis::VTKViewer_Axis() myVectorText = vtkVectorText::New(); myMapper[2] = vtkPolyDataMapper::New(); - myMapper[2]->SetInput(myVectorText->GetOutput()); + myMapper[2]->SetInputConnection(myVectorText->GetOutputPort()); myLabelActor = VTKViewer_UnScaledActor::New(); myLabelActor->SetMapper(myMapper[2]);