Developer Documentation

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
45
46
47 //=============================================================================
48 //
49 // CLASS MaterialNode
50 //
51 //=============================================================================
52
53 #ifndef ACG_MATERIAL_NODE_HH
54 #define ACG_MATERIAL_NODE_HH
55
56
57 //== INCLUDES =================================================================
58
59 #include "BaseNode.hh"
60 #include <string>
61 #include <QVariantMap>
62
63 //== NAMESPACES ===============================================================
64
65 namespace ACG {
66
67 QVariantMap ACGDLLEXPORT json_to_variant_map(QString json);
68
69 namespace SceneGraph {
70
71
72 //== CLASS DEFINITION =========================================================
73
79 class ACGDLLEXPORT Material {
80
81 friend class MaterialNode;
82
83 public:
85 Material() :
86 baseColor_(GLState::default_base_color),
87 ambientColor_(GLState::default_ambient_color),
88 diffuseColor_(GLState::default_diffuse_color),
89 specularColor_(GLState::default_specular_color),
90 overlayColor_(GLState::default_overlay_color),
91 shininess_(GLState::default_shininess),
92 reflectance_(0.0),
93 indexOfRefraction_(1.0),
94 isRefractive_(false),
95 pointSize_(1.0),
96 lineWidth_(1.0),
97 roundPoints_(false),
98 linesSmooth_(false),
99 alphaTest_(false),
100 alphaClip_(0),
101 blending_(false),
102 blendParam1_(GL_SRC_ALPHA),
103 blendParam2_(GL_ONE_MINUS_SRC_ALPHA),
104 colorMaterial_(true),
105 backfaceCulling_(false),
106 multiSampling_(true) {};
107
109 virtual ~Material() {};
110
112 Material(const Material& _m) :
113 baseColor_(_m.baseColor_),
114 ambientColor_(_m.ambientColor_),
115 diffuseColor_(_m.diffuseColor_),
116 specularColor_(_m.specularColor_),
117 overlayColor_(_m.overlayColor_),
118 shininess_(_m.shininess_),
119 reflectance_(_m.reflectance_),
120 indexOfRefraction_(_m.indexOfRefraction_),
121 isRefractive_(_m.isRefractive_),
122 pointSize_(_m.pointSize_),
123 lineWidth_(_m.lineWidth_),
124 roundPoints_(_m.roundPoints_),
125 linesSmooth_(_m.linesSmooth_),
126 alphaTest_(_m.alphaTest_),
127 alphaClip_(_m.alphaClip_),
128 blending_(_m.blending_),
129 blendParam1_(_m.blendParam1_),
130 blendParam2_(_m.blendParam2_),
131 colorMaterial_(_m.colorMaterial_),
132 backfaceCulling_(_m.backfaceCulling_),
133 multiSampling_(_m.multiSampling_) {};
134
135 static bool support_json_serialization();
136 QString serializeToJson() const;
137 void deserializeFromJson(const QString &json);
138 void deserializeFromVariantMap(const QVariantMap &matMap);
139
147 void color(const Vec4f& _c) {
148 Vec4f c(0.0,0.0,0.0,1.0);
149 baseColor(c);
150 overlayColor(c);
151 c = _c * 0.2f; c[3]=_c[3]; ambientColor(c);
152 c = _c * 0.6f; c[3]=_c[3]; diffuseColor(c);
153 c = _c * 0.8f; c[3]=_c[3]; specularColor(c);
154 }
155
157 void generateRandomColor() {
158 color( Vec4f(0.2 + double(rand())/double(RAND_MAX)*0.8,
159 0.2 + double(rand())/double(RAND_MAX)*0.8,
160 0.2 + double(rand())/double(RAND_MAX)*0.8,
161 1.0));
162 }
163
165 void baseColor(const Vec4f& _c) { baseColor_ = _c;}
167 const Vec4f& baseColor() const { return baseColor_; }
168
170 void emissionColor(const Vec4f& _c) { baseColor_ = _c;}
172 const Vec4f& emissionColor() const { return baseColor_; }
173
175 void ambientColor(const Vec4f& _a) { ambientColor_ = _a; }
177 const Vec4f& ambientColor() const { return ambientColor_; }
178
180 void diffuseColor(const Vec4f& _d) { diffuseColor_ = _d; }
182 const Vec4f& diffuseColor() const { return diffuseColor_; }
183
185 void specularColor(const Vec4f& _s) { specularColor_ = _s; }
187 const Vec4f& specularColor() const { return specularColor_; }
188
190 void overlayColor(const Vec4f& _s) { overlayColor_ = _s; }
192 const Vec4f& overlayColor() const { return overlayColor_; }
193
195 void colorMaterial( const bool _cm) { colorMaterial_ = _cm; }
197 void enableColorMaterial() { colorMaterial_ = true; }
199 void disableColorMaterial() { colorMaterial_ = false; }
201 bool colorMaterial() { return colorMaterial_; }
202
204 void shininess(float _s) { shininess_ = _s; }
206 float shininess() const { return shininess_; }
207
209 void reflectance(double _m) { reflectance_ = _m; }
211 double reflectance() const { return reflectance_; }
212
214 void indexOfRefraction(double _m) { indexOfRefraction_ = _m; }
216 double indexOfRefraction() const { return indexOfRefraction_; }
217
219 void setRefractive(bool _r) { isRefractive_ = _r; }
221 bool isRefractive() const {return isRefractive_;}
222
224 void pointSize(float _sz) { pointSize_ = _sz; }
226 float pointSize() const { return pointSize_; }
227
229 void lineWidth(float _sz) { lineWidth_ = _sz; }
231 float lineWidth() const { return lineWidth_; }
232
234 void roundPoints(bool _b) { roundPoints_ = _b; }
236 bool roundPoints() const { return roundPoints_; }
237
239 void lineSmooth(bool _b) { linesSmooth_ = _b; }
241 bool lineSmooth() const { return linesSmooth_; }
242
244 void enableAlphaTest(float _clip) {
245 alphaTest_ = true; alphaClip_ = _clip;
246 }
247
249 void disableAlphaTest() { alphaTest_ = false; }
250
252 bool alphaTest() const { return alphaTest_; };
253
255 void enableMultisampling() {
256 multiSampling_ = true;
257 }
258
260 void disableMultisampling() {
261 multiSampling_ = false;
262 }
263
265 bool multiSampling() const {
266 return multiSampling_;
267 }
268
270 void multisampling( bool _state ) {
271 multiSampling_ = _state;
272 }
273
275 float alphaValue() const { return alphaClip_; };
276
277 bool blending() const { return blending_; };
278
279 GLenum blendingParam1() const { return blendParam1_; };
280 GLenum blendingParam2() const { return blendParam2_; };
281
283 void enableBlending(GLenum _p1 = GL_SRC_ALPHA,
284 GLenum _p2 = GL_ONE_MINUS_SRC_ALPHA)
285 { blending_ = true; blendParam1_ = _p1; blendParam2_ = _p2; }
287 void disableBlending() { blending_ = false; }
288
289 bool backfaceCulling() const { return backfaceCulling_; };
290
292 void enableBackfaceCulling() { backfaceCulling_ = true; }
294 void disableBackfaceCulling() { backfaceCulling_ = false; }
295
296 bool isEmissive() const { return (baseColor_[0] > 0.f || baseColor_[1] > 0.f || baseColor_[2] > 0.f); }
297
298 protected:
299
300 Vec4f baseColor_;
301 Vec4f ambientColor_;
302 Vec4f diffuseColor_;
303 Vec4f specularColor_;
304 Vec4f overlayColor_;
305
306 float shininess_;
307 double reflectance_;
308 double indexOfRefraction_;
309 bool isRefractive_;
310 float pointSize_;
311 float lineWidth_;
312
313 bool roundPoints_;
314 bool linesSmooth_;
315
316 bool alphaTest_;
317 float alphaClip_;
318
319 bool blending_;
320 GLenum blendParam1_;
321 GLenum blendParam2_;
322
323 bool colorMaterial_;
324 bool backfaceCulling_;
325
326 bool multiSampling_;
327 };
328
329
338 class ACGDLLEXPORT MaterialNode : public BaseNode
339 {
340 public:
341
343 enum ApplyProperties
344 {
346 None=0,
348 All=0xffff,
350 BaseColor=1,
352 Material=2,
354 PointSize=4,
356 LineWidth=8,
358 RoundPoints=16,
360 LineSmooth=32,
362 AlphaTest=64,
364 Blending=128,
366 BackFaceCulling=256,
368 ColorMaterial=512,
370 MultiSampling=1024
371 };
372
374 MaterialNode( BaseNode* _parent = 0,
375 const std::string& _name = "<MaterialNode>",
376 unsigned int _applyProperties = (All & ~BackFaceCulling));
377
379 virtual ~MaterialNode() {};
380
382 void read( std::istream & _is);
383
384 //===========================================================================
387 //===========================================================================
388
389 ACG_CLASSNAME(MaterialNode);
390
392 void enter(GLState& _state, const DrawModes::DrawMode& _drawmode);
394 void leave(GLState& _state, const DrawModes::DrawMode& _drawmode);
395
396
398 void enterPick(GLState& _state, PickTarget _target, const DrawModes::DrawMode& _drawMode );
399
401 void leavePick(GLState& _state, PickTarget _target, const DrawModes::DrawMode& _drawMode );
402
405 //===========================================================================
408 //===========================================================================
409
411 void set_color(const Vec4f& _c) {
412 material_.color(_c);
413 }
414
416 void set_random_color() {
417 material_.generateRandomColor();
418 }
419
421 void set_base_color(const Vec4f& _c) { material_.baseColor(_c); }
423 const Vec4f& base_color() const { return material_.baseColor(); }
424
426 void set_emission(const Vec4f& _c) { material_.baseColor(_c); }
428 const Vec4f& emission() const { return material_.baseColor(); }
429
431 void set_ambient_color(const Vec4f& _a) { material_.ambientColor(_a); }
433 const Vec4f& ambient_color() const { return material_.ambientColor(); }
434
436 void set_diffuse_color(const Vec4f& _d) { material_.diffuseColor(_d); }
438 const Vec4f& diffuse_color() const { return material_.diffuseColor(); }
439
441 void set_specular_color(const Vec4f& _s) { material_.specularColor(_s); }
443 const Vec4f& specular_color() const { return material_.specularColor(); }
444
446 void set_overlay_color(const Vec4f& _s) { material_.overlayColor(_s); }
448 const Vec4f& overlay_color() const { return material_.overlayColor(); }
449
451 void colorMaterial( const bool _cm) { material_.colorMaterial(_cm); }
453 void enable_color_material() { material_.enableColorMaterial(); }
455 void disable_color_material() { material_.disableColorMaterial(); }
457 bool colorMaterial() { return material_.colorMaterial(); }
458
460 void set_shininess(float _s) { material_.shininess(_s); }
462 float shininess() const { return material_.shininess(); }
463
465 void set_reflectance(double _m) { material_.reflectance(_m); }
467 double reflectance() const { return material_.reflectance(); }
468
470 void set_indexOfRefraction(double _m) { material_.indexOfRefraction(_m); }
472 double indexOfRefraction() const { return material_.indexOfRefraction(); }
473
475 void set_refractive(bool _r) { material_.isRefractive_ = _r; }
477 bool isRefractive() const {return material_.isRefractive_;}
478
481 //===========================================================================
484 //===========================================================================
486 void set_point_size(float _sz) { material_.pointSize(_sz); }
488 float point_size() const { return material_.pointSize(); }
489
491 void set_line_width(float _sz) { material_.lineWidth(_sz); }
493 float line_width() const { return material_.lineWidth(); }
494
496 void set_round_points(bool _b) { material_.roundPoints(_b); }
498 bool round_points() const { return material_.roundPoints(); }
499
501 void set_line_smooth(bool _b) { material_.lineSmooth(_b); }
503 bool line_smooth() const { return material_.lineSmooth(); }
504
507 //===========================================================================
510 //===========================================================================
511
513 void enable_alpha_test(float _clip) { material_.enableAlphaTest(_clip); }
514
516 void disable_alpha_test() { material_.disableAlphaTest(); }
517
519 bool alpha_test() { return material_.alphaTest(); };
520
523 //===========================================================================
526 //===========================================================================
527
529 void enable_multisampling() { material_.enableMultisampling(); }
530
532 void disable_multisampling() { material_.disableMultisampling(); }
533
535 bool multiSampling() { return material_.multiSampling(); }
536
538 void set_multisampling( bool _state ) { material_.multisampling(_state); }
539
542 float alpha_value(){ return material_.alphaValue(); };
544
545 bool blending() { return material_.blending(); };
546
547 GLenum blending_param1() { return material_.blendingParam1(); };
548 GLenum blending_param2() { return material_.blendingParam2(); };
549
551 void enable_blending(GLenum _p1 = GL_SRC_ALPHA,
552 GLenum _p2 = GL_ONE_MINUS_SRC_ALPHA) {
553 material_.enableBlending(_p1, _p2);
554 }
556 void disable_blending() { material_.disableBlending(); }
557
558 bool backface_culling() { return material_.backfaceCulling(); };
559
561 void enable_backface_culling() { material_.enableBackfaceCulling(); }
562
564 void disable_backface_culling() { material_.disableBackfaceCulling(); }
565
567 unsigned int applyProperties() const { return applyProperties_; }
568
570 void applyProperties(unsigned int _applyProperties) {
571 applyProperties_ = _applyProperties;
572 }
573
575 ACG::SceneGraph::Material& material() { return material_; }
576
578 void set_material(const ACG::SceneGraph::Material& _m) { material_ = _m; }
579
580 private:
581
583 int applyProperties_;
584
586 ACG::SceneGraph::Material material_;
587
589 ACG::SceneGraph::Material materialBackup_;
590 };
591
592
593 //=============================================================================
594 } // namespace SceneGraph
595 } // namespace ACG
596 //=============================================================================
597 #endif // ACG_MATERIAL_NODE_HH defined
598 //=============================================================================
599
ACG::SceneGraph::Material::enableAlphaTest
void enableAlphaTest(float _clip)
enable alpha test (draw pixels if alpha >= _clip)
Definition: MaterialNode.hh:244
ACG::SceneGraph::MaterialNode::disable_multisampling
void disable_multisampling()
enable alpha test (draw pixels if alpha >= _clip)
Definition: MaterialNode.hh:532
ACG::SceneGraph::Material::isRefractive
bool isRefractive() const
get refractive flag
Definition: MaterialNode.hh:221
ACG::SceneGraph::Material::colorMaterial
void colorMaterial(const bool _cm)
Set colorMaterial.
Definition: MaterialNode.hh:195
ACG::SceneGraph::Material::emissionColor
const Vec4f & emissionColor() const
get emission ( Same as baseColor() )
Definition: MaterialNode.hh:172
ACG
Namespace providing different geometric functions concerning angles.
Definition: BaseObjectData.hh:68
ACG::SceneGraph::Material::disableColorMaterial
void disableColorMaterial()
Disable Color Material.
Definition: MaterialNode.hh:199
ACG::SceneGraph::Material::lineSmooth
void lineSmooth(bool _b)
set: smooth lines enabled
Definition: MaterialNode.hh:239
MaterialNode
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
Definition: BaseObjectData.hh:85
ACG::SceneGraph::MaterialNode::set_diffuse_color
void set_diffuse_color(const Vec4f &_d)
set the diffuse color.
Definition: MaterialNode.hh:436
ACG::SceneGraph::Material::lineWidth
void lineWidth(float _sz)
set line width (default: 1.0)
Definition: MaterialNode.hh:229
ACG::SceneGraph::Material::indexOfRefraction
void indexOfRefraction(double _m)
set index of refraction
Definition: MaterialNode.hh:214
ACG::SceneGraph::MaterialNode::enable_color_material
void enable_color_material()
Enable Color Material.
Definition: MaterialNode.hh:453
ACG::SceneGraph::MaterialNode::applyProperties_
int applyProperties_
OR&#39;ed ApplyProperties.
Definition: MaterialNode.hh:583
ACG::SceneGraph::MaterialNode::ApplyProperties
ApplyProperties
Apply which properties? Others will be ignored. Values may be OR&#39;ed.
Definition: MaterialNode.hh:343
ACG::SceneGraph::Material::enableColorMaterial
void enableColorMaterial()
Enable Color Material.
Definition: MaterialNode.hh:197
OpenMesh::Attributes::None
Clear all attribute bits.
Definition: Attributes.hh:81
ACG::SceneGraph::Material::ambientColor
void ambientColor(const Vec4f &_a)
set the ambient color.
Definition: MaterialNode.hh:175
ACG::SceneGraph::MaterialNode::set_round_points
void set_round_points(bool _b)
set round points enabled
Definition: MaterialNode.hh:496
ACG::SceneGraph::Material::lineWidth
float lineWidth() const
get line width
Definition: MaterialNode.hh:231
ACG::SceneGraph::MaterialNode::set_specular_color
void set_specular_color(const Vec4f &_s)
set the specular color
Definition: MaterialNode.hh:441
ACG::SceneGraph::Material::enableMultisampling
void enableMultisampling()
Enable Multisampling.
Definition: MaterialNode.hh:255
ACG::SceneGraph::MaterialNode::diffuse_color
const Vec4f & diffuse_color() const
get the diffuse color.
Definition: MaterialNode.hh:438
ACG::SceneGraph::Material::alphaValue
float alphaValue() const
get current alpha value for alpha_test
Definition: MaterialNode.hh:275
ACG::SceneGraph::MaterialNode::set_color
void set_color(const Vec4f &_c)
set color (base, ambient, diffuse, specular) based on _c
Definition: MaterialNode.hh:411
ACG::SceneGraph::MaterialNode::line_width
float line_width() const
get line width
Definition: MaterialNode.hh:493
ACG::SceneGraph::MaterialNode::set_material
void set_material(const ACG::SceneGraph::Material &_m)
Set material object.
Definition: MaterialNode.hh:578
ACG::SceneGraph::Material::indexOfRefraction
double indexOfRefraction() const
get index of refraction ( not used in OpenGL Rendering)
Definition: MaterialNode.hh:216
ACG::SceneGraph::Material::pointSize
void pointSize(float _sz)
set point size (default: 1.0)
Definition: MaterialNode.hh:224
ACG::SceneGraph::MaterialNode::set_emission
void set_emission(const Vec4f &_c)
set emission ( same as set_base_color(const Vec4f& _c) )
Definition: MaterialNode.hh:426
ACG::SceneGraph::MaterialNode::line_smooth
bool line_smooth() const
get: rsmooth lines enabled
Definition: MaterialNode.hh:503
ACG::SceneGraph::Material::emissionColor
void emissionColor(const Vec4f &_c)
set emission ( Same as baseColor( const Vec4f& _c )) )
Definition: MaterialNode.hh:170
ACG::SceneGraph::MaterialNode::set_multisampling
void set_multisampling(bool _state)
Set state of multisampling.
Definition: MaterialNode.hh:538
ACG::Vec4f
VectorT< float, 4 > Vec4f
Definition: VectorT.hh:138
ACG::SceneGraph::MaterialNode::materialBackup_
ACG::SceneGraph::Material materialBackup_
Material Backup.
Definition: MaterialNode.hh:589
ACG::SceneGraph::Material::roundPoints
void roundPoints(bool _b)
set: round points enabled
Definition: MaterialNode.hh:234
ACG::SceneGraph::Material::specularColor
void specularColor(const Vec4f &_s)
set the specular color
Definition: MaterialNode.hh:185
ACG::SceneGraph::Material::shininess
float shininess() const
get shininess
Definition: MaterialNode.hh:206
ACG::SceneGraph::Material::colorMaterial
bool colorMaterial()
get colorMaterial state
Definition: MaterialNode.hh:201
ACG::SceneGraph::Material::diffuseColor
void diffuseColor(const Vec4f &_d)
set the diffuse color.
Definition: MaterialNode.hh:180
ACG::SceneGraph::MaterialNode::reflectance
double reflectance() const
get reflectance
Definition: MaterialNode.hh:467
ACG::SceneGraph::MaterialNode
Definition: MaterialNode.hh:338
ACG::SceneGraph::MaterialNode::alpha_test
bool alpha_test()
Return state of Alpha test.
Definition: MaterialNode.hh:519
ACG::SceneGraph::MaterialNode::disable_blending
void disable_blending()
disable blending
Definition: MaterialNode.hh:556
ACG::SceneGraph::MaterialNode::disable_backface_culling
void disable_backface_culling()
disable backface culling (not active by default, see applyProperties)
Definition: MaterialNode.hh:564
ACG::SceneGraph::Material::multisampling
void multisampling(bool _state)
Set state of multisampling.
Definition: MaterialNode.hh:270
ACG::SceneGraph::MaterialNode::set_line_smooth
void set_line_smooth(bool _b)
set: smooth lines enabled
Definition: MaterialNode.hh:501
ACG::SceneGraph::Material::enableBackfaceCulling
void enableBackfaceCulling()
enable backface culling (not active by default, see applyProperties)
Definition: MaterialNode.hh:292
ACG::SceneGraph::Material::baseColor
const Vec4f & baseColor() const
get the base color ( Same as emission() )
Definition: MaterialNode.hh:167
ACG::GLState
Definition: GLState.hh:213
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:283
ACG::SceneGraph::Material::ambientColor
const Vec4f & ambientColor() const
get the ambient color.
Definition: MaterialNode.hh:177
ACG::SceneGraph::Material::disableBackfaceCulling
void disableBackfaceCulling()
disable backface culling (not active by default, see applyProperties)
Definition: MaterialNode.hh:294
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:190
ACG::SceneGraph::Material::~Material
virtual ~Material()
Deconstructor.
Definition: MaterialNode.hh:109
ACG::SceneGraph::Material::pointSize
float pointSize() const
get point size
Definition: MaterialNode.hh:226
ACG::SceneGraph::Material::Material
Material()
Default constructor.
Definition: MaterialNode.hh:85
ACG::SceneGraph::MaterialNode::material_
ACG::SceneGraph::Material material_
Local material class that actually stores the properties.
Definition: MaterialNode.hh:586
ACG::SceneGraph::Material::reflectance
void reflectance(double _m)
set reflectance ( not used in OpenGL Rendering)
Definition: MaterialNode.hh:209
ACG::SceneGraph::Material::baseColor
void baseColor(const Vec4f &_c)
set the base color (Sets the baseColor which is the same as the emission(const Vec4f& _c) ) ...
Definition: MaterialNode.hh:165
ACG::SceneGraph::MaterialNode::multiSampling
bool multiSampling()
Get state of multisampling.
Definition: MaterialNode.hh:535
ACG::SceneGraph::MaterialNode::set_line_width
void set_line_width(float _sz)
set line width (default: 1.0)
Definition: MaterialNode.hh:491
ACG::SceneGraph::MaterialNode::set_indexOfRefraction
void set_indexOfRefraction(double _m)
set index of refraction
Definition: MaterialNode.hh:470
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:551
ACG::SceneGraph::MaterialNode::shininess
float shininess() const
get shininess
Definition: MaterialNode.hh:462
ACG::SceneGraph::MaterialNode::indexOfRefraction
double indexOfRefraction() const
get index of refraction
Definition: MaterialNode.hh:472
ACG::SceneGraph::MaterialNode::set_overlay_color
void set_overlay_color(const Vec4f &_s)
set the overlay color
Definition: MaterialNode.hh:446
ACG::SceneGraph::MaterialNode::round_points
bool round_points() const
get round points enabled
Definition: MaterialNode.hh:498
ACG::SceneGraph::MaterialNode::colorMaterial
bool colorMaterial()
get colorMaterial state
Definition: MaterialNode.hh:457
ACG::SceneGraph::Material::Material
Material(const Material &_m)
Copy constructor.
Definition: MaterialNode.hh:112
ACG::SceneGraph::Material::color
void color(const Vec4f &_c)
Set color based on _c.
Definition: MaterialNode.hh:147
ACG::SceneGraph::MaterialNode::ambient_color
const Vec4f & ambient_color() const
get the ambient color.
Definition: MaterialNode.hh:433
ACG::SceneGraph::MaterialNode::set_random_color
void set_random_color()
Generates a random color and sets it.
Definition: MaterialNode.hh:416
ACG::SceneGraph::MaterialNode::set_shininess
void set_shininess(float _s)
set shininess
Definition: MaterialNode.hh:460
ACG::SceneGraph::DrawModes::DrawMode
Specifies a DrawMode.
Definition: DrawModes.hh:288
ACG::SceneGraph::Material
Definition: MaterialNode.hh:79
ACG::SceneGraph::MaterialNode::applyProperties
unsigned int applyProperties() const
get properties that will be applied (OR&#39;ed ApplyProperties)
Definition: MaterialNode.hh:567
ACG::SceneGraph::MaterialNode::emission
const Vec4f & emission() const
get emission ( same as base_color() )
Definition: MaterialNode.hh:428
ACG::SceneGraph::Material::specularColor
const Vec4f & specularColor() const
get the specular color
Definition: MaterialNode.hh:187
ACG::SceneGraph::MaterialNode::disable_color_material
void disable_color_material()
Disable Color Material.
Definition: MaterialNode.hh:455
ACG::SceneGraph::Material::generateRandomColor
void generateRandomColor()
Creates a randomized color and sets it.
Definition: MaterialNode.hh:157
ACG::SceneGraph::MaterialNode::specular_color
const Vec4f & specular_color() const
get the specular color
Definition: MaterialNode.hh:443
ACG::SceneGraph::Material::alphaTest
bool alphaTest() const
Return state of Alpha test.
Definition: MaterialNode.hh:252
ACG::SceneGraph::MaterialNode::set_refractive
void set_refractive(bool _r)
set refractive flag
Definition: MaterialNode.hh:475
ACG::SceneGraph::MaterialNode::set_ambient_color
void set_ambient_color(const Vec4f &_a)
set the ambient color.
Definition: MaterialNode.hh:431
ACG::SceneGraph::MaterialNode::set_point_size
void set_point_size(float _sz)
set point size (default: 1.0)
Definition: MaterialNode.hh:486
SceneGraph
Definition: QtPrincipalAxisDialog.hh:67
ACG::SceneGraph::PickTarget
PickTarget
What target to use for picking.
Definition: PickTarget.hh:73
ACG::SceneGraph::Material::reflectance
double reflectance() const
get reflectance ( not used in OpenGL Rendering)
Definition: MaterialNode.hh:211
ACG::SceneGraph::BaseNode
Definition: BaseNode.hh:104
ACG::SceneGraph::MaterialNode::colorMaterial
void colorMaterial(const bool _cm)
Set colorMaterial.
Definition: MaterialNode.hh:451
ACG::SceneGraph::MaterialNode::base_color
const Vec4f & base_color() const
get the base color ( same as emission() )
Definition: MaterialNode.hh:423
ACG::SceneGraph::Material::setRefractive
void setRefractive(bool _r)
set refractive flag
Definition: MaterialNode.hh:219
OpenMesh::VectorT
Definition: Vector11T.hh:83
ACG::SceneGraph::MaterialNode::material
ACG::SceneGraph::Material & material()
Get material object reference.
Definition: MaterialNode.hh:575
ACG::SceneGraph::Material::diffuseColor
const Vec4f & diffuseColor() const
get the diffuse color.
Definition: MaterialNode.hh:182
ACG::SceneGraph::MaterialNode::point_size
float point_size() const
get point size
Definition: MaterialNode.hh:488
ACG::SceneGraph::MaterialNode::isRefractive
bool isRefractive() const
get refractive flag
Definition: MaterialNode.hh:477
ACG::SceneGraph::Material::disableAlphaTest
void disableAlphaTest()
disable alpha test
Definition: MaterialNode.hh:249
ACG::SceneGraph::MaterialNode::set_reflectance
void set_reflectance(double _m)
set reflectance
Definition: MaterialNode.hh:465
ACG::SceneGraph::Material::disableBlending
void disableBlending()
disable blending
Definition: MaterialNode.hh:287
ACG::SceneGraph::MaterialNode::enable_backface_culling
void enable_backface_culling()
enable backface culling (not active by default, see applyProperties)
Definition: MaterialNode.hh:561
ACG::SceneGraph::MaterialNode::enable_alpha_test
void enable_alpha_test(float _clip)
enable alpha test (draw pixels if alpha >= _clip)
Definition: MaterialNode.hh:513
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:192
ACG::SceneGraph::MaterialNode::set_base_color
void set_base_color(const Vec4f &_c)
set the base color ( Same as set_emission(const Vec4f& _c) )
Definition: MaterialNode.hh:421
ACG::SceneGraph::Material::shininess
void shininess(float _s)
set shininess
Definition: MaterialNode.hh:204
ACG::SceneGraph::MaterialNode::~MaterialNode
virtual ~MaterialNode()
Destructor.
Definition: MaterialNode.hh:379
ACG::SceneGraph::MaterialNode::disable_alpha_test
void disable_alpha_test()
disable alpha test
Definition: MaterialNode.hh:516
ACG::SceneGraph::MaterialNode::enable_multisampling
void enable_multisampling()
Enable Multisampling.
Definition: MaterialNode.hh:529
ACG::SceneGraph::Material::disableMultisampling
void disableMultisampling()
enable alpha test (draw pixels if alpha >= _clip)
Definition: MaterialNode.hh:260
Blending
Definition: BlendingMethod.hh:4
ACG::SceneGraph::MaterialNode::applyProperties
void applyProperties(unsigned int _applyProperties)
set properties that will be applied (OR&#39;ed ApplyProperties)
Definition: MaterialNode.hh:570
ACG::SceneGraph::Material::lineSmooth
bool lineSmooth() const
get: rsmooth lines enabled
Definition: MaterialNode.hh:241
ACG::SceneGraph::MaterialNode::overlay_color
const Vec4f & overlay_color() const
get the overlay color
Definition: MaterialNode.hh:448
ACG::SceneGraph::Material::roundPoints
bool roundPoints() const
get: round points enabled
Definition: MaterialNode.hh:236
ACG::SceneGraph::Material::multiSampling
bool multiSampling() const
Get state of multisampling.
Definition: MaterialNode.hh:265