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

sglShadeModel Class Reference

#include <sglStatelet.hpp>

Inheritance diagram for sglShadeModel::

sglStatelet sglObject List of all members.

Public Types

enum  ShadeModelEnum {
  eFLAT = GL_FLAT,
  eSMOOTH = GL_SMOOTH
}

Public Methods

 sglShadeModel (ShadeModelEnum model=eSMOOTH)
virtual ~sglShadeModel ()
void setShadeModel (ShadeModelEnum model)
ShadeModelEnum getShadeModel () const
void apply (sglCurrState *curr_state) const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Protected Attributes

ShadeModelEnum m_model

Detailed Description

This statelet encapsulates OpenGL's glShadeModel() function which sets the shading model to either flat or smooth (the default).

Example:

   sglShadeModel *shade_model = new sglShadeModel;    // default: smooth
   shade_model->setShadeModel(sglShadeModel::eFLAT);  // flat shading

Definition at line 2095 of file sglStatelet.hpp.


Member Enumeration Documentation

enum sglShadeModel::ShadeModelEnum
 

The shade model type tokens.

Enumeration values:
eFLAT   flat shading.
eSMOOTH   smooth (or Gouraud) shading.

Definition at line 2099 of file sglStatelet.hpp.


Constructor & Destructor Documentation

sglShadeModel::sglShadeModel ( ShadeModelEnum model = eSMOOTH ) [inline]
 

Constructor (also the default constructor)

Parameters:
model   One of the ShadeModelEnum tokens: eFLAT for flat shading, or eSMOOTH (the default) for Gouraud shading.

Definition at line 2113 of file sglStatelet.hpp.

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

virtual destructor.

Definition at line 2117 of file sglStatelet.hpp.


Member Function Documentation

void sglShadeModel::setShadeModel ( ShadeModelEnum model ) [inline]
 

Set the shading model.

Parameters:
model   One of the ShadeModelEnum tokens: eFLAT for flat shading, or eSMOOTH for Gouraud shading.

Definition at line 2123 of file sglStatelet.hpp.

ShadeModelEnum sglShadeModel::getShadeModel ( ) const [inline]
 

Query the current shading model.

Returns:
One of the ShadeModelEnum tokens corresponding to the current shading model.

Definition at line 2129 of file sglStatelet.hpp.

void sglShadeModel::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.

virtual void sglShadeModel::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:10 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001