]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To fix the bug with magnification
authorouv <ouv@opencascade.com>
Thu, 21 Dec 2006 15:24:06 +0000 (15:24 +0000)
committerouv <ouv@opencascade.com>
Thu, 21 Dec 2006 15:24:06 +0000 (15:24 +0000)
src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_GaussPtsAct.h
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx
src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx

index 3618316b211daa2ce93806c589c1ac0c2d9df6ae..e8520ebb05fe028a2d05028a8197b40b503ee4a3 100644 (file)
@@ -1111,6 +1111,26 @@ VISU_GaussPtsAct
   Update();
 }
 
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct
+::UpdateFromFactory()
+{
+  myUpdateFromFactoryTime.Modified();
+  myActorFactory->UpdateActor(this);
+  Update();
+}
+
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_GaussPtsAct
+::GetMTime()
+{
+  unsigned long int aTime = Superclass::GetMTime();
+  aTime = std::max(aTime, myGaussPointsPL->GetPSMapper()->GetMTime() );
+  return aTime;
+}
+
 //==============================================================================
 vtkStandardNewMacro(VISU_GaussPtsAct1);
 
index 09ba29e6831bf2ca281316c8950d09b71e37d48a..35583a767900eda8087ea0ff44c64905bcc26378 100644 (file)
@@ -247,6 +247,15 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   int
   GetPickable();
 
+  //----------------------------------------------------------------------------
+  virtual
+  void
+  UpdateFromFactory();
+
+  virtual
+  unsigned long int 
+  GetMTime();
+
  protected:
   //----------------------------------------------------------------------------
   VISU_GaussPtsAct();
index 3def82c504baafdf0907dde870474b84f9c7faa8..569c106c6e9eb352470f163a36bbb6e097319a36 100755 (executable)
@@ -237,8 +237,6 @@ VISU_OpenGLPointSpriteMapper::VISU_OpenGLPointSpriteMapper()
   this->PointSpriteTexture       = 0;
 
   this->UseOpenGLMapper          = false;
-
-  this->TempMapper               = vtkPolyDataMapper::New();
 }
 //-----------------------------------------------------------------------------
 VISU_OpenGLPointSpriteMapper::~VISU_OpenGLPointSpriteMapper()
@@ -248,9 +246,6 @@ VISU_OpenGLPointSpriteMapper::~VISU_OpenGLPointSpriteMapper()
 
   if( this->LastWindow )
     this->ReleaseGraphicsResources(this->LastWindow);
-
-  if( this->TempMapper )
-    this->TempMapper->Delete();
 }
 
 //-----------------------------------------------------------------------------
@@ -346,7 +341,6 @@ void VISU_OpenGLPointSpriteMapper::SetPrimitiveType( int thePrimitiveType )
     return;
 
   this->PrimitiveType = thePrimitiveType;
-  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -366,7 +360,6 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp( float theClamp )
     return;
 
   this->PointSpriteClamp = theClamp;
-  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -376,7 +369,6 @@ void VISU_OpenGLPointSpriteMapper::SetAverageCellSize(float theSize)
     return;
 
   this->AverageCellSize = theSize;
-  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -386,7 +378,6 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteSize( float theSize )
     return;
 
   this->PointSpriteSize = theSize;
-  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -396,7 +387,6 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize( float theMinSize )
     return;
 
   this->PointSpriteMinSize = theMinSize;
-  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -406,7 +396,6 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteMaxSize( float theMaxSize )
     return;
 
   this->PointSpriteMaxSize = theMaxSize;
-  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -416,7 +405,6 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification( float theMagnifi
     return;
 
   this->PointSpriteMagnification = theMagnification;
-  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -426,7 +414,6 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold( float theAlphaT
     return;
 
   this->PointSpriteAlphaThreshold = theAlphaThreshold;
-  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -557,7 +544,7 @@ void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act)
        act->GetProperty()->GetMTime() > this->BuildTime ||
        ren->GetRenderWindow() != this->LastWindow)
   {
-    /* To contol when the mapper is recalculated
+    /* To control when the mapper is recalculated
     cout<<"VISU_OpenGLPointSpriteMapper::RenderPiece - "
        <<(this->GetMTime() > this->BuildTime)<<"; "
        <<(input->GetMTime() > this->BuildTime)<<"; "
index 1a07fd2b29d6a9d2fbf4ef1cff80a7aca1ee9910..559f97f6100e2817497dd50748963cb8385061c7 100755 (executable)
@@ -278,7 +278,6 @@ private:
   float             AverageCellSize;
 
   vtkSmartPointer<vtkImageData> ImageData;
-  vtkPolyDataMapper* TempMapper;
 };
 
 #endif