1 /**************************************************************************\
2  * Copyright (c) Kongsberg Oil & Gas Technologies AS
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  * Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  *
12  * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * Neither the name of the copyright holder nor the names of its
17  * contributors may be used to endorse or promote products derived from
18  * this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 \**************************************************************************/
32 
33 /*!
34   \class SoOverrideElement Inventor/elements/SoOverrideElement.h
35   \brief The SoOverrideElement maintains a list of overridable elements and a list over which elements should be overridden.
36 
37   \ingroup elements
38 
39   Only certain elements can be overridden.
40 
41 
42   The remaining class documentation describes a single, special case:
43 
44   A common request for functionality is to override only the
45   transparency of the full scene graph, or parts of the scene
46   graph.
47 
48   In the original SGI Inventor, this is nigh impossible, as the API
49   was designed to only make it possible to override all or none of the
50   fields of a node. So calling SoNode::setOverride() on an SoMaterial
51   node will cause all material settings of that node to override all
52   material settings further on in the scene graph, and there is no way
53   to override only the transparency settings.
54 
55   In Coin, we have added in a little hack to overcome this problem,
56   since it is such a common request for functionality: to have
57   separate transparency override settings, set the environment
58   variable \c COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE to "1" to
59   enable this hack.
60 
61   (Do however note that this will not work when the SoPackedColor or
62   SoVertexProperty node is used to specify diffuse color and
63   transparency -- only with the SoMaterial node.)
64 
65   Here is a complete, stand-alone example which demonstrates how to
66   accomplish this:
67 
68   \code
69   #include <Inventor/Qt/SoQt.h>
70   #include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
71   #include <Inventor/nodes/SoSeparator.h>
72   #include <Inventor/nodes/SoMaterial.h>
73 
74   // *************************************************************************
75 
76   const char * scene = "#Inventor V2.1 asci\n"
77   "\n"
78   "Separator {"
79   "   Cone { }"
80   "   Translation { translation 1 0 5 }"
81   ""
82   "   DEF OVERRIDEMATERIAL Material { transparency 0.5 }"
83   ""
84   "   DEF OBJMATERIAL Material {"
85   "      diffuseColor 0.5 0 0"
86   "      transparency 0"
87   "   }"
88   "   Sphere { }"
89   "}"
90   ;
91 
92   int
93   main(int argc, char ** argv)
94   {
95     QWidget * window = SoQt::init(argv[0]);
96 
97     (void)coin_setenv("COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE", "1", TRUE);
98 
99     SoInput * in = new SoInput;
100     in->setBuffer((void *)scene, strlen(scene));
101     SoSeparator * root = SoDB::readAll(in);
102     assert(root);
103     delete in;
104 
105     root->ref();
106 
107     SoMaterial * overridemat = (SoMaterial *)
108       SoBase::getNamedBase("OVERRIDEMATERIAL", SoMaterial::getClassTypeId());
109     assert(overridemat);
110 
111     overridemat->diffuseColor.setIgnored(TRUE);
112     overridemat->setOverride(TRUE);
113 
114     SoQtExaminerViewer * viewer = new SoQtExaminerViewer(window);
115     viewer->setSceneGraph(root);
116     viewer->show();
117 
118     SoQt::show(window);
119     SoQt::mainLoop();
120 
121     delete viewer;
122     root->unref();
123 
124     return 0;
125   }
126   \endcode
127 */
128 
129 // *************************************************************************
130 
131 #include "SbBasicP.h"
132 
133 #include <Inventor/elements/SoOverrideElement.h>
134 
135 #include <cassert>
136 #include <cstdlib>
137 
138 #include <Inventor/C/tidbits.h>
139 
140 // *************************************************************************
141 
142 #define SO_GET_OVERRIDE(flag) \
143 const SoOverrideElement * const element = \
144   coin_assert_cast<const SoOverrideElement *>(getConstElement(state, classStackIndex)); \
145 return (element->flags & flag)
146 
147 #define SO_SET_OVERRIDE(flag) \
148 SoOverrideElement * const element = \
149   const_cast<SoOverrideElement * const> \
150   ( \
151    coin_safe_cast<const SoOverrideElement *>(getElement(state, classStackIndex)) \
152     ); \
153 if (element && override) \
154   element->flags |= flag; \
155 else if (element) \
156   element->flags &= ~flag
157 
158 // *************************************************************************
159 
160 static int COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE = -1;
161 
162 // *************************************************************************
163 
164 static SbBool
use_separate_transp_diffuse(void)165 use_separate_transp_diffuse(void)
166 {
167   if (COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE < 0) {
168     COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE = 0;
169 
170     const char * env =
171       coin_getenv("COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE");
172     if (env) {
173       COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE = atoi(env);
174     }
175   }
176   return COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE ?
177     TRUE : FALSE;
178 }
179 
180 // *************************************************************************
181 
182 /*!
183 \enum SoOverrideElement::FlagBits
184 
185 FIXME: write doc.
186 */
187 
188 SO_ELEMENT_SOURCE(SoOverrideElement);
189 
190 /*!
191 This static method initializes static data for the
192 SoOverrideElement class.
193 */
194 
195 void
initClass(void)196 SoOverrideElement::initClass(void)
197 {
198   SO_ELEMENT_INIT_CLASS(SoOverrideElement, inherited);
199 }
200 
201 /*!
202   The destructor.
203 */
204 
~SoOverrideElement(void)205 SoOverrideElement::~SoOverrideElement(void)
206 {
207 }
208 
209 //! FIXME: write doc.
210 
211 void
init(SoState * state)212 SoOverrideElement::init(SoState * state)
213 {
214   inherited::init(state);
215   this->flags = 0;
216 }
217 
218 //! FIXME: write doc.
219 
220 void
push(SoState * state)221 SoOverrideElement::push(SoState * state)
222 {
223   inherited::push(state);
224   const SoOverrideElement * prev = coin_assert_cast<SoOverrideElement *>
225     (
226      this->getNextInStack()
227      );
228   this->flags = prev->flags;
229 }
230 
231 //! FIXME: write doc.
232 
233 SbBool
matches(const SoElement * element) const234 SoOverrideElement::matches(const SoElement *element) const
235 {
236   return (coin_assert_cast<const SoOverrideElement *>(element))->flags == this->flags;
237 }
238 
239 //! FIXME: write doc.
240 
241 SoElement *
copyMatchInfo(void) const242 SoOverrideElement::copyMatchInfo(void) const
243 {
244   SoOverrideElement * elem = static_cast<SoOverrideElement *>
245     (
246      this->getTypeId().createInstance()
247      );
248   elem->flags = this->flags;
249   return elem;
250 }
251 
252 //! FIXME: write doc.
253 
254 void
print(FILE *) const255 SoOverrideElement::print(FILE * /* file */) const
256 {
257 }
258 
259 /*!
260   FIXME: write doc.
261 */
262 
263 SbBool
getAmbientColorOverride(SoState * const state)264 SoOverrideElement::getAmbientColorOverride(SoState * const state)
265 {
266   SO_GET_OVERRIDE(AMBIENT_COLOR);
267 }
268 
269 /*!
270   FIXME: write doc.
271 */
272 
273 SbBool
getColorIndexOverride(SoState * const state)274 SoOverrideElement::getColorIndexOverride(SoState * const state)
275 {
276   SO_GET_OVERRIDE(COLOR_INDEX);
277 }
278 
279 /*!
280   FIXME: write doc.
281 */
282 
283 SbBool
getComplexityOverride(SoState * const state)284 SoOverrideElement::getComplexityOverride(SoState * const state)
285 {
286   SO_GET_OVERRIDE(COMPLEXITY);
287 }
288 
289 /*!
290   FIXME: write doc.
291 */
292 
293 SbBool
getComplexityTypeOverride(SoState * const state)294 SoOverrideElement::getComplexityTypeOverride(SoState * const state)
295 {
296   SO_GET_OVERRIDE(COMPLEXITY_TYPE);
297 }
298 
299 /*!
300   FIXME: write doc.
301 */
302 
303 SbBool
getCreaseAngleOverride(SoState * const state)304 SoOverrideElement::getCreaseAngleOverride(SoState * const state)
305 {
306   SO_GET_OVERRIDE(CREASE_ANGLE);
307 }
308 
309 /*!
310   FIXME: write doc.
311 */
312 
313 SbBool
getDiffuseColorOverride(SoState * const state)314 SoOverrideElement::getDiffuseColorOverride(SoState * const state)
315 {
316   SO_GET_OVERRIDE(DIFFUSE_COLOR);
317 }
318 
319 /*!
320   FIXME: write doc.
321 */
322 
323 SbBool
getDrawStyleOverride(SoState * const state)324 SoOverrideElement::getDrawStyleOverride(SoState * const state)
325 {
326   SO_GET_OVERRIDE(DRAW_STYLE);
327 }
328 
329 /*!
330   FIXME: write doc.
331 */
332 
333 SbBool
getEmissiveColorOverride(SoState * const state)334 SoOverrideElement::getEmissiveColorOverride(SoState * const state)
335 {
336   SO_GET_OVERRIDE(EMISSIVE_COLOR);
337 }
338 
339 /*!
340   FIXME: write doc.
341 */
342 
343 SbBool
getFontNameOverride(SoState * const state)344 SoOverrideElement::getFontNameOverride(SoState * const state)
345 {
346   SO_GET_OVERRIDE(FONT_NAME);
347 }
348 
349 /*!
350   FIXME: write doc.
351 */
352 
353 SbBool
getFontSizeOverride(SoState * const state)354 SoOverrideElement::getFontSizeOverride(SoState * const state)
355 {
356   SO_GET_OVERRIDE(FONT_SIZE);
357 }
358 
359 /*!
360   FIXME: write doc.
361 */
362 
363 SbBool
getLightModelOverride(SoState * const state)364 SoOverrideElement::getLightModelOverride(SoState * const state)
365 {
366   SO_GET_OVERRIDE(LIGHT_MODEL);
367 }
368 
369 /*!
370   FIXME: write doc.
371 */
372 
373 SbBool
getLinePatternOverride(SoState * const state)374 SoOverrideElement::getLinePatternOverride(SoState * const state)
375 {
376   SO_GET_OVERRIDE(LINE_PATTERN);
377 }
378 
379 /*!
380   FIXME: write doc.
381 */
382 
383 SbBool
getLineWidthOverride(SoState * const state)384 SoOverrideElement::getLineWidthOverride(SoState * const state)
385 {
386   SO_GET_OVERRIDE(LINE_WIDTH);
387 }
388 
389 /*!
390   FIXME: write doc.
391 */
392 
393 SbBool
getMaterialBindingOverride(SoState * const state)394 SoOverrideElement::getMaterialBindingOverride(SoState * const state)
395 {
396   SO_GET_OVERRIDE(MATERIAL_BINDING);
397 }
398 
399 /*!
400   FIXME: write doc.
401 */
402 
403 SbBool
getPointSizeOverride(SoState * const state)404 SoOverrideElement::getPointSizeOverride(SoState * const state)
405 {
406   SO_GET_OVERRIDE(POINT_SIZE);
407 }
408 
409 /*!
410   FIXME: write doc.
411 */
412 
413 SbBool
getPickStyleOverride(SoState * const state)414 SoOverrideElement::getPickStyleOverride(SoState * const state)
415 {
416   SO_GET_OVERRIDE(PICK_STYLE);
417 }
418 
419 /*!
420   FIXME: write doc.
421 */
422 
423 SbBool
getShapeHintsOverride(SoState * const state)424 SoOverrideElement::getShapeHintsOverride(SoState * const state)
425 {
426   SO_GET_OVERRIDE(SHAPE_HINTS);
427 }
428 
429 /*!
430   FIXME: write doc.
431 */
432 
433 SbBool
getShininessOverride(SoState * const state)434 SoOverrideElement::getShininessOverride(SoState * const state)
435 {
436   SO_GET_OVERRIDE(SHININESS);
437 }
438 
439 /*!
440   FIXME: write doc.
441 */
442 
443 SbBool
getSpecularColorOverride(SoState * const state)444 SoOverrideElement::getSpecularColorOverride(SoState * const state)
445 {
446   SO_GET_OVERRIDE(SPECULAR_COLOR);
447 }
448 
449 /*!
450   FIXME: write doc.
451 */
452 
453 SbBool
getTransparencyOverride(SoState * const state)454 SoOverrideElement::getTransparencyOverride(SoState * const state)
455 {
456   SO_GET_OVERRIDE(TRANSPARENCY);
457 }
458 
459 /*!
460   FIXME: write doc.
461 */
462 
463 SbBool
getTransparencyTypeOverride(SoState * const state)464 SoOverrideElement::getTransparencyTypeOverride(SoState * const state)
465 {
466   SO_GET_OVERRIDE(TRANSPARENCY_TYPE);
467 }
468 
469 /*!
470   FIXME: write doc.
471 */
472 
473 SbBool
getPolygonOffsetOverride(SoState * const state)474 SoOverrideElement::getPolygonOffsetOverride(SoState * const state)
475 {
476   SO_GET_OVERRIDE(POLYGON_OFFSET);
477 }
478 
479 /*!
480   Returns normal vector override value.
481 
482   \COIN_FUNCTION_EXTENSION
483 
484   \since Coin 2.0
485 */
486 SbBool
getNormalVectorOverride(SoState * const state)487 SoOverrideElement::getNormalVectorOverride(SoState * const state)
488 {
489   SO_GET_OVERRIDE(NORMAL_VECTOR);
490 }
491 
492 /*!
493   Returns normal binding override value.
494 
495   \COIN_FUNCTION_EXTENSION
496 
497   \since Coin 2.0
498 */
499 SbBool
getNormalBindingOverride(SoState * const state)500 SoOverrideElement::getNormalBindingOverride(SoState * const state)
501 {
502   SO_GET_OVERRIDE(NORMAL_BINDING);
503 }
504 
505 /*!
506   FIXME: write doc.
507 */
508 
509 void
setAmbientColorOverride(SoState * const state,SoNode * const,const SbBool override)510 SoOverrideElement::setAmbientColorOverride(SoState * const state,
511                                            SoNode * const /* node */,
512                                            const SbBool override)
513 {
514   SO_SET_OVERRIDE(AMBIENT_COLOR);
515 }
516 
517 /*!
518   FIXME: write doc.
519 */
520 
521 void
setColorIndexOverride(SoState * const state,SoNode * const,const SbBool override)522 SoOverrideElement::setColorIndexOverride(SoState * const state,
523                                          SoNode * const /* node */,
524                                          const SbBool override)
525 {
526   SO_SET_OVERRIDE(COLOR_INDEX);
527 }
528 
529 /*!
530   FIXME: write doc.
531 */
532 
533 void
setComplexityOverride(SoState * const state,SoNode * const,const SbBool override)534 SoOverrideElement::setComplexityOverride(SoState * const state,
535                                          SoNode * const /* node */,
536                                          const SbBool override)
537 {
538   SO_SET_OVERRIDE(COMPLEXITY);
539 }
540 
541 /*!
542   FIXME: write doc.
543 */
544 
545 void
setComplexityTypeOverride(SoState * const state,SoNode * const,const SbBool override)546 SoOverrideElement::setComplexityTypeOverride(SoState * const state,
547                                              SoNode * const /* node */,
548                                              const SbBool override)
549 {
550   SO_SET_OVERRIDE(COMPLEXITY_TYPE);
551 }
552 
553 /*!
554   FIXME: write doc.
555 */
556 
557 void
setCreaseAngleOverride(SoState * const state,SoNode * const,const SbBool override)558 SoOverrideElement::setCreaseAngleOverride(SoState * const state,
559                                           SoNode * const /* node */,
560                                           const SbBool override)
561 {
562   SO_SET_OVERRIDE(CREASE_ANGLE);
563 }
564 
565 /*!
566   Can be used to set diffuse color override. This will also set the
567   transparency override. Since we feel this is a design flaw,
568   it is possible to override this behaviour by setting an environement
569   value called COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE to 1.
570 
571   Please note that separate override will not work for the PackedColor
572   or SoVertexProperty nodes.
573 */
574 void
setDiffuseColorOverride(SoState * const state,SoNode * const,const SbBool override)575 SoOverrideElement::setDiffuseColorOverride(SoState * const state,
576                                            SoNode * const /* node */,
577                                            const SbBool override)
578 {
579   SO_SET_OVERRIDE(DIFFUSE_COLOR);
580   if (!use_separate_transp_diffuse()) {
581     SO_SET_OVERRIDE(TRANSPARENCY);
582   }
583 }
584 
585 /*!
586   FIXME: write doc.
587 */
588 
589 void
setDrawStyleOverride(SoState * const state,SoNode * const,const SbBool override)590 SoOverrideElement::setDrawStyleOverride(SoState * const state,
591                                         SoNode * const /* node */,
592                                         const SbBool override)
593 {
594   SO_SET_OVERRIDE(DRAW_STYLE);
595 }
596 
597 /*!
598   FIXME: write doc.
599 */
600 
601 void
setEmissiveColorOverride(SoState * const state,SoNode * const,const SbBool override)602 SoOverrideElement::setEmissiveColorOverride(SoState * const state,
603                                             SoNode * const /* node */,
604                                             const SbBool override)
605 {
606   SO_SET_OVERRIDE(EMISSIVE_COLOR);
607 }
608 
609 /*!
610   FIXME: write doc.
611 */
612 
613 void
setFontNameOverride(SoState * const state,SoNode * const,const SbBool override)614 SoOverrideElement::setFontNameOverride(SoState * const state,
615                                        SoNode * const /* node */,
616                                        const SbBool override)
617 {
618   SO_SET_OVERRIDE(FONT_NAME);
619 }
620 
621 /*!
622   FIXME: write doc.
623 */
624 
625 void
setFontSizeOverride(SoState * const state,SoNode * const,const SbBool override)626 SoOverrideElement::setFontSizeOverride(SoState * const state,
627                                        SoNode * const /* node */,
628                                        const SbBool override)
629 {
630   SO_SET_OVERRIDE(FONT_SIZE);
631 }
632 
633 /*!
634   FIXME: write doc.
635 */
636 
637 void
setLightModelOverride(SoState * const state,SoNode * const,const SbBool override)638 SoOverrideElement::setLightModelOverride(SoState * const state,
639                                          SoNode * const /* node */,
640                                          const SbBool override)
641 {
642   SO_SET_OVERRIDE(LIGHT_MODEL);
643 }
644 
645 /*!
646   FIXME: write doc.
647 */
648 
649 void
setLinePatternOverride(SoState * const state,SoNode * const,const SbBool override)650 SoOverrideElement::setLinePatternOverride(SoState * const state,
651                                           SoNode * const /* node */,
652                                           const SbBool override)
653 {
654   SO_SET_OVERRIDE(LINE_PATTERN);
655 }
656 
657 /*!
658   FIXME: write doc.
659 */
660 
661 void
setLineWidthOverride(SoState * const state,SoNode * const,const SbBool override)662 SoOverrideElement::setLineWidthOverride(SoState * const state,
663                                         SoNode * const /* node */,
664                                         const SbBool override)
665 {
666   SO_SET_OVERRIDE(LINE_WIDTH);
667 }
668 
669 //! FIXME: write doc.
670 
671 void
setMaterialBindingOverride(SoState * const state,SoNode * const,const SbBool override)672 SoOverrideElement::setMaterialBindingOverride(SoState * const state,
673                                               SoNode * const /* node */,
674                                               const SbBool override)
675 {
676   SO_SET_OVERRIDE(MATERIAL_BINDING);
677 }
678 
679 /*!
680   FIXME: write doc.
681 */
682 
683 void
setPickStyleOverride(SoState * const state,SoNode * const,const SbBool override)684 SoOverrideElement::setPickStyleOverride(SoState * const state,
685                                         SoNode * const /* node */,
686                                         const SbBool override)
687 {
688   SO_SET_OVERRIDE(PICK_STYLE);
689 }
690 
691 /*!
692   FIXME: write doc.
693 */
694 
695 void
setPointSizeOverride(SoState * const state,SoNode * const,const SbBool override)696 SoOverrideElement::setPointSizeOverride(SoState * const state,
697                                         SoNode * const /* node */,
698                                         const SbBool override)
699 {
700   SO_SET_OVERRIDE(POINT_SIZE);
701 }
702 
703 /*!
704   FIXME: write doc.
705 */
706 
707 void
setPolygonOffsetOverride(SoState * const state,SoNode * const,const SbBool override)708 SoOverrideElement::setPolygonOffsetOverride(SoState * const state,
709                                             SoNode * const /* node */,
710                                             const SbBool override)
711 {
712   SO_SET_OVERRIDE(POLYGON_OFFSET);
713 }
714 
715 /*!
716   FIXME: write doc.
717 */
718 
719 void
setShapeHintsOverride(SoState * const state,SoNode * const,const SbBool override)720 SoOverrideElement::setShapeHintsOverride(SoState * const state,
721                                          SoNode * const /* node */,
722                                          const SbBool override)
723 {
724   SO_SET_OVERRIDE(SHAPE_HINTS);
725 }
726 
727 /*!
728   FIXME: write doc.
729 */
730 
731 void
setShininessOverride(SoState * const state,SoNode * const,const SbBool override)732 SoOverrideElement::setShininessOverride(SoState * const state,
733                                         SoNode * const /* node */,
734                                         const SbBool override)
735 {
736   SO_SET_OVERRIDE(SHININESS);
737 }
738 
739 /*!
740   FIXME: write doc.
741 */
742 
743 void
setSpecularColorOverride(SoState * const state,SoNode * const,const SbBool override)744 SoOverrideElement::setSpecularColorOverride(SoState * const state,
745                                             SoNode * const /* node */,
746                                             const SbBool override)
747 {
748   SO_SET_OVERRIDE(SPECULAR_COLOR);
749 }
750 
751 
752 /*!
753   Can be used to set the transparency override.
754 
755   \sa setDiffuseColorOverride().
756 */
757 void
setTransparencyOverride(SoState * const state,SoNode * const,const SbBool override)758 SoOverrideElement::setTransparencyOverride(SoState * const state,
759                                            SoNode * const /* node */,
760                                            const SbBool override)
761 {
762   SO_SET_OVERRIDE(TRANSPARENCY);
763   if (!use_separate_transp_diffuse()) {
764     SO_SET_OVERRIDE(DIFFUSE_COLOR);
765   }
766 }
767 
768 /*!
769   Can be used to set the transparency type override.
770 
771   \sa setDiffuseColorOverride().
772 */
773 void
setTransparencyTypeOverride(SoState * const state,SoNode * const,const SbBool override)774 SoOverrideElement::setTransparencyTypeOverride(SoState * const state,
775                                                SoNode * const /* node */,
776                                                const SbBool override)
777 {
778   SO_SET_OVERRIDE(TRANSPARENCY_TYPE);
779 }
780 
781 /*!
782   Can be used to set normal vector override.
783 
784   \COIN_FUNCTION_EXTENSION
785 
786   \since Coin 2.0
787 */
788 void
setNormalVectorOverride(SoState * const state,SoNode * const,const SbBool override)789 SoOverrideElement::setNormalVectorOverride(SoState * const state,
790                                            SoNode * const /* node */,
791                                            const SbBool override)
792 {
793   SO_SET_OVERRIDE(NORMAL_VECTOR);
794 }
795 
796 /*!
797   Can be used to set normal binding override.
798 
799   \COIN_FUNCTION_EXTENSION
800 
801   \since Coin 2.0
802 */
803 void
setNormalBindingOverride(SoState * const state,SoNode * const,const SbBool override)804 SoOverrideElement::setNormalBindingOverride(SoState * const state,
805                                             SoNode * const /* node */,
806                                             const SbBool override)
807 {
808   SO_SET_OVERRIDE(NORMAL_BINDING);
809 }
810 
811 #undef SO_GET_OVERRIDE
812 #undef SO_SET_OVERRIDE
813