H3D API  2.4.1
X3DAppearanceNode.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __X3DAPPEARANCENODE_H__
30 #define __X3DAPPEARANCENODE_H__
31 
32 #include <H3D/X3DNode.h>
34 #include <H3D/H3DSurfaceNode.h>
35 
36 namespace H3D {
37 
43  class H3DAPI_API X3DAppearanceNode :
44  public X3DNode, public H3DDisplayListObject {
45  public:
47 
49  X3DAppearanceNode( Inst< DisplayList > _displayList = 0,
50  Inst< SFNode > _metadata = 0,
51  Inst< SFSurface > _surface = 0 );
52 
53 
56  virtual void preRender() {}
57 
60  virtual void postRender() {}
61 
65  virtual GLbitfield getAffectedGLAttribs() { return 0; }
66 
69  virtual bool isTransparent() {
70  return false;
71  }
72 
75  virtual bool hasGeometryShadow() {
76  return false;
77  }
78 
81  virtual bool usingMultiPassTransparency() {
82  return default_using_multi_pass_transparency;
83  }
84 
88  virtual string defaultXMLContainerField() {
89  return "appearance";
90  }
91 
96  virtual void traverseSG( TraverseInfo &ti );
97 
102  H3DUniquePtr< SFSurface > surface;
103 
106 
110  inline static void setDefaultUsingMultiPassTransparency( bool b ) {
111  default_using_multi_pass_transparency = b;
112  }
113 
116  return default_using_multi_pass_transparency;
117  }
118 
119  protected:
124  };
125 }
126 
127 #endif
Header file for H3DDisplayListObject.
Header file for H3DSurfaceNode.
Header file for X3DNode, X3D scene-graph node.
This abstract interface class is the base class for all node types that wants to create an OpenGL dis...
Definition: H3DDisplayListObject.h:54
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
Template to make sure that the Node that is set in a SFNode is of a specified Node type.
Definition: SFNode.h:97
This is the base node type for all Appearance nodes.
Definition: X3DAppearanceNode.h:44
static void setDefaultUsingMultiPassTransparency(bool b)
Set the default value for usage of multi pass transparancy.
Definition: X3DAppearanceNode.h:110
virtual void postRender()
This function will be called by the X3DShapeNode after the geometry has been rendered.
Definition: X3DAppearanceNode.h:60
virtual string defaultXMLContainerField()
Returns the default xml containerField attribute value.
Definition: X3DAppearanceNode.h:88
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: X3DAppearanceNode.h:105
virtual bool hasGeometryShadow()
This function return true if the appearance has decided that shadow should be cast.
Definition: X3DAppearanceNode.h:75
H3DUniquePtr< SFSurface > surface
Contains the Surface node that will determine how an object will feel haptically.
Definition: X3DAppearanceNode.h:102
virtual bool isTransparent()
This function checks the transparency field to determine if the material requires that the geometry i...
Definition: X3DAppearanceNode.h:69
virtual void preRender()
This function will be called by the X3DShapeNode before any rendering of geometry and before the call...
Definition: X3DAppearanceNode.h:56
static bool getDefaultUsingMultiPassTransparency()
Get the default value for usage of multi pass transparancy.
Definition: X3DAppearanceNode.h:115
static bool default_using_multi_pass_transparency
The default value to use for multipass transparency, if the inherited appearance node does not contai...
Definition: X3DAppearanceNode.h:123
virtual bool usingMultiPassTransparency()
This function checks if multi-pass transparency should be used or not (see RenderProperties_multiPass...
Definition: X3DAppearanceNode.h:81
virtual GLbitfield getAffectedGLAttribs()
Returns a bitmask of the OpenGL attrib bits that will be affected by this node.
Definition: X3DAppearanceNode.h:65
This abstract node type is the base type for all nodes in the X3D system.
Definition: X3DNode.h:65
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194