From f3c5dbfa54544e50f61c6e369cdadfa8ca806564 Mon Sep 17 00:00:00 2001 From: ouv Date: Thu, 21 Dec 2006 15:24:06 +0000 Subject: [PATCH] To fix the bug with magnification --- src/OBJECT/VISU_GaussPtsAct.cxx | 20 +++++++++++++++++++ src/OBJECT/VISU_GaussPtsAct.h | 9 +++++++++ src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 15 +------------- src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx | 1 - 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 3618316b..e8520ebb 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -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); diff --git a/src/OBJECT/VISU_GaussPtsAct.h b/src/OBJECT/VISU_GaussPtsAct.h index 09ba29e6..35583a76 100644 --- a/src/OBJECT/VISU_GaussPtsAct.h +++ b/src/OBJECT/VISU_GaussPtsAct.h @@ -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(); diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index 3def82c5..569c106c 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -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)<<"; " diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx index 1a07fd2b..559f97f6 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx @@ -278,7 +278,6 @@ private: float AverageCellSize; vtkSmartPointer ImageData; - vtkPolyDataMapper* TempMapper; }; #endif -- 2.39.2