Core Scene Graph Data Structures in C++
IndexedFaceSet
Only pointers to IndexedFaceSet nodes and IndexedLineSet nodes are allowed as values for the geometry field of a Shape node. In the VRML'97 Standard the IndexedFaceSet node is defined as follows:
IndexedFaceSet {
SFNode color NULL
SFNode coord NULL
SFNode normal NULL
SFNode texCoord NULL
SFBool ccw TRUE
MFInt32 colorIndex [] # [-1,)
SFBool colorPerVertex TRUE
SFBool convex TRUE
MFInt32 coordIndex [] # [-1,)
SFFloat creaseAngle 0 # [ 0,)
MFInt32 normalIndex [] # [-1,)
SFBool normalPerVertex TRUE
SFBool solid TRUE
MFInt32 texCoordIndex [] # [-1,)
}
In the DGP2026 implementation the IndexedFaceSet C++ class has the following private interface.
class IndexedFaceSet : public Node {
public:
IndexedFaceSet();
~IndexedFaceSet();
void clear();
bool& getCcw();
bool& getConvex();
float& getCreaseangle();
bool& getSolid();
bool& getNormalPerVertex();
bool& getColorPerVertex();
vector<float>& getCoord();
vector<int>& getCoordIndex();
vector<float>& getNormal();
vector<int>& getNormalIndex();
vector<float>& getColor();
vector<int>& getColorIndex();
vector<float>& getTexCoord();
vector<int>& getTexCoordIndex();
bool isTriangleMesh();
int getNumberOfFaces();
int getNumberOfCorners();
int getNumberOfCoord();
int getNumberOfNormal();
int getNumberOfColor();
int getNumberOfTexCoord();
void setNormalPerVertex(bool value);
void setColorPerVertex(bool value);
static const string stringBinding(Binding b);
Binding getCoordBinding();
Binding getNormalBinding();
Binding getColorBinding();
Binding getTexCoordBinding();
virtual bool isIndexedFaceSet() const;
virtual string getType() const;
};
enum IndexedFaceSet::Binding {
PB_NONE = 0,
PB_PER_VERTEX,
PB_PER_FACE,
PB_PER_FACE_INDEXED,
PB_PER_CORNER
};