From 8ad87eec032c0e7ce2c25efed9d50c0b5dd8b4b7 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 18 Dec 2006 12:52:37 +0000 Subject: [PATCH] To implement more accurate VISU_PipeLine::ShallowCopy method --- src/OBJECT/VISU_Actor.cxx | 20 ++- src/OBJECT/VISU_Actor.h | 4 + src/OBJECT/VISU_GaussPtsAct.cxx | 15 +- src/OBJECT/VISU_GaussPtsDeviceActor.cxx | 2 +- src/PIPELINE/VISU_CutLinesPL.cxx | 5 +- src/PIPELINE/VISU_CutLinesPL.hxx | 3 +- src/PIPELINE/VISU_CutPlanesPL.cxx | 5 +- src/PIPELINE/VISU_CutPlanesPL.hxx | 3 +- src/PIPELINE/VISU_DeformedShapePL.cxx | 5 +- src/PIPELINE/VISU_DeformedShapePL.hxx | 3 +- src/PIPELINE/VISU_GaussPointsPL.cxx | 132 +++++++++++------- src/PIPELINE/VISU_GaussPointsPL.hxx | 9 +- src/PIPELINE/VISU_IsoSurfacesPL.cxx | 5 +- src/PIPELINE/VISU_IsoSurfacesPL.hxx | 3 +- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 34 ++++- src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx | 5 +- src/PIPELINE/VISU_PipeLine.cxx | 31 +++- src/PIPELINE/VISU_PipeLine.hxx | 13 +- src/PIPELINE/VISU_PipeLineUtils.cxx | 49 +++++-- src/PIPELINE/VISU_PipeLineUtils.hxx | 17 ++- src/PIPELINE/VISU_Plot3DPL.cxx | 5 +- src/PIPELINE/VISU_Plot3DPL.hxx | 3 +- .../VISU_ScalarMapOnDeformedShapePL.cxx | 5 +- .../VISU_ScalarMapOnDeformedShapePL.hxx | 3 +- src/PIPELINE/VISU_ScalarMapPL.cxx | 13 +- src/PIPELINE/VISU_ScalarMapPL.hxx | 3 +- src/PIPELINE/VISU_StreamLinesPL.cxx | 5 +- src/PIPELINE/VISU_StreamLinesPL.hxx | 3 +- src/PIPELINE/VISU_VectorsPL.cxx | 5 +- src/PIPELINE/VISU_VectorsPL.hxx | 3 +- src/VISU_I/VISU_GaussPoints_i.cc | 4 +- src/VISU_I/VISU_Vectors_i.cc | 6 +- 32 files changed, 280 insertions(+), 141 deletions(-) diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index c03cb0de..242d4fbb 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -32,8 +32,6 @@ #include "VTKViewer_GeometryFilter.h" #include "VTKViewer_PassThroughFilter.h" -#include "VISU_PipeLineUtils.hxx" - #include #include @@ -64,6 +62,8 @@ #include "utilities.h" +#include "VISU_PipeLineUtils.hxx" + using namespace std; static int MYVTKDEBUG = 0; @@ -132,8 +132,11 @@ void VISU_Actor ::ShallowCopyPL(VISU_PipeLine* thePipeLine) { - myPipeLine->ShallowCopy(thePipeLine); - VISU::CopyMapper(GetMapper(), thePipeLine->GetMapper()); + myPipeLine->ShallowCopy(thePipeLine, true); + vtkDataSetMapper* aTarget = GetDataSetMapper(); + vtkDataSetMapper* aSource = thePipeLine->GetDataSetMapper(); + VISU::CopyDataSetMapper(aTarget, aSource, true); + aTarget->SetLookupTable(aSource->GetLookupTable()); } //---------------------------------------------------------------------------- @@ -231,7 +234,6 @@ VISU_Actor if(vtkMapper *aMapper = myPipeLine->GetMapper()){ if(vtkDataSet *aDataSet = aMapper->GetInput()){ SetShrinkable(thePipeLine->IsShrinkable()); - SetMapperInput(aDataSet); } } @@ -410,6 +412,14 @@ VISU_Actor return GetCurrentPL()->GetOutput(); } +//---------------------------------------------------------------------------- +vtkDataSetMapper* +VISU_Actor +::GetDataSetMapper() +{ + return myMapper.GetPointer(); +} + //---------------------------------------------------------------------------- unsigned long int VISU_Actor diff --git a/src/OBJECT/VISU_Actor.h b/src/OBJECT/VISU_Actor.h index fab9ea4c..8d60bf54 100644 --- a/src/OBJECT/VISU_Actor.h +++ b/src/OBJECT/VISU_Actor.h @@ -196,6 +196,10 @@ class VTKOCC_EXPORT VISU_Actor : vtkDataSet* GetInput(); + virtual + vtkDataSetMapper* + GetDataSetMapper(); + //! Gets memory size used by the instance (bytes). virtual unsigned long int diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index c8760129..3618316b 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -201,11 +201,11 @@ VISU_GaussPtsAct ::ShallowCopyPL(VISU_PipeLine* thePipeLine) { if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::ShallowCopyPL - this = "<GetMapper()->GetInput(); unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024; - //aSize += Superclass::GetMemorySize(); + aSize += Superclass::GetMemorySize(); return aSize; } @@ -377,8 +377,7 @@ namespace CreatePipeLine(VISU_GaussPointsPL* thePipeLine) { VISU_GaussPointsPL* aPipeLine = VISU_GaussPointsPL::New(); - aPipeLine->SetGaussPtsIDMapper(thePipeLine->GetGaussPtsIDMapper()); - aPipeLine->ShallowCopy(thePipeLine); + aPipeLine->ShallowCopy(thePipeLine, true); aPipeLine->Update(); return aPipeLine; } @@ -1086,7 +1085,7 @@ VISU_GaussPtsAct SALOME_ExtractGeometry* anExtractGeometry = aPipeline->GetExtractGeometryFilter(); vtkImplicitFunction* anImplicitFunction = anExtractGeometry->GetImplicitFunction(); - aPipeline->ShallowCopy(GetGaussPointsPL()); + aPipeline->ShallowCopy(GetGaussPointsPL(), true); aPipeline->SetImplicitFunction(anImplicitFunction); // To restore @@ -1363,7 +1362,7 @@ VISU_GaussPtsAct1 vtkImplicitFunction* anImplicitFunction = anExtractGeometry->GetImplicitFunction(); vtkFloatingPointType aMagnification = aPipeline->GetMagnification(); - aPipeline->ShallowCopy(GetGaussPointsPL()); + aPipeline->ShallowCopy(GetGaussPointsPL(), true); aPipeline->SetImplicitFunction(anImplicitFunction); // To restore anExtractGeometry->SetExtractBoundaryCells(true); diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx index 1bf2ec18..55e32709 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx @@ -218,7 +218,7 @@ void VISU_GaussPtsDeviceActor ::ShallowCopyPL(VISU_GaussPointsPL* thePipeLine) { - myPipeLine->ShallowCopy(thePipeLine); + myPipeLine->ShallowCopy(thePipeLine, true); } diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index 2a278253..2fd62fde 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -43,7 +43,8 @@ VISU_CutLinesPL void VISU_CutLinesPL -::DoShallowCopy(VISU_PipeLine *thePipeLine) +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_CutLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation(aPipeLine->GetPlaneOrientation(1), @@ -54,7 +55,7 @@ VISU_CutLinesPL else SetPosition(aPipeLine->GetPosition()); } - Superclass::DoShallowCopy(thePipeLine); + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); } void diff --git a/src/PIPELINE/VISU_CutLinesPL.hxx b/src/PIPELINE/VISU_CutLinesPL.hxx index b72654c0..4f2f6ea6 100644 --- a/src/PIPELINE/VISU_CutLinesPL.hxx +++ b/src/PIPELINE/VISU_CutLinesPL.hxx @@ -123,7 +123,8 @@ protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); vtkFloatingPointType myDirLn[3]; vtkFloatingPointType myRealDirLn[3]; diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx index a96b049a..3eb87827 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -64,7 +64,8 @@ VISU_CutPlanesPL void VISU_CutPlanesPL -::DoShallowCopy(VISU_PipeLine *thePipeLine) +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_CutPlanesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation(aPipeLine->GetPlaneOrientation(), @@ -74,7 +75,7 @@ VISU_CutPlanesPL for (int i = 0, iend = GetNbParts(); i < iend; i++) if(!aPipeLine->IsPartDefault(i)) SetPartPosition(i, aPipeLine->GetPartPosition(i)); } - Superclass::DoShallowCopy(thePipeLine); + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); } void diff --git a/src/PIPELINE/VISU_CutPlanesPL.hxx b/src/PIPELINE/VISU_CutPlanesPL.hxx index 79a59ad1..145b30ca 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.hxx +++ b/src/PIPELINE/VISU_CutPlanesPL.hxx @@ -186,7 +186,8 @@ protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); void SetPartPosition(int theNum = 0); diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index d3d431a3..b1817198 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -52,12 +52,13 @@ VISU_DeformedShapePL void VISU_DeformedShapePL -::DoShallowCopy(VISU_PipeLine *thePipeLine) +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_DeformedShapePL *aPipeLine = dynamic_cast(thePipeLine)){ SetScale(aPipeLine->GetScale()); } - Superclass::DoShallowCopy(thePipeLine); + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); } vtkFloatingPointType diff --git a/src/PIPELINE/VISU_DeformedShapePL.hxx b/src/PIPELINE/VISU_DeformedShapePL.hxx index e842588b..3c9e6875 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.hxx +++ b/src/PIPELINE/VISU_DeformedShapePL.hxx @@ -85,7 +85,8 @@ protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); vtkFloatingPointType myScaleFactor; vtkWarpVector *myWarpVector; diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index f3edad74..12c36f84 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -52,7 +52,6 @@ VISU_GaussPointsPL ::VISU_GaussPointsPL(): myIsDeformed(false), myScaleFactor(0.0), - myResolution( 8 ), myMagnificationIncrement(2) { myExtractGeometry->SetExtractInside(0); @@ -78,6 +77,8 @@ VISU_GaussPointsPL myCellDataToPointData->SetInput( myFieldTransform->GetUnstructuredGridOutput() ); mySphereSource = vtkSphereSource::New(); + mySphereSource->SetThetaResolution( 8 ); + mySphereSource->SetPhiResolution( 8 ); myGlyph->SetSource( mySphereSource->GetOutput() ); for(int i = 0; i < 2; i++) @@ -118,27 +119,32 @@ unsigned long int VISU_GaussPointsPL ::GetMTime() { - unsigned long int aTime = std::max(Superclass::GetMTime(),myPSMapper->GetMTime()); + unsigned long int aTime = std::max(Superclass::GetMTime(), myPSMapper->GetMTime()); return aTime; } //---------------------------------------------------------------------------- void -CopyGlyph( vtkGlyph3D* source, vtkGlyph3D* dest ) +CopyGlyph( vtkGlyph3D* theSource, vtkGlyph3D* theDestination ) { - dest->SetRange( source->GetRange() ); - dest->SetScaling( source->GetScaling() ); - dest->SetClamping( source->GetClamping() ); - dest->SetScaleMode( source->GetScaleMode() ); - dest->SetColorMode( source->GetColorMode() ); - dest->SetScaleFactor( source->GetScaleFactor() ); + vtkFloatingPointType* aSourceRange = theSource->GetRange(); + vtkFloatingPointType* aDestinationRange = theDestination->GetRange(); + if(!VISU::CheckIsSameRange(aDestinationRange, aSourceRange)) + theDestination->SetRange( aSourceRange ); + + theDestination->SetScaling( theSource->GetScaling() ); + theDestination->SetClamping( theSource->GetClamping() ); + theDestination->SetScaleMode( theSource->GetScaleMode() ); + theDestination->SetColorMode( theSource->GetColorMode() ); + theDestination->SetScaleFactor( theSource->GetScaleFactor() ); } //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::DoShallowCopy(VISU_PipeLine *thePipeLine) +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_GaussPointsPL *aPipeLine = dynamic_cast(thePipeLine)){ SetPrimitiveType(aPipeLine->GetPrimitiveType()); @@ -155,20 +161,29 @@ VISU_GaussPointsPL SetIsDeformed( aPipeLine->GetIsDeformed() ); SetScale( aPipeLine->GetScale() ); - mySphereSource->SetRadius( aPipeLine->mySphereSource->GetRadius() ); + vtkFloatingPointType aRadius = aPipeLine->mySphereSource->GetRadius(); + if(!VISU::CheckIsSameValue(mySphereSource->GetRadius(), aRadius)) + mySphereSource->SetRadius( aRadius ); + CopyGlyph( aPipeLine->myGlyph, this->myGlyph ); } - Superclass::DoShallowCopy(thePipeLine); + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); } //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::DoCopyMapper(VISU_PipeLine *thePipeLine) +::DoCopyMapper(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_GaussPointsPL* aPipeLine = dynamic_cast(thePipeLine)){ - VISU::CopyPointSpriteDataMapper(GetPSMapper(), aPipeLine->GetPSMapper()); + if(theIsCopyInput) + SetGaussPtsIDMapper(aPipeLine->GetGaussPtsIDMapper()); + Update(); + VISU::CopyPointSpriteDataMapper(GetPSMapper(), + aPipeLine->GetPSMapper(), + theIsCopyInput); } } @@ -256,11 +271,12 @@ VISU_GaussPointsPL myScalarArray = aCellData->GetScalars(); myPSMapper->SetLookupTable( myMapperTable ); - myPSMapper->SetScalarRange( aScalarRange ); + if(!VISU::CheckIsSameRange(myPSMapper->GetScalarRange(), aScalarRange)) + myPSMapper->SetScalarRange( aScalarRange ); this->UpdateGlyph(); - VISU_ScalarMapPL::Update(); + Superclass::Update(); } //---------------------------------------------------------------------------- @@ -295,48 +311,54 @@ void VISU_GaussPointsPL ::UpdateGlyph() { - //cout << "VISU_GaussPointsPL::UpdateGlyph()" << endl; - vtkFloatingPointType* aScalarRange = GetScalarRange(); if( myPSMapper->GetPointSpriteMode() == 0 ) // Results { - //cout << "Results" << endl; myGlyph->ClampingOn(); myGlyph->SetScaleModeToScaleByScalar(); myGlyph->SetColorModeToColorByScalar(); - vtkFloatingPointType aRange = 0; + vtkFloatingPointType aScaleFactor = 0.0; vtkFloatingPointType aMinSize = GetMinSize(); vtkFloatingPointType aMaxSize = GetMaxSize(); - if( fabs( aMaxSize - aMinSize ) > 0.0001 ) - aRange = ( aScalarRange[1] - aScalarRange[0] ) / ( aMaxSize - aMinSize ); - vtkFloatingPointType aMinRange = aScalarRange[0] - aMinSize * aRange; - vtkFloatingPointType aMaxRange = aMinRange + aRange; - - myGlyph->SetRange( aMinRange, aMaxRange ); - myGlyph->SetScaleFactor( 1.0 ); + if(!VISU::CheckIsSameValue(aMaxSize, aMinSize)) + aScaleFactor = ( aScalarRange[1] - aScalarRange[0] ) / ( aMaxSize - aMinSize ); + + vtkFloatingPointType aMinRange = aScalarRange[0] - aMinSize * aScaleFactor; + vtkFloatingPointType aMaxRange = aMinRange + aScaleFactor; + vtkFloatingPointType aRange[2] = {aMinRange, aMaxRange}; + + if(!VISU::CheckIsSameRange(myGlyph->GetRange(), aRange)){ + myGlyph->SetRange( aRange ); + if(!VISU::CheckIsSameValue(myGlyph->GetScaleFactor(), 1.0)) + myGlyph->SetScaleFactor( 1.0 ); + } } else if( myPSMapper->GetPointSpriteMode() == 1 ) // Geometry { - //cout << "Geometry" << endl; myGlyph->ClampingOff(); myGlyph->SetScaleModeToDataScalingOff(); myGlyph->SetColorModeToColorByScale(); - myGlyph->SetScaleFactor( GetSize() ); + vtkFloatingPointType aScaleFactor = GetSize(); + if(!VISU::CheckIsSameValue(myGlyph->GetScaleFactor(), aScaleFactor)) + myGlyph->SetScaleFactor( aScaleFactor ); } else if( myPSMapper->GetPointSpriteMode() == 2 ) // Outside { - //cout << "Outside" << endl; myGlyph->ClampingOff(); myGlyph->SetScaleModeToDataScalingOff(); myGlyph->SetColorModeToColorByScalar(); - myGlyph->SetScaleFactor( GetSize() ); + vtkFloatingPointType aScaleFactor = GetSize(); + if(!VISU::CheckIsSameValue(myGlyph->GetScaleFactor(), aScaleFactor)) + myGlyph->SetScaleFactor( aScaleFactor ); } - mySphereSource->SetRadius( GetMagnification() * GetAverageCellSize() / 2. ); + vtkFloatingPointType aRadius = GetMagnification() * GetAverageCellSize() / 2.0; + if(!VISU::CheckIsSameValue(mySphereSource->GetRadius(), aRadius)) + mySphereSource->SetRadius( aRadius ); } //---------------------------------------------------------------------------- @@ -384,6 +406,9 @@ void VISU_GaussPointsPL ::SetIsDeformed( bool theIsDeformed ) { + if( GetIsDeformed() == theIsDeformed ) + return; + if( theIsDeformed ) { myWarpVector->SetInput( myCellDataToPointData->GetUnstructuredGridOutput() ); @@ -393,8 +418,6 @@ VISU_GaussPointsPL myPassFilter[0]->SetInput(myCellDataToPointData->GetUnstructuredGridOutput()); myIsDeformed = theIsDeformed; - - Modified(); } //---------------------------------------------------------------------------- @@ -415,8 +438,6 @@ VISU_GaussPointsPL myMapperTable->SetBicolor( theBicolor ); myBarTable->SetBicolor( theBicolor ); - - Modified(); } //---------------------------------------------------------------------------- @@ -448,6 +469,9 @@ void VISU_GaussPointsPL ::SetPrimitiveType(int thePrimitiveType) { + if( GetPrimitiveType() == thePrimitiveType ) + return; + if( thePrimitiveType == VISU_OpenGLPointSpriteMapper::GeomSphere ) { myGlyph->SetInput( myGeomFilter->GetOutput() ); @@ -457,8 +481,6 @@ VISU_GaussPointsPL myPassFilter[1]->SetInput(myGeomFilter->GetOutput()); myPSMapper->SetPrimitiveType( thePrimitiveType ); - - Modified(); } //---------------------------------------------------------------------------- @@ -483,7 +505,6 @@ VISU_GaussPointsPL ::SetClamp(vtkFloatingPointType theClamp) { myPSMapper->SetPointSpriteClamp( theClamp ); - Modified(); } //---------------------------------------------------------------------------- @@ -500,7 +521,6 @@ VISU_GaussPointsPL ::SetSize(vtkFloatingPointType theSize) { myPSMapper->SetPointSpriteSize( theSize ); - Modified(); } //---------------------------------------------------------------------------- @@ -517,7 +537,6 @@ VISU_GaussPointsPL ::SetMinSize(vtkFloatingPointType theMinSize) { myPSMapper->SetPointSpriteMinSize( theMinSize ); - Modified(); } //---------------------------------------------------------------------------- @@ -534,7 +553,6 @@ VISU_GaussPointsPL ::SetMaxSize(vtkFloatingPointType theMaxSize) { myPSMapper->SetPointSpriteMaxSize( theMaxSize ); - Modified(); } //---------------------------------------------------------------------------- @@ -551,7 +569,6 @@ VISU_GaussPointsPL ::SetMagnification(vtkFloatingPointType theMagnification) { myPSMapper->SetPointSpriteMagnification( theMagnification ); - Modified(); } //---------------------------------------------------------------------------- @@ -567,7 +584,11 @@ void VISU_GaussPointsPL ::SetMagnificationIncrement(vtkFloatingPointType theIncrement) { + if(VISU::CheckIsSameValue(myMagnificationIncrement, theIncrement)) + return; + myMagnificationIncrement = theIncrement; + Modified(); } //---------------------------------------------------------------------------- @@ -576,7 +597,6 @@ VISU_GaussPointsPL ::SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold) { myPSMapper->SetPointSpriteAlphaThreshold( theAlphaThreshold ); - Modified(); } //---------------------------------------------------------------------------- @@ -592,9 +612,16 @@ void VISU_GaussPointsPL ::SetResolution(int theResolution) { - myResolution = theResolution; - mySphereSource->SetThetaResolution( myResolution ); - mySphereSource->SetPhiResolution( myResolution ); + mySphereSource->SetThetaResolution( theResolution ); + mySphereSource->SetPhiResolution( theResolution ); +} + +//---------------------------------------------------------------------------- +int +VISU_GaussPointsPL +::GetResolution() +{ + return mySphereSource->GetThetaResolution(); } //---------------------------------------------------------------------------- @@ -636,7 +663,7 @@ VISU_GaussPointsPL vtkDataSet* aDataSet = aMapper->GetInput(); vtkCellData* aCellData = aDataSet->GetCellData(); vtkDataArray* aScalarArray = aCellData->GetScalars(); - return GetPointSize(theID,aScalarArray); + return GetPointSize(theID, aScalarArray); } //---------------------------------------------------------------------------- @@ -645,7 +672,6 @@ VISU_GaussPointsPL ::SetAverageCellSize(vtkFloatingPointType theAverageCellSize) { myPSMapper->SetAverageCellSize( theAverageCellSize ); - Modified(); } //---------------------------------------------------------------------------- @@ -728,9 +754,11 @@ VISU_GaussPointsPL void VISU_GaussPointsPL::SetScale( vtkFloatingPointType theScale ) { + if(VISU::CheckIsSameValue(myWarpVector->GetScaleFactor(), theScale)) + return; + myWarpVector->SetScaleFactor( theScale ); - myScaleFactor = GetScale(); - Modified(); + myScaleFactor = theScale; } vtkFloatingPointType VISU_GaussPointsPL::GetScale() @@ -740,7 +768,7 @@ vtkFloatingPointType VISU_GaussPointsPL::GetScale() void VISU_GaussPointsPL::SetMapScale( vtkFloatingPointType theMapScale ) { - VISU_ScalarMapPL::SetMapScale( theMapScale ); + Superclass::SetMapScale( theMapScale ); myWarpVector->SetScaleFactor( myScaleFactor * theMapScale ); Modified(); diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index da77134c..d17b732c 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -217,7 +217,7 @@ public: //! Get resolution of the Geometrical Sphere. int - GetResolution() { return myResolution; } + GetResolution(); //! Method for changing the Magnification parameter. void @@ -286,11 +286,13 @@ protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); virtual void - DoCopyMapper(VISU_PipeLine *thePipeLine); + DoCopyMapper(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); bool myIsDeformed; vtkFloatingPointType myScaleFactor; @@ -300,7 +302,6 @@ protected: vtkGlyph3D* myGlyph; vtkSphereSource* mySphereSource; - int myResolution; VISU_OpenGLPointSpriteMapper* myPSMapper; VISU::PGaussPtsIDMapper myGaussPtsIDMapper; diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.cxx b/src/PIPELINE/VISU_IsoSurfacesPL.cxx index 43894fbe..8c8b4cca 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.cxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.cxx @@ -53,14 +53,15 @@ VISU_IsoSurfacesPL void VISU_IsoSurfacesPL -::DoShallowCopy(VISU_PipeLine *thePipeLine) +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_IsoSurfacesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetNbParts(aPipeLine->GetNbParts()); vtkFloatingPointType aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()}; SetRange(aRange); } - Superclass::DoShallowCopy(thePipeLine); + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); } int diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.hxx b/src/PIPELINE/VISU_IsoSurfacesPL.hxx index 2422746d..10a0be3f 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.hxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.hxx @@ -96,7 +96,8 @@ protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); int myNbParts; vtkFloatingPointType myRange[2]; diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index af693934..3def82c5 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -328,6 +328,7 @@ void VISU_OpenGLPointSpriteMapper::InitShader() */ free( shader ); } + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetShaderVariable( const char* variable, float value ) { @@ -337,6 +338,7 @@ void VISU_OpenGLPointSpriteMapper::SetShaderVariable( const char* variable, floa vglVertexAttrib1fARB( vglGetAttribLocationARB( this->VertexProgram, variable ), value ); } + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetPrimitiveType( int thePrimitiveType ) { @@ -344,7 +346,9 @@ void VISU_OpenGLPointSpriteMapper::SetPrimitiveType( int thePrimitiveType ) return; this->PrimitiveType = thePrimitiveType; + this->Modified(); } + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetPointSpriteMode( int theMode ) { @@ -354,6 +358,7 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteMode( int theMode ) this->PointSpriteMode = theMode; this->Modified(); } + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp( float theClamp ) { @@ -361,7 +366,19 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp( float theClamp ) return; this->PointSpriteClamp = theClamp; + this->Modified(); } + +//----------------------------------------------------------------------------- +void VISU_OpenGLPointSpriteMapper::SetAverageCellSize(float theSize) +{ + if( fabs( this->AverageCellSize - theSize ) < Tolerance ) + return; + + this->AverageCellSize = theSize; + this->Modified(); +} + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetPointSpriteSize( float theSize ) { @@ -369,7 +386,9 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteSize( float theSize ) return; this->PointSpriteSize = theSize; + this->Modified(); } + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize( float theMinSize ) { @@ -377,7 +396,9 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize( float theMinSize ) return; this->PointSpriteMinSize = theMinSize; + this->Modified(); } + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetPointSpriteMaxSize( float theMaxSize ) { @@ -385,7 +406,9 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteMaxSize( float theMaxSize ) return; this->PointSpriteMaxSize = theMaxSize; + this->Modified(); } + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification( float theMagnification ) { @@ -393,7 +416,9 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification( float theMagnifi return; this->PointSpriteMagnification = theMagnification; + this->Modified(); } + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold( float theAlphaThreshold ) { @@ -401,7 +426,9 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold( float theAlphaT return; this->PointSpriteAlphaThreshold = theAlphaThreshold; + this->Modified(); } + //----------------------------------------------------------------------------- bool VISU_OpenGLPointSpriteMapper::InitExtensions() { @@ -605,6 +632,7 @@ void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act) if( this->UsePointSprites ) //&& this->PrimitiveType == VISU_OpenGLPointSpriteMapper::PointSprite ) this->CleanupPointSprites(); } + //----------------------------------------------------------------------------- float VISU_OpenGLPointSpriteMapper::GetMaximumSupportedSize() { @@ -613,6 +641,7 @@ float VISU_OpenGLPointSpriteMapper::GetMaximumSupportedSize() return maximumSupportedSize; } + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::InitPointSprites() { @@ -656,6 +685,7 @@ void VISU_OpenGLPointSpriteMapper::InitPointSprites() // Disable material properties glDisable( GL_COLOR_MATERIAL ); } + //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::CleanupPointSprites() { @@ -678,8 +708,10 @@ void VISU_OpenGLPointSpriteMapper ::SetImageData( vtkImageData* theImageData ) { - //cout << "VISU_OpenGLPointSpriteMapper::SetImageData " << theImageData << endl; + if(GetImageData() == theImageData) + return; this->ImageData = theImageData; + this->Modified(); } vtkImageData* diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx index 6f99d0b0..1a07fd2b 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx @@ -97,13 +97,12 @@ public: * card for sprite display, then the quadratic factors are adjusted to * bring the size down. */ - vtkSetMacro(DefaultPointSize, float); - //! Get the initial point size to be used. vtkGetMacro(DefaultPointSize, float); //! Set Average Cell Size. - vtkSetMacro(AverageCellSize, float); + void + SetAverageCellSize(float theSize); //! Get Average Cell Size. vtkGetMacro(AverageCellSize, float); diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index bc6944a6..31597270 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -115,27 +115,35 @@ VISU_PipeLine //---------------------------------------------------------------------------- void VISU_PipeLine -::ShallowCopy(VISU_PipeLine *thePipeLine) +::ShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { SetImplicitFunction(thePipeLine->GetImplicitFunction()); - DoShallowCopy(thePipeLine); + DoShallowCopy(thePipeLine, theIsCopyInput); } //---------------------------------------------------------------------------- void VISU_PipeLine -::DoShallowCopy(VISU_PipeLine *thePipeLine) +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { - DoCopyMapper(thePipeLine); + DoCopyMapper(thePipeLine, theIsCopyInput); Build(); } //---------------------------------------------------------------------------- void VISU_PipeLine -::DoCopyMapper(VISU_PipeLine *thePipeLine) +::DoCopyMapper(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { - VISU::CopyMapper(GetMapper(), thePipeLine->GetMapper()); + if(theIsCopyInput) + SetIDMapper(thePipeLine->GetIDMapper()); + Update(); + VISU::CopyDataSetMapper(GetDataSetMapper(), + thePipeLine->GetDataSetMapper(), + theIsCopyInput); } //---------------------------------------------------------------------------- @@ -143,7 +151,7 @@ void VISU_PipeLine ::SameAs(VISU_PipeLine *thePipeLine) { - DoShallowCopy(thePipeLine); + DoShallowCopy(thePipeLine, false); } //---------------------------------------------------------------------------- @@ -202,6 +210,15 @@ VISU_PipeLine return myMapper.GetPointer(); } +//---------------------------------------------------------------------------- +vtkDataSetMapper* +VISU_PipeLine +::GetDataSetMapper() +{ + GetMapper(); + return myMapper.GetPointer(); +} + //---------------------------------------------------------------------------- void VISU_PipeLine diff --git a/src/PIPELINE/VISU_PipeLine.hxx b/src/PIPELINE/VISU_PipeLine.hxx index 251637ff..5a6a22a4 100644 --- a/src/PIPELINE/VISU_PipeLine.hxx +++ b/src/PIPELINE/VISU_PipeLine.hxx @@ -105,7 +105,8 @@ public: virtual void - ShallowCopy(VISU_PipeLine *thePipeLine); + ShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); virtual void @@ -133,6 +134,10 @@ public: TMapper* GetMapper(); + virtual + vtkDataSetMapper* + GetDataSetMapper(); + virtual void Init() = 0; @@ -229,11 +234,13 @@ protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); virtual void - DoCopyMapper(VISU_PipeLine *thePipeLine); + DoCopyMapper(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); virtual TInput* diff --git a/src/PIPELINE/VISU_PipeLineUtils.cxx b/src/PIPELINE/VISU_PipeLineUtils.cxx index 22a35362..7525426d 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.cxx +++ b/src/PIPELINE/VISU_PipeLineUtils.cxx @@ -50,24 +50,35 @@ VISU::Sub(const vtkFloatingPointType A[3], namespace VISU { bool - CheckIsSameRange(vtkFloatingPointType* theTarget, - vtkFloatingPointType* theSource) + CheckIsSameValue(vtkFloatingPointType theTarget, + vtkFloatingPointType theSource) { static vtkFloatingPointType TOL = 10.0 / VTK_LARGE_FLOAT; - if(fabs(theTarget[0] - theSource[0]) + fabs(theTarget[1] - theSource[1]) < TOL) + if(fabs(theTarget - theSource) < TOL) return true; return false; -} + } + + bool + CheckIsSameRange(vtkFloatingPointType* theTarget, + vtkFloatingPointType* theSource) + { + return CheckIsSameValue(theTarget[0], theSource[0]) && + CheckIsSameValue(theTarget[1], theSource[1]); + } void CopyMapper(vtkMapper* theTarget, - vtkMapper* theSource) + vtkMapper* theSource, + bool theIsCopyInput) { // To customize vtkMapper::ShallowCopy ... - theTarget->SetLookupTable(theSource->GetLookupTable()); theTarget->SetScalarVisibility(theSource->GetScalarVisibility()); - if(!CheckIsSameRange(theTarget->GetScalarRange(), theSource->GetScalarRange())) - theTarget->SetScalarRange(theSource->GetScalarRange()); + if(theIsCopyInput){ + vtkFloatingPointType* aScalarRange = theSource->GetScalarRange(); + if(!CheckIsSameRange(theTarget->GetScalarRange(), aScalarRange)) + theTarget->SetScalarRange(aScalarRange); + } theTarget->SetColorMode(theSource->GetColorMode()); theTarget->SetScalarMode(theSource->GetScalarMode()); theTarget->SetImmediateModeRendering(theSource->GetImmediateModeRendering()); @@ -81,22 +92,34 @@ namespace VISU theTarget->SetClippingPlanes(theSource->GetClippingPlanes()); } + void + CopyDataSetMapper(vtkDataSetMapper* theTarget, + vtkDataSetMapper* theSource, + bool theIsCopyInput) + { + // To customize vtkDataSetMapper::ShallowCopy ... + //theTarget->SetInput(theSource->GetInput()); + CopyMapper(theTarget, theSource, theIsCopyInput); + } + void CopyPolyDataMapper(vtkPolyDataMapper* theTarget, - vtkPolyDataMapper* theSource) + vtkPolyDataMapper* theSource, + bool theIsCopyInput) { // To customize vtkPolyDataMapper::ShallowCopy ... - //aTargetMapper->SetInput(aMapper->GetInput()); + //theTarget->SetInput(theSource->GetInput()); theTarget->SetGhostLevel(theSource->GetGhostLevel()); theTarget->SetNumberOfPieces(theSource->GetNumberOfPieces()); theTarget->SetNumberOfSubPieces(theSource->GetNumberOfSubPieces()); - CopyMapper(theTarget, theSource); + CopyMapper(theTarget, theSource, theIsCopyInput); } void CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget, - VISU_OpenGLPointSpriteMapper* theSource) + VISU_OpenGLPointSpriteMapper* theSource, + bool theIsCopyInput) { // To customize VISU_OpenGLPointSpriteMapper::ShallowCopy ... theTarget->SetPrimitiveType( theSource->GetPrimitiveType() ); @@ -112,6 +135,6 @@ namespace VISU theTarget->SetImageData( theSource->GetImageData() ); theTarget->SetPointSpriteAlphaThreshold( theSource->GetPointSpriteAlphaThreshold() ); - CopyPolyDataMapper(theTarget, theSource); + CopyPolyDataMapper(theTarget, theSource, theIsCopyInput); } } diff --git a/src/PIPELINE/VISU_PipeLineUtils.hxx b/src/PIPELINE/VISU_PipeLineUtils.hxx index e4a655e9..b37daee0 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.hxx +++ b/src/PIPELINE/VISU_PipeLineUtils.hxx @@ -99,24 +99,33 @@ namespace VISU theTItem->SetInput(theFieldTransform->GetUnstructuredGridOutput()); } + //! Checks whether the float values are the same or not + bool + CheckIsSameValue(vtkFloatingPointType theTarget, + vtkFloatingPointType theSource); + //! Checks whether the scalar range is the same or not bool CheckIsSameRange(vtkFloatingPointType* theTarget, vtkFloatingPointType* theSource); - //! Customizes vtkMapper::ShallowCopy + //! Customizes vtkDataSetMapper::ShallowCopy void - CopyMapper(vtkMapper* theTarget, vtkMapper* theSource); + CopyDataSetMapper(vtkDataSetMapper* theTarget, + vtkDataSetMapper* theSource, + bool theIsCopyInput); //! Customizes vtkPolyDataMapper::ShallowCopy void CopyPolyDataMapper(vtkPolyDataMapper* theTarget, - vtkPolyDataMapper* theSource); + vtkPolyDataMapper* theSource, + bool theIsCopyInput); //! Customizes VISU_OpenGLPointSpriteMapper::ShallowCopy void CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget, - VISU_OpenGLPointSpriteMapper* theSource); + VISU_OpenGLPointSpriteMapper* theSource, + bool theIsCopyInput); } #endif diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index dbdf62ab..898b5740 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -66,7 +66,8 @@ VISU_Plot3DPL::~VISU_Plot3DPL() void VISU_Plot3DPL:: -DoShallowCopy(VISU_PipeLine *thePipeLine) +DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_Plot3DPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation (aPipeLine->GetPlaneOrientation(), @@ -77,7 +78,7 @@ DoShallowCopy(VISU_PipeLine *thePipeLine) SetContourPrs( aPipeLine->GetIsContourPrs() ); SetNumberOfContours( aPipeLine->GetNumberOfContours() ); } - Superclass::DoShallowCopy(thePipeLine); + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); } VISU_CutPlanesPL::PlaneOrientation diff --git a/src/PIPELINE/VISU_Plot3DPL.hxx b/src/PIPELINE/VISU_Plot3DPL.hxx index 733f65be..81f47c49 100644 --- a/src/PIPELINE/VISU_Plot3DPL.hxx +++ b/src/PIPELINE/VISU_Plot3DPL.hxx @@ -126,7 +126,8 @@ protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); vtkFloatingPointType myAngle[3]; bool myIsRelative, myIsContour; diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index 73922a8b..cfd0068f 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -194,7 +194,8 @@ VISU_ScalarMapOnDeformedShapePL */ void VISU_ScalarMapOnDeformedShapePL -::DoShallowCopy(VISU_PipeLine *thePipeLine) +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast(thePipeLine)){ SetScale(aPipeLine->GetScale()); @@ -203,7 +204,7 @@ VISU_ScalarMapOnDeformedShapePL aPipeLine->GetSourceRange(aRange); SetScalarRange(aRange); } - Superclass::DoShallowCopy(thePipeLine); + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); } /*! diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx index b57f0c1b..b09ed168 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx @@ -112,7 +112,8 @@ protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); vtkFloatingPointType myScaleFactor; vtkWarpVector *myDeformVectors; diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index 04d4c27a..1ad9bbe6 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -70,16 +70,18 @@ VISU_ScalarMapPL //---------------------------------------------------------------------------- void VISU_ScalarMapPL -::DoShallowCopy(VISU_PipeLine *thePipeLine) +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_ScalarMapPL *aPipeLine = dynamic_cast(thePipeLine)){ - SetScalarRange(aPipeLine->GetScalarRange()); + if(theIsCopyInput) + SetScalarRange(aPipeLine->GetScalarRange()); SetScalarMode(aPipeLine->GetScalarMode()); SetNbColors(aPipeLine->GetNbColors()); SetScaling(aPipeLine->GetScaling()); SetMapScale(aPipeLine->GetMapScale()); } - Superclass::DoShallowCopy(thePipeLine); + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); } @@ -116,7 +118,6 @@ VISU_ScalarMapPL } // myExtractor->SetScalarMode(theScalarMode); - Modified(); } @@ -137,7 +138,6 @@ VISU_ScalarMapPL myFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Log10)); else myFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Ident)); - Modified(); } @@ -153,9 +153,7 @@ void VISU_ScalarMapPL ::SetScalarRange(vtkFloatingPointType theRange[2]) { - //cout << "VISU_ScalarMapPL::SetScalarRange" << endl; if(!VISU::CheckIsSameRange(GetScalarRange(), theRange)){ - //cout << "( " << theRange[0] << " : " << theRange[1] << " )"<< endl; myFieldTransform->SetScalarRange(theRange); myBarTable->SetRange(theRange); } @@ -187,7 +185,6 @@ VISU_ScalarMapPL { myMapperTable->SetNumberOfColors(theNbColors); myBarTable->SetNumberOfColors(theNbColors); - Modified(); } int diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index 97720d68..9d976381 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -146,7 +146,8 @@ protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); VISU_LookupTable* myMapperTable; VISU_LookupTable* myBarTable; diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index b0b23805..aeb1c9ed 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -79,7 +79,8 @@ VISU_StreamLinesPL void VISU_StreamLinesPL -::DoShallowCopy(VISU_PipeLine *thePipeLine) +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_StreamLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetParams(aPipeLine->GetIntegrationStep(), @@ -89,7 +90,7 @@ VISU_StreamLinesPL aPipeLine->GetUsedPoints(), aPipeLine->GetDirection()); } - Superclass::DoShallowCopy(thePipeLine); + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); } diff --git a/src/PIPELINE/VISU_StreamLinesPL.hxx b/src/PIPELINE/VISU_StreamLinesPL.hxx index 35cee6ab..747e97e0 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.hxx +++ b/src/PIPELINE/VISU_StreamLinesPL.hxx @@ -195,7 +195,8 @@ public: protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); static size_t diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx index 813b4116..2c10134b 100644 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ b/src/PIPELINE/VISU_VectorsPL.cxx @@ -72,13 +72,14 @@ VISU_VectorsPL void VISU_VectorsPL -::DoShallowCopy(VISU_PipeLine *thePipeLine) +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) { if(VISU_VectorsPL *aPipeLine = dynamic_cast(thePipeLine)){ SetGlyphType(aPipeLine->GetGlyphType()); SetGlyphPos(aPipeLine->GetGlyphPos()); } - Superclass::DoShallowCopy(thePipeLine); + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); } diff --git a/src/PIPELINE/VISU_VectorsPL.hxx b/src/PIPELINE/VISU_VectorsPL.hxx index b8b3e6ea..5e22f6da 100644 --- a/src/PIPELINE/VISU_VectorsPL.hxx +++ b/src/PIPELINE/VISU_VectorsPL.hxx @@ -119,7 +119,8 @@ protected: virtual void - DoShallowCopy(VISU_PipeLine *thePipeLine); + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); GlyphType myTypeGlyph; GlyphPos myPosGlyph; diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index d8f8cf08..778d0526 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -639,9 +639,7 @@ VISU::GaussPoints_i // We create a new PipeLine instance in order to provide // different representations for different actors (basic and segmented) VISU_GaussPointsPL* aPipeLine = VISU_GaussPointsPL::New(); - aPipeLine->SetGaussPtsIDMapper(myGaussPointsPL->GetGaussPtsIDMapper()); - aPipeLine->ShallowCopy(GetPipeLine()); - aPipeLine->Update(); + aPipeLine->ShallowCopy(GetPipeLine(), true); return aPipeLine; } diff --git a/src/VISU_I/VISU_Vectors_i.cc b/src/VISU_I/VISU_Vectors_i.cc index 7da7d785..7a95878b 100644 --- a/src/VISU_I/VISU_Vectors_i.cc +++ b/src/VISU_I/VISU_Vectors_i.cc @@ -264,9 +264,7 @@ VISU::Vectors_i ::GetActorPipeLine() { VISU_PipeLine* aPipeLine = VISU_VectorsPL::New(); - aPipeLine->SetIDMapper(GetPipeLine()->GetIDMapper()); - aPipeLine->ShallowCopy(GetPipeLine()); - aPipeLine->Update(); + aPipeLine->ShallowCopy(GetPipeLine(), true); return aPipeLine; } @@ -314,7 +312,7 @@ VISU::Vectors_i TSuperClass::UpdateActor(anActor); anActor->GetProperty()->SetLineWidth(GetLineWidth()); if(VISU_VectorsPL* aVectorsPL = dynamic_cast(anActor->GetPipeLine())){ - aVectorsPL->ShallowCopy(GetPipeLine()); + aVectorsPL->ShallowCopy(GetPipeLine(), true); aVectorsPL->Update(); aVectorsPL->SetMapScale(myVectorsPL->GetMapScale()); } -- 2.39.2