H3D API  2.4.1
TextureCoordinate4D.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 __TEXTURECOORDINATE4D_H__
30 #define __TEXTURECOORDINATE4D_H__
31 
33 #include <GL/glew.h>
34 #include <H3D/MFVec4f.h>
35 
36 namespace H3D {
37 
51  class H3DAPI_API TextureCoordinate4D : public X3DTextureCoordinateNode {
52  public:
54  TextureCoordinate4D( Inst< SFNode > _metadata = 0,
55  Inst< MFVec4f> _point = 0 );
56 
58  virtual ~TextureCoordinate4D();
59 
61  virtual bool supportsExplicitTexCoords() {
62  return true;
63  }
64 
68  virtual void render( int index );
69 
71  virtual void renderForTextureUnit( int index,
72  unsigned int texture_unit );
73 
76  virtual void renderArray();
77 
79  virtual void disableArray();
80 
82  virtual void setAttributeData ( );
83 
85  virtual void renderVBO ( );
86 
88  virtual void disableVBO ( );
89 
91  virtual bool preRenderCheckFail ( );
92 
94  virtual unsigned int nrAvailableTexCoords() {
95  return point->size();
96  }
97 
100  inline virtual bool supportsGetTexCoord( unsigned int texture_unit ) {
101  return true;
102  }
103 
105  virtual Vec4f getTexCoord( int index, unsigned int texture_unit ) {
106  return point->getValueByIndex( index );
107  }
108 
114  H3DUniquePtr< MFVec4f > point;
115 
118  };
119 }
120 
121 #endif
Contains the MFVec4f field class.
Header file for X3DTextureCoordinateNode, X3D scene-graph node.
The TextureCoordinate4D node is a geometry property node that specifies a set of 4D (homogeneous 3D) ...
Definition: TextureCoordinate4D.h:51
virtual bool supportsGetTexCoord(unsigned int texture_unit)
Returns true if the getTexCoord function is available for use.
Definition: TextureCoordinate4D.h:100
virtual bool supportsExplicitTexCoords()
Returns true.
Definition: TextureCoordinate4D.h:61
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: TextureCoordinate4D.h:117
virtual unsigned int nrAvailableTexCoords()
Returns the number of texture coordinates this node can render.
Definition: TextureCoordinate4D.h:94
virtual Vec4f getTexCoord(int index, unsigned int texture_unit)
Gets texture coordinate of the given index and texture unit.
Definition: TextureCoordinate4D.h:105
H3DUniquePtr< MFVec4f > point
A vector of 4d texture coordinates.
Definition: TextureCoordinate4D.h:114
This abstract node type is the base type for all node types which specify texture coordinates.
Definition: X3DTextureCoordinateNode.h:55
Vec4f()
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