Porting to VTK 6.

First compilable version of GEOM and SMESH modules.
This commit is contained in:
ouv 2013-01-30 11:10:42 +00:00
parent 577999dffd
commit 6868039740
19 changed files with 74 additions and 65 deletions

View File

@ -1281,7 +1281,7 @@ vtkUnstructuredGrid* SMESH_ActorDef::GetUnstructuredGrid(){
bool SMESH_ActorDef::IsInfinitive(){
vtkDataSet *aDataSet = myPickableActor->GetUnstructuredGrid();
aDataSet->Update();
//aDataSet->Update(); // OUV_PORTING_VTK6: seems to be useless
myIsInfinite = aDataSet->GetNumberOfCells() == 0 ||
( aDataSet->GetNumberOfCells() == 1 &&
aDataSet->GetCell(0)->GetCellType() == VTK_VERTEX );

View File

@ -90,7 +90,7 @@ namespace SMESH
{
vtkXMLUnstructuredGridWriter* aWriter = vtkXMLUnstructuredGridWriter::New();
aWriter->SetFileName(theFileName);
aWriter->SetInput(theGrid);
aWriter->SetInputData(theGrid);
aWriter->SetDataModeToAscii();
if(theGrid->GetNumberOfCells()){
aWriter->Write();

View File

@ -52,19 +52,19 @@ SMESH_CellLabelActor::SMESH_CellLabelActor() {
myCellsNumDataSet = vtkUnstructuredGrid::New();
myCellCenters = VTKViewer_CellCenters::New();
myCellCenters->SetInput(myCellsNumDataSet);
myCellCenters->SetInputData(myCellsNumDataSet);
myClsMaskPoints = vtkMaskPoints::New();
myClsMaskPoints->SetInput(myCellCenters->GetOutput());
myClsMaskPoints->SetInputConnection(myCellCenters->GetOutputPort());
myClsMaskPoints->SetOnRatio(1);
myClsSelectVisiblePoints = vtkSelectVisiblePoints::New();
myClsSelectVisiblePoints->SetInput(myClsMaskPoints->GetOutput());
myClsSelectVisiblePoints->SetInputConnection(myClsMaskPoints->GetOutputPort());
myClsSelectVisiblePoints->SelectInvisibleOff();
myClsSelectVisiblePoints->SetTolerance(0.1);
myClsLabeledDataMapper = vtkLabeledDataMapper::New();
myClsLabeledDataMapper->SetInput(myClsSelectVisiblePoints->GetOutput());
myClsLabeledDataMapper->SetInputConnection(myClsSelectVisiblePoints->GetOutputPort());
myClsLabeledDataMapper->SetLabelFormat("%d");
myClsLabeledDataMapper->SetLabelModeToLabelScalars();
@ -156,7 +156,7 @@ void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled) {
anArray->SetValue(anId,aSMDSId);
}
aDataSet->GetCellData()->SetScalars(anArray);
myCellCenters->SetInput(aDataSet);
myCellCenters->SetInputData(aDataSet);
myCellsLabels->SetVisibility(GetVisibility());
}else{
myCellsLabels->SetVisibility(false);

View File

@ -125,7 +125,7 @@ SMESH_DeviceActor
myFaceOrientationFilter = SMESH_FaceOrientationFilter::New();
myFaceOrientationDataMapper = vtkPolyDataMapper::New();
myFaceOrientationDataMapper->SetInput(myFaceOrientationFilter->GetOutput());
myFaceOrientationDataMapper->SetInputConnection(myFaceOrientationFilter->GetOutputPort());
myFaceOrientation = vtkActor::New();
myFaceOrientation->SetMapper(myFaceOrientationDataMapper);
@ -208,9 +208,9 @@ SMESH_DeviceActor
{
int anId = 0;
if(theIsImplicitFunctionUsed)
myPassFilter[ anId ]->SetInput( myExtractGeometry->GetOutput() );
myPassFilter[ anId ]->SetInputConnection( myExtractGeometry->GetOutputPort() );
else
myPassFilter[ anId ]->SetInput( myMergeFilter->GetOutput() );
myPassFilter[ anId ]->SetInputConnection( myMergeFilter->GetOutputPort() );
myIsImplicitFunctionUsed = theIsImplicitFunctionUsed;
SetStoreClippingMapping(myStoreClippingMapping);
@ -225,32 +225,33 @@ SMESH_DeviceActor
//myIsShrinkable = theGrid->GetNumberOfCells() > 10;
myIsShrinkable = true;
myExtractUnstructuredGrid->SetInput(theGrid);
myExtractUnstructuredGrid->SetInputData(theGrid);
myMergeFilter->SetGeometry(myExtractUnstructuredGrid->GetOutput());
myMergeFilter->SetGeometryConnection(myExtractUnstructuredGrid->GetOutputPort());
myExtractGeometry->SetInput(myMergeFilter->GetOutput());
myExtractGeometry->SetInputConnection(myMergeFilter->GetOutputPort());
int anId = 0;
SetImplicitFunctionUsed(myIsImplicitFunctionUsed);
myPassFilter[ anId + 1]->SetInput( myPassFilter[ anId ]->GetOutput() );
myPassFilter[ anId + 1]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 1
myTransformFilter->SetInput( myPassFilter[ anId ]->GetOutput() );
myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 2
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++; // 3
myGeomFilter->SetInput( myPassFilter[ anId ]->GetOutput() );
myGeomFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 4
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++; // 5
myMapper->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
// OUV_PORTING_VTK6: to check
myMapper->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
vtkLODActor::SetMapper( myMapper );
Modified();
@ -322,7 +323,7 @@ SMESH_DeviceActor
theLookupTable->SetNumberOfTableValues(theScalarBarActor->GetMaximumNumberOfColors());
theLookupTable->Build();
myMergeFilter->SetScalars(aDataSet);
myMergeFilter->SetScalarsData(aDataSet);
aDataSet->Delete();
}
GetMapper()->SetScalarVisibility(anIsInitialized);
@ -402,7 +403,7 @@ SMESH_DeviceActor
theLookupTable->SetRange(aScalars->GetRange());
theLookupTable->Build();
myMergeFilter->SetScalars(aDataSet);
myMergeFilter->SetScalarsData(aDataSet);
aDataSet->Delete();
}
else if (MultiConnection2D* aMultiConnection2D = dynamic_cast<MultiConnection2D*>(theFunctor.get())){
@ -462,7 +463,7 @@ SMESH_DeviceActor
theLookupTable->SetRange(aScalars->GetRange());
theLookupTable->Build();
myMergeFilter->SetScalars(aDataSet);
myMergeFilter->SetScalarsData(aDataSet);
aDataSet->Delete();
}
}
@ -600,10 +601,10 @@ SMESH_DeviceActor
::SetShrink()
{
if ( !myIsShrinkable ) return;
if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() )
if ( vtkAlgorithmOutput* aDataSet = myPassFilter[ 0 ]->GetOutputPort() )
{
myShrinkFilter->SetInput( aDataSet );
myPassFilter[ 1 ]->SetInput( myShrinkFilter->GetOutput() );
myShrinkFilter->SetInputConnection( aDataSet );
myPassFilter[ 1 ]->SetInputConnection( myShrinkFilter->GetOutputPort() );
myIsShrunk = true;
}
}
@ -613,9 +614,9 @@ SMESH_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 );
myPassFilter[ 1 ]->Modified();
myIsShrunk = false;
Modified();
@ -627,11 +628,11 @@ void
SMESH_DeviceActor
::SetFacesOriented(bool theIsFacesOriented)
{
if ( vtkDataSet* aDataSet = myTransformFilter->GetOutput() )
if ( vtkAlgorithmOutput* aDataSet = myTransformFilter->GetOutputPort() )
{
myIsFacesOriented = theIsFacesOriented;
if( theIsFacesOriented )
myFaceOrientationFilter->SetInput( aDataSet );
myFaceOrientationFilter->SetInputConnection( aDataSet );
UpdateFaceOrientation();
}
}

View File

@ -61,10 +61,10 @@ SMESH_FaceOrientationFilter::SMESH_FaceOrientationFilter()
myFacePolyData = vtkPolyData::New();
myFaceCenters = VTKViewer_CellCenters::New();
myFaceCenters->SetInput(myFacePolyData);
myFaceCenters->SetInputData(myFacePolyData);
myFaceMaskPoints = vtkMaskPoints::New();
myFaceMaskPoints->SetInput(myFaceCenters->GetOutput());
myFaceMaskPoints->SetInputConnection(myFaceCenters->GetOutputPort());
myFaceMaskPoints->SetOnRatio(1);
myGlyphSource = vtkGlyphSource2D::New();
@ -73,11 +73,14 @@ SMESH_FaceOrientationFilter::SMESH_FaceOrientationFilter()
myGlyphSource->SetCenter(0.5, 0.0, 0.0);
myBaseGlyph = vtkGlyph3D::New();
myBaseGlyph->SetInput(myFaceMaskPoints->GetOutput());
myBaseGlyph->SetInputConnection(myFaceMaskPoints->GetOutputPort());
myBaseGlyph->SetVectorModeToUseVector();
myBaseGlyph->SetScaleModeToDataScalingOff();
myBaseGlyph->SetColorModeToColorByScalar();
myBaseGlyph->SetSource(my3dVectors ? myArrowPolyData : myGlyphSource->GetOutput());
if( my3dVectors )
myBaseGlyph->SetSourceData(myArrowPolyData);
else
myBaseGlyph->SetSourceConnection(myGlyphSource->GetOutputPort());
}
SMESH_FaceOrientationFilter::~SMESH_FaceOrientationFilter()
@ -99,7 +102,10 @@ void SMESH_FaceOrientationFilter::SetOrientationScale( vtkFloatingPointType theS
void SMESH_FaceOrientationFilter::Set3dVectors( bool theState )
{
my3dVectors = theState;
myBaseGlyph->SetSource(my3dVectors ? myArrowPolyData : myGlyphSource->GetOutput());
if( my3dVectors )
myBaseGlyph->SetSourceData(myArrowPolyData);
else
myBaseGlyph->SetSourceConnection(myGlyphSource->GetOutputPort());
Modified();
}

View File

@ -50,16 +50,16 @@ SMESH_NodeLabelActor::SMESH_NodeLabelActor() {
myPointsNumDataSet = vtkUnstructuredGrid::New();
myPtsMaskPoints = vtkMaskPoints::New();
myPtsMaskPoints->SetInput(myPointsNumDataSet);
myPtsMaskPoints->SetInputData(myPointsNumDataSet);
myPtsMaskPoints->SetOnRatio(1);
myPtsSelectVisiblePoints = vtkSelectVisiblePoints::New();
myPtsSelectVisiblePoints->SetInput(myPtsMaskPoints->GetOutput());
myPtsSelectVisiblePoints->SetInputConnection(myPtsMaskPoints->GetOutputPort());
myPtsSelectVisiblePoints->SelectInvisibleOff();
myPtsSelectVisiblePoints->SetTolerance(0.1);
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort());
myPtsLabeledDataMapper->SetLabelFormat("%d");
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
@ -156,7 +156,7 @@ void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled) {
}
aDataSet->GetPointData()->SetScalars( anArray );
myPtsMaskPoints->SetInput( aDataSet );
myPtsMaskPoints->SetInputData( aDataSet );
myPointLabels->SetVisibility( GetVisibility() );
anArray->Delete();
}

View File

@ -88,7 +88,7 @@ SMESH_ScalarBarActor::SMESH_ScalarBarActor() {
this->ScalarBar = vtkPolyData::New();
this->ScalarBarMapper = vtkPolyDataMapper2D::New();
this->ScalarBarMapper->SetInput(this->ScalarBar);
this->ScalarBarMapper->SetInputData(this->ScalarBar);
this->ScalarBarActor = vtkActor2D::New();
this->ScalarBarActor->SetMapper(this->ScalarBarMapper);
this->ScalarBarActor->GetPositionCoordinate()->
@ -103,7 +103,7 @@ SMESH_ScalarBarActor::SMESH_ScalarBarActor() {
// Customization of the vtkScalarBarActor to show distribution histogram.
myDistribution = vtkPolyData::New();
myDistributionMapper = vtkPolyDataMapper2D::New();
myDistributionMapper->SetInput(this->myDistribution);
myDistributionMapper->SetInputData(this->myDistribution);
myDistributionActor = vtkActor2D::New();
myDistributionActor->SetMapper(this->myDistributionMapper);

View File

@ -87,7 +87,8 @@ unsigned long SMDS_UnstructuredGrid::GetMTime()
MESSAGE("vtkUnstructuredGrid::GetMTime: " << mtime);
return mtime;
}
// OUV_PORTING_VTK6: seems to be useless
/*
void SMDS_UnstructuredGrid::Update()
{
MESSAGE("SMDS_UnstructuredGrid::Update");
@ -99,7 +100,7 @@ void SMDS_UnstructuredGrid::UpdateInformation()
MESSAGE("SMDS_UnstructuredGrid::UpdateInformation");
return vtkUnstructuredGrid::UpdateInformation();
}
*/
vtkPoints* SMDS_UnstructuredGrid::GetPoints()
{
// TODO erreur incomprehensible de la macro vtk GetPoints apparue avec la version paraview de fin aout 2010

View File

@ -70,8 +70,9 @@ public:
std::vector<int>& idCellsOldToNew,
int newCellSize);
virtual unsigned long GetMTime();
virtual void Update();
virtual void UpdateInformation();
// OUV_PORTING_VTK6: seems to be useless
//virtual void Update();
//virtual void UpdateInformation();
virtual vtkPoints *GetPoints();
//#ifdef VTK_HAVE_POLYHEDRON

View File

@ -113,7 +113,7 @@ namespace SMESH
// Create and display actor
myMapper = vtkDataSetMapper::New();
myMapper->SetInput(myGrid);
myMapper->SetInputData(myGrid);
myPreviewActor = SALOME_Actor::New();
myPreviewActor->PickableOff();
@ -137,10 +137,10 @@ namespace SMESH
// Orientation of faces
myFaceOrientationFilter = SMESH_FaceOrientationFilter::New();
myFaceOrientationFilter->SetInput(myGrid);
myFaceOrientationFilter->SetInputData(myGrid);
myFaceOrientationDataMapper = vtkPolyDataMapper::New();
myFaceOrientationDataMapper->SetInput(myFaceOrientationFilter->GetOutput());
myFaceOrientationDataMapper->SetInputConnection(myFaceOrientationFilter->GetOutputPort());
myFaceOrientation = SALOME_Actor::New();
myFaceOrientation->PickableOff();

View File

@ -140,7 +140,7 @@ namespace SMESH
// Create and display actor
myMapper = vtkDataSetMapper::New();
myMapper->SetInput(myGrid);
myMapper->SetInputData(myGrid);
myPreviewActor = SALOME_Actor::New();
myPreviewActor->PickableOff();
@ -164,10 +164,10 @@ namespace SMESH
// Orientation of faces
myFaceOrientationFilter = SMESH_FaceOrientationFilter::New();
myFaceOrientationFilter->SetInput(myGrid);
myFaceOrientationFilter->SetInputData(myGrid);
myFaceOrientationDataMapper = vtkPolyDataMapper::New();
myFaceOrientationDataMapper->SetInput(myFaceOrientationFilter->GetOutput());
myFaceOrientationDataMapper->SetInputConnection(myFaceOrientationFilter->GetOutputPort());
myFaceOrientation = SALOME_Actor::New();
myFaceOrientation->PickableOff();

View File

@ -132,7 +132,7 @@ void SMESH::OrientedPlane::Init()
// Create and display actor
myMapper = vtkDataSetMapper::New();
myMapper->SetInput(myPlaneSource->GetOutput());
myMapper->SetInputData(myPlaneSource->GetOutput());
myActor = SALOME_Actor::New();
myActor->VisibilityOff();

View File

@ -106,7 +106,7 @@ namespace SMESH
// Create and display actor
myMapper = vtkDataSetMapper::New();
myMapper->SetInput( myGrid );
myMapper->SetInputData( myGrid );
myPreviewActor = SALOME_Actor::New();
myPreviewActor->PickableOff();

View File

@ -362,7 +362,7 @@ void SMESHGUI_MinDistance::createPreview( double x1, double y1, double z1, doubl
aCells->Delete();
// create actor
vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
aMapper->SetInput( aGrid );
aMapper->SetInputData( aGrid );
aGrid->Delete();
myPreview = SALOME_Actor::New();
myPreview->PickableOff();
@ -879,7 +879,7 @@ void SMESHGUI_BoundingBox::createPreview( double minX, double maxX, double minY,
aCells->Delete();
// create actor
vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
aMapper->SetInput( aGrid );
aMapper->SetInputData( aGrid );
aGrid->Delete();
myPreview = SALOME_Actor::New();
myPreview->PickableOff();

View File

@ -124,7 +124,7 @@ namespace SMESH
// Create and display actor
vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
aMapper->SetInput( myIdGrid );
aMapper->SetInputData( myIdGrid );
myIdActor = SALOME_Actor::New();
myIdActor->SetInfinitive(true);
@ -140,16 +140,16 @@ namespace SMESH
myPointsNumDataSet = vtkUnstructuredGrid::New();
myPtsMaskPoints = vtkMaskPoints::New();
myPtsMaskPoints->SetInput(myPointsNumDataSet);
myPtsMaskPoints->SetInputData(myPointsNumDataSet);
myPtsMaskPoints->SetOnRatio(1);
myPtsSelectVisiblePoints = vtkSelectVisiblePoints::New();
myPtsSelectVisiblePoints->SetInput(myPtsMaskPoints->GetOutput());
myPtsSelectVisiblePoints->SetInputConnection(myPtsMaskPoints->GetOutputPort());
myPtsSelectVisiblePoints->SelectInvisibleOff();
myPtsSelectVisiblePoints->SetTolerance(0.1);
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort());
#if (VTK_XVERSION < 0x050200)
myPtsLabeledDataMapper->SetLabelFormat("%g");
#endif
@ -250,7 +250,7 @@ namespace SMESH
anArray->SetValue( i, myIDs[i] );
aDataSet->GetPointData()->SetScalars( anArray );
anArray->Delete();
myPtsMaskPoints->SetInput( aDataSet );
myPtsMaskPoints->SetInputData( aDataSet );
myPointLabels->SetVisibility( theIsActorVisible );
}
else {

View File

@ -66,7 +66,7 @@ SMESHGUI_MeshEditPreview::SMESHGUI_MeshEditPreview(SVTK_ViewWindow* theViewWindo
// Create and display actor
vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
aMapper->SetInput( myGrid );
aMapper->SetInputData( myGrid );
myPreviewActor = SALOME_Actor::New();
myPreviewActor->SetInfinitive(true);

View File

@ -957,7 +957,7 @@ void SMESHGUI_MeshPatternDlg::displayPreview()
// Create and display actor
vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
aMapper->SetInput(aGrid);
aMapper->SetInputData(aGrid);
myPreviewActor = SALOME_Actor::New();
myPreviewActor->PickableOff();

View File

@ -1451,7 +1451,7 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview()
// Create and display actor
vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
aMapper->SetInput(aGrid);
aMapper->SetInputData(aGrid);
myPreviewActor = SALOME_Actor::New();
myPreviewActor->PickableOff();

View File

@ -173,7 +173,7 @@ namespace SMESH
// Create and display actor
myMapper = vtkDataSetMapper::New();
myMapper->SetInput( aGrid );
myMapper->SetInputData( aGrid );
aGrid->Delete();
myPreviewActor = SALOME_Actor::New();