[vtkusers] Stipple patterns on lines

Sebastien BARRE seb-ml-vtk at barre.nom.fr
Wed Feb 14 16:11:59 EST 2001


At 14/02/2001 15:15, Amy Henderson wrote:
>What version of VTK are you using?  Sebastien Barre added that 
>functionality to vtkProperty last month.

Yes.
You will have to download the CVS or a nightly release, as it was not ready 
for the latest stable release.

I've added the following settings to vtkProperty and vtkProperty2D (and 
modified  vtkOpenGLProperty and vtkOpenGLPolyDataMapper2D accordingly).

   // Set/Get the stippling pattern of a Line, as a 16-bit binary pattern
   // (1 = pixel on, 0 = pixel off).
   // This is only implemented for OpenGL. The default is 0xFFFF.
   vtkSetMacro(LineStipplePattern,int);
   vtkGetMacro(LineStipplePattern,int);

   // Description:
   // Set/Get the stippling repeat factor of a Line, which specifies how
   // many times each bit in the pattern is to be repeated.
   // This is only implemented for OpenGL. The default is 1.
   vtkSetClampMacro(LineStippleRepeatFactor,int,1,VTK_LARGE_INTEGER);
   vtkGetMacro(LineStippleRepeatFactor,int);

It follows the OpenGL settings (and is not supported if your 3D API below 
VTK is not OpenGL).

I've added a graphics/exampleTcl/TestLineStipple.tcl script, an extended 
version of the squadViewer, where you can change the repeat factor and the 
pattern *interactively*, and watch the resulting line aspect.





More information about the vtkusers mailing list