17 #ifndef ABSTRACT_MESH_H_ 18 #define ABSTRACT_MESH_H_ 114 virtual bool load(
const std::string &_fname,
bool _calcBB=
true) noexcept =0;
118 AbstractMesh() noexcept : m_vbo(false), m_vao(false), m_ext(
nullptr) {;}
126 void drawBBox()
const noexcept;
130 void draw()
const noexcept;
135 void loadTexture(
const std::string& _fname ) noexcept;
147 void calcDimensions() noexcept;
152 void calcBoundingSphere() noexcept;
158 void writeToRibSubdiv(
RibExport& _ribFile)
const noexcept;
163 virtual void createVAO() noexcept;
173 Real *mapVAOVerts() noexcept;
177 void unMapVAO() noexcept;
183 const std::vector<IndexRef> &
getIndices() noexcept{
return m_indices; }
189 void saveNCCABinaryMesh(
const std::string &_fname ) noexcept;
259 bool isTriangular() noexcept;
399 #endif // end of the class a class to hold the index into vert / norm and tex list for creating the VBO data structure ...
std::vector< uint32_t > m_tex
The texture co-ord index.
a simple texture loader / GL texture object
Real getSphereRadius() const noexcept
accesor to get the bounding sphere center
IndexRef(uint32_t _v, uint32_t _n, uint32_t _t) noexcept
ctor to set the data
GLenum GLenum GLenum GLenum GLenum scale
std::vector< IndexRef > m_indices
a vector of indices used to pass the index into the Data arrays to the VBO
std::vector< uint32_t > m_norm
the normal index
BBox & getBBox() noexcept
a method to get the current bounding box of the mesh
main definition of types and namespace
Real m_minX
The Min X value in the obj file used to calculate the extents bbox.
std::vector< Vec3 > m_tex
Pointer to the Texture co-ord list (note that only x and y are used)
Vec3 getVertexAtIndex(uint32_t _i) const noexcept
accessor for the vertex data
const std::vector< IndexRef > & getIndices() noexcept
get a pointer to the indices used to represent the VBO data, this is used in the clip class when re-o...
Vec3 getCenter() const noexcept
accesor to get the center
std::vector< uint32_t > m_vert
The vertices index.
std::vector< Vec3 > m_verts
Pointer to the Vertex list.
unsigned int getNumNormals() const noexcept
accessor to get the number of normals in the object
Real m_maxX
The Maximum X value in the obj file used to calculate the extents bbox.
simple Vec3 encapsulates a 3 float object like glsl vec3 but not maths use the Vec3 class for maths a...
implementation files for RibExport class
std::unique_ptr< AbstractVAO > m_vaoMesh
id for our vertexArray object
std::vector< Vec3 > getVertexList() noexcept
accessor for the vertex data
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
encapsulates a 4d Homogenous Point / Vector object
Vec3 m_center
Center of the object.
unsigned int getNumVerts() const noexcept
accessor to get the number of vertices in the object
simple rib export class, attempts to auto tab the rib file etc. needs lots of work to make it complet...
bool m_loaded
flag to indicate if anything loaded for dtor
unsigned int getMeshSize() const noexcept
GLuint m_vboBuffers
buffers for the VBO in order Vert, Tex, Norm
std::unique_ptr< BBox > m_ext
Create a bounding box of the object to store it's extents.
bool m_texture
flag to indicate if texture assigned
an abstract base mesh used to build specific meshes such as Obj
unsigned int m_nVerts
The number of vertices in the object.
simple class used to encapsulate a single face of an abstract mesh file
std::vector< Vec3 > m_norm
Pointer to the Normal List.
std::vector< Vec3 > getNormalList() noexcept
accessor for the normals data
unsigned int m_nNorm
The number of normals in the object.
unsigned int getNumFaces() const noexcept
accessor to get the number of faces in the object
AbstractMesh() noexcept
default ctor must be called from the child class so our dtor is called
GLenum m_vboDrawType
which type of VBO are we going to draw
unsigned int m_bufferPackSize
the size of the buffer pack we use this for the saving of bin vbo but it actually holds the size of t...
GLuint m_dataPackType
determines if the data is Packed as either TRI or QUAD
Real m_maxY
The Max Y value in the obj file used to calculate the extents bbox.
std::vector< Face > getFaceList() noexcept
accessor for the Face data
unsigned int m_nFaces
the number of faces in the object
Real m_maxZ
The Max Z value in the obj file used to calculate the extents bbox.
std::vector< Vec3 > getTextureCordList() noexcept
accessor for the texture co-ordinates data
bool m_textureCoord
debug flag to turn face on and off
Real m_sphereRadius
the radius of the bounding sphere
GLuint m_textureID
The openGL id of the texture for the texture generation.
uint32_t m_v
index into the vert list
Vec3 getSphereCenter() const noexcept
accesor to get the bounding sphere center
a simple rib exporter function
std::vector< GLuint > m_outIndices
a vectr of indices without duplicates which are actually passed to the VBO when creating ...
bool m_vboMapped
flag to indicate if the VBO vertex data has been mapped
bool m_vbo
flag to indicate if a VBO has been created
Simple Bounding box class used in various parts of ngl and other example programs.
a simple bounding box class
Real m_minZ
The Min Z value in the obj file used to calculate the extents bbox.
unsigned int m_nTex
the number of texture co-ordinates in the object
size_t m_indexSize
the size of the index array
uint32_t m_t
index into the texture list
unsigned int getTextureID() const noexcept
get the texture id
uint32_t m_n
index into the nornmal list
Vec3 m_sphereCenter
the center of the bounding sphere
unsigned int getNumTexCords() const noexcept
accessor to get the number of texture co-ordinates in the object
re impliment asserts so we don't exit on failure
unsigned int m_numVerts
the number of vertices in the face
Class to load and manipulate NCCAPointBake data, this will replace the Houdini Clip files as they are...
GLsizei const GLchar *const * string
Real m_minY
The Min Y value in the obj file used to calculate the extents bbox.
std::vector< Face > m_face
Pointer to the Face list.
bool m_vao
flag to indicate if a VBO has been created