From 954d1fe65c128d3e914b137d5b1021d06757a4f3 Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 3 Oct 2005 12:41:04 +0000 Subject: [PATCH] Flag for results/geometry mode added --- src/PIPELINE/VISU_GaussPointsPL.cxx | 10 ++++++++-- src/PIPELINE/VISU_GaussPointsPL.hxx | 2 ++ src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 15 ++++++++++++++- src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx | 8 ++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 060659ac..c605cdbb 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -211,6 +211,14 @@ VISU_GaussPointsPL return myMapperTable->GetBicolor(); } +//---------------------------------------------------------------------------- +void +VISU_GaussPointsPL +::SetIsColored(bool theIsColored) +{ + myPSMapper->SetPointSpriteResults( theIsColored ); +} + //---------------------------------------------------------------------------- float VISU_GaussPointsPL @@ -247,7 +255,6 @@ VISU_GaussPointsPL ::SetMinSize(float theMinSize) { myMinSize = theMinSize; - myPSMapper->SetPointSpriteSize( 0.0 ); myPSMapper->SetPointSpriteMinSize( 1000.0 * myAverageCellSize * myMinSize / 100.0 ); Modified(); @@ -259,7 +266,6 @@ VISU_GaussPointsPL ::SetMaxSize(float theMaxSize) { myMaxSize = theMaxSize; - myPSMapper->SetPointSpriteSize( 0.0 ); myPSMapper->SetPointSpriteMaxSize( 1000.0 * myAverageCellSize * myMaxSize / 100.0 ); Modified(); diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index ffe339f6..0a310f08 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -90,6 +90,8 @@ public: bool GetBicolor(); + void SetIsColored(bool theIsColored); + float GetMaximumSupportedSize(); diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index fb9f32a3..5e67af59 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -133,6 +133,8 @@ VISU_OpenGLPointSpriteMapper::VISU_OpenGLPointSpriteMapper() this->UseTextures = true; this->UseShader = true; + this->PointSpriteResults = true; + this->PointSpriteClamp = 100.0; this->PointSpriteSize = 0.0; this->PointSpriteMinSize = 15.0; @@ -170,6 +172,8 @@ void VISU_OpenGLPointSpriteMapper::ShallowCopy( vtkAbstractMapper* mapper ) VISU_OpenGLPointSpriteMapper* m = VISU_OpenGLPointSpriteMapper::SafeDownCast(mapper); if( m != NULL ) { + this->SetPointSpriteResults( m->GetPointSpriteResults() ); + this->SetPointSpriteClamp( m->GetPointSpriteClamp() ); this->SetPointSpriteSize( m->GetPointSpriteSize() ); this->SetPointSpriteMinSize( m->GetPointSpriteMinSize() ); @@ -306,6 +310,14 @@ void VISU_OpenGLPointSpriteMapper::SetShaderVariable( const char* variable, floa } #endif //----------------------------------------------------------------------------- +void VISU_OpenGLPointSpriteMapper::SetPointSpriteResults( bool theResults ) +{ + this->PointSpriteResults = theResults; +#ifdef GL_ARB_shader_objects + this->SetShaderVariable( "results", theResults ); +#endif +} +//----------------------------------------------------------------------------- void VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp( float theClamp ) { this->PointSpriteClamp = theClamp; @@ -403,10 +415,11 @@ void VISU_OpenGLPointSpriteMapper::InitExtensions() this->SetShaderVariable( "attrib1", 1.0 ); this->SetShaderVariable( "attrib2", 1.0 ); this->SetShaderVariable( "attrib3", 1.0 ); + this->SetShaderVariable( "results", this->PointSpriteResults ); this->SetShaderVariable( "clamp", this->PointSpriteClamp ); this->SetShaderVariable( "geomSize", this->PointSpriteSize ); - this->SetShaderVariable( "minSize", this->PointSpriteMinSize ); this->SetShaderVariable( "attrib4", 1.0 ); + this->SetShaderVariable( "minSize", this->PointSpriteMinSize ); this->SetShaderVariable( "maxSize", this->PointSpriteMaxSize ); this->SetShaderVariable( "magnification", this->PointSpriteMagnification ); } diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx index 5bb6033d..848070cd 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx @@ -151,6 +151,11 @@ public: vtkSetMacro(UseShader, bool); vtkGetMacro(UseShader, bool); + // Description: + // Point Sprite drawing mode + // (Results - multicolor, Geometry - fixed color) + vtkGetMacro(PointSpriteResults, bool); + // Description: // Point Sprite size parameters vtkGetMacro(PointSpriteClamp, float); @@ -159,6 +164,7 @@ public: vtkGetMacro(PointSpriteMaxSize, float); vtkGetMacro(PointSpriteMagnification, float); + void SetPointSpriteResults( bool ); void SetPointSpriteClamp( float ); void SetPointSpriteSize( float ); void SetPointSpriteMinSize( float ); @@ -221,6 +227,8 @@ protected: void* OpenGLLibrary; #endif + bool PointSpriteResults; + float PointSpriteClamp; float PointSpriteSize; float PointSpriteMinSize; -- 2.39.2