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

EggRenderMode Class Reference

This class stores miscellaneous rendering properties that is associated with geometry, and which may be set on the geometry primitive level, on the group above it, or indirectly via a texture. More...

#include <eggRenderMode.h>

Inheritance diagram for EggRenderMode:

EggGroup EggPrimitive EggTexture EggBin EggCurve EggPoint EggPolygon EggSurface EggNurbsCurve EggNurbsSurface List of all members.

Public Types

enum  AlphaMode {
  AM_unspecified, AM_off, AM_on, AM_blend,
  AM_blend_no_occlude, AM_ms, AM_ms_mask, AM_binary,
  AM_dual
}
enum  DepthWriteMode { DWM_unspecified, DWM_off, DWM_on }
enum  DepthTestMode { DTM_unspecified, DTM_off, DTM_on }

Public Member Functions

 EggRenderMode ()
 EggRenderMode (const EggRenderMode &copy)
EggRenderMode & operator= (const EggRenderMode &copy)
void write (ostream &out, int indent_level) const
 Writes the attributes to the indicated output stream in Egg format.

void set_alpha_mode (AlphaMode mode)
 Specifies precisely how the transparency for this geometry should be achieved, or if it should be used.

AlphaMode get_alpha_mode () const
 Returns the alpha mode that was set, or AM_unspecified if nothing was set.

void set_depth_write_mode (DepthWriteMode mode)
 Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry.

DepthWriteMode get_depth_write_mode () const
 Returns the depth_write mode that was set, or DWM_unspecified if nothing was set.

void set_depth_test_mode (DepthTestMode mode)
 Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming the rendering backend provides a depth buffer).

DepthTestMode get_depth_test_mode () const
 Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.

void set_draw_order (int order)
 Sets the "draw-order" flag associated with this object.

int get_draw_order () const
 Returns the "draw-order" flag as set for this particular object.

bool has_draw_order () const
 Returns true if the draw-order flag has been set for this particular object.

void clear_draw_order ()
 Removes the draw-order flag from this particular object.

void set_bin (const string &bin)
 Sets the "bin" string for this particular object.

string get_bin () const
 Returns the bin name that has been set for this particular object, if any.

bool has_bin () const
 Returns true if a bin name has been set for this particular object.

void clear_bin ()
 Removes the bin name that was set for this particular object.

bool operator== (const EggRenderMode &other) const
bool operator!= (const EggRenderMode &other) const
bool operator< (const EggRenderMode &other) const

Static Public Member Functions

AlphaMode string_alpha_mode (const string &string)
 Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the string does not match any known AlphaMode value.

DepthWriteMode string_depth_write_mode (const string &string)
 Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthWriteMode value.

DepthTestMode string_depth_test_mode (const string &string)
 Returns the DepthTestMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthTestMode value.

TypeHandle get_class_type ()
void init_type ()

Private Attributes

AlphaMode _alpha_mode
DepthWriteMode _depth_write_mode
DepthTestMode _depth_test_mode
int _draw_order
bool _has_draw_order
string _bin

Static Private Attributes

TypeHandle _type_handle

Detailed Description

This class stores miscellaneous rendering properties that is associated with geometry, and which may be set on the geometry primitive level, on the group above it, or indirectly via a texture.

It's intended to be a base class for egg objects that can have these properties set.

This class cannot inherit from EggObject, because it causes problems at the EggPolygon level with multiple appearances of the EggObject base class. And making EggObject a virtual base class is just no fun.

Definition at line 56 of file eggRenderMode.h.


Member Enumeration Documentation

enum EggRenderMode::AlphaMode
 

Enumeration values:
AM_unspecified 
AM_off 
AM_on 
AM_blend 
AM_blend_no_occlude 
AM_ms 
AM_ms_mask 
AM_binary 
AM_dual 

Definition at line 64 of file eggRenderMode.h.

enum EggRenderMode::DepthTestMode
 

Enumeration values:
DTM_unspecified 
DTM_off 
DTM_on 

Definition at line 80 of file eggRenderMode.h.

Referenced by get_depth_write_mode(), and EggLoader::setup_bucket().

enum EggRenderMode::DepthWriteMode
 

Enumeration values:
DWM_unspecified 
DWM_off 
DWM_on 

Definition at line 76 of file eggRenderMode.h.


Constructor & Destructor Documentation

EggRenderMode::EggRenderMode  )  [inline]
 

Definition at line 31 of file eggRenderMode.I.

References _has_draw_order.

EggRenderMode::EggRenderMode const EggRenderMode &  copy  )  [inline]
 

Definition at line 48 of file eggRenderMode.I.

References _alpha_mode, _depth_test_mode, _depth_write_mode, _draw_order, _has_draw_order, and INLINE.


Member Function Documentation

void EggRenderMode::clear_bin  )  [inline]
 

Removes the bin name that was set for this particular object.

See set_bin().

Definition at line 326 of file eggRenderMode.I.

void EggRenderMode::clear_draw_order  )  [inline]
 

Removes the draw-order flag from this particular object.

See set_draw_order().

Definition at line 254 of file eggRenderMode.I.

EggRenderMode::AlphaMode EggRenderMode::get_alpha_mode  )  const [inline]
 

Returns the alpha mode that was set, or AM_unspecified if nothing was set.

See set_alpha_mode().

Definition at line 186 of file eggRenderMode.I.

References _has_draw_order, and INLINE.

string EggRenderMode::get_bin  )  const [inline]
 

Returns the bin name that has been set for this particular object, if any.

See set_bin().

Definition at line 296 of file eggRenderMode.I.

TypeHandle EggRenderMode::get_class_type void   )  [inline, static]
 

Reimplemented in EggBin, EggCurve, EggGroup, EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, EggPrimitive, EggSurface, and EggTexture.

Definition at line 122 of file eggRenderMode.h.

EggRenderMode::DepthTestMode EggRenderMode::get_depth_test_mode  )  const [inline]
 

Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.

See set_depth_test_mode().

Definition at line 138 of file eggRenderMode.I.

References _alpha_mode.

Referenced by EggGroup::determine_alpha_mode(), and EggPrimitive::determine_depth_write_mode().

EggRenderMode::DepthWriteMode EggRenderMode::get_depth_write_mode  )  const [inline]
 

Returns the depth_write mode that was set, or DWM_unspecified if nothing was set.

See set_depth_write_mode().

Definition at line 100 of file eggRenderMode.I.

References _depth_test_mode, DepthTestMode, and INLINE.

int EggRenderMode::get_draw_order  )  const [inline]
 

Returns the "draw-order" flag as set for this particular object.

See set_draw_order().

Definition at line 224 of file eggRenderMode.I.

References _bin, and INLINE.

bool EggRenderMode::has_bin  )  const [inline]
 

Returns true if a bin name has been set for this particular object.

See set_bin().

Definition at line 311 of file eggRenderMode.I.

Referenced by EggGroup::determine_depth_write_mode().

bool EggRenderMode::has_draw_order  )  const [inline]
 

Returns true if the draw-order flag has been set for this particular object.

See set_draw_order().

Definition at line 239 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_depth_test_mode().

void EggRenderMode::init_type void   )  [inline, static]
 

Reimplemented in EggBin, EggCurve, EggGroup, EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, EggPrimitive, EggSurface, and EggTexture.

Definition at line 125 of file eggRenderMode.h.

bool EggRenderMode::operator!= const EggRenderMode &  other  )  const [inline]
 

Definition at line 338 of file eggRenderMode.I.

bool EggRenderMode::operator< const EggRenderMode &  other  )  const
 

Definition at line 100 of file eggRenderMode.cxx.

References _has_draw_order.

EggRenderMode & EggRenderMode::operator= const EggRenderMode &  copy  )  [inline]
 

Definition at line 60 of file eggRenderMode.I.

References _depth_write_mode, and INLINE.

Referenced by EggTexture::EggTexture().

bool EggRenderMode::operator== const EggRenderMode &  other  )  const
 

Definition at line 71 of file eggRenderMode.cxx.

References _draw_order.

void EggRenderMode::set_alpha_mode AlphaMode  mode  )  [inline]
 

Specifies precisely how the transparency for this geometry should be achieved, or if it should be used.

The default, AM_unspecified, is to use transparency if the geometry has a color whose alpha value is non-1, or if it has a four-channel texture applied; otherwise, AM_on forces transparency on, and AM_off forces it off. The other flavors of transparency are specific ways to turn on transparency, which may or may not be supported by a particular rendering backend.

Definition at line 169 of file eggRenderMode.I.

References _has_draw_order, and INLINE.

void EggRenderMode::set_bin const string &  bin  )  [inline]
 

Sets the "bin" string for this particular object.

This names a particular bin in which the object should be rendered. The exact meaning of a bin is implementation defined, but generally a GeomBin matching each bin name must also be specifically added to the rendering engine (e.g. the CullTraverser) in use for this to work. See also set_draw_order().

Definition at line 281 of file eggRenderMode.I.

void EggRenderMode::set_depth_test_mode DepthTestMode  mode  )  [inline]
 

Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming the rendering backend provides a depth buffer).

Note that this is different, and independent from, the depth_write mode.

Definition at line 121 of file eggRenderMode.I.

References _alpha_mode, and INLINE.

void EggRenderMode::set_depth_write_mode DepthWriteMode  mode  )  [inline]
 

Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry.

Definition at line 83 of file eggRenderMode.I.

void EggRenderMode::set_draw_order int  order  )  [inline]
 

Sets the "draw-order" flag associated with this object.

This specifies a particular order in which objects of this type should be drawn, within the specified bin. If a bin is not explicitly specified, "fixed" is used. See also set_bin().

Definition at line 208 of file eggRenderMode.I.

References _bin, and INLINE.

EggRenderMode::AlphaMode EggRenderMode::string_alpha_mode const string &  string  )  [static]
 

Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the string does not match any known AlphaMode value.

Definition at line 141 of file eggRenderMode.cxx.

References AM_dual.

EggRenderMode::DepthTestMode EggRenderMode::string_depth_test_mode const string &  string  )  [static]
 

Returns the DepthTestMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthTestMode value.

Definition at line 203 of file eggRenderMode.cxx.

References AM_binary, AM_dual, and AM_ms_mask.

EggRenderMode::DepthWriteMode EggRenderMode::string_depth_write_mode const string &  string  )  [static]
 

Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthWriteMode value.

Definition at line 178 of file eggRenderMode.cxx.

void EggRenderMode::write ostream &  out,
int  indent_level
const
 

Writes the attributes to the indicated output stream in Egg format.

Reimplemented in EggGroup, EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, and EggTexture.

Definition at line 40 of file eggRenderMode.cxx.


Member Data Documentation

AlphaMode EggRenderMode::_alpha_mode [private]
 

Definition at line 113 of file eggRenderMode.h.

Referenced by EggRenderMode(), get_depth_test_mode(), and set_depth_test_mode().

string EggRenderMode::_bin [private]
 

Definition at line 118 of file eggRenderMode.h.

Referenced by get_draw_order(), and set_draw_order().

DepthTestMode EggRenderMode::_depth_test_mode [private]
 

Definition at line 115 of file eggRenderMode.h.

Referenced by EggRenderMode(), and get_depth_write_mode().

DepthWriteMode EggRenderMode::_depth_write_mode [private]
 

Definition at line 114 of file eggRenderMode.h.

Referenced by EggRenderMode(), and operator=().

int EggRenderMode::_draw_order [private]
 

Definition at line 116 of file eggRenderMode.h.

Referenced by EggRenderMode(), and operator==().

bool EggRenderMode::_has_draw_order [private]
 

Definition at line 117 of file eggRenderMode.h.

Referenced by EggRenderMode(), get_alpha_mode(), operator<(), and set_alpha_mode().

TypeHandle EggRenderMode::_type_handle [static, private]
 

Reimplemented in EggBin, EggCurve, EggGroup, EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, EggPrimitive, EggSurface, and EggTexture.

Definition at line 27 of file eggRenderMode.cxx.


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:50:20 2003 for Panda by doxygen1.3