]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Flag for results/geometry mode added
authorouv <ouv@opencascade.com>
Mon, 3 Oct 2005 12:41:04 +0000 (12:41 +0000)
committerouv <ouv@opencascade.com>
Mon, 3 Oct 2005 12:41:04 +0000 (12:41 +0000)
src/PIPELINE/VISU_GaussPointsPL.cxx
src/PIPELINE/VISU_GaussPointsPL.hxx
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx
src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx

index 060659ac9c290a2d7ac0034e80b11a6d468e2116..c605cdbb260f9ba560ddb6bf9fbc52a8e5060229 100644 (file)
@@ -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();
index ffe339f69d9ccd4a4236a0de5389851f33d69255..0a310f08273837187cc6eedbc3815e1976c7238e 100644 (file)
@@ -90,6 +90,8 @@ public:
   bool
   GetBicolor();
 
+  void SetIsColored(bool theIsColored);
+
   float 
   GetMaximumSupportedSize();
 
index fb9f32a3cdbf7291a139d25aff76e8053af1114f..5e67af59d3e26155f21c9de3422c3de6760c3f33 100755 (executable)
@@ -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 );
   }
index 5bb6033d36698b80d0181af54a05ece0bd59acd1..848070cd5b7dc51145c44d472e42d82fc8cc940c 100755 (executable)
@@ -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;