From: enk Date: Thu, 15 Mar 2007 15:10:27 +0000 (+0000) Subject: Porting to VTK-5.0.0 X-Git-Tag: V4_0a2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=af2e05780ad155306e29504b89d5623eb2c372fa;p=modules%2Fsmesh.git Porting to VTK-5.0.0 --- diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 40bf343fe..db2265289 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -410,13 +410,16 @@ SMESH_ActorDef::~SMESH_ActorDef() //--------------------------------------- myPointsNumDataSet->Delete(); - myPtsLabeledDataMapper->RemoveAllInputs(); + // commented: porting to vtk 5.0 + // myPtsLabeledDataMapper->RemoveAllInputs(); myPtsLabeledDataMapper->Delete(); - myPtsSelectVisiblePoints->UnRegisterAllOutputs(); + // commented: porting to vtk 5.0 + // myPtsSelectVisiblePoints->UnRegisterAllOutputs(); myPtsSelectVisiblePoints->Delete(); - myPtsMaskPoints->UnRegisterAllOutputs(); + // commented: porting to vtk 5.0 + // myPtsMaskPoints->UnRegisterAllOutputs(); myPtsMaskPoints->Delete(); myPointLabels->Delete(); @@ -429,13 +432,16 @@ SMESH_ActorDef::~SMESH_ActorDef() myClsLabeledDataMapper->RemoveAllInputs(); myClsLabeledDataMapper->Delete(); - myClsSelectVisiblePoints->UnRegisterAllOutputs(); + // commented: porting to vtk 5.0 + // myClsSelectVisiblePoints->UnRegisterAllOutputs(); myClsSelectVisiblePoints->Delete(); - myClsMaskPoints->UnRegisterAllOutputs(); + // commented: porting to vtk 5.0 + // myClsMaskPoints->UnRegisterAllOutputs(); myClsMaskPoints->Delete(); - myCellCenters->UnRegisterAllOutputs(); + // commented: porting to vtk 5.0 + // myCellCenters->UnRegisterAllOutputs(); myCellCenters->Delete(); myCellsLabels->Delete(); diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 0b3a424c4..8a7341b49 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -35,7 +35,6 @@ #include #include -#include #include // VTK Includes @@ -60,6 +59,7 @@ #include #include +#include #include "utilities.h" @@ -110,7 +110,7 @@ SMESH_DeviceActor myTransformFilter = VTKViewer_TransformFilter::New(); for(int i = 0; i < 6; i++) - myPassFilter.push_back(VTKViewer_PassThroughFilter::New()); + myPassFilter.push_back(vtkPassThroughFilter::New()); } diff --git a/src/OBJECT/SMESH_DeviceActor.h b/src/OBJECT/SMESH_DeviceActor.h index 16664fe0c..5ec3be21d 100644 --- a/src/OBJECT/SMESH_DeviceActor.h +++ b/src/OBJECT/SMESH_DeviceActor.h @@ -45,10 +45,10 @@ class vtkUnstructuredGrid; class vtkScalarBarActor; class vtkLookupTable; class vtkImplicitBoolean; +class vtkPassThroughFilter; class VTKViewer_Transform; class VTKViewer_TransformFilter; -class VTKViewer_PassThroughFilter; class VTKViewer_ExtractUnstructuredGrid; class SMESH_ExtractGeometry; @@ -127,7 +127,7 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{ bool myStoreClippingMapping; VTKViewer_GeometryFilter *myGeomFilter; VTKViewer_TransformFilter *myTransformFilter; - std::vector myPassFilter; + std::vector myPassFilter; vtkShrinkFilter* myShrinkFilter; bool myIsShrinkable; diff --git a/src/OBJECT/SMESH_ExtractGeometry.cxx b/src/OBJECT/SMESH_ExtractGeometry.cxx index acd4a6f5f..19a2c6250 100644 --- a/src/OBJECT/SMESH_ExtractGeometry.cxx +++ b/src/OBJECT/SMESH_ExtractGeometry.cxx @@ -28,6 +28,8 @@ #include #include #include +#include +#include using namespace std; @@ -74,8 +76,21 @@ vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int theVtkID){ } -void SMESH_ExtractGeometry::Execute() +int SMESH_ExtractGeometry::RequestData( + vtkInformation *vtkNotUsed(request), + vtkInformationVector **inputVector, + vtkInformationVector *outputVector) { + // get the info objects + vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); + vtkInformation *outInfo = outputVector->GetInformationObject(0); + + // get the input and ouptut + vtkDataSet *input = vtkDataSet::SafeDownCast( + inInfo->Get(vtkDataObject::DATA_OBJECT())); + vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast( + outInfo->Get(vtkDataObject::DATA_OBJECT())); + vtkIdType ptId, numPts, numCells, i, cellId, newCellId, newId, *pointMap; vtkIdList *cellPts; vtkCell *cell; @@ -84,10 +99,8 @@ void SMESH_ExtractGeometry::Execute() vtkFloatingPointType multiplier; vtkPoints *newPts; vtkIdList *newCellPts; - vtkDataSet *input = this->GetInput(); vtkPointData *pd = input->GetPointData(); vtkCellData *cd = input->GetCellData(); - vtkUnstructuredGrid *output = this->GetOutput(); vtkPointData *outputPD = output->GetPointData(); vtkCellData *outputCD = output->GetCellData(); int npts; @@ -99,7 +112,7 @@ void SMESH_ExtractGeometry::Execute() if ( ! this->ImplicitFunction ) { vtkErrorMacro(<<"No implicit function specified"); - return; + return 0; } newCellPts = vtkIdList::New(); @@ -251,4 +264,5 @@ void SMESH_ExtractGeometry::Execute() } output->Squeeze(); + return 1; } diff --git a/src/OBJECT/SMESH_ExtractGeometry.h b/src/OBJECT/SMESH_ExtractGeometry.h index 97435e05e..e331f9f90 100644 --- a/src/OBJECT/SMESH_ExtractGeometry.h +++ b/src/OBJECT/SMESH_ExtractGeometry.h @@ -46,7 +46,8 @@ protected: SMESH_ExtractGeometry(); ~SMESH_ExtractGeometry(); - void Execute(); + // Usual data generation method + virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); private: bool myStoreMapping; diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx index 2558e6567..8a30f65e1 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx @@ -182,7 +182,8 @@ protected: myMapper->RemoveAllInputs(); myMapper->Delete(); - myPlaneSource->UnRegisterAllOutputs(); + // commented: porting to vtk 5.0 + // myPlaneSource->UnRegisterAllOutputs(); myPlaneSource->Delete(); };