30 _alpha_mode = AM_unspecified;
31 _depth_write_mode = DWM_unspecified;
32 _depth_test_mode = DTM_unspecified;
33 _visibility_mode = VM_unspecified;
35 _has_depth_offset =
false;
37 _has_draw_order =
false;
45 _alpha_mode = copy._alpha_mode;
46 _depth_write_mode = copy._depth_write_mode;
47 _depth_test_mode = copy._depth_test_mode;
48 _visibility_mode = copy._visibility_mode;
49 _depth_offset = copy._depth_offset;
50 _has_depth_offset = copy._has_depth_offset;
51 _draw_order = copy._draw_order;
52 _has_draw_order = copy._has_draw_order;
60 write(ostream &out,
int indent_level)
const {
87 <<
"<Scalar> bin { " <<
get_bin() <<
" }\n";
96 if (_alpha_mode != other._alpha_mode ||
97 _depth_write_mode != other._depth_write_mode ||
98 _depth_test_mode != other._depth_test_mode ||
99 _visibility_mode != other._visibility_mode ||
100 _has_depth_offset != other._has_depth_offset ||
101 _has_draw_order != other._has_draw_order) {
105 if (_has_depth_offset) {
106 if (_depth_offset != other._depth_offset) {
111 if (_has_draw_order) {
112 if (_draw_order != other._draw_order) {
117 if (_bin != other._bin) {
129 if (_alpha_mode != other._alpha_mode) {
130 return (
int)_alpha_mode < (int)other._alpha_mode;
132 if (_depth_write_mode != other._depth_write_mode) {
133 return (
int)_depth_write_mode < (int)other._depth_write_mode;
135 if (_depth_test_mode != other._depth_test_mode) {
136 return (
int)_depth_test_mode < (int)other._depth_test_mode;
138 if (_visibility_mode != other._visibility_mode) {
139 return (
int)_visibility_mode < (int)other._visibility_mode;
142 if (_has_depth_offset != other._has_depth_offset) {
143 return (
int)_has_depth_offset < (int)other._has_depth_offset;
145 if (_has_draw_order != other._has_draw_order) {
146 return (
int)_has_draw_order < (int)other._has_draw_order;
149 if (_has_depth_offset) {
150 if (_depth_offset != other._depth_offset) {
151 return _depth_offset < other._depth_offset;
154 if (_has_draw_order) {
155 if (_draw_order != other._draw_order) {
156 return _draw_order < other._draw_order;
160 if (_bin != other._bin) {
161 return _bin < other._bin;
174 if (cmp_nocase_uh(
string,
"off") == 0) {
176 }
else if (cmp_nocase_uh(
string,
"on") == 0) {
178 }
else if (cmp_nocase_uh(
string,
"blend") == 0) {
180 }
else if (cmp_nocase_uh(
string,
"blend_no_occlude") == 0) {
181 return AM_blend_no_occlude;
182 }
else if (cmp_nocase_uh(
string,
"ms") == 0) {
184 }
else if (cmp_nocase_uh(
string,
"ms_mask") == 0) {
186 }
else if (cmp_nocase_uh(
string,
"binary") == 0) {
188 }
else if (cmp_nocase_uh(
string,
"dual") == 0) {
190 }
else if (cmp_nocase_uh(
string,
"premultiplied") == 0) {
191 return AM_premultiplied;
193 return AM_unspecified;
204 if (cmp_nocase_uh(
string,
"off") == 0) {
206 }
else if (cmp_nocase_uh(
string,
"on") == 0) {
209 return DWM_unspecified;
220 if (cmp_nocase_uh(
string,
"off") == 0) {
222 }
else if (cmp_nocase_uh(
string,
"on") == 0) {
225 return DTM_unspecified;
236 if (cmp_nocase_uh(
string,
"hidden") == 0) {
238 }
else if (cmp_nocase_uh(
string,
"normal") == 0) {
241 return VM_unspecified;
249 ostream &operator << (ostream &out, EggRenderMode::AlphaMode mode) {
251 case EggRenderMode::AM_unspecified:
252 return out <<
"unspecified";
253 case EggRenderMode::AM_off:
255 case EggRenderMode::AM_on:
257 case EggRenderMode::AM_blend:
258 return out <<
"blend";
259 case EggRenderMode::AM_blend_no_occlude:
260 return out <<
"blend_no_occlude";
261 case EggRenderMode::AM_ms:
263 case EggRenderMode::AM_ms_mask:
264 return out <<
"ms_mask";
265 case EggRenderMode::AM_binary:
266 return out <<
"binary";
267 case EggRenderMode::AM_dual:
268 return out <<
"dual";
269 case EggRenderMode::AM_premultiplied:
270 return out <<
"premultiplied";
273 nassertr(
false, out);
274 return out <<
"(**invalid**)";
280 istream &operator >> (istream &in, EggRenderMode::AlphaMode &mode) {
290 ostream &operator << (ostream &out, EggRenderMode::DepthWriteMode mode) {
292 case EggRenderMode::DWM_unspecified:
293 return out <<
"unspecified";
294 case EggRenderMode::DWM_off:
296 case EggRenderMode::DWM_on:
300 nassertr(
false, out);
301 return out <<
"(**invalid**)";
307 ostream &operator << (ostream &out, EggRenderMode::DepthTestMode mode) {
309 case EggRenderMode::DTM_unspecified:
310 return out <<
"unspecified";
311 case EggRenderMode::DTM_off:
313 case EggRenderMode::DTM_on:
317 nassertr(
false, out);
318 return out <<
"(**invalid**)";
326 ostream &operator << (ostream &out, EggRenderMode::VisibilityMode mode) {
328 case EggRenderMode::VM_unspecified:
329 return out <<
"unspecified";
330 case EggRenderMode::VM_hidden:
331 return out <<
"hidden";
332 case EggRenderMode::VM_normal:
333 return out <<
"normal";
336 nassertr(
false, out);
337 return out <<
"(**invalid**)";
AlphaMode get_alpha_mode() const
Returns the alpha mode that was set, or AM_unspecified if nothing was set.
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.
static AlphaMode string_alpha_mode(const std::string &string)
Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the...
std::string get_bin() const
Returns the bin name that has been set for this particular object, if any.
int get_draw_order() const
Returns the "draw-order" flag as set for this particular object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
DepthWriteMode get_depth_write_mode() const
Returns the depth_write mode that was set, or DWM_unspecified if nothing was set. ...
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.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
static VisibilityMode string_visibility_mode(const std::string &string)
Returns the HiddenMode value associated with the given string representation, or VM_unspecified if th...
void write(std::ostream &out, int indent_level) const
Writes the attributes to the indicated output stream in Egg format.
bool has_draw_order() const
Returns true if the draw-order flag has been set for this particular object.
static DepthWriteMode string_depth_write_mode(const std::string &string)
Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified ...
bool has_depth_offset() const
Returns true if the depth-offset flag has been set for this particular object.
TypeHandle is the identifier used to differentiate C++ class types.
int get_depth_offset() const
Returns the "depth-offset" flag as set for this particular object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static DepthTestMode string_depth_test_mode(const std::string &string)
Returns the DepthTestMode value associated with the given string representation, or DTM_unspecified i...
DepthTestMode get_depth_test_mode() const
Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.