From: ouv Date: Tue, 12 Mar 2013 15:50:09 +0000 (+0000) Subject: Porting to VTK 6. X-Git-Tag: before_mergefrom_V6_main_15Mar13~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3fce1967c2194d3177bfef6dcf95907c948b974b;p=modules%2Fvisu.git Porting to VTK 6. Debug. --- diff --git a/src/CONVERTOR/VISU_CommonCellsFilter.cxx b/src/CONVERTOR/VISU_CommonCellsFilter.cxx index be5237af..4473acb6 100644 --- a/src/CONVERTOR/VISU_CommonCellsFilter.cxx +++ b/src/CONVERTOR/VISU_CommonCellsFilter.cxx @@ -209,7 +209,9 @@ namespace vtkStandardNewMacro(VISU_CommonCellsFilter); VISU_CommonCellsFilter -::VISU_CommonCellsFilter() +::VISU_CommonCellsFilter() : + myIsProfileSet( false ), + myIsCellsSet( false ) {} VISU_CommonCellsFilter @@ -218,30 +220,18 @@ VISU_CommonCellsFilter void VISU_CommonCellsFilter -::SetProfileUG(vtkUnstructuredGrid *input) +::SetProfileUG(vtkAlgorithmOutput *input) { - this->SetInputData(0, input); -} - -vtkUnstructuredGrid* -VISU_CommonCellsFilter -::GetProfileUG() -{ - return dynamic_cast(this->GetInput(0)); + myIsProfileSet = true; + this->SetInputConnection(0, input); } void VISU_CommonCellsFilter -::SetCellsUG(vtkUnstructuredGrid *input) +::SetCellsUG(vtkAlgorithmOutput *input) { - this->SetInputData(1, input); -} - -vtkUnstructuredGrid* -VISU_CommonCellsFilter -::GetCellsUG() -{ - return dynamic_cast(this->GetInput(1)); + myIsCellsSet = true; + this->SetInputConnection(1, input); } int @@ -253,25 +243,25 @@ VISU_CommonCellsFilter { VISU::TTimerLog aTimerLog(MYDEBUG,"VISU_CommonCellsFilter::Execute"); - // get the info objects - vtkInformation *inInfo1 = inputVector[0]->GetInformationObject(0); - vtkInformation *inInfo2 = inputVector[1]->GetInformationObject(0); // OUV_PORTING: to check - vtkInformation *outInfo = outputVector->GetInformationObject(0); + if( !myIsProfileSet ) + return 0; - // get the input and ouptut + vtkInformation *inInfo1 = inputVector[0]->GetInformationObject(0); vtkUnstructuredGrid *anInputProfileUG = vtkUnstructuredGrid::SafeDownCast( inInfo1->Get(vtkDataObject::DATA_OBJECT())); - vtkUnstructuredGrid *anInputCellsUG = vtkUnstructuredGrid::SafeDownCast( - inInfo2->Get(vtkDataObject::DATA_OBJECT())); + + vtkUnstructuredGrid *anInputCellsUG = NULL; + if( myIsCellsSet ) + { + vtkInformation *inInfo2 = inputVector[1]->GetInformationObject(0); + anInputCellsUG = vtkUnstructuredGrid::SafeDownCast( + inInfo2->Get(vtkDataObject::DATA_OBJECT())); + } + + vtkInformation *outInfo = outputVector->GetInformationObject(0); vtkUnstructuredGrid *anOutput = vtkUnstructuredGrid::SafeDownCast( outInfo->Get(vtkDataObject::DATA_OBJECT())); - // OUV_PORTING: to delete - //vtkUnstructuredGrid* anInputProfileUG = this->GetProfileUG(); - //vtkUnstructuredGrid* anInputCellsUG = this->GetCellsUG(); - - //vtkUnstructuredGrid* anOutput = this->GetOutput(); - if(anInputCellsUG == NULL){ anOutput->ShallowCopy(anInputProfileUG); } diff --git a/src/CONVERTOR/VISU_CommonCellsFilter.hxx b/src/CONVERTOR/VISU_CommonCellsFilter.hxx index 1d3ec82d..7074bfca 100644 --- a/src/CONVERTOR/VISU_CommonCellsFilter.hxx +++ b/src/CONVERTOR/VISU_CommonCellsFilter.hxx @@ -35,14 +35,12 @@ public: // Description: // Specify the Unstructured Grid which overview // nodal profile. - void SetProfileUG(vtkUnstructuredGrid *input); - vtkUnstructuredGrid* GetProfileUG(); + void SetProfileUG(vtkAlgorithmOutput *input); // Description: // Specify the Unstructured Grid which overview // cells data on CELL_ENTITY. - void SetCellsUG(vtkUnstructuredGrid *input); - vtkUnstructuredGrid* GetCellsUG(); + void SetCellsUG(vtkAlgorithmOutput *input); protected: VISU_CommonCellsFilter(); @@ -50,6 +48,10 @@ protected: virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); //generate output data +private: + bool myIsProfileSet; + bool myIsCellsSet; + private: VISU_CommonCellsFilter(const VISU_CommonCellsFilter&); // Lock copy void operator=(const VISU_CommonCellsFilter&); // Lock copy diff --git a/src/CONVERTOR/VISU_ConvertorUtils.cxx b/src/CONVERTOR/VISU_ConvertorUtils.cxx index c9b7b0bb..11d0cdab 100644 --- a/src/CONVERTOR/VISU_ConvertorUtils.cxx +++ b/src/CONVERTOR/VISU_ConvertorUtils.cxx @@ -243,7 +243,6 @@ namespace VISU bool IsDataOnPoints(vtkDataSet* theDataSet) { - //theDataSet->Update(); // OUV_PORTING (see the same below) vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData(); return aDataSetAttributes->GetArray("VISU_FIELD") != NULL; } diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 8104dc3b..82cd72c7 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -553,8 +553,6 @@ namespace } anAppendFilter->Update(); // Fix on VTK - //theMeshOnEntity->GetOutput()->Update(); // OUV_PORTING - vtkDataSet* aSource = anAppendFilter->GetOutput(); INITMSGA(MYDEBUG,0,"aNbPoints - "<GetNumberOfPoints()<GetNumberOfCells()<Update(); // OUV_PORTING BEGMSG(1,"GetPoints() = "<GetPoints()->GetActualMemorySize()*1000)<GetCellData()) - anIsDataOnCells = (aCellData->GetArray("VISU_FIELD") != NULL); + if(vtkCellData* aCellData1 = aDataSet->GetCellData()) + anIsDataOnCells = (aCellData1->GetArray("VISU_FIELD") != NULL); if(anIsDataOnCells){ vtkIntArray *aGeometryCellMapper = dynamic_cast(aCellMapper); vtkIntArray* aDataCellMapper = GetIDMapper(theFieldList, diff --git a/src/CONVERTOR/VISU_Structures_impl.cxx b/src/CONVERTOR/VISU_Structures_impl.cxx index dea7c4aa..96d596d1 100644 --- a/src/CONVERTOR/VISU_Structures_impl.cxx +++ b/src/CONVERTOR/VISU_Structures_impl.cxx @@ -303,7 +303,6 @@ namespace VISU ::GetMemorySize() { if(vtkDataSet* anOutput = GetPolyDataOutput()){ - //anOutput->Update(); // OUV_PORTING return anOutput->GetActualMemorySize() * 1024; } if(myIsDone){ @@ -337,12 +336,18 @@ namespace VISU return GetSource().GetPointer(); } + vtkAlgorithmOutput* + TUnstructuredGridHolder + ::GetOutputPort() + { + return NULL; + } + unsigned long int TUnstructuredGridHolder ::GetMemorySize() { if(vtkDataSet* anOutput = GetUnstructuredGridOutput()){ - //anOutput->Update(); // OUV_PORTING return anOutput->GetActualMemorySize() * 1024; } if(myIsDone){ @@ -360,7 +365,6 @@ namespace VISU { if(myIsVTKDone){ if(vtkDataSet* anOutput = GetOutput()){ - //anOutput->Update(); // OUV_PORTING return anOutput->GetActualMemorySize() * 1024; } } @@ -394,6 +398,13 @@ namespace VISU return GetFilter()->GetOutput(); } + vtkAlgorithmOutput* + TAppendFilterHolder + ::GetOutputPort() + { + return GetFilter()->GetOutputPort(); + } + //--------------------------------------------------------------- TAppendPolyDataHolder ::TAppendPolyDataHolder() @@ -419,6 +430,13 @@ namespace VISU return GetFilter()->GetOutput(); } + vtkAlgorithmOutput* + TAppendPolyDataHolder + ::GetOutputPort() + { + return GetFilter()->GetOutputPort(); + } + //--------------------------------------------------------------- TMergeFilterHolder @@ -444,6 +462,13 @@ namespace VISU return GetFilter()->GetOutput(); } + vtkAlgorithmOutput* + TMergeFilterHolder + ::GetOutputPort() + { + return GetFilter()->GetOutputPort(); + } + //--------------------------------------------------------------- TMeshImpl @@ -600,6 +625,14 @@ namespace VISU return anAppendFilter->GetOutput(); } + vtkAlgorithmOutput* + TProfileImpl + ::GetOutputPort() + { + const PAppendFilter& anAppendFilter = GetFilter(); + return anAppendFilter->GetOutputPort(); + } + unsigned long int TProfileImpl ::GetMemorySize() @@ -688,7 +721,7 @@ namespace VISU TUnstructuredGridIDMapperImpl ::SetReferencedMesh( const PNamedIDMapper& theNamedIDMapper ) { - myCommonCellsFilter->SetCellsUG( theNamedIDMapper->GetUnstructuredGridOutput() ); + myCommonCellsFilter->SetCellsUG( theNamedIDMapper->GetOutputPort() ); } void @@ -698,15 +731,18 @@ namespace VISU if ( !myFilter.GetPointer() ) { const PAppendFilter& anAppendFilter = myIDMapper->GetFilter(); - vtkUnstructuredGrid* aGeometry = anAppendFilter->GetOutput(); + vtkAlgorithmOutput* aGeometryConnection = anAppendFilter->GetOutputPort(); + vtkUnstructuredGrid* aGeometryData = anAppendFilter->GetOutput(); + anAppendFilter->Update(); + const PUnstructuredGrid& aSource = mySource.GetSource(); vtkUnstructuredGrid* aDataSet = aSource.GetPointer(); - aDataSet->ShallowCopy( aGeometry ); + aDataSet->ShallowCopy( aGeometryData ); const PMergeFilter& aFilter = GetFilter(); - aFilter->SetGeometry( aGeometry ); - aFilter->SetScalars( aDataSet ); - aFilter->SetVectors( aDataSet ); + aFilter->SetGeometryConnection( aGeometryConnection ); + aFilter->SetScalarsData( aDataSet ); + aFilter->SetVectorsData( aDataSet ); aFilter->AddField( "VISU_FIELD", aDataSet ); aFilter->AddField( "VISU_FIELD_GAUSS_MIN", aDataSet ); aFilter->AddField( "VISU_FIELD_GAUSS_MAX", aDataSet ); @@ -716,7 +752,7 @@ namespace VISU aFilter->AddField( "ELNO_COMPONENT_MAPPER", aDataSet ); aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet ); - myCommonCellsFilter->SetProfileUG( aFilter->GetUnstructuredGridOutput() ); + myCommonCellsFilter->SetProfileUG( aFilter->GetOutputPort() ); } } @@ -725,7 +761,9 @@ namespace VISU ::GetUnstructuredGridOutput() { Build(); - return myCommonCellsFilter->GetOutput(); + vtkUnstructuredGrid* anOutput = myCommonCellsFilter->GetOutput(); + myCommonCellsFilter->Update(); + return anOutput; } vtkDataSet* @@ -735,6 +773,13 @@ namespace VISU return GetUnstructuredGridOutput(); } + vtkAlgorithmOutput* + TUnstructuredGridIDMapperImpl + ::GetOutputPort() + { + return myCommonCellsFilter->GetOutputPort(); + } + PUnstructuredGrid TUnstructuredGridIDMapperImpl ::GetSource() @@ -806,16 +851,18 @@ namespace VISU { if ( !myFilter.GetPointer() ) { const PAppendPolyData& anAppendFilter = myIDMapper->GetFilter(); - vtkPolyData* aGeometry = anAppendFilter->GetOutput(); + vtkAlgorithmOutput* aGeometryConnection = anAppendFilter->GetOutputPort(); + vtkPolyData* aGeometryData = anAppendFilter->GetOutput(); + anAppendFilter->Update(); const PPolyData& aSource = mySource.GetSource(); vtkPolyData* aDataSet = aSource.GetPointer(); - aDataSet->ShallowCopy( aGeometry ); + aDataSet->ShallowCopy( aGeometryData ); const PMergeFilter& aFilter = GetFilter(); - aFilter->SetGeometry( aGeometry ); - aFilter->SetScalars( aDataSet ); - aFilter->SetVectors( aDataSet ); + aFilter->SetGeometryConnection( aGeometryConnection ); + aFilter->SetScalarsData( aDataSet ); + aFilter->SetVectorsData( aDataSet ); aFilter->AddField( "VISU_FIELD", aDataSet ); aFilter->AddField( "VISU_FIELD_GAUSS_MIN", aDataSet ); aFilter->AddField( "VISU_FIELD_GAUSS_MAX", aDataSet ); @@ -840,6 +887,13 @@ namespace VISU return GetPolyDataOutput(); } + vtkAlgorithmOutput* + TPolyDataIDMapperImpl + ::GetOutputPort() + { + return myFilter->GetOutputPort(); + } + PPolyData TPolyDataIDMapperImpl ::GetSource() @@ -1017,6 +1071,13 @@ namespace VISU return TAppendPolyDataHolder::GetPolyDataOutput(); } + vtkAlgorithmOutput* + TGaussMeshImpl + ::GetOutputPort() + { + return TAppendPolyDataHolder::GetOutputPort(); + } + unsigned long int TGaussMeshImpl ::GetMemorySize() @@ -1188,6 +1249,13 @@ namespace VISU return TAppendFilterHolder::GetUnstructuredGridOutput(); } + vtkAlgorithmOutput* + TMeshOnEntityImpl + ::GetOutputPort() + { + return TAppendFilterHolder::GetOutputPort(); + } + unsigned long int TMeshOnEntityImpl ::GetMemorySize() @@ -1260,6 +1328,13 @@ namespace VISU return TUnstructuredGridHolder::GetUnstructuredGridOutput(); } + vtkAlgorithmOutput* + TFamilyImpl + ::GetOutputPort() + { + return TUnstructuredGridHolder::GetOutputPort(); + } + unsigned long int TFamilyImpl ::GetMemorySize() @@ -1346,6 +1421,13 @@ namespace VISU return TAppendFilterHolder::GetUnstructuredGridOutput(); } + vtkAlgorithmOutput* + TGroupImpl + ::GetOutputPort() + { + return TAppendFilterHolder::GetOutputPort(); + } + unsigned long int TGroupImpl ::GetMemorySize() diff --git a/src/CONVERTOR/VISU_Structures_impl.hxx b/src/CONVERTOR/VISU_Structures_impl.hxx index a4921835..2598cd95 100644 --- a/src/CONVERTOR/VISU_Structures_impl.hxx +++ b/src/CONVERTOR/VISU_Structures_impl.hxx @@ -90,6 +90,10 @@ namespace VISU vtkUnstructuredGrid* GetUnstructuredGridOutput(); + virtual + vtkAlgorithmOutput* + GetOutputPort(); + //! Gets memory size used by the instance (bytes). virtual unsigned long int @@ -132,6 +136,11 @@ namespace VISU virtual vtkUnstructuredGrid* GetUnstructuredGridOutput(); + + //! Reimplement the TNamedIDMapper::GetOutputPort + virtual + vtkAlgorithmOutput* + GetOutputPort(); }; /*! @@ -157,6 +166,11 @@ namespace VISU virtual vtkPolyData* GetPolyDataOutput(); + + //! Reimplement the TGaussPtsIDMapper::GetOutputPort + virtual + vtkAlgorithmOutput* + GetOutputPort(); }; @@ -180,6 +194,11 @@ namespace VISU virtual vtkDataSet* GetOutput(); + + //! Gets output port of the filter + virtual + vtkAlgorithmOutput* + GetOutputPort(); }; @@ -295,6 +314,11 @@ namespace VISU vtkUnstructuredGrid* GetUnstructuredGridOutput(); + //! Reimplement the TNamedIDMapper::GetOutputPort + virtual + vtkAlgorithmOutput* + GetOutputPort(); + //! Gets memory size used by the instance (bytes). virtual unsigned long int @@ -369,6 +393,11 @@ namespace VISU vtkDataSet* GetOutput(); + //! Reimplement the TUnstructuredGridIDMapper::GetOutputPort + virtual + vtkAlgorithmOutput* + GetOutputPort(); + //! Gets memory size used by the instance (bytes). virtual unsigned long int @@ -433,6 +462,11 @@ namespace VISU vtkDataSet* GetOutput(); + //! Reimplement the TPolyDataIDMapper::GetOutputPort + virtual + vtkAlgorithmOutput* + GetOutputPort(); + //! Gets memory size used by the instance (bytes). virtual unsigned long int @@ -539,6 +573,11 @@ namespace VISU vtkPolyData* GetPolyDataOutput(); + //! Reimplement the TGaussPtsIDMapper::GetOutputPort + virtual + vtkAlgorithmOutput* + GetOutputPort(); + //! Gets memory size used by the instance (bytes). virtual unsigned long int @@ -675,6 +714,11 @@ namespace VISU vtkUnstructuredGrid* GetUnstructuredGridOutput(); + //! Reimplement the TNamedIDMapper::GetOutputPort + virtual + vtkAlgorithmOutput* + GetOutputPort(); + //! Gets memory size used by the instance (bytes). virtual unsigned long int @@ -724,6 +768,11 @@ namespace VISU vtkUnstructuredGrid* GetUnstructuredGridOutput(); + //! Reimplement the TUnstructuredGridIDMapper::GetOutputPort + virtual + vtkAlgorithmOutput* + GetOutputPort(); + //! Gets memory size used by the instance (bytes). virtual unsigned long int @@ -781,6 +830,11 @@ namespace VISU vtkUnstructuredGrid* GetUnstructuredGridOutput(); + //! Reimplement the TUnstructuredGridIDMapper::GetOutputPort + virtual + vtkAlgorithmOutput* + GetOutputPort(); + //! Gets memory size used by the instance (bytes). virtual unsigned long int diff --git a/src/CONVERTOR/VISU_TableReader.hxx b/src/CONVERTOR/VISU_TableReader.hxx index 70c3727b..03843569 100644 --- a/src/CONVERTOR/VISU_TableReader.hxx +++ b/src/CONVERTOR/VISU_TableReader.hxx @@ -80,6 +80,10 @@ namespace VISU vtkPolyData* GetPolyDataOutput(); + virtual + vtkAlgorithmOutput* + GetOutputPort() { return NULL; } + virtual long unsigned int GetMemorySize(); diff --git a/src/CONVERTOR/VISU_UsedPointsFilter.hxx b/src/CONVERTOR/VISU_UsedPointsFilter.hxx index 3150a792..15b05833 100644 --- a/src/CONVERTOR/VISU_UsedPointsFilter.hxx +++ b/src/CONVERTOR/VISU_UsedPointsFilter.hxx @@ -29,8 +29,7 @@ #include "VISUConvertor.hxx" -//class VISU_CONVERTOR_EXPORT VISU_UsedPointsFilter : public vtkDataSetToUnstructuredGridFilter -class VISU_CONVERTOR_EXPORT VISU_UsedPointsFilter : public vtkUnstructuredGridAlgorithm // OUV_PORTING: to check +class VISU_CONVERTOR_EXPORT VISU_UsedPointsFilter : public vtkUnstructuredGridAlgorithm { public: vtkTypeMacro(VISU_UsedPointsFilter,vtkUnstructuredGridAlgorithm); diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index 958d9bb5..b76717d5 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -139,7 +139,7 @@ VISU_Actor myShrinkFilter->SetStoreMapping(true); myAnnotationMapper->Delete(); - myAnnotationActor->vtkActor2D::SetMapper(myAnnotationMapper.GetPointer()); // OUV_PORTING: to check + myAnnotationActor->vtkActor2D::SetMapper(myAnnotationMapper.GetPointer()); myAnnotationActor->Delete(); myAnnotationActor->SetVisibility(0); @@ -438,8 +438,7 @@ VISU_Actor if ( !myIsFeatureEdgesAllowed || myIsFeatureEdgesEnabled == theIsFeatureEdgesEnabled ) return; - //if ( vtkPolyData* aPolyData = myPassFilter[ 2 ]->GetPolyDataOutput() ) - if ( vtkAlgorithmOutput* aPolyData = myPassFilter[ 2 ]->GetOutputPort() ) // OUV_PORTING: to check + if ( vtkAlgorithmOutput* aPolyData = myPassFilter[ 2 ]->GetOutputPort() ) { if( theIsFeatureEdgesEnabled ) { diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 046c2586..ed291998 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -450,7 +450,7 @@ VISU_GaussPtsAct // myPolyDataExtractor->SetInput(myCurrentPL->GetPickableDataSet()); //myMapper->SetInput(myPolyDataExtractor->GetOutput()); - myMapper->SetInputData(myCurrentPL->GetPickableDataSet()); + myMapper->SetInputConnection(myCurrentPL->GetPickableDataSet()); SetMapper(myMapper.GetPointer()); } @@ -1281,8 +1281,7 @@ VISU_GaussPtsAct myCellDataToPointData->PassCellDataOn(); aCellsToWarp->Delete(); - //myWarpVector->SetInput(myCellDataToPointData->GetUnstructuredGridOutput()); - myWarpVector->SetInputConnection(myCellDataToPointData->GetOutputPort()); // OUV_PORTING: to check + myWarpVector->SetInputConnection(myCellDataToPointData->GetOutputPort()); vtkUnstructuredGrid* aWarpedDataSet = myWarpVector->GetUnstructuredGridOutput(); myWarpVector->Update(); myCellSource->SetPoints(aWarpedDataSet->GetPoints()); diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx index 2ca74452..14154222 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx @@ -211,27 +211,25 @@ void VISU_GaussDeviceActorBase ::SetPointSpriteMapper(VISU_OpenGLPointSpriteMapper* theMapper) { - vtkPolyData* aDataSet = theMapper->GetInput(); + vtkAlgorithmOutput* aDataSet = theMapper->GetInputConnection( 0, 0 ); myMapper = theMapper; int anId = 0; if (myPolyDataExtractor) { - myPolyDataExtractor->SetInputData(aDataSet); + myPolyDataExtractor->SetInputConnection(aDataSet); myPassFilter[ anId ]->SetInputConnection( myPolyDataExtractor->GetOutputPort() ); } else { - myPassFilter[ anId ]->SetInputData( aDataSet ); + myPassFilter[ anId ]->SetInputConnection( aDataSet ); } myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; - //myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() ); - myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); // OUV_PORTING: to check + myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; myPassFilter[ anId ]->SetInputConnection( myTransformFilter->GetOutputPort() ); - //myMapper->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() ); - myMapper->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); // OUV_PORTING: to check + myMapper->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); Superclass::SetMapper( theMapper ); } diff --git a/src/OBJECT/VISU_MeshAct.cxx b/src/OBJECT/VISU_MeshAct.cxx index e5c23953..0d5cf83e 100644 --- a/src/OBJECT/VISU_MeshAct.cxx +++ b/src/OBJECT/VISU_MeshAct.cxx @@ -113,9 +113,9 @@ VISU_MeshAct { Superclass::SetMapperInput(theDataSet); - mySurfaceActor->SetInput(theDataSet); - myEdgeActor->SetInput(theDataSet); - myNodeActor->SetInput(theDataSet); + mySurfaceActor->SetInputData(theDataSet); + myEdgeActor->SetInputData(theDataSet); + myNodeActor->SetInputData(theDataSet); } diff --git a/src/OBJECT/VISU_ScalarMapAct.cxx b/src/OBJECT/VISU_ScalarMapAct.cxx index 7ac2774f..b076e4d7 100644 --- a/src/OBJECT/VISU_ScalarMapAct.cxx +++ b/src/OBJECT/VISU_ScalarMapAct.cxx @@ -70,12 +70,21 @@ class VISU_PointsDeviceActor: public VISU_GaussDeviceActorBase //---------------------------------------------------------------------------- virtual void - SetInput(vtkDataSet* theDataSet) + SetInputData(vtkDataSet* theDataSet) { myGeomFilter->SetInputData( theDataSet ); } + //---------------------------------------------------------------------------- + virtual + void + SetInputConnection(vtkAlgorithmOutput* theAlgorithmOutput) + { + myGeomFilter->SetInputConnection( theAlgorithmOutput ); + } + + //---------------------------------------------------------------------------- void SetInteractor(vtkRenderWindowInteractor* theInteractor) @@ -312,15 +321,15 @@ VISU_ScalarMapAct // myEdgeActor->SetInput( theDataSet ); if (theDataSet->IsA("vtkPolyData")) { - myPointSpriteActor->SetInput( myPolyDataExtractor->GetOutput() ); - myPointsActor->SetInput( myPolyDataExtractor->GetOutput() ); - mySurfaceActor->SetInput( myPolyDataExtractor->GetOutput() ); - myEdgeActor->SetInput( myPolyDataExtractor->GetOutput() ); + myPointSpriteActor->SetInputConnection( myPolyDataExtractor->GetOutputPort() ); + myPointsActor->SetInputConnection( myPolyDataExtractor->GetOutputPort() ); + mySurfaceActor->SetInputConnection( myPolyDataExtractor->GetOutputPort() ); + myEdgeActor->SetInputConnection( myPolyDataExtractor->GetOutputPort() ); } else { - myPointSpriteActor->SetInput( myExtractor->GetOutput() ); - myPointsActor->SetInput( myExtractor->GetOutput() ); - mySurfaceActor->SetInput( myExtractor->GetOutput() ); - myEdgeActor->SetInput( myExtractor->GetOutput() ); + myPointSpriteActor->SetInputConnection( myExtractor->GetOutputPort() ); + myPointsActor->SetInputConnection( myExtractor->GetOutputPort() ); + mySurfaceActor->SetInputConnection( myExtractor->GetOutputPort() ); + myEdgeActor->SetInputConnection( myExtractor->GetOutputPort() ); } } diff --git a/src/OBJECT/VISU_VectorsAct.cxx b/src/OBJECT/VISU_VectorsAct.cxx index 76e0f234..2c41b83e 100644 --- a/src/OBJECT/VISU_VectorsAct.cxx +++ b/src/OBJECT/VISU_VectorsAct.cxx @@ -93,24 +93,14 @@ VISU_VectorsAct ::SetMapper(vtkMapper* theMapper) { if(theMapper){ - myPassFilter[0]->SetInputData(theMapper->GetInput()); + myPassFilter[0]->SetInputConnection(theMapper->GetInputConnection(0, 0)); - //myPassFilter[1]->SetInput(myPassFilter[0]->GetPolyDataOutput()); - myPassFilter[1]->SetInputConnection(myPassFilter[0]->GetOutputPort()); // OUV_PORTING: to check - - //myPassFilter[2]->SetInput(myPassFilter[1]->GetPolyDataOutput()); - myPassFilter[2]->SetInputConnection(myPassFilter[1]->GetOutputPort()); // OUV_PORTING: to check - - //myPassFilter[3]->SetInput(myPassFilter[2]->GetPolyDataOutput()); - myPassFilter[3]->SetInputConnection(myPassFilter[2]->GetOutputPort()); // OUV_PORTING: to check - - // OUV_PORTING: to check - /* - if(vtkDataSetMapper* aMapper = dynamic_cast(theMapper)) - aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput()); - else if(vtkPolyDataMapper* aMapper = dynamic_cast(theMapper)) - aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput()); - */ + myPassFilter[1]->SetInputConnection(myPassFilter[0]->GetOutputPort()); + + myPassFilter[2]->SetInputConnection(myPassFilter[1]->GetOutputPort()); + + myPassFilter[3]->SetInputConnection(myPassFilter[2]->GetOutputPort()); + theMapper->SetInputConnection(myPassFilter[3]->GetOutputPort()); } diff --git a/src/PIPELINE/VISU_ColoredPL.cxx b/src/PIPELINE/VISU_ColoredPL.cxx index ae532735..b8169349 100644 --- a/src/PIPELINE/VISU_ColoredPL.cxx +++ b/src/PIPELINE/VISU_ColoredPL.cxx @@ -383,13 +383,21 @@ VISU_ColoredPL return myPassFilter->GetUnstructuredGridOutput(); } +//---------------------------------------------------------------------------- +vtkAlgorithmOutput* +VISU_ColoredPL +::GetClippedInputPort() +{ + return myPassFilter->GetOutputPort(); +} + //---------------------------------------------------------------------------- void VISU_ColoredPL ::Build() { - myExtractor->SetInputData( Superclass::GetClippedInput() ); + myExtractor->SetInputConnection( Superclass::GetClippedInputPort() ); myFieldTransform->SetInputConnection(myExtractor->GetOutputPort()); myThreshold->SetInputConnection( myFieldTransform->GetOutputPort() ); diff --git a/src/PIPELINE/VISU_ColoredPL.hxx b/src/PIPELINE/VISU_ColoredPL.hxx index 16dbc84a..11bb1c27 100644 --- a/src/PIPELINE/VISU_ColoredPL.hxx +++ b/src/PIPELINE/VISU_ColoredPL.hxx @@ -176,6 +176,10 @@ protected: vtkPointSet* GetClippedInput(); + virtual + vtkAlgorithmOutput* + GetClippedInputPort(); + //---------------------------------------------------------------------------- static void diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index e298113b..df80557f 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -98,11 +98,11 @@ VISU_CutLinesPL Modified(); } -vtkDataSet* +vtkAlgorithmOutput* VISU_CutLinesPL ::InsertCustomPL() { - return myAppendPolyData->GetOutput(); + return myAppendPolyData->GetOutputPort(); } //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_CutLinesPL.hxx b/src/PIPELINE/VISU_CutLinesPL.hxx index f82032dc..d25c6f04 100644 --- a/src/PIPELINE/VISU_CutLinesPL.hxx +++ b/src/PIPELINE/VISU_CutLinesPL.hxx @@ -65,7 +65,7 @@ public: void Init(); - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx index b485c5da..06ab525d 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -147,11 +147,11 @@ VISU_CutPlanesPL //---------------------------------------------------------------------------- -vtkDataSet* +vtkAlgorithmOutput* VISU_CutPlanesPL ::InsertCustomPL() { - return GetWarpVectorOutput(); + return GetWarpVectorOutputPort(); } diff --git a/src/PIPELINE/VISU_CutPlanesPL.hxx b/src/PIPELINE/VISU_CutPlanesPL.hxx index 238794d5..52a44c0c 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.hxx +++ b/src/PIPELINE/VISU_CutPlanesPL.hxx @@ -201,7 +201,7 @@ protected: ~VISU_CutPlanesPL(); virtual - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_CutSegmentPL.cxx b/src/PIPELINE/VISU_CutSegmentPL.cxx index 75cdff5a..1619b4f7 100644 --- a/src/PIPELINE/VISU_CutSegmentPL.cxx +++ b/src/PIPELINE/VISU_CutSegmentPL.cxx @@ -120,11 +120,11 @@ VISU_CutSegmentPL } //---------------------------------------------------------------------------- -vtkDataSet* +vtkAlgorithmOutput* VISU_CutSegmentPL ::InsertCustomPL() { - return myAppendPolyData->GetOutput(); + return myAppendPolyData->GetOutputPort(); } //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_CutSegmentPL.hxx b/src/PIPELINE/VISU_CutSegmentPL.hxx index 273f2dad..0816ce92 100644 --- a/src/PIPELINE/VISU_CutSegmentPL.hxx +++ b/src/PIPELINE/VISU_CutSegmentPL.hxx @@ -67,7 +67,7 @@ public: void Init(); - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_DataSetMapperHolder.cxx b/src/PIPELINE/VISU_DataSetMapperHolder.cxx index 62daa712..cc2a7613 100644 --- a/src/PIPELINE/VISU_DataSetMapperHolder.cxx +++ b/src/PIPELINE/VISU_DataSetMapperHolder.cxx @@ -135,7 +135,7 @@ void VISU_DataSetMapperHolder ::SetUnstructuredGridIDMapper(const VISU::PUnstructuredGridIDMapper& theIDMapper) { - myElnoDisassembleFilter->SetInputData( theIDMapper->GetUnstructuredGridOutput() ); + myElnoDisassembleFilter->SetInputConnection( theIDMapper->GetOutputPort() ); myExtractGeometry->SetInputConnection( myElnoDisassembleFilter->GetOutputPort() ); myUnstructuredGridIDMapper = theIDMapper; SetIDMapper( theIDMapper ); @@ -173,6 +173,14 @@ VISU_DataSetMapperHolder return myExtractGeometry->GetOutput(); } +//---------------------------------------------------------------------------- +vtkAlgorithmOutput* +VISU_DataSetMapperHolder +::GetClippedInputPort() +{ + return myExtractGeometry->GetOutputPort(); +} + //---------------------------------------------------------------------------- void diff --git a/src/PIPELINE/VISU_DataSetMapperHolder.hxx b/src/PIPELINE/VISU_DataSetMapperHolder.hxx index f2faa6fc..ae287468 100644 --- a/src/PIPELINE/VISU_DataSetMapperHolder.hxx +++ b/src/PIPELINE/VISU_DataSetMapperHolder.hxx @@ -162,6 +162,10 @@ protected: vtkPointSet* GetClippedInput(); + virtual + vtkAlgorithmOutput* + GetClippedInputPort(); + private: //---------------------------------------------------------------------------- VISU::PUnstructuredGridIDMapper myUnstructuredGridIDMapper; diff --git a/src/PIPELINE/VISU_DeformationPL.cxx b/src/PIPELINE/VISU_DeformationPL.cxx index abff8816..89417ad1 100755 --- a/src/PIPELINE/VISU_DeformationPL.cxx +++ b/src/PIPELINE/VISU_DeformationPL.cxx @@ -121,24 +121,34 @@ void VISU_DeformationPL::SetWarpVectorInput(vtkDataSet *theInput) //---------------------------------------------------------------------------- vtkDataSet* VISU_DeformationPL::GetWarpVectorOutput() { - return myOutputPassFiler->GetOutput(); + vtkDataSet* aDataSet = myOutputPassFiler->GetOutput(); + myOutputPassFiler->Update(); + return aDataSet; +} + +//---------------------------------------------------------------------------- +vtkAlgorithmOutput* VISU_DeformationPL::GetWarpVectorOutputPort() +{ + return myOutputPassFiler->GetOutputPort(); } //---------------------------------------------------------------------------- void VISU_DeformationPL::SetMergeFilterInput(vtkDataSet* ScalarInput, vtkDataSet* VectorialInput) { - myVectorMergeFilter->SetScalars(ScalarInput); + myVectorMergeFilter->SetScalarsData(ScalarInput); myVectorMergeFilter->AddField("VISU_CELLS_MAPPER",ScalarInput); myVectorMergeFilter->AddField("VISU_POINTS_MAPPER",ScalarInput); - myVectorMergeFilter->SetGeometry(VectorialInput); - myVectorMergeFilter->SetVectors(VectorialInput); + myVectorMergeFilter->SetGeometryData(VectorialInput); + myVectorMergeFilter->SetVectorsData(VectorialInput); } //---------------------------------------------------------------------------- vtkDataSet* VISU_DeformationPL::GetMergeFilterOutput(){ - return myVectorMergeFilter->GetOutput(); + vtkDataSet* aDataSet = myVectorMergeFilter->GetOutput(); + myVectorMergeFilter->Update(); + return aDataSet; } //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_DeformationPL.hxx b/src/PIPELINE/VISU_DeformationPL.hxx index 8f7bff2c..33fd83db 100755 --- a/src/PIPELINE/VISU_DeformationPL.hxx +++ b/src/PIPELINE/VISU_DeformationPL.hxx @@ -60,6 +60,7 @@ public: void SetWarpVectorInput(vtkDataSet *theInput); vtkDataSet* GetWarpVectorOutput(); + vtkAlgorithmOutput* GetWarpVectorOutputPort(); //----------------------------------------------------------- void SetMergeFilterInput(vtkDataSet* ScalarInput, diff --git a/src/PIPELINE/VISU_DeformedGridPL.cxx b/src/PIPELINE/VISU_DeformedGridPL.cxx index de42e6a7..b9033b26 100644 --- a/src/PIPELINE/VISU_DeformedGridPL.cxx +++ b/src/PIPELINE/VISU_DeformedGridPL.cxx @@ -123,10 +123,8 @@ VISU_DeformedGridPL { Superclass::Build(); - //myWarpScalar->SetInput( GetFieldTransformFilter()->GetPolyDataOutput() ); - myWarpScalar->SetInputConnection( GetFieldTransformFilter()->GetOutputPort() ); // OUV_PORTING: to check - //GetPolyDataMapper()->SetInput( myWarpScalar->GetPolyDataOutput() ); - GetPolyDataMapper()->SetInputConnection( myWarpScalar->GetOutputPort() ); // OUV_PORTING: to check + myWarpScalar->SetInputConnection( GetFieldTransformFilter()->GetOutputPort() ); + GetPolyDataMapper()->SetInputConnection( myWarpScalar->GetOutputPort() ); } @@ -135,8 +133,7 @@ void VISU_DeformedGridPL ::Update() { - //vtkPointSet* aPointSet = GetFieldTransformFilter()->GetPolyDataOutput(); - vtkAlgorithmOutput* aPointSet = GetFieldTransformFilter()->GetOutputPort(); // OUV_PORTING: to check + vtkAlgorithmOutput* aPointSet = GetFieldTransformFilter()->GetOutputPort(); if ( !myIsContour ) // surface prs { myWarpScalar->SetInputConnection( aPointSet ); diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx index 460f7cc9..cc4dec57 100644 --- a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx +++ b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx @@ -129,7 +129,7 @@ VISU_DeformedShapeAndScalarMapPL //---------------------------------------------------------------------------- -vtkDataSet* +vtkAlgorithmOutput* VISU_DeformedShapeAndScalarMapPL ::InsertCustomPL() { @@ -138,7 +138,8 @@ VISU_DeformedShapeAndScalarMapPL VISU::CellDataToPoint(myWarpVector, myCellDataToPointData, - GetMergedInput()); + GetMergedInput(), + GetMergedInputPort()); myScalars = vtkUnstructuredGrid::SafeDownCast(GetMergedInput()); @@ -147,14 +148,17 @@ VISU_DeformedShapeAndScalarMapPL myScalarsFieldTransform->SetInputConnection(myScalarsExtractor->GetOutputPort()); // Sets geometry for merge filter - myScalarsMergeFilter->SetGeometry(myWarpVector->GetUnstructuredGridOutput()); + myScalarsMergeFilter->SetGeometryConnection(myWarpVector->GetOutputPort()); vtkDataSet* aScalarsDataSet = myScalarsFieldTransform->GetOutput(); - myScalarsMergeFilter->SetScalars(aScalarsDataSet); + myScalarsFieldTransform->Update(); + + vtkAlgorithmOutput* aScalarsConnection = myScalarsFieldTransform->GetOutputPort(); + myScalarsMergeFilter->SetScalarsConnection(aScalarsConnection); myScalarsMergeFilter->AddField("VISU_CELLS_MAPPER", aScalarsDataSet); myScalarsMergeFilter->AddField("VISU_POINTS_MAPPER", aScalarsDataSet); - return myScalarsMergeFilter->GetOutput(); + return myScalarsMergeFilter->GetOutputPort(); } @@ -218,7 +222,9 @@ VISU_DeformedShapeAndScalarMapPL myExtractGeometry->SetInputConnection(myScalarsElnoDisassembleFilter->GetOutputPort()); myScalarsExtractor->SetInputConnection(myExtractGeometry->GetOutputPort()); - if(VISU::IsDataOnCells(myScalarsElnoDisassembleFilter->GetOutput())) + vtkDataSet* aDataSet = myScalarsElnoDisassembleFilter->GetOutput(); + myScalarsElnoDisassembleFilter->Update(); + if(VISU::IsDataOnCells(aDataSet)) GetMapper()->SetScalarModeToUseCellData(); else GetMapper()->SetScalarModeToUsePointData(); diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx index f9911df9..cf73c042 100644 --- a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx +++ b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx @@ -152,7 +152,7 @@ protected: ~VISU_DeformedShapeAndScalarMapPL(); virtual - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index 118395c6..14f70de4 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -96,8 +96,6 @@ VISU_DeformedShapePL if(!theDataSet) return 0.0; - //theDataSet->Update(); // OUV_PORTING - int aNbCells = theDataSet->GetNumberOfCells(); int aNbPoints = theDataSet->GetNumberOfPoints(); int aNbElem = aNbCells? aNbCells: aNbPoints; @@ -183,15 +181,16 @@ VISU_DeformedShapePL //---------------------------------------------------------------------------- -vtkDataSet* +vtkAlgorithmOutput* VISU_DeformedShapePL ::InsertCustomPL() { VISU::CellDataToPoint(myWarpVector, myCellDataToPointData, - GetMergedInput()); + GetMergedInput(), + GetMergedInputPort()); - return myWarpVector->GetOutput(); + return myWarpVector->GetOutputPort(); } diff --git a/src/PIPELINE/VISU_DeformedShapePL.hxx b/src/PIPELINE/VISU_DeformedShapePL.hxx index 504ee3be..04462af0 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.hxx +++ b/src/PIPELINE/VISU_DeformedShapePL.hxx @@ -91,7 +91,7 @@ protected: ~VISU_DeformedShapePL(); virtual - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index ef820084..2175fc77 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -230,11 +230,11 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- -vtkPolyData* +vtkAlgorithmOutput* VISU_GaussPointsPL ::GetPickableDataSet() { - return myPassFilter[1]->GetPolyDataOutput(); + return myPassFilter[1]->GetOutputPort(); } @@ -269,11 +269,14 @@ VISU_GaussPointsPL SetSourceGeometry(); vtkDataSet* aDataSet = GetFieldTransformFilter()->GetOutput(); + GetFieldTransformFilter()->Update(); + + vtkAlgorithmOutput* anAlgorithmOutput = GetFieldTransformFilter()->GetOutputPort(); + + myMergeFilter->SetGeometryConnection(myAppendFilter->GetOutputPort()); - myMergeFilter->SetGeometry(myAppendFilter->GetOutput()); - - myMergeFilter->SetScalars(aDataSet); - myMergeFilter->SetVectors(aDataSet); + myMergeFilter->SetScalarsConnection(anAlgorithmOutput); + myMergeFilter->SetVectorsConnection(anAlgorithmOutput); myMergeFilter->RemoveFields(); myMergeFilter->AddField("VISU_FIELD", aDataSet); @@ -282,16 +285,15 @@ VISU_GaussPointsPL myMergeFilter->AddField("VISU_CELLS_MAPPER", aDataSet); myMergeFilter->SetGaussPtsIDMapper(GetGaussPtsIDMapper()); - - myPassFilter[0]->SetInputData(InsertCustomPL()); + + myPassFilter[0]->SetInputConnection(InsertCustomPL()); myPassFilter[1]->SetInputConnection(myPassFilter[0]->GetOutputPort()); // Geometrical Sphere myPassFilter[2]->SetInputConnection(myPassFilter[1]->GetOutputPort()); - //GetPointSpriteMapper()->SetInputConnection( myPassFilter[2]->GetPolyDataOutput() ); - GetPointSpriteMapper()->SetInputConnection( myPassFilter[2]->GetOutputPort() ); // OUV_PORTING: to check + GetPointSpriteMapper()->SetInputConnection( myPassFilter[2]->GetOutputPort() ); // Update according the current state SetIsDeformed(GetIsDeformed()); @@ -412,8 +414,7 @@ VISU_GaussPointsPL ::SetIsDeformed( bool theIsDeformed ) { if(theIsDeformed){ - //myWarpVector->SetInput( myPassFilter[0]->GetPolyDataOutput() ); - myWarpVector->SetInputConnection( myPassFilter[0]->GetOutputPort() ); // OUV_PORTING: to check + myWarpVector->SetInputConnection( myPassFilter[0]->GetOutputPort() ); myPassFilter[1]->SetInputConnection(myWarpVector->GetOutputPort()); }else myPassFilter[1]->SetInputConnection(myPassFilter[0]->GetOutputPort()); @@ -792,7 +793,6 @@ VISU_GaussPointsPL } aMainReader->Delete(); anAlphaReader->Delete(); - //aCompositeImageData->Update(); // OUV_PORTING return aCompositeImageData; } @@ -841,11 +841,11 @@ VISU_GaussPointsPL } } -vtkDataSet* +vtkAlgorithmOutput* VISU_GaussPointsPL ::InsertCustomPL() { - return GetMergedInput(); + return GetMergedInputPort(); } int @@ -908,3 +908,10 @@ VISU_GaussPointsPL myMergeFilter->Update(); return myMergeFilter->GetOutput(); } + +vtkAlgorithmOutput* +VISU_GaussPointsPL +::GetMergedInputPort() +{ + return myMergeFilter->GetOutputPort(); +} diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index 66717891..085c7933 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -91,7 +91,7 @@ public: GetParentMesh(); //! Get an intermediate dataset that can be picked - vtkPolyData* + vtkAlgorithmOutput* GetPickableDataSet(); //---------------------------------------------------------------------------- @@ -322,6 +322,10 @@ public: vtkPointSet* GetMergedInput(); + virtual + vtkAlgorithmOutput* + GetMergedInputPort(); + protected: //---------------------------------------------------------------------------- VISU_GaussPointsPL(); @@ -338,7 +342,7 @@ protected: Build(); virtual - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.cxx b/src/PIPELINE/VISU_IsoSurfacesPL.cxx index 0364aacd..1f52e0f1 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.cxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.cxx @@ -220,18 +220,19 @@ VISU_IsoSurfacesPL VISU::CellDataToPoint(myContourFilter, myCellDataToPointData, - GetMergedInput()); + GetMergedInput(), + GetMergedInputPort()); } //---------------------------------------------------------------------------- -vtkDataSet* +vtkAlgorithmOutput* VISU_IsoSurfacesPL ::InsertCustomPL() { - return myContourFilter->GetOutput(); + return myContourFilter->GetOutputPort(); } diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.hxx b/src/PIPELINE/VISU_IsoSurfacesPL.hxx index c8936a53..97784a86 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.hxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.hxx @@ -99,7 +99,7 @@ public: GetMemorySize(); virtual - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_MapperHolder.hxx b/src/PIPELINE/VISU_MapperHolder.hxx index 32296da8..39530fb4 100644 --- a/src/PIPELINE/VISU_MapperHolder.hxx +++ b/src/PIPELINE/VISU_MapperHolder.hxx @@ -151,6 +151,10 @@ public: vtkPointSet* GetClippedInput() = 0; + virtual + vtkAlgorithmOutput* + GetClippedInputPort() = 0; + //---------------------------------------------------------------------------- virtual void diff --git a/src/PIPELINE/VISU_MergedPL.hxx b/src/PIPELINE/VISU_MergedPL.hxx index 58a5421c..39dfd4e1 100644 --- a/src/PIPELINE/VISU_MergedPL.hxx +++ b/src/PIPELINE/VISU_MergedPL.hxx @@ -28,6 +28,7 @@ #include "VISUPipeline.hxx" #include "VISU_Structures.hxx" +class vtkAlgorithmOutput; class vtkDataSet; class vtkPointSet; class VISU_PipeLine; @@ -64,6 +65,10 @@ struct VISU_PIPELINE_EXPORT VISU_MergedPL vtkPointSet* GetMergedInput() = 0; + virtual + vtkAlgorithmOutput* + GetMergedInputPort() = 0; + virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, diff --git a/src/PIPELINE/VISU_MeshPL.cxx b/src/PIPELINE/VISU_MeshPL.cxx index 56783377..0f962add 100644 --- a/src/PIPELINE/VISU_MeshPL.cxx +++ b/src/PIPELINE/VISU_MeshPL.cxx @@ -61,7 +61,7 @@ void VISU_MeshPL ::Build() { - GetDataSetMapper()->SetInputData(GetClippedInput()); + GetDataSetMapper()->SetInputConnection(GetClippedInputPort()); } diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index 3fca5834..aa8ce5a4 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -519,7 +519,6 @@ void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act) else { this->InvokeEvent(vtkCommand::StartEvent,NULL); - //input->Update(); // OUV_PORTING: to check this->Update(); this->InvokeEvent(vtkCommand::EndEvent,NULL); diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index 84aa9aa9..f840bbe4 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -389,6 +389,14 @@ VISU_PipeLine return GetMapperHolder()->GetClippedInput(); } +//---------------------------------------------------------------------------- +vtkAlgorithmOutput* +VISU_PipeLine +::GetClippedInputPort() +{ + return GetMapperHolder()->GetClippedInputPort(); +} + //---------------------------------------------------------------------------- void diff --git a/src/PIPELINE/VISU_PipeLine.hxx b/src/PIPELINE/VISU_PipeLine.hxx index 36e5be73..af1eac79 100644 --- a/src/PIPELINE/VISU_PipeLine.hxx +++ b/src/PIPELINE/VISU_PipeLine.hxx @@ -222,6 +222,9 @@ protected: vtkDataSet* GetClippedInput(); + vtkAlgorithmOutput* + GetClippedInputPort(); + void SetIsShrinkable(bool theIsShrinkable); diff --git a/src/PIPELINE/VISU_PipeLineUtils.hxx b/src/PIPELINE/VISU_PipeLineUtils.hxx index aad4cb09..45df1b72 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.hxx +++ b/src/PIPELINE/VISU_PipeLineUtils.hxx @@ -77,16 +77,16 @@ namespace VISU void CellDataToPoint(TOutputFilter* theOutputFilter, VISU_CellDataToPointData *theCellDataToPointData, - vtkDataSet* theDataSet) + vtkDataSet* theDataSet, + vtkAlgorithmOutput* theAlgorithmOutput) { if(VISU::IsDataOnCells(theDataSet)){ - theCellDataToPointData->SetInputData(theDataSet); + theCellDataToPointData->SetInputConnection(theAlgorithmOutput); theCellDataToPointData->PassCellDataOn(); - //theOutputFilter->SetInput(theCellDataToPointData->GetUnstructuredGridOutput()); - theOutputFilter->SetInputConnection(theCellDataToPointData->GetOutputPort()); // OUV_PORTING: to check + theOutputFilter->SetInputConnection(theCellDataToPointData->GetOutputPort()); }else - theOutputFilter->SetInputData(theDataSet); + theOutputFilter->SetInputConnection(theAlgorithmOutput); } //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index d98b6291..59d4f349 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -121,8 +121,6 @@ VISU_CutPlanesPL::PlaneOrientation VISU_Plot3DPL ::GetOrientation(vtkDataSet* theDataSet) { - //theDataSet->Update(); // OUV_PORTING - double aBounds[6]; theDataSet->GetBounds(aBounds); double aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]}; @@ -155,7 +153,6 @@ VISU_Plot3DPL ::GetScaleFactor( VISU_ColoredPL* theColoredPL, vtkDataSet* theDataSet ) { - //theDataSet->Update(); // OUV_PORTING double aLength = theDataSet->GetLength(); // diagonal length double aScalarRange[2]; @@ -183,11 +180,11 @@ VISU_Plot3DPL //---------------------------------------------------------------------------- -vtkDataSet* +vtkAlgorithmOutput* VISU_Plot3DPL ::InsertCustomPL() { - return myAppendPolyData->GetOutput(); + return myAppendPolyData->GetOutputPort(); } @@ -233,7 +230,6 @@ VISU_Plot3DPL if(VISU::IsDataOnCells(aPolyData)) { myCellDataToPointData->SetInputData(aPolyData); myCellDataToPointData->PassCellDataOn(); - //myWarpScalar->SetInputConnection(myCellDataToPointData->GetPolyDataOutput()); // OUV_PORTING: to check myWarpScalar->SetInputConnection(myCellDataToPointData->GetOutputPort()); }else myWarpScalar->SetInputData(aPolyData); @@ -255,7 +251,6 @@ VISU_Plot3DPL } VISU_CutPlanesPL::ClearAppendPolyData(myAppendPolyData.GetPointer()); - //myAppendPolyData->AddInputConnection(myWarpScalar->GetPolyDataOutput()); // OUV_PORTING: to check myAppendPolyData->AddInputConnection(myWarpScalar->GetOutputPort()); if ( aCutPlane ) diff --git a/src/PIPELINE/VISU_Plot3DPL.hxx b/src/PIPELINE/VISU_Plot3DPL.hxx index d1e3422a..1e76d2aa 100644 --- a/src/PIPELINE/VISU_Plot3DPL.hxx +++ b/src/PIPELINE/VISU_Plot3DPL.hxx @@ -137,7 +137,7 @@ protected: ~VISU_Plot3DPL(); virtual - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_PolyDataMapperHolder.cxx b/src/PIPELINE/VISU_PolyDataMapperHolder.cxx index 400c4252..2958285d 100644 --- a/src/PIPELINE/VISU_PolyDataMapperHolder.cxx +++ b/src/PIPELINE/VISU_PolyDataMapperHolder.cxx @@ -118,7 +118,7 @@ void VISU_PolyDataMapperHolder ::SetPolyDataIDMapper(const VISU::PPolyDataIDMapper& theIDMapper) { - myExtractPolyDataGeometry->SetInputData(theIDMapper->GetPolyDataOutput()); + myExtractPolyDataGeometry->SetInputConnection(theIDMapper->GetOutputPort()); myPolyDataIDMapper = theIDMapper; SetIDMapper(theIDMapper); } @@ -155,6 +155,14 @@ VISU_PolyDataMapperHolder return myExtractPolyDataGeometry->GetOutput(); } +//---------------------------------------------------------------------------- +vtkAlgorithmOutput* +VISU_PolyDataMapperHolder +::GetClippedInputPort() +{ + return myExtractPolyDataGeometry->GetOutputPort(); +} + //---------------------------------------------------------------------------- void diff --git a/src/PIPELINE/VISU_PolyDataMapperHolder.hxx b/src/PIPELINE/VISU_PolyDataMapperHolder.hxx index 05ccdfc0..18bac778 100644 --- a/src/PIPELINE/VISU_PolyDataMapperHolder.hxx +++ b/src/PIPELINE/VISU_PolyDataMapperHolder.hxx @@ -158,6 +158,10 @@ protected: vtkPointSet* GetClippedInput(); + virtual + vtkAlgorithmOutput* + GetClippedInputPort(); + private: //---------------------------------------------------------------------------- VISU::PPolyDataIDMapper myPolyDataIDMapper; diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index bf5f22bd..5c1f332f 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -108,11 +108,12 @@ VISU_ScalarMapPL SetSourceGeometry(); - myMergeFilter->SetGeometry(myAppendFilter->GetOutput()); + myMergeFilter->SetGeometryConnection(myAppendFilter->GetOutputPort()); vtkDataSet* aDataSet = GetClippedInput(); - myMergeFilter->SetScalars(aDataSet); - myMergeFilter->SetVectors(aDataSet); + vtkAlgorithmOutput* anAlgorithmOutput = GetClippedInputPort(); + myMergeFilter->SetScalarsConnection(anAlgorithmOutput); + myMergeFilter->SetVectorsConnection(anAlgorithmOutput); myMergeFilter->RemoveFields(); myMergeFilter->AddField("VISU_FIELD", aDataSet); @@ -123,7 +124,7 @@ VISU_ScalarMapPL myMergeFilter->AddField("VISU_POINTS_MAPPER", aDataSet); myMergeFilter->AddField("ELNO_POINT_COORDS", aDataSet); - myElnoAssembleFilter->SetInputData( InsertCustomPL() ); + myElnoAssembleFilter->SetInputConnection( InsertCustomPL() ); GetDataSetMapper()->SetInputConnection( myElnoAssembleFilter->GetOutputPort() ); } @@ -181,7 +182,7 @@ VISU_ScalarMapPL { if(IsExternalGeometryUsed()){ ClearGeometry(); - myAppendFilter->AddInputData(GetClippedInput()); + myAppendFilter->AddInputConnection(GetClippedInputPort()); } } @@ -274,11 +275,11 @@ VISU_ScalarMapPL //---------------------------------------------------------------------------- -vtkDataSet* +vtkAlgorithmOutput* VISU_ScalarMapPL ::InsertCustomPL() { - return GetMergedInput(); + return GetMergedInputPort(); } @@ -293,4 +294,13 @@ VISU_ScalarMapPL } +//---------------------------------------------------------------------------- +vtkAlgorithmOutput* +VISU_ScalarMapPL +::GetMergedInputPort() +{ + return myMergeFilter->GetOutputPort(); +} + + //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index 27b9ffdb..47ec79d0 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -100,6 +100,10 @@ public: vtkPointSet* GetMergedInput(); + virtual + vtkAlgorithmOutput* + GetMergedInputPort(); + protected: //---------------------------------------------------------------------------- VISU_ScalarMapPL(); @@ -112,7 +116,7 @@ protected: OnCreateMapperHolder(); virtual - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index 2171011e..6f10122b 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -216,7 +216,6 @@ VISU_StreamLinesPL int theDirection) { vtkPointSet* aDataSet = theSource? theSource: GetMergedInput(); - //aDataSet->Update(); // OUV_PORTING vtkIdType aNbOfPoints = aDataSet->GetNumberOfPoints(); vtkDataSet* aPointSet = GetExtractorFilter()->GetOutput(); @@ -240,20 +239,20 @@ VISU_StreamLinesPL thePropogationTime, thePercents); - // OUV_PORTING: to do - /* if (anIsAccepted) { mySource = theSource; myPercents = thePercents; if(VISU::IsDataOnCells(GetMergedInput())){ - myCenters->SetInput(aDataSet); + myCenters->SetInputData(aDataSet); myCenters->VertexCellsOn(); aDataSet = myCenters->GetOutput(); + myCenters->Update(); } - myPointsFilter->SetInput(aDataSet); + myPointsFilter->SetInputData(aDataSet); myPointsFilter->SetPercentsOfUsedPoints(thePercents); aDataSet = myPointsFilter->GetOutput(); - myStream->SetSource(aDataSet); + myPointsFilter->Update(); + myStream->SetSourceData(aDataSet); myStream->SetIntegrationStepLength(theIntStep); myStream->SetMaximumPropagationTime(thePropogationTime); myStream->SetStepLength(theStepLength); @@ -262,7 +261,6 @@ VISU_StreamLinesPL myStream->Modified(); Modified(); } - */ return anIsAccepted; } @@ -384,8 +382,6 @@ VISU_StreamLinesPL if(!theDataSet) return -1.0; - //theDataSet->Update(); // OUV_PORTING - int degree = 0; double aVolume = 1.0; double* aBounds = theDataSet->GetBounds(); @@ -430,8 +426,6 @@ VISU_StreamLinesPL if(!theDataSet) return -1.0; - //theDataSet->Update(); // OUV_PORTING - double aLength = theDataSet->GetLength(); double* aBounds = theDataSet->GetBounds(); double aMaxSizeY = (aBounds[3]-aBounds[2])/aLength; @@ -460,8 +454,6 @@ VISU_StreamLinesPL ::GetBaseIntegrationStep(vtkDataSet* theDataSet, double thePercents) { - //theDataSet->Update(); // OUV_PORTING - double aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet); double anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep; double aMinMax = theDataSet->GetLength() / theDataSet->GetNumberOfPoints(); @@ -483,8 +475,6 @@ VISU_StreamLinesPL vtkDataSet* theDataSet, double thePercents) { - //theDataSet->Update(); // OUV_PORTING - double aMinIntegrationStep = GetMinIntegrationStep(theDataSet, thePercents); if(aMinIntegrationStep > theStep) theStep = aMinIntegrationStep; @@ -567,7 +557,6 @@ VISU_StreamLinesPL if(!theDataSet) return -1.0; - //theDataSet->Update(); // OUV_PORTING double aPropagationTime = theDataSet->GetLength() / GetVelocityCoeff(theDataSet); return aPropagationTime; @@ -696,7 +685,8 @@ VISU_StreamLinesPL VISU::CellDataToPoint(myStream, myCellDataToPointData, - GetMergedInput()); + GetMergedInput(), + GetMergedInputPort()); myGeomFilter->SetInputConnection(myStream->GetOutputPort()); myGeomFilter->ExtentClippingOn(); @@ -704,11 +694,11 @@ VISU_StreamLinesPL //---------------------------------------------------------------------------- -vtkDataSet* +vtkAlgorithmOutput* VISU_StreamLinesPL ::InsertCustomPL() { - return myGeomFilter->GetOutput(); + return myGeomFilter->GetOutputPort(); } diff --git a/src/PIPELINE/VISU_StreamLinesPL.hxx b/src/PIPELINE/VISU_StreamLinesPL.hxx index 1b4c62e4..d7f4d8b4 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.hxx +++ b/src/PIPELINE/VISU_StreamLinesPL.hxx @@ -127,7 +127,7 @@ public: public: virtual - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx index 03c30161..5dc2c675 100644 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ b/src/PIPELINE/VISU_VectorsPL.cxx @@ -253,11 +253,11 @@ VISU_VectorsPL //---------------------------------------------------------------------------- -vtkDataSet* +vtkAlgorithmOutput* VISU_VectorsPL ::InsertCustomPL() { - return myGlyph->GetOutput(); + return myGlyph->GetOutputPort(); } diff --git a/src/PIPELINE/VISU_VectorsPL.hxx b/src/PIPELINE/VISU_VectorsPL.hxx index 1b69f50b..510ea42e 100644 --- a/src/PIPELINE/VISU_VectorsPL.hxx +++ b/src/PIPELINE/VISU_VectorsPL.hxx @@ -126,7 +126,7 @@ protected: ~VISU_VectorsPL(); virtual - vtkDataSet* + vtkAlgorithmOutput* InsertCustomPL(); virtual diff --git a/src/PIPELINE/VISU_XYPlotActor.cxx b/src/PIPELINE/VISU_XYPlotActor.cxx index fbc001e7..46485603 100644 --- a/src/PIPELINE/VISU_XYPlotActor.cxx +++ b/src/PIPELINE/VISU_XYPlotActor.cxx @@ -490,7 +490,6 @@ int VISU_XYPlotActor::RenderOpaqueGeometry(vtkViewport *viewport) for (mtime=0, this->InputList->InitTraversal(dsit); (ds = this->InputList->GetNextDataSet(dsit)); ) { - //ds->Update(); // OUV_PORTING dsMtime = ds->GetMTime(); if ( dsMtime > mtime ) { @@ -505,7 +504,6 @@ int VISU_XYPlotActor::RenderOpaqueGeometry(vtkViewport *viewport) for (mtime=0, this->DataObjectInputList->InitTraversal(doit); (dobj = this->DataObjectInputList->GetNextDataObject(doit)); ) { - //dobj->Update(); // OUV_PORTING dsMtime = dobj->GetMTime(); if ( dsMtime > mtime ) { @@ -2090,7 +2088,6 @@ void VISU_XYPlotActor::GenerateClipPlanes(int *pos, int *pos2) double VISU_XYPlotActor::ComputeGlyphScale(int i, int *pos, int *pos2) { vtkPolyData *pd=this->LegendActor->GetEntrySymbol(i); - //pd->Update(); // OUV_PORTING double length=pd->GetLength(); double sf = this->GlyphSize * sqrt((double)(pos[0]-pos2[0])*(pos[0]-pos2[0]) + (pos[1]-pos2[1])*(pos[1]-pos2[1])) / length; diff --git a/src/VISUGUI/VisuGUI_EvolutionDlg.cxx b/src/VISUGUI/VisuGUI_EvolutionDlg.cxx index b5f1f630..938a2045 100644 --- a/src/VISUGUI/VisuGUI_EvolutionDlg.cxx +++ b/src/VISUGUI/VisuGUI_EvolutionDlg.cxx @@ -263,7 +263,8 @@ void VisuGUI_EvolutionDlg::setVisible( bool theIsVisible ) VISU::PNamedIDMapper aMapper = aResult->GetInput()->GetMeshOnEntity( myEngine->getMeshName(), myEngine->getEntity() ); vtkDataSetMapper* aPreviewMapper = vtkDataSetMapper::New(); - aPreviewMapper->SetInputData( aMapper->GetOutput() ); + aPreviewMapper->SetInputConnection( aMapper->GetOutputPort() ); + aPreviewMapper->Update(); vtkProperty* aProperty = vtkProperty::New(); aProperty->SetColor( 1, 1, 1 );