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"
Public Member Functions | |
EggRenderMode (const EggRenderMode ©) | |
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 |
EggRenderMode & | operator= (const EggRenderMode ©) |
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... | |
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.
|
inline |
Removes the bin name that was set for this particular object.
See set_bin().
Definition at line 216 of file eggRenderMode.I.
|
inline |
Removes the depth-offset flag from this particular object.
See set_depth_offset().
Definition at line 137 of file eggRenderMode.I.
|
inline |
Removes the draw-order flag from this particular object.
See set_draw_order().
Definition at line 177 of file eggRenderMode.I.
|
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().
|
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().
|
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().
|
inline |
Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.
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().
|
inline |
Returns the depth_write mode that was set, or DWM_unspecified if nothing was set.
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().
|
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().
|
inline |
Returns the visibility mode that was set, or VM_unspecified if nothing was set.
Definition at line 75 of file eggRenderMode.I.
Referenced by EggPrimitive::determine_visibility_mode(), EggGroup::determine_visibility_mode(), EggRenderState::fill_state(), and write().
|
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().
|
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().
|
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().
|
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().
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
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().