Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MaterialNode.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openflipper.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenFlipper. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41
42 /*===========================================================================*\
43 * *
44 * $Revision$ *
45 * $Author$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49
50
51
52
53 //=============================================================================
54 //
55 // CLASS MaterialNode
56 //
57 //=============================================================================
58
59 #ifndef ACG_MATERIAL_NODE_HH
60 #define ACG_MATERIAL_NODE_HH
61
62
63 //== INCLUDES =================================================================
64
65 #include "BaseNode.hh"
66 #include <string>
67 #include <QVariantMap>
68
69 //== NAMESPACES ===============================================================
70
71 namespace ACG {
72
73 QVariantMap ACGDLLEXPORT json_to_variant_map(QString json);
74
75 namespace SceneGraph {
76
77
78 //== CLASS DEFINITION =========================================================
79
85 class ACGDLLEXPORT Material {
86
87 friend class MaterialNode;
88
89 public:
91 Material() :
92 baseColor_(GLState::default_base_color),
93 ambientColor_(GLState::default_ambient_color),
94 diffuseColor_(GLState::default_diffuse_color),
95 specularColor_(GLState::default_specular_color),
96 overlayColor_(GLState::default_overlay_color),
97 shininess_(GLState::default_shininess),
98 reflectance_(0.0),
99 pointSize_(1.0),
100 lineWidth_(1.0),
101 roundPoints_(false),
102 linesSmooth_(false),
103 alphaTest_(false),
104 alphaClip_(0),
105 blending_(false),
106 blendParam1_(GL_SRC_ALPHA),
107 blendParam2_(GL_ONE_MINUS_SRC_ALPHA),
108 colorMaterial_(true),
109 backfaceCulling_(false),
110 multiSampling_(true) {};
111
113 virtual ~Material() {};
114
116 Material(const Material& _m) :
117 baseColor_(_m.baseColor_),
118 ambientColor_(_m.ambientColor_),
119 diffuseColor_(_m.diffuseColor_),
120 specularColor_(_m.specularColor_),
121 overlayColor_(_m.overlayColor_),
122 shininess_(_m.shininess_),
123 reflectance_(_m.reflectance_),
124 pointSize_(_m.pointSize_),
125 lineWidth_(_m.lineWidth_),
126 roundPoints_(_m.roundPoints_),
127 linesSmooth_(_m.linesSmooth_),
128 alphaTest_(_m.alphaTest_),
129 alphaClip_(_m.alphaClip_),
130 blending_(_m.blending_),
131 blendParam1_(_m.blendParam1_),
132 blendParam2_(_m.blendParam2_),
133 colorMaterial_(_m.colorMaterial_),
134 backfaceCulling_(_m.backfaceCulling_),
135 multiSampling_(_m.multiSampling_) {};
136
137 static bool support_json_serialization();
138 QString serializeToJson() const;
139 void deserializeFromJson(const QString &json);
140 void deserializeFromVariantMap(const QVariantMap &matMap);
141
149 void color(const Vec4f& _c) {
150 Vec4f c(0.0,0.0,0.0,1.0);
151 baseColor(c);
152 overlayColor(c);
153 c = _c * 0.2f; c[3]=_c[3]; ambientColor(c);
154 c = _c * 0.6f; c[3]=_c[3]; diffuseColor(c);
155 c = _c * 0.8f; c[3]=_c[3]; specularColor(c);
156 }
157
159 void generateRandomColor() {
160 color( Vec4f(0.2 + double(rand())/double(RAND_MAX)*0.8,
161 0.2 + double(rand())/double(RAND_MAX)*0.8,
162 0.2 + double(rand())/double(RAND_MAX)*0.8,
163 1.0));
164 }
165
167 void baseColor(const Vec4f& _c) { baseColor_ = _c;}
169 const Vec4f& baseColor() const { return baseColor_; }
170
172 void ambientColor(const Vec4f& _a) { ambientColor_ = _a; }
174 const Vec4f& ambientColor() const { return ambientColor_; }
175
177 void diffuseColor(const Vec4f& _d) { diffuseColor_ = _d; }
179 const Vec4f& diffuseColor() const { return diffuseColor_; }
180
182 void specularColor(const Vec4f& _s) { specularColor_ = _s; }
184 const Vec4f& specularColor() const { return specularColor_; }
185
187 void overlayColor(const Vec4f& _s) { overlayColor_ = _s; }
189 const Vec4f& overlayColor() const { return overlayColor_; }
190
192 void colorMaterial( const bool _cm) { colorMaterial_ = _cm; }
194 void enableColorMaterial() { colorMaterial_ = true; }
196 void disableColorMaterial() { colorMaterial_ = false; }
198 bool colorMaterial() { return colorMaterial_; }
199
201 void shininess(float _s) { shininess_ = _s; }
203 float shininess() const { return shininess_; }
204
206 void reflectance(double _m) { reflectance_ = _m; }
208 double reflectance() const { return reflectance_; }
209
211 void pointSize(float _sz) { pointSize_ = _sz; }
213 float pointSize() const { return pointSize_; }
214
216 void lineWidth(float _sz) { lineWidth_ = _sz; }
218 float lineWidth() const { return lineWidth_; }
219
221 void roundPoints(bool _b) { roundPoints_ = _b; }
223 bool roundPoints() const { return roundPoints_; }
224
226 void lineSmooth(bool _b) { linesSmooth_ = _b; }
228 bool lineSmooth() const { return linesSmooth_; }
229
231 void enableAlphaTest(float _clip) {
232 alphaTest_ = true; alphaClip_ = _clip;
233 }
234
236 void disableAlphaTest() { alphaTest_ = false; }
237
239 bool alphaTest() const { return alphaTest_; };
240
242 void enableMultisampling() {
243 multiSampling_ = true;
244 }
245
247 void disableMultisampling() {
248 multiSampling_ = false;
249 }
250
252 bool multiSampling() const {
253 return multiSampling_;
254 }
255
257 void multisampling( bool _state ) {
258 multiSampling_ = _state;
259 }
260
262 float alphaValue() const { return alphaClip_; };
263
264 bool blending() const { return blending_; };
265
266 GLenum blendingParam1() const { return blendParam1_; };
267 GLenum blendingParam2() const { return blendParam2_; };
268
270 void enableBlending(GLenum _p1 = GL_SRC_ALPHA,
271 GLenum _p2 = GL_ONE_MINUS_SRC_ALPHA)
272 { blending_ = true; blendParam1_ = _p1; blendParam2_ = _p2; }
274 void disableBlending() { blending_ = false; }
275
276 bool backfaceCulling() const { return backfaceCulling_; };
277
279 void enableBackfaceCulling() { backfaceCulling_ = true; }
281 void disableBackfaceCulling() { backfaceCulling_ = false; }
282
283 protected:
284
285 Vec4f baseColor_;
286 Vec4f ambientColor_;
287 Vec4f diffuseColor_;
288 Vec4f specularColor_;
289 Vec4f overlayColor_;
290
291 float shininess_;
292 double reflectance_;
293 float pointSize_;
294 float lineWidth_;
295
296 bool roundPoints_;
297 bool linesSmooth_;
298
299 bool alphaTest_;
300 float alphaClip_;
301
302 bool blending_;
303 GLenum blendParam1_;
304 GLenum blendParam2_;
305
306 bool colorMaterial_;
307 bool backfaceCulling_;
308
309 bool multiSampling_;
310 };
311
312
321 class ACGDLLEXPORT MaterialNode : public BaseNode
322 {
323 public:
324
326 enum ApplyProperties
327 {
329 None=0,
331 All=0xffff,
333 BaseColor=1,
335 Material=2,
337 PointSize=4,
339 LineWidth=8,
341 RoundPoints=16,
343 LineSmooth=32,
345 AlphaTest=64,
347 Blending=128,
349 BackFaceCulling=256,
351 ColorMaterial=512,
353 MultiSampling=1024
354 };
355
357 MaterialNode( BaseNode* _parent = 0,
358 const std::string& _name = "<MaterialNode>",
359 unsigned int _applyProperties = (All & ~BackFaceCulling));
360
362 virtual ~MaterialNode() {};
363
365 void read( std::istream & _is);
366
367 //===========================================================================
370 //===========================================================================
371
372 ACG_CLASSNAME(MaterialNode);
373
375 void enter(GLState& _state, const DrawModes::DrawMode& _drawmode);
377 void leave(GLState& _state, const DrawModes::DrawMode& _drawmode);
378
379
381 void enterPick(GLState& _state, PickTarget _target, const DrawModes::DrawMode& _drawMode );
382
384 void leavePick(GLState& _state, PickTarget _target, const DrawModes::DrawMode& _drawMode );
385
388 //===========================================================================
391 //===========================================================================
392
394 void set_color(const Vec4f& _c) {
395 material_.color(_c);
396 }
397
399 void set_random_color() {
400 material_.generateRandomColor();
401 }
402
404 void set_base_color(const Vec4f& _c) { material_.baseColor(_c); }
406 const Vec4f& base_color() const { return material_.baseColor(); }
407
409 void set_ambient_color(const Vec4f& _a) { material_.ambientColor(_a); }
411 const Vec4f& ambient_color() const { return material_.ambientColor(); }
412
414 void set_diffuse_color(const Vec4f& _d) { material_.diffuseColor(_d); }
416 const Vec4f& diffuse_color() const { return material_.diffuseColor(); }
417
419 void set_specular_color(const Vec4f& _s) { material_.specularColor(_s); }
421 const Vec4f& specular_color() const { return material_.specularColor(); }
422
424 void set_overlay_color(const Vec4f& _s) { material_.overlayColor(_s); }
426 const Vec4f& overlay_color() const { return material_.overlayColor(); }
427
429 void colorMaterial( const bool _cm) { material_.colorMaterial(_cm); }
431 void enable_color_material() { material_.enableColorMaterial(); }
433 void disable_color_material() { material_.disableColorMaterial(); }
435 bool colorMaterial() { return material_.colorMaterial(); }
436
438 void set_shininess(float _s) { material_.shininess(_s); }
440 float shininess() const { return material_.shininess(); }
441
443 void set_reflectance(double _m) { material_.reflectance(_m); }
445 double reflectance() const { return material_.reflectance(); }
446
449 //===========================================================================
452 //===========================================================================
454 void set_point_size(float _sz) { material_.pointSize(_sz); }
456 float point_size() const { return material_.pointSize(); }
457
459 void set_line_width(float _sz) { material_.lineWidth(_sz); }
461 float line_width() const { return material_.lineWidth(); }
462
464 void set_round_points(bool _b) { material_.roundPoints(_b); }
466 bool round_points() const { return material_.roundPoints(); }
467
469 void set_line_smooth(bool _b) { material_.lineSmooth(_b); }
471 bool line_smooth() const { return material_.lineSmooth(); }
472
475 //===========================================================================
478 //===========================================================================
479
481 void enable_alpha_test(float _clip) { material_.enableAlphaTest(_clip); }
482
484 void disable_alpha_test() { material_.disableAlphaTest(); }
485
487 bool alpha_test() { return material_.alphaTest(); };
488
491 //===========================================================================
494 //===========================================================================
495
497 void enable_multisampling() { material_.enableMultisampling(); }
498
500 void disable_multisampling() { material_.disableMultisampling(); }
501
503 bool multiSampling() { return material_.multiSampling(); }
504
506 void set_multisampling( bool _state ) { material_.multisampling(_state); }
507
510 float alpha_value(){ return material_.alphaValue(); };
512
513 bool blending() { return material_.blending(); };
514
515 GLenum blending_param1() { return material_.blendingParam1(); };
516 GLenum blending_param2() { return material_.blendingParam2(); };
517
519 void enable_blending(GLenum _p1 = GL_SRC_ALPHA,
520 GLenum _p2 = GL_ONE_MINUS_SRC_ALPHA) {
521 material_.enableBlending(_p1, _p2);
522 }
524 void disable_blending() { material_.disableBlending(); }
525
526 bool backface_culling() { return material_.backfaceCulling(); };
527
529 void enable_backface_culling() { material_.enableBackfaceCulling(); }
530
532 void disable_backface_culling() { material_.disableBackfaceCulling(); }
533
535 unsigned int applyProperties() const { return applyProperties_; }
536
538 void applyProperties(unsigned int _applyProperties) {
539 applyProperties_ = _applyProperties;
540 }
541
543 ACG::SceneGraph::Material& material() { return material_; }
544
546 void set_material(const ACG::SceneGraph::Material& _m) { material_ = _m; }
547
548 private:
549
551 int applyProperties_;
552
554 ACG::SceneGraph::Material material_;
555
557 ACG::SceneGraph::Material materialBackup_;
558 };
559
560
561 //=============================================================================
562 } // namespace SceneGraph
563 } // namespace ACG
564 //=============================================================================
565 #endif // ACG_MATERIAL_NODE_HH defined
566 //=============================================================================
567
ACG::SceneGraph::MaterialNode::ApplyProperties
ApplyProperties
Apply which properties? Others will be ignored. Values may be OR'ed.
Definition: MaterialNode.hh:326
ACG::SceneGraph::Material::disableBlending
void disableBlending()
disable blending
Definition: MaterialNode.hh:274
ACG::SceneGraph::MaterialNode::diffuse_color
const Vec4f & diffuse_color() const
get the diffuse color.
Definition: MaterialNode.hh:416
ACG::SceneGraph::MaterialNode::round_points
bool round_points() const
get round points enabled
Definition: MaterialNode.hh:466
ACG::SceneGraph::Material::alphaTest
bool alphaTest() const
Return state of Alpha test.
Definition: MaterialNode.hh:239
ACG
Namespace providing different geometric functions concerning angles.
Definition: DBSCANT.cc:51
ACG::SceneGraph::MaterialNode::enable_backface_culling
void enable_backface_culling()
enable backface culling (not active by default, see applyProperties)
Definition: MaterialNode.hh:529
ACG::SceneGraph::BaseNode
Definition: BaseNode.hh:135
ACG::SceneGraph::MaterialNode::disable_blending
void disable_blending()
disable blending
Definition: MaterialNode.hh:524
ACG::SceneGraph::Material::specularColor
void specularColor(const Vec4f &_s)
set the specular color
Definition: MaterialNode.hh:182
ACG::SceneGraph::PickTarget
PickTarget
What target to use for picking.
Definition: BaseNode.hh:99
ACG::SceneGraph::MaterialNode::applyProperties
unsigned int applyProperties() const
get properties that will be applied (OR'ed ApplyProperties)
Definition: MaterialNode.hh:535
ACG::SceneGraph::Material::overlayColor
const Vec4f & overlayColor() const
get the overlay color (This can be used to render overlays e.g. additional wireframes in a different ...
Definition: MaterialNode.hh:189
ACG::SceneGraph::MaterialNode::multiSampling
bool multiSampling()
Get state of multisampling.
Definition: MaterialNode.hh:503
ACG::SceneGraph::Material::enableBackfaceCulling
void enableBackfaceCulling()
enable backface culling (not active by default, see applyProperties)
Definition: MaterialNode.hh:279
ACG::SceneGraph::MaterialNode::set_random_color
void set_random_color()
Generates a random color and sets it.
Definition: MaterialNode.hh:399
ACG::SceneGraph::MaterialNode::point_size
float point_size() const
get point size
Definition: MaterialNode.hh:456
ACG::SceneGraph::Material::roundPoints
bool roundPoints() const
get: round points enabled
Definition: MaterialNode.hh:223
ACG::SceneGraph::MaterialNode::base_color
const Vec4f & base_color() const
get the base color
Definition: MaterialNode.hh:406
ACG::SceneGraph::MaterialNode::set_overlay_color
void set_overlay_color(const Vec4f &_s)
set the overlay color
Definition: MaterialNode.hh:424
ACG::SceneGraph::MaterialNode::colorMaterial
bool colorMaterial()
get colorMaterial state
Definition: MaterialNode.hh:435
ACG::Vec4f
VectorT< float, 4 > Vec4f
Definition: VectorT.hh:144
ACG::SceneGraph::MaterialNode::disable_alpha_test
void disable_alpha_test()
disable alpha test
Definition: MaterialNode.hh:484
ACG::SceneGraph::Material::specularColor
const Vec4f & specularColor() const
get the specular color
Definition: MaterialNode.hh:184
ACG::SceneGraph::MaterialNode::enable_multisampling
void enable_multisampling()
Enable Multisampling.
Definition: MaterialNode.hh:497
ACG::SceneGraph::Material::ambientColor
const Vec4f & ambientColor() const
get the ambient color.
Definition: MaterialNode.hh:174
ACG::GLState
Definition: GLState.hh:220
ACG::SceneGraph::MaterialNode::~MaterialNode
virtual ~MaterialNode()
Destructor.
Definition: MaterialNode.hh:362
ACG::SceneGraph::Material::enableAlphaTest
void enableAlphaTest(float _clip)
enable alpha test (draw pixels if alpha >= _clip)
Definition: MaterialNode.hh:231
ACG::SceneGraph::MaterialNode::set_base_color
void set_base_color(const Vec4f &_c)
set the base color
Definition: MaterialNode.hh:404
ACG::SceneGraph::Material::diffuseColor
void diffuseColor(const Vec4f &_d)
set the diffuse color.
Definition: MaterialNode.hh:177
ACG::SceneGraph::Material::Material
Material(const Material &_m)
Copy constructor.
Definition: MaterialNode.hh:116
ACG::SceneGraph::DrawModes::DrawMode
Specifies a DrawMode.
Definition: DrawModes.hh:294
ACG::SceneGraph::ACG::SceneGraph::Material
Definition: MeshNode2T.cc:85
ACG::SceneGraph::Material::reflectance
void reflectance(double _m)
set reflectance ( not used in OpenGL Rendering)
Definition: MaterialNode.hh:206
ACG::SceneGraph::Material::generateRandomColor
void generateRandomColor()
Creates a randomized color and sets it.
Definition: MaterialNode.hh:159
ACG::SceneGraph::MaterialNode::set_color
void set_color(const Vec4f &_c)
set color (base, ambient, diffuse, specular) based on _c
Definition: MaterialNode.hh:394
ACG::SceneGraph::Material::roundPoints
void roundPoints(bool _b)
set: round points enabled
Definition: MaterialNode.hh:221
ACG::SceneGraph::Material::reflectance
double reflectance() const
get reflectance ( not used in OpenGL Rendering)
Definition: MaterialNode.hh:208
ACG::SceneGraph::MaterialNode::set_material
void set_material(const ACG::SceneGraph::Material &_m)
Set material object.
Definition: MaterialNode.hh:546
ACG::SceneGraph::MaterialNode::set_point_size
void set_point_size(float _sz)
set point size (default: 1.0)
Definition: MaterialNode.hh:454
ACG::SceneGraph::MaterialNode::material
ACG::SceneGraph::Material & material()
Get material object reference.
Definition: MaterialNode.hh:543
ACG::SceneGraph::Material::overlayColor
void overlayColor(const Vec4f &_s)
set the overlay color (This can be used to render overlays e.g. additional wireframes in a different ...
Definition: MaterialNode.hh:187
ACG::SceneGraph::Material::pointSize
float pointSize() const
get point size
Definition: MaterialNode.hh:213
ACG::SceneGraph::Material::lineWidth
void lineWidth(float _sz)
set line width (default: 1.0)
Definition: MaterialNode.hh:216
ACG::SceneGraph::Material::shininess
float shininess() const
get shininess
Definition: MaterialNode.hh:203
ACG::SceneGraph::MaterialNode::applyProperties
void applyProperties(unsigned int _applyProperties)
set properties that will be applied (OR'ed ApplyProperties)
Definition: MaterialNode.hh:538
OpenMesh::VectorT
Definition: Vector11T.hh:83
ACG::SceneGraph::Material::colorMaterial
bool colorMaterial()
get colorMaterial state
Definition: MaterialNode.hh:198
ACG::SceneGraph::Material::diffuseColor
const Vec4f & diffuseColor() const
get the diffuse color.
Definition: MaterialNode.hh:179
ACG::SceneGraph::Material::lineSmooth
void lineSmooth(bool _b)
set: smooth lines enabled
Definition: MaterialNode.hh:226
ACG::SceneGraph::MaterialNode::set_line_width
void set_line_width(float _sz)
set line width (default: 1.0)
Definition: MaterialNode.hh:459
ACG::SceneGraph::Material::ambientColor
void ambientColor(const Vec4f &_a)
set the ambient color.
Definition: MaterialNode.hh:172
ACG::SceneGraph::MaterialNode::enable_color_material
void enable_color_material()
Enable Color Material.
Definition: MaterialNode.hh:431
ACG::SceneGraph::Material::enableBlending
void enableBlending(GLenum _p1=GL_SRC_ALPHA, GLenum _p2=GL_ONE_MINUS_SRC_ALPHA)
enable blending with Parameters (_p1, _p2)
Definition: MaterialNode.hh:270
ACG::SceneGraph::MaterialNode::set_specular_color
void set_specular_color(const Vec4f &_s)
set the specular color
Definition: MaterialNode.hh:419
ACG::SceneGraph::MaterialNode::set_reflectance
void set_reflectance(double _m)
set reflectance
Definition: MaterialNode.hh:443
ACG::SceneGraph::MaterialNode::set_round_points
void set_round_points(bool _b)
set round points enabled
Definition: MaterialNode.hh:464
ACG::SceneGraph::MaterialNode::line_smooth
bool line_smooth() const
get: rsmooth lines enabled
Definition: MaterialNode.hh:471
ACG::SceneGraph::Material::multiSampling
bool multiSampling() const
Get state of multisampling.
Definition: MaterialNode.hh:252
ACG::SceneGraph::MaterialNode::shininess
float shininess() const
get shininess
Definition: MaterialNode.hh:440
ACG::SceneGraph::MaterialNode::specular_color
const Vec4f & specular_color() const
get the specular color
Definition: MaterialNode.hh:421
ACG::SceneGraph::Material::baseColor
void baseColor(const Vec4f &_c)
set the base color
Definition: MaterialNode.hh:167
ACG::SceneGraph::Material::multisampling
void multisampling(bool _state)
Set state of multisampling.
Definition: MaterialNode.hh:257
ACG::SceneGraph::Material::lineWidth
float lineWidth() const
get line width
Definition: MaterialNode.hh:218
ACG::SceneGraph::MaterialNode::set_multisampling
void set_multisampling(bool _state)
Set state of multisampling.
Definition: MaterialNode.hh:506
ACG::SceneGraph::MaterialNode::overlay_color
const Vec4f & overlay_color() const
get the overlay color
Definition: MaterialNode.hh:426
ACG::SceneGraph::Material::Material
Material()
Default constructor.
Definition: MaterialNode.hh:91
ACG::SceneGraph::MaterialNode::reflectance
double reflectance() const
get reflectance
Definition: MaterialNode.hh:445
ACG::SceneGraph::MaterialNode::alpha_test
bool alpha_test()
Return state of Alpha test.
Definition: MaterialNode.hh:487
ACG::SceneGraph::MaterialNode::material_
ACG::SceneGraph::Material material_
Local material class that actually stores the properties.
Definition: MaterialNode.hh:554
ACG::SceneGraph::Material::lineSmooth
bool lineSmooth() const
get: rsmooth lines enabled
Definition: MaterialNode.hh:228
ACG::SceneGraph::MaterialNode::enable_alpha_test
void enable_alpha_test(float _clip)
enable alpha test (draw pixels if alpha >= _clip)
Definition: MaterialNode.hh:481
ACG::SceneGraph::Material::disableColorMaterial
void disableColorMaterial()
Disable Color Material.
Definition: MaterialNode.hh:196
ACG::SceneGraph::Material::disableBackfaceCulling
void disableBackfaceCulling()
disable backface culling (not active by default, see applyProperties)
Definition: MaterialNode.hh:281
ACG::SceneGraph::MaterialNode::disable_color_material
void disable_color_material()
Disable Color Material.
Definition: MaterialNode.hh:433
ACG::SceneGraph::MaterialNode::set_line_smooth
void set_line_smooth(bool _b)
set: smooth lines enabled
Definition: MaterialNode.hh:469
ACG::SceneGraph::MaterialNode::set_diffuse_color
void set_diffuse_color(const Vec4f &_d)
set the diffuse color.
Definition: MaterialNode.hh:414
ACG::SceneGraph::Material::enableColorMaterial
void enableColorMaterial()
Enable Color Material.
Definition: MaterialNode.hh:194
ACG::SceneGraph::MaterialNode::colorMaterial
void colorMaterial(const bool _cm)
Set colorMaterial.
Definition: MaterialNode.hh:429
ACG::SceneGraph::Material::color
void color(const Vec4f &_c)
Set color based on _c.
Definition: MaterialNode.hh:149
ACG::SceneGraph::Material::disableMultisampling
void disableMultisampling()
enable alpha test (draw pixels if alpha >= _clip)
Definition: MaterialNode.hh:247
ACG::SceneGraph::MaterialNode::disable_multisampling
void disable_multisampling()
enable alpha test (draw pixels if alpha >= _clip)
Definition: MaterialNode.hh:500
ACG::SceneGraph::Material::colorMaterial
void colorMaterial(const bool _cm)
Set colorMaterial.
Definition: MaterialNode.hh:192
OpenMesh::Attributes::None
Clear all attribute bits.
Definition: Attributes.hh:86
ACG::SceneGraph::Material
Definition: MaterialNode.hh:85
ACG::SceneGraph::MaterialNode::line_width
float line_width() const
get line width
Definition: MaterialNode.hh:461
ACG::SceneGraph::Material::~Material
virtual ~Material()
Deconstructor.
Definition: MaterialNode.hh:113
MaterialNode
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
Definition: BaseObjectData.hh:88
ACG::SceneGraph::Material::disableAlphaTest
void disableAlphaTest()
disable alpha test
Definition: MaterialNode.hh:236
ACG::SceneGraph::Material::shininess
void shininess(float _s)
set shininess
Definition: MaterialNode.hh:201
ACG::SceneGraph::MaterialNode
Definition: MaterialNode.hh:321
ACG::SceneGraph::Material::enableMultisampling
void enableMultisampling()
Enable Multisampling.
Definition: MaterialNode.hh:242
ACG::SceneGraph::MaterialNode::set_shininess
void set_shininess(float _s)
set shininess
Definition: MaterialNode.hh:438
ACG::SceneGraph::Material::baseColor
const Vec4f & baseColor() const
get the base color
Definition: MaterialNode.hh:169
ACG::SceneGraph::MaterialNode::applyProperties_
int applyProperties_
OR'ed ApplyProperties.
Definition: MaterialNode.hh:551
ACG::SceneGraph::MaterialNode::enable_blending
void enable_blending(GLenum _p1=GL_SRC_ALPHA, GLenum _p2=GL_ONE_MINUS_SRC_ALPHA)
enable blending with Parameters (_p1, _p2)
Definition: MaterialNode.hh:519
ACG::SceneGraph::Material::pointSize
void pointSize(float _sz)
set point size (default: 1.0)
Definition: MaterialNode.hh:211
ACG::SceneGraph::MaterialNode::materialBackup_
ACG::SceneGraph::Material materialBackup_
Material Backup.
Definition: MaterialNode.hh:557
ACG::SceneGraph::MaterialNode::set_ambient_color
void set_ambient_color(const Vec4f &_a)
set the ambient color.
Definition: MaterialNode.hh:409
ACG::SceneGraph::Material::alphaValue
float alphaValue() const
get current alpha value for alpha_test
Definition: MaterialNode.hh:262
ACG::SceneGraph::MaterialNode::disable_backface_culling
void disable_backface_culling()
disable backface culling (not active by default, see applyProperties)
Definition: MaterialNode.hh:532
ACG::SceneGraph::MaterialNode::ambient_color
const Vec4f & ambient_color() const
get the ambient color.
Definition: MaterialNode.hh:411