From 8ba58f285c911fdca1b1d859a9a8405ef276f825 Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 18 Nov 2005 12:02:47 +0000 Subject: [PATCH] Fixed bug GVIEW10545 : Frame rate not goob (bis) --- src/OBJECT/VISU_GaussPtsAct.cxx | 2 -- src/PIPELINE/VISU_GaussPointsPL.cxx | 2 -- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 16 ++++++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 199be4ba..bdc73dfe 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -987,8 +987,6 @@ VISU_GaussPtsAct1 myOutsideDeviceActor->SetPipeLine(aPipeLine); aPipeLine->Delete(); - myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff(); - SALOME_ExtractGeometry* anExtractGeometry = aPipeLine->GetExtractGeometryFilter(); anExtractGeometry->SetExtractBoundaryCells(true); anExtractGeometry->SetExtractInside(true); diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index caf88531..7e02f9c8 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -116,8 +116,6 @@ VISU_GaussPointsPL myExtractor->SetInput( GetInput2() ); myFieldTransform->SetInput( myExtractor->GetOutput() ); - //myPSMapper->SetQuadraticPointDistanceAttenuation( 1.0, 20.0, 0.0 ); - //myPSMapper->SetImmediateModeRendering( 1 ); myPSMapper->SetColorModeToMapScalars(); myPSMapper->ScalarVisibilityOn(); diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index a56d3f4c..b2277081 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -306,6 +306,11 @@ void VISU_OpenGLPointSpriteMapper::SetShaderVariable( const char* variable, floa //----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetPointSpriteResults( bool theResults ) { + if( theResults ) + this->ScalarVisibilityOn(); + else + this->ScalarVisibilityOff(); + float aResults = theResults ? 1.0 : 0.0; //cout << "SetPointSpriteResults " << this << " " << aResults << endl; @@ -426,12 +431,6 @@ void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act) // make sure our window is current ren->GetRenderWindow()->MakeCurrent(); - // For vertex coloring, this sets this->Colors as side effect. - // Color arrays are cached. If nothing has changed, - // then the scalars do not have to be regenerted. - this->ActorOpacity = act->GetProperty()->GetOpacity(); - this->MapScalars(this->ActorOpacity); - // Initializing the texture for Point Sprites if( this->UseTextures ) this->InitTextures(); @@ -446,6 +445,9 @@ void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act) act->GetProperty()->GetMTime() > this->BuildTime || ren->GetRenderWindow() != this->LastWindow) { + // sets this->Colors as side effect + this->MapScalars( act->GetProperty()->GetOpacity() ); + if (!this->ImmediateModeRendering && !this->GetGlobalImmediateModeRendering()) { @@ -490,6 +492,8 @@ void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act) if (this->ImmediateModeRendering || this->GetGlobalImmediateModeRendering()) { + this->MapScalars( act->GetProperty()->GetOpacity() ); + // Time the actual drawing this->Timer->StartTimer(); this->Draw(ren,act); -- 2.39.2