H3D API  2.4.1
X3DNormalNode.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 __X3DNORMALNODE_H__
30 #define __X3DNORMALNODE_H__
31 
34 
35 namespace H3D {
36 
43  class H3DAPI_API X3DNormalNode :
46  public:
47 
49  X3DNormalNode( Inst< SFNode> _metadata = 0 );
50 
51  // Gets the normal of a given index.
52  virtual Vec3f getNormal( int index ) = 0;
53 
56  virtual void render( int /*index*/ ) {}
57 
60  virtual void renderArray() {}
61 
63  virtual void disableArray(){}
64 
66  virtual void setAttributeData ( ){};
67 
69  virtual void renderVBO ( ){};
70 
72  virtual void disableVBO ( ){};
73 
77  virtual string defaultXMLContainerField() {
78  return "normal";
79  }
80 
82  virtual unsigned int nrAvailableNormals() = 0;
83  };
84 }
85 
86 #endif
Contains the GLVertexAttributeObject class.
Header file for X3DGeometricPropertyNode, X3D scene-graph node.
This abstract interface is inherited by all nodes that could be used as vertex attributes in a glsl s...
Definition: GLVertexAttributeObject.h:54
This is the base node type for all geometric property node types defined in X3D.
Definition: X3DGeometricPropertyNode.h:43
This is the base node type for all normal node types in X3D.
Definition: X3DNormalNode.h:45
virtual string defaultXMLContainerField()
Returns the default xml containerField attribute value.
Definition: X3DNormalNode.h:77
virtual void renderVBO()
VBO rendering implementation.
Definition: X3DNormalNode.h:69
virtual unsigned int nrAvailableNormals()=0
Returns the number of normals this normal node can render.
virtual void disableArray()
Disable the array state enabled in renderArray().
Definition: X3DNormalNode.h:63
virtual void setAttributeData()
Implement the method to specify data and releated information.
Definition: X3DNormalNode.h:66
virtual void renderArray()
Perform the OpenGL commands to render all vertices as a vertex array.
Definition: X3DNormalNode.h:60
virtual void render(int)
Perform the OpenGL commands to render a normal given the index of the normal.
Definition: X3DNormalNode.h:56
virtual void disableVBO()
VBO disabling implementation.
Definition: X3DNormalNode.h:72
H3D API namespace.
Definition: Anchor.h:38