|
Public Member Functions |
int | getCoordIndexSetSize () |
| CIvfGLPrimitive () |
virtual | ~CIvfGLPrimitive () |
| IvfClassInfo ("CIvfGLPrimitive", CIvfShape) |
void | clear () |
void | addCoord (double x, double y, double z) |
void | addCoord (CIvfVec3d &coord) |
void | setCoord (int pos, double x, double y, double z) |
void | getCoord (long pos, double &x, double &y, double &z) |
long | getCoordSetSize () |
void | clearCoord () |
void | addMaterial (CIvfMaterial *material) |
void | clearMaterial () |
int | getMaterialSetSize () |
CIvfMaterial * | getMaterial (int pos) |
CIvfMaterialSet * | getMaterialSet () |
void | setMaterialSet (CIvfMaterialSet *materialSet) |
void | addMaterialIndex (int idx) |
void | clearMaterialIndex () |
int | getMaterialIndex (int pos) |
void | addCoordIndex (CIvfIndex *index) |
CIvfIndex * | getCoordIndex (long pos) |
void | clearCoordIndex () |
void | addColor (float red, float green, float blue) |
void | addColor (float red, float green, float blue, float alfa) |
void | setColor (int pos, float red, float green, float blue) |
void | setColor (int pos, float red, float green, float blue, float alfa) |
void | getColor (long pos, float &red, float &green, float &blue) |
void | getColor (int pos, float &red, float &green, float &blue, float &alfa) |
void | setAlfa (int pos, float alfa) |
float | getAlfa (int pos) |
long | getColorSetSize () |
void | addColorIndex (CIvfIndex *index) |
CIvfIndex * | getColorIndex (long pos) |
void | addNormal (double n1, double n2, double n3) |
void | getNormal (long pos, double &n1, double &n2, double &n3) |
long | getNormalSetSize () |
void | addNormalIndex (CIvfIndex *index) |
CIvfIndex * | getNormalIndex (long pos) |
void | addTextureCoord (double s, double t) |
void | setTextureCoord (int pos, double s, double t) |
void | getTextureCoord (long pos, double &s, double &t) |
long | getTextureCoordSetSize () |
void | clearTextureCoord () |
void | addTextureIndex (CIvfIndex *index) |
CIvfIndex * | getTextureIndex (long pos) |
void | refresh () |
void | setUseVertexNormals (bool flag) |
bool | getUseVertexNormals () |
virtual void | updateVertexNormals () |
void | updateBoundingSphere () |
Protected Member Functions |
virtual void | calcNormal (CIvfIndex *idx) |
Protected Attributes |
std::vector< CIvfVec3d * > | m_coordSet |
std::vector< CIvfColor * > | m_colorSet |
std::vector< CIvfVec3d * > | m_normalSet |
CIvfMaterialSetPtr | m_materialSet |
std::vector< CIvfVec3d * > | m_textureCoordSet |
std::vector< CIvfIndexPtr > | m_coordIndexSet |
std::vector< CIvfIndexPtr > | m_colorIndexSet |
std::vector< CIvfIndexPtr > | m_normalIndexSet |
std::vector< CIvfIndexPtr > | m_textureIndexSet |
std::vector< CIvfVec3d * > | m_vertexNormalSet |
std::vector< CIvfIndexPtr > | m_vertexNormalIndexSet |
std::vector< int > | m_materialIndexSet |
Base class for all classes implemting OpenGL primtives. This class maintains 4 main arrays for controlling the appearance of the geometry generated: a coordinate set, a color set, a normal set and a texture coordinate set. OpenGL primitives are created indirectly from these by specifying indices with instances of CIvfIndex. A quad set is created using this principle in the following code:
CIvfQuadSet* quadSet = new CIvfQuadSet();
quadSet->addCoord(0.0,0.0,2.0);
quadSet->addCoord(1.0,0.3,2.0);
quadSet->addCoord(2.0,0.0,2.0);
quadSet->addCoord(0.0,0.3,1.0);
quadSet->addCoord(1.0,0.5,1.0);
quadSet->addCoord(2.0,0.3,1.0);
quadSet->addCoord(0.0,0.0,0.0);
quadSet->addCoord(1.0,0.3,0.0);
quadSet->addCoord(2.0,0.0,0.0);
coordIdx = new CIvfIndex();
coordIdx->add(0,1,4,3);
coordIdx->add(1,2,5,4);
coordIdx->add(3,4,7,6);
coordIdx->add(4,5,8,7);
quadSet->addCoordIndex(coordIdx);
quadSet->setMaterial(greenMaterial);
quadSet->setUseVertexNormals(false);