]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To implement more accurate VISU_PipeLine::ShallowCopy method
authorapo <apo@opencascade.com>
Mon, 18 Dec 2006 12:52:37 +0000 (12:52 +0000)
committerapo <apo@opencascade.com>
Mon, 18 Dec 2006 12:52:37 +0000 (12:52 +0000)
32 files changed:
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_Actor.h
src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_GaussPtsDeviceActor.cxx
src/PIPELINE/VISU_CutLinesPL.cxx
src/PIPELINE/VISU_CutLinesPL.hxx
src/PIPELINE/VISU_CutPlanesPL.cxx
src/PIPELINE/VISU_CutPlanesPL.hxx
src/PIPELINE/VISU_DeformedShapePL.cxx
src/PIPELINE/VISU_DeformedShapePL.hxx
src/PIPELINE/VISU_GaussPointsPL.cxx
src/PIPELINE/VISU_GaussPointsPL.hxx
src/PIPELINE/VISU_IsoSurfacesPL.cxx
src/PIPELINE/VISU_IsoSurfacesPL.hxx
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx
src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx
src/PIPELINE/VISU_PipeLine.cxx
src/PIPELINE/VISU_PipeLine.hxx
src/PIPELINE/VISU_PipeLineUtils.cxx
src/PIPELINE/VISU_PipeLineUtils.hxx
src/PIPELINE/VISU_Plot3DPL.cxx
src/PIPELINE/VISU_Plot3DPL.hxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx
src/PIPELINE/VISU_ScalarMapPL.cxx
src/PIPELINE/VISU_ScalarMapPL.hxx
src/PIPELINE/VISU_StreamLinesPL.cxx
src/PIPELINE/VISU_StreamLinesPL.hxx
src/PIPELINE/VISU_VectorsPL.cxx
src/PIPELINE/VISU_VectorsPL.hxx
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_Vectors_i.cc

index c03cb0de9ceda34233b745299945c9de7f3621c4..242d4fbb3f5d263e7936fe42efe70dba67662f1d 100644 (file)
@@ -32,8 +32,6 @@
 #include "VTKViewer_GeometryFilter.h"
 #include "VTKViewer_PassThroughFilter.h"
  
-#include "VISU_PipeLineUtils.hxx"
-
 #include <stdexcept>
 #include <sstream>
 
@@ -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
index fab9ea4caaf135db223b949319f7d1798d47e511..8d60bf54b14206011793a5439fa82aa4fcecde10 100644 (file)
@@ -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
index c87601295895e91e909076f7573610daee1ab025..3618316b211daa2ce93806c589c1ac0c2d9df6ae 100644 (file)
@@ -201,11 +201,11 @@ VISU_GaussPtsAct
 ::ShallowCopyPL(VISU_PipeLine* thePipeLine)
 {
   if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::ShallowCopyPL - this = "<<this);
-
+  
   Superclass::ShallowCopyPL(thePipeLine);
-
+  
   UpdateInsideCursorSettings();
-
+  
   Highlight(isHighlighted());
 }
 
@@ -249,7 +249,7 @@ VISU_GaussPtsAct
   vtkDataSet* aDataSet = myDeviceActor->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);
index 1bf2ec18671e7d16a419ade72537755f78d711fa..55e3270975a5efd108d8faa2bdca0dbf10d1f415 100644 (file)
@@ -218,7 +218,7 @@ void
 VISU_GaussPtsDeviceActor
 ::ShallowCopyPL(VISU_GaussPointsPL* thePipeLine)
 {
-  myPipeLine->ShallowCopy(thePipeLine);
+  myPipeLine->ShallowCopy(thePipeLine, true);
 }
 
 
index 2a278253dd1008dfc0d4116bfab891e1c283dac5..2fd62fde7a75bbe4cc9e3ad06159c6fdd75c3b0e 100644 (file)
@@ -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<VISU_CutLinesPL*>(thePipeLine)){
     SetOrientation(aPipeLine->GetPlaneOrientation(1),
@@ -54,7 +55,7 @@ VISU_CutLinesPL
     else
       SetPosition(aPipeLine->GetPosition());
   }
-  Superclass::DoShallowCopy(thePipeLine);
+  Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
 }
 
 void
index b72654c03cac2531179c9750edd389f68b79c028..4f2f6ea60929360a2b95d78bfa4c1f3d8300d1c0 100644 (file)
@@ -123,7 +123,8 @@ protected:
 
   virtual
   void
-  DoShallowCopy(VISU_PipeLine *thePipeLine);
+  DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput);
 
   vtkFloatingPointType myDirLn[3];
   vtkFloatingPointType myRealDirLn[3];
index a96b049a45d5b822e24e6bae2f7544d1c242e24d..3eb878271d3c4b312064bffb2b9156683d0647e0 100644 (file)
@@ -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<VISU_CutPlanesPL*>(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
index 79a59ad14dc17e783fb97b39bdb87b2262e4bb58..145b30ca3afe12dafc16114b349e323937832d6e 100644 (file)
@@ -186,7 +186,8 @@ protected:
 
   virtual
   void
-  DoShallowCopy(VISU_PipeLine *thePipeLine);
+  DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput);
 
   void
   SetPartPosition(int theNum = 0);
index d3d431a3265c08182c10bf8d8af25510a0ca5a71..b1817198472f62b1870804f24661a9dc0803e967 100644 (file)
@@ -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<VISU_DeformedShapePL*>(thePipeLine)){
     SetScale(aPipeLine->GetScale());
   }
-  Superclass::DoShallowCopy(thePipeLine);
+  Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
 }
 
 vtkFloatingPointType
index e842588b675ffd0b977408f1512552c98da4c950..3c9e68752aacaaa64dd13a3fe93bb668f7f77909 100644 (file)
@@ -85,7 +85,8 @@ protected:
 
   virtual
   void
-  DoShallowCopy(VISU_PipeLine *thePipeLine);
+  DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput);
 
   vtkFloatingPointType myScaleFactor;
   vtkWarpVector *myWarpVector;
index f3edad74d503bb22b10545030a33f88fb11c5f90..12c36f84f5ac77ca890cb7371139b2c9ce267782 100644 (file)
@@ -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<VISU_GaussPointsPL*>(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<VISU_GaussPointsPL*>(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();
index da77134ce72d76adcedb340b8f6531d8b107e238..d17b732c956e7ba34c5421e954d069832690758d 100644 (file)
@@ -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;
index 43894fbed1b0c012623bc7c5f5d637c607c73ffe..8c8b4cca9352df63a8ff38c02037401b52353d2c 100644 (file)
@@ -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<VISU_IsoSurfacesPL*>(thePipeLine)){
     SetNbParts(aPipeLine->GetNbParts());
     vtkFloatingPointType aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()};
     SetRange(aRange);
   }
-  Superclass::DoShallowCopy(thePipeLine);
+  Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
 }
 
 int
index 2422746d2d2c1f3e0a381fff1f4f624b93698b85..10a0be3fa0081551542e5a9120d73fe4c1ed6c63 100644 (file)
@@ -96,7 +96,8 @@ protected:
 
   virtual
   void
-  DoShallowCopy(VISU_PipeLine *thePipeLine);
+  DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput);
 
   int myNbParts;
   vtkFloatingPointType myRange[2];
index af69393439725112743f22d35198b38613653475..3def82c504baafdf0907dde870474b84f9c7faa8 100755 (executable)
@@ -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*
index 6f99d0b007c11353c49fea542094023eddacdcef..1a07fd2b29d6a9d2fbf4ef1cff80a7aca1ee9910 100755 (executable)
@@ -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);
index bc6944a67a416c634112bef38d28a5ec569b758b..315972700ab3c2a101107cfdb2ba749d5c337422 100644 (file)
@@ -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
index 251637ffecec6f96c5b12ced98c122f668658ab7..5a6a22a4235add40ece77717994db7194fbf0550 100644 (file)
@@ -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* 
index 22a35362b3bccd056e228f6e56b26b6742d608bb..7525426db0e6cab9d3842a46e2ba26f3739dd227 100644 (file)
@@ -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);
   }
 }
index e4a655e9f239095bcc3ee8df4e08a5af9e322755..b37daee047ea4382230ccc780632fe9752b5243f 100644 (file)
@@ -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
index dbdf62ab915e61197f6a190adfa18321c4b6f81a..898b574011fd933ecf12e20a68c710d7f6e4a067 100644 (file)
@@ -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<VISU_Plot3DPL*>(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
index 733f65beb16f038b0df467292a133b2672314b0e..81f47c491e7cd394b1547a9440d51f9038daecba 100644 (file)
@@ -126,7 +126,8 @@ protected:
 
   virtual
   void
-  DoShallowCopy(VISU_PipeLine *thePipeLine);
+  DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput);
 
   vtkFloatingPointType myAngle[3];
   bool myIsRelative, myIsContour;
index 73922a8bbbd04c91a8d09478557d060e8e866b7d..cfd0068fd20289a90c9ccbbcef59c6fc1babf20a 100644 (file)
@@ -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<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine)){
      SetScale(aPipeLine->GetScale());
@@ -203,7 +204,7 @@ VISU_ScalarMapOnDeformedShapePL
      aPipeLine->GetSourceRange(aRange);
      SetScalarRange(aRange);
   }
-  Superclass::DoShallowCopy(thePipeLine);
+  Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
 }
 
 /*!
index b57f0c1bd493c40bf7d89946924530f5b50c66f9..b09ed168ca89e1edd8508f9912c63a7e5e43f67b 100644 (file)
@@ -112,7 +112,8 @@ protected:
 
   virtual
   void
-  DoShallowCopy(VISU_PipeLine *thePipeLine);
+  DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput);
 
   vtkFloatingPointType myScaleFactor;
   vtkWarpVector  *myDeformVectors;
index 04d4c27a66ca5632f9664b079343ebc37694a16e..1ad9bbe6961e7a79a5db629a022fd0d6ce31c2e9 100644 (file)
@@ -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<VISU_ScalarMapPL*>(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
index 97720d6860d43839059c97b836edf1f2858d6b2c..9d976381324763777cc6f599baba74561d506714 100644 (file)
@@ -146,7 +146,8 @@ protected:
 
   virtual
   void
-  DoShallowCopy(VISU_PipeLine *thePipeLine);
+  DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput);
 
   VISU_LookupTable* myMapperTable;
   VISU_LookupTable* myBarTable;
index b0b238057e85515ab6feea9a35e4a6925bf8dd85..aeb1c9ed9d3a3c8bc73d7f7de41afa1999968beb 100644 (file)
@@ -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<VISU_StreamLinesPL*>(thePipeLine)){
     SetParams(aPipeLine->GetIntegrationStep(),
@@ -89,7 +90,7 @@ VISU_StreamLinesPL
              aPipeLine->GetUsedPoints(),
              aPipeLine->GetDirection());
   }
-  Superclass::DoShallowCopy(thePipeLine);
+  Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
 }
 
 
index 35cee6ab0db5c985113250f2e839adf3ba6e69ed..747e97e04fea2fe2141990e7a854967b204ee7bf 100644 (file)
@@ -195,7 +195,8 @@ public:
 protected:
   virtual
   void
-  DoShallowCopy(VISU_PipeLine *thePipeLine);
+  DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput);
 
   static 
   size_t
index 813b4116387c15172b4c416cf0ce94da0aa549b6..2c10134b92dfa3e8a0ca1c545bcde9c4e3098e77 100644 (file)
@@ -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<VISU_VectorsPL*>(thePipeLine)){
     SetGlyphType(aPipeLine->GetGlyphType());
     SetGlyphPos(aPipeLine->GetGlyphPos());
   }
-  Superclass::DoShallowCopy(thePipeLine);
+  Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
 }
 
 
index b8b3e6eaf763ff81de8a119d74e0ebc7cec8a75b..5e22f6dab483f608ac5d051d47e568a2ab3048b5 100644 (file)
@@ -119,7 +119,8 @@ protected:
 
   virtual
   void
-  DoShallowCopy(VISU_PipeLine *thePipeLine);
+  DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput);
 
   GlyphType myTypeGlyph;
   GlyphPos myPosGlyph;
index d8f8cf08199d60c4a3606788a3265e4f413eff81..778d0526ca6a9b46cd20eb82e868b81dd9b1ed0a 100644 (file)
@@ -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;
 }
 
index 7da7d785f256e8b58e821777df93cc541a566307..7a95878b392d2ff5ce2001df31b3ecc6837a2be9 100644 (file)
@@ -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<VISU_VectorsPL*>(anActor->GetPipeLine())){
-      aVectorsPL->ShallowCopy(GetPipeLine());
+      aVectorsPL->ShallowCopy(GetPipeLine(), true);
       aVectorsPL->Update();
       aVectorsPL->SetMapScale(myVectorsPL->GetMapScale());
     }