Panda3D
Public Types | Public Member Functions | Static Public Member Functions
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 EggCompositePrimitive EggCurve EggPoint EggPolygon EggSurface EggLine EggTriangleFan EggTriangleStrip 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  DepthTestMode { DTM_unspecified, DTM_off, DTM_on }
enum  DepthWriteMode { DWM_unspecified, DWM_off, DWM_on }
enum  VisibilityMode { VM_unspecified, VM_hidden, VM_normal }

Public Member Functions

 EggRenderMode (const EggRenderMode &copy)
void clear_bin ()
 Removes the bin name that was set for this particular object.
void clear_depth_offset ()
 Removes the depth-offset flag from this particular object.
void clear_draw_order ()
 Removes the draw-order flag from this particular object.
AlphaMode get_alpha_mode () const
 Returns the alpha mode that was set, or AM_unspecified if nothing was set.
string get_bin () const
 Returns the bin name that has been set for this particular object, if any.
int get_depth_offset () const
 Returns the "depth-offset" flag as set for this particular object.
DepthTestMode get_depth_test_mode () const
 Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.
DepthWriteMode get_depth_write_mode () const
 Returns the depth_write mode that was set, or DWM_unspecified if nothing was set.
int get_draw_order () const
 Returns the "draw-order" flag as set for this particular object.
VisibilityMode get_visibility_mode () const
 Returns the visibility mode that was set, or VM_unspecified if nothing was set.
bool has_bin () const
 Returns true if a bin name has been set for this particular object.
bool has_depth_offset () const
 Returns true if the depth-offset flag has been set for this particular object.
bool has_draw_order () const
 Returns true if the draw-order flag has been set for this particular object.
bool operator!= (const EggRenderMode &other) const
bool operator< (const EggRenderMode &other) const
EggRenderModeoperator= (const EggRenderMode &copy)
bool operator== (const EggRenderMode &other) const
void set_alpha_mode (AlphaMode mode)
 Specifies precisely how the transparency for this geometry should be achieved, or if it should be used.
void set_bin (const string &bin)
 Sets the "bin" string for this particular object.
void set_depth_offset (int bias)
 Sets the "depth-offset" flag associated with this object.
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).
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.
void set_draw_order (int order)
 Sets the "draw-order" flag associated with this object.
void set_visibility_mode (VisibilityMode mode)
 Specifies whether this geometry is to be considered normally visible, or hidden.
void write (ostream &out, int indent_level) const
 Writes the attributes to the indicated output stream in Egg format.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
static 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.
static DepthTestMode string_depth_test_mode (const string &string)
 Returns the DepthTestMode value associated with the given string representation, or DTM_unspecified if the string does not match any known DepthTestMode value.
static 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.
static VisibilityMode string_visibility_mode (const string &string)
 Returns the HiddenMode value associated with the given string representation, or VM_unspecified if the string does not match any known HiddenMode value.

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 36 of file eggRenderMode.h.


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 277 of file eggRenderMode.I.

Removes the depth-offset flag from this particular object.

See set_depth_offset().

Definition at line 178 of file eggRenderMode.I.

Removes the draw-order flag from this particular object.

See set_draw_order().

Definition at line 227 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 130 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_alpha_mode(), EggGroup::determine_alpha_mode(), EggRenderState::fill_state(), TextureReference::from_egg(), and write().

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 255 of file eggRenderMode.I.

Referenced by EggRenderState::fill_state(), and write().

int EggRenderMode::get_depth_offset ( ) const [inline]

Returns the "depth-offset" flag as set for this particular object.

See set_depth_offset().

Definition at line 156 of file eggRenderMode.I.

Referenced by EggRenderState::fill_state(), and write().

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 73 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_depth_test_mode(), EggGroup::determine_depth_test_mode(), EggRenderState::fill_state(), and write().

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 47 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_depth_write_mode(), EggGroup::determine_depth_write_mode(), EggRenderState::fill_state(), and write().

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 205 of file eggRenderMode.I.

Referenced by EggRenderState::fill_state(), and write().

EggRenderMode::VisibilityMode EggRenderMode::get_visibility_mode ( ) const [inline]

Returns the visibility mode that was set, or VM_unspecified if nothing was set.

See set_visibility_mode().

Definition at line 99 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_visibility_mode(), EggGroup::determine_visibility_mode(), EggRenderState::fill_state(), and write().

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 266 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_bin(), EggGroup::determine_bin(), and write().

bool EggRenderMode::has_depth_offset ( ) const [inline]

Returns true if the depth-offset flag has been set for this particular object.

See set_depth_offset().

Definition at line 167 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_depth_offset(), EggGroup::determine_depth_offset(), and write().

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 216 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_draw_order(), EggGroup::determine_draw_order(), and write().

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 118 of file eggRenderMode.I.

Referenced by TextureReference::update_egg().

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 244 of file eggRenderMode.I.

void EggRenderMode::set_depth_offset ( int  order) [inline]

Sets the "depth-offset" flag associated with this object.

This adds or subtracts an offset bias into the depth buffer. See also DepthOffsetAttrib and NodePath::set_depth_offset().

Definition at line 143 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 61 of file eggRenderMode.I.

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 35 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 193 of file eggRenderMode.I.

void EggRenderMode::set_visibility_mode ( VisibilityMode  mode) [inline]

Specifies whether this geometry is to be considered normally visible, or hidden.

If it is hidden, it is either not loaded into the scene graph at all, or loaded as a "stashed" node, according to the setting of egg-suppress-hidden.

Definition at line 87 of file eggRenderMode.I.

Referenced by MayaNodeTree::get_egg_group().

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 183 of file eggRenderMode.cxx.

Referenced by TxaLine::parse().

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

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

Definition at line 233 of file eggRenderMode.cxx.

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 214 of file eggRenderMode.cxx.

EggRenderMode::VisibilityMode EggRenderMode::string_visibility_mode ( const string &  string) [static]

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

Definition at line 252 of file eggRenderMode.cxx.

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

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations