

Public Types | |
| enum | ApplyProperties { None = 0, All = 0xffff, BaseColor = 1, Material = 2, PointSize = 4, LineWidth = 8, RoundPoints = 16, AlphaTest = 32, Blending = 64, BackFaceCulling = 128 } |
Apply which properties? Others will be ignored. Values may be OR'ed. More... | |
| enum | Side { FrontSide = 0, BackSide = 1 } |
Public Member Functions | |
| Material2Node (BaseNode *_parent=0, const std::string &_name="<Material2Node>", unsigned int _applyProperties=(All &~BackFaceCulling)) | |
| Default constructor. Applies all properties. | |
| virtual | ~Material2Node () |
| Destructor. | |
| ACG_CLASSNAME (Material2Node) | |
| void | read (std::istream &_is) |
| read MaterialFile | |
| void | enter (GLState &_state, DrawModes::DrawMode _drawmode) |
| set current GL-color and GL-material | |
| void | leave (GLState &_state, DrawModes::DrawMode _drawmode) |
| restores original GL-color and GL-material | |
| unsigned int | applyProperties () const |
| get properties that will be applied (OR'ed ApplyProperties) | |
| void | applyProperties (unsigned int _applyProperties) |
| set properties that will be applied (OR'ed ApplyProperties) | |
| void | set_color (const Vec4f &_c, Side _side=FrontSide) |
| set color (base, ambient, diffuse, specular) based on _c | |
| void | set_base_color (const Vec4f &_c, Side _side=FrontSide) |
| set the base color | |
| const Vec4f & | base_color (Side _side=FrontSide) const |
| get the base color | |
| void | set_ambient_color (const Vec4f &_a, Side _side=FrontSide) |
| set the ambient color. | |
| const Vec4f & | ambient_color (Side _side=FrontSide) const |
| get the ambient color. | |
| void | set_diffuse_color (const Vec4f &_d, Side _side=FrontSide) |
| set the diffuse color. | |
| const Vec4f & | diffuse_color (Side _side=FrontSide) const |
| get the diffuse color. | |
| void | set_specular_color (const Vec4f &_s, Side _side=FrontSide) |
| set the specular color | |
| const Vec4f & | specular_color (Side _side=FrontSide) const |
| get the specular color | |
| void | set_shininess (float _s) |
| set shininess | |
| float | shininess () const |
| get shininess | |
| void | set_point_size (float _sz) |
| set point size (default: 1.0) | |
| float | point_size () const |
| get point size | |
| void | set_line_width (float _sz) |
| set line width (default: 1.0) | |
| float | line_width () const |
| get line width | |
| void | set_round_points (bool _b) |
| set: round points enabled | |
| bool | round_points () const |
| get: round points enabled | |
| void | enable_alpha_test (float _clip) |
| enable alpha test (draw pixels if alpha >= _clip) | |
| void | disable_alpha_test () |
| disable alpha test | |
| void | enable_blending (GLenum _p1=GL_SRC_ALPHA, GLenum _p2=GL_ONE_MINUS_SRC_ALPHA) |
| enable blending with Parameters (_p1, _p2) | |
| void | disable_blending () |
| disable blending | |
| void | enable_backface_culling () |
| enable backface culling (not active by default, see applyProperties) | |
| void | disable_backface_culling () |
| disable backface culling (not active by default, see applyProperties) | |
| void | set_twosided (bool _twosided) |
| enable two-sided material | |
Private Attributes | |
| int | applyProperties_ |
| OR'ed ApplyProperties. | |
| Vec4f | base_color_ [2] |
| Vec4f | base_color_backup_ [2] |
| Vec4f | ambient_color_ [2] |
| Vec4f | ambient_color_backup_ [2] |
| Vec4f | diffuse_color_ [2] |
| Vec4f | diffuse_color_backup_ [2] |
| Vec4f | specular_color_ [2] |
| Vec4f | specular_color_backup_ [2] |
| float | shininess_ |
| float | shininess_backup_ |
| float | point_size_ |
| float | point_size_backup_ |
| float | line_width_ |
| float | line_width_backup_ |
| bool | round_points_ |
| bool | round_points_backup_ |
| bool | alpha_test_ |
| bool | alpha_test_backup_ |
| float | alpha_clip_ |
| float | alpha_clip_backup_ |
| bool | blending_ |
| bool | blending_backup_ |
| GLenum | blend_param1_ |
| GLenum | blend_param1_backup_ |
| GLenum | blend_param2_ |
| GLenum | blend_param2_backup_ |
| bool | backface_culling_ |
| bool | backface_culling_backup_ |
| bool | twosided_ |
Definition at line 68 of file Material2Node.hh.
Apply which properties? Others will be ignored. Values may be OR'ed.
Definition at line 73 of file Material2Node.hh.