Panda3D
Public Types | Public Member Functions | Static Public Member Functions | List of all 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 EggCompositePrimitive EggCurve EggPatch EggPoint EggPolygon EggSurface EggLine EggTriangleFan EggTriangleStrip EggNurbsCurve EggNurbsSurface

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

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
static AlphaMode string_alpha_mode (const std::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. More...
 
static DepthTestMode string_depth_test_mode (const std::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. More...
 
static DepthWriteMode string_depth_write_mode (const std::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. More...
 
static VisibilityMode string_visibility_mode (const std::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. More...
 

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

Member Function Documentation

◆ clear_bin()

void EggRenderMode::clear_bin ( )
inline

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

See set_bin().

Definition at line 216 of file eggRenderMode.I.

◆ clear_depth_offset()

void EggRenderMode::clear_depth_offset ( )
inline

Removes the depth-offset flag from this particular object.

See set_depth_offset().

Definition at line 137 of file eggRenderMode.I.

◆ clear_draw_order()

void EggRenderMode::clear_draw_order ( )
inline

Removes the draw-order flag from this particular object.

See set_draw_order().

Definition at line 177 of file eggRenderMode.I.

◆ get_alpha_mode()

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

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

◆ get_bin()

std::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 198 of file eggRenderMode.I.

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

◆ get_depth_offset()

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

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

◆ get_depth_test_mode()

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

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

◆ get_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 36 of file eggRenderMode.I.

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

◆ get_draw_order()

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

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

◆ get_visibility_mode()

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

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

◆ has_bin()

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

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

◆ has_depth_offset()

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

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

◆ has_draw_order()

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

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

◆ set_alpha_mode()

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

Referenced by TextureReference::update_egg().

◆ set_bin()

void EggRenderMode::set_bin ( const std::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 189 of file eggRenderMode.I.

◆ set_depth_offset()

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

◆ set_depth_test_mode()

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

◆ set_depth_write_mode()

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

◆ set_draw_order()

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

◆ set_visibility_mode()

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

◆ string_alpha_mode()

EggRenderMode::AlphaMode EggRenderMode::string_alpha_mode ( const std::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 173 of file eggRenderMode.cxx.

◆ string_depth_test_mode()

EggRenderMode::DepthTestMode EggRenderMode::string_depth_test_mode ( const std::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 219 of file eggRenderMode.cxx.

◆ string_depth_write_mode()

EggRenderMode::DepthWriteMode EggRenderMode::string_depth_write_mode ( const std::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 203 of file eggRenderMode.cxx.

◆ string_visibility_mode()

EggRenderMode::VisibilityMode EggRenderMode::string_visibility_mode ( const std::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 235 of file eggRenderMode.cxx.

◆ write()

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

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

Definition at line 60 of file eggRenderMode.cxx.

References get_alpha_mode(), get_bin(), get_depth_offset(), get_depth_test_mode(), get_depth_write_mode(), get_draw_order(), get_visibility_mode(), has_bin(), has_depth_offset(), has_draw_order(), and indent().

Referenced by EggGroup::write_render_mode().


The documentation for this class was generated from the following files: