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

sglLineWidth Class Reference

#include <sglStatelet.hpp>

Inheritance diagram for sglLineWidth::

sglStatelet sglObject List of all members.

Public Methods

 sglLineWidth (float line_width=1.0f)
virtual ~sglLineWidth ()
void setLineWidth (float line_width)
float getLineWidth () 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 glLineWidth() function which controls the width, in pixels, for rendered lines. The default value is one pixel.


   sglLineWidth *line_width = new sglLineWidth;   // the default of 1.
   line_width->setLineWidth(2.5f);                // 2.5 times large

Definition at line 1308 of file sglStatelet.hpp.

Constructor & Destructor Documentation

sglLineWidth::sglLineWidth ( float line_width = 1.0f ) [inline]

Constructor (and the default constructor).

line_width   The width of lines in pixels. This must be greater than zero, and is 1.0 by default. Values less than or equal to zero will result in the default width of 1.0.

Definition at line 1316 of file sglStatelet.hpp.

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

virtual destructor.

Definition at line 1321 of file sglStatelet.hpp.

Member Function Documentation

void sglLineWidth::setLineWidth ( float line_width )

Set the line width.

line_width   The width of lines in pixels. This must be greater than zero. Values less than zero will be set to 1.0.

Referenced by sglLineWidth().

float sglLineWidth::getLineWidth ( ) const [inline]

Query the current line width

The current line width.

Definition at line 1332 of file sglStatelet.hpp.

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

Apply this state change to the current rendering state.

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 sglLineWidth::getSorted ( ) const [inline, virtual]

Query the sorting mode for this statelet.

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 1338 of file sglStatelet.hpp.

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

Output the state of this node to the specified ostream.

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