\image html viewing13.png
<ul>
<li>\b Opacity - allows to set the value of opacity of the
-presentation between 0 (transparent) and 100 (opaque).</li>
+presentation between 0 (transparent) and 100 (opaque).
+\note For \ref gauss_points_presentations_page "Gauss Points"
+presentation, displayed by <b>Point Sprites</b> or <b>OpenGL Points</b>
+\ref primitive_types_page "primitives" this property allows only to
+switch between transparent and opaque modes. Textures are drawn in
+opaque mode as long as the opacity level is equal 100% and in
+transparent mode when opacity level is lower that 100% (note that
+they become invisible when the level is equal 0%).
+</li>
<li><b>Line Width</b> - allows to set the width of lines representing
edges of the presentation between 1 (thin) and 100 (thick).</li>
</ul>
}
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct
+::SetOpacity(vtkFloatingPointType theValue)
+{
+ GetGaussPointsPL()->SetOpacity(theValue);
+ Superclass::SetOpacity(theValue);
+}
+
+
//----------------------------------------------------------------------------
void
VISU_GaussPtsAct
unsigned long int
GetMemorySize();
+ //----------------------------------------------------------------------------
+ virtual
+ void
+ SetOpacity(vtkFloatingPointType theValue);
+
//----------------------------------------------------------------------------
virtual
void
}
+//----------------------------------------------------------------------------
+void
+VISU_GaussPointsPL
+::SetOpacity(vtkFloatingPointType theOpacity)
+{
+ GetPointSpriteMapper()->SetPointSpriteOpacity( theOpacity );
+}
+
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType
+VISU_GaussPointsPL
+::GetOpacity()
+{
+ return GetPointSpriteMapper()->GetPointSpriteOpacity();
+}
+
+
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
vtkFloatingPointType
GetAlphaThreshold();
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteOpacity.
+ void
+ SetOpacity(vtkFloatingPointType theOpacity);
+
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteOpacity, vtkFloatingPointType).
+ vtkFloatingPointType
+ GetOpacity();
+
//! Set resolution of the Geometrical Sphere.
void
SetResolution(int theResolution);
this->PointSpriteMagnification = 1.0;
this->PointSpriteAlphaThreshold = 0.5;
+ this->PointSpriteOpacity = 1.0;
this->PointSpriteTexture = 0;
this->UseOpenGLMapper = false;
glEnable( GL_POINT_SPRITE_ARB );
glEnable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB );
+ glPushAttrib( GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT | GL_LIGHTING_BIT );
+
+ this->RenderMode = this->PointSpriteOpacity < 1.0 ? VISU_OpenGLPointSpriteMapper::Accumulate : VISU_OpenGLPointSpriteMapper::Occlude;
+
switch (this->RenderMode)
{
case VISU_OpenGLPointSpriteMapper::Accumulate:
{
- glDisable(GL_DEPTH_TEST);
+ glDepthFunc( GL_LESS );
+ glEnable( GL_DEPTH_TEST );
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
void VISU_OpenGLPointSpriteMapper::CleanupPointSprites()
{
// Set GL params back to normal to stop other vtkMappers displaying wrongly
- glDisable( GL_ALPHA_TEST );
-
- glEnable( GL_BLEND );
-
- glEnable( GL_DEPTH_TEST );
- glEnable( GL_LIGHTING );
- glEnable( GL_COLOR_MATERIAL );
+ glPopAttrib();
glDisable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB );
glDisable( GL_POINT_SPRITE_ARB );
vtkPoints *points;
int noAbort = 1;
int cellScalars = 0;
- float tran;
-
- // get the transparency
- tran = theActor->GetProperty()->GetOpacity();
// if the primitives are invisable then get out of here
- if (tran <= 0.0)
+ if (this->PointSpriteOpacity <= 0.0)
{
return noAbort;
}
//! Get Point Sprite AlphaThreshold.
vtkGetMacro(PointSpriteAlphaThreshold, float);
+ //! Set Point Sprite Opacity
+ vtkSetMacro(PointSpriteOpacity, float);
+
+ //! Get Point Sprite Opacity
+ vtkGetMacro(PointSpriteOpacity, float);
+
//! Set ImageData for Point Sprite Texture.
void SetImageData(vtkImageData* theImageData);
GLuint PointSpriteTexture;
float PointSpriteAlphaThreshold;
+ float PointSpriteOpacity;
float AverageCellSize;