Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglLineStipple Class Reference

#include <sglStatelet.hpp>

Inheritance diagram for sglLineStipple::

sglStatelet sglObject List of all members.

Public Methods

 sglLineStipple (GLushort pattern=0xffff, int factor=1)
virtual ~sglLineStipple ()
void setLineStipple (GLushort pattern, int factor)
void getLineStipple (GLushort &pattern, int &factor) const
void apply (sglCurrState *curr_state) const
virtual bool getSorted () const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Detailed Description

This statelet encapsulates OpenGL's glLineStipple() and glEnable(GL_LINE_STIPPLE) functions which controls the stippling pattern for line primitives. This is disabled by default (by setting the pattern is 0xffff). The factor scales the stipple pattern and can take on a value in the range [1..255]. Values outside this range will be clamped.

Example:

   sglLineStipple *lstipple = new sglLineStipple(0xf0f0, 1);  // enable - - -
   lstipple->setLineStipple(0x5555, 1);                       // enable .......
   lstipple->setLineStipple(0xffff, 1);                       // disable

Definition at line 1230 of file sglStatelet.hpp.


Constructor & Destructor Documentation

sglLineStipple::sglLineStipple ( GLushort pattern = 0xffff,
int factor = 1 ) [inline]
 

Constructor (also the default constructor).

Parameters:
pattern   The bit pattern (16 bits) defining the basic pattern where each 1 bit defines an on pixel and each 0 bit defines an off pixel. The default is 0xffff which is all on and disables this statelet.
factor   The scale factor for the pattern. The default is 1 (no scale), and larger scales factors lengthen the pattern in integer multiples. This value will be clamped to the range [1..255].

Definition at line 1242 of file sglStatelet.hpp.

sglLineStipple::~sglLineStipple ( ) [inline, virtual]
 

virtual destructor.

Definition at line 1247 of file sglStatelet.hpp.


Member Function Documentation

void sglLineStipple::setLineStipple ( GLushort pattern,
int factor )
 

Set the line stipple pattern and scale factor.

Parameters:
pattern   The bit pattern (16 bits) defining the basic pattern where each 1 bit defines an on pixel and each 0 bit defines an off pixel. A pattern of 0xffff (all bits on) and disables this statelet.
factor   The scale factor for the pattern. Scale factors larger larger than one lengthen the pattern in integer multiples. This value will be clamped to the range [1..255].

Referenced by sglLineStipple().

void sglLineStipple::getLineStipple ( GLushort & pattern,
int & factor ) const [inline]
 

Query the current stipple pattern and scale factor.

Parameters:
pattern   On return, contains the current bit pattern.
factor   On return, contains the current scale factor.

Definition at line 1264 of file sglStatelet.hpp.

void sglLineStipple::apply ( sglCurrState * curr_state ) const [virtual]
 

Apply this state change to the current rendering state.

Parameters:
curr_state   Required for statelets that affect one another. For example the sglTransparency sets up depth mask and blending modes which interact with the sglBlending and sglDepthMask statelets, and the curr_state object is used to resolve these internal issues.

Reimplemented from sglStatelet.

bool sglLineStipple::getSorted ( ) const [inline, virtual]
 

Query the sorting mode for this statelet.

Returns:
true if this type of statelet should be sorted by pointer rather than using m_index to index into an array. The defualt implementation is the latter, but if a statelet can take on an inordinate number of states (e.g. a floating point parameter) then true should be returned.

Reimplemented from sglStatelet.

Definition at line 1274 of file sglStatelet.hpp.

virtual void sglLineStipple::printInfo ( ostream & ostrm,
const char * indent_string ) const [virtual]
 

Output the state of this node to the specified ostream.

Parameters:
ostrm   the ostream to which the output is sent
indent_string   the string (usually spaces) that is output at the beginning of every line of output

Reimplemented from sglStatelet.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:08 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001