![]() |
PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
|
3D Mesh class. More...
3D Mesh class.
Mesh objects are 2-level entities:
Definition at line 48 of file PureMesh3DManager.h.
#include <PureMesh3DManager.h>
Classes | |
class | PureMesh3DImpl |
Public Member Functions | |
virtual | ~PureMesh3D () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
virtual TPureBool | isLevel1 () const |
Tells if the mesh is a level-1 parent mesh. | |
virtual TPureBool | isLevel2 () const |
Tells if the mesh is a level-2 submesh. | |
virtual TPURE_PRIMITIVE_FORMAT | getPrimitiveFormat () const |
Gets the primitives' format. | |
virtual TPureUInt | getVerticesCount () const |
Gets the number of total vertices. | |
virtual const TXYZ * | getVertices (TPureBool implicitAccessSubobject=true) const |
Gets the pointer to vertices. | |
virtual TXYZ * | getVertices (TPureBool implicitAccessSubobject=true) |
Gets the pointer to vertices. | |
virtual TPureUInt | getVertexIndicesCount () const |
Gets the number of total vertex indices. | |
virtual const void * | getVertexIndices (TPureBool implicitAccessSubobject=true) const |
Gets the pointer to vertex indices. | |
virtual unsigned int | getVertexIndicesType (TPureBool implicitAccessSubobject=true) const |
Gets the type of the indices. | |
virtual TPureUInt | getMinVertexIndex (TPureBool implicitAccessSubobject=true) const |
Gets the smallest index in the vertex indices array. | |
virtual TPureUInt | getMaxVertexIndex (TPureBool implicitAccessSubobject=true) const |
Gets the greatest index in the vertex indices array. | |
virtual TPureUInt | getVertexIndex (TPureUInt index, TPureBool implicitAccessSubobject=true) const |
Gets an index value from the vertex indices array. | |
virtual const TXYZ * | getNormals (TPureBool implicitAccessSubobject=true) const |
Gets the pointer to normals. | |
virtual TPureUInt | getFaceCount () const |
Gets the number of faces/polygons formed by the vertices. | |
virtual TPureUInt | getTriangleCount () const |
Gets the number of triangles formed by the vertices. | |
PureVector & | getPosVec () |
Gets the position. | |
const PureVector & | getPosVec () const |
Gets the position. | |
virtual const PureVector & | getRelPosVec () const |
Gets the mesh-local relative position. | |
virtual const PureVector & | getSizeVec () const |
Gets the base sizes. | |
void | RecalculateSize () |
Recalculates the sizes. | |
const PureMaterial & | getMaterial (TPureBool implicitAccessSubobject=true) const |
Gets the material. | |
PureMaterial & | getMaterial (TPureBool implicitAccessSubobject=true) |
Gets the material. | |
virtual TPureUInt | getUsedSystemMemory () const |
Gets the amount of allocated system memory. | |
![]() | |
PureFiledManaged () | |
virtual | ~PureFiledManaged () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
const std::string & | getFilename () const |
Gets the filename. | |
![]() | |
PureManaged () | |
virtual | ~PureManaged () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
const PureManaged * | getUtiliser () const |
Returns the managed that utilizes this managed. | |
PureManaged * | getUtiliser () |
Returns the managed that utilizes this managed. | |
void | SetUtiliser (PureManaged *pUtiliser) |
Sets the managed that utilizes this managed. | |
void | DetachFrom () |
Removes the managed from its manager. | |
PureManager * | getManager () const |
Gets the manager of the managed. | |
const std::string & | getName () const |
Gets the name. | |
void | SetName (const std::string &name) |
Sets the name. | |
virtual void | FlushResources () |
This can be used if the specialized managed object has some resources that may be released from memory when not needed anymore. | |
![]() | |
PureFiledManager () | |
virtual | ~PureFiledManager () |
CConsole & | getConsole () const |
Returns access to console preset with logger module name as this class. | |
PureFiledManaged * | getByFilename (const char *filename) const |
Gets the FiledManaged by the specified filename. | |
virtual PureFiledManaged * | createFromFile (const char *filename) |
Should create a new managed from the given file. | |
void | WriteList () const |
From PureManager, adding logging file names. | |
![]() | |
PureManager () | |
virtual | ~PureManager () |
CConsole & | getConsole () const |
Returns access to console preset with logger module name as this class. | |
TPureInt | getCount () const |
Gets the number of managed objects. | |
TPureBool | isEmpty () const |
Is the number of manageds 0? | |
TPureInt | getSize () const |
Gets the number of allocated slots for managed objects; getSize() >= getCount(). | |
PureManaged * | getAttachedAt (TPureInt ind) const |
Gets the pointer to the managed at the given index. | |
TPureInt | getAttachedIndex (const PureManaged &m) const |
Gets the index of the given managed. | |
void | PreAlloc (TPureInt count) |
Allocates count free slots for manageds. | |
TPureBool | hasAttached (const PureManaged &m) const |
Gets whether the given managed is managed by this manager. | |
virtual void | Attach (PureManaged &m) |
Adds the given managed to the manager, if the managed has no manager yet. | |
virtual void | Detach (PureManaged &m) |
Removes the given managed from the manager, so the managed will have no manager. | |
void | DeleteAttachedInstance (PureManaged &m) |
Removes the given managed from the manager and destructs it. | |
void | DeleteAll () |
Removes and destructs every managed element in the manager. | |
virtual void | HandleManagedPropertyChanged (PureManaged &m) |
Should be invoked when a managed's property got changed from a different kind of manager or managed. | |
Static Public Member Functions | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
Protected Member Functions | |
PureMesh3D (TPURE_PRIMITIVE_FORMAT prfmt=PURE_PM_TRIANGLES) | |
Only PureMesh3DManager creates it. | |
PureMesh3D (const PureMesh3D &) | |
PureMesh3D & | operator= (const PureMesh3D &) |
![]() | |
PureFiledManaged (const PureFiledManaged &other) | |
PureFiledManaged & | operator= (const PureFiledManaged &other) |
void | SetFilename (const std::string &filename) |
Sets the filename. | |
![]() | |
PureManaged (const PureManaged &other) | |
PureManaged & | operator= (const PureManaged &other) |
![]() | |
PureFiledManager (const PureFiledManager &) | |
PureFiledManager & | operator= (const PureFiledManager &) |
virtual void | WriteListCallback (const PureManaged &mngd) const |
From PureManager, printing filename. | |
![]() | |
PureManager (const PureManager &other) | |
PureManager & | operator= (const PureManager &) |
Private Attributes | |
PureMesh3DImpl * | pImpl |
Friends | |
class | PureMesh3DManager |
class | PureObject3DManager |
class | SampleManagerForDescendantFromVertexTransfer |
|
virtual |
Definition at line 565 of file PureMesh3D.cpp.
|
protected |
Only PureMesh3DManager creates it.
Only PureObject3DManager creates it.
std::bad_alloc | - This class or its ancestor dynamically allocates memory with operator new, in case of failure the exception is not handled but propagated to caller. |
Definition at line 954 of file PureMesh3D.cpp.
|
protected |
Definition at line 960 of file PureMesh3D.cpp.
|
virtual |
Gets the number of faces/polygons formed by the vertices.
Gets the number of faces/polygons/primitives formed by the vertices.
Face count doesn't only depend on vertex or vertex index count but also on the primitive format (see: getPrimitiveFormat()). Note that face count is not necessarily equal to getTriangleCount() because e.q. if primitive format is quads/quadrilaterals, then obviously face count will be smaller than triangle count. Even if primitive format indicates quads/quadrilaterals, they are split into triangles at some point when transferred through the graphics pipeline.
Reimplemented in PureObject3D.
Definition at line 812 of file PureMesh3D.cpp.
|
static |
Returns the logger module name of this class.
Intentionally not virtual, so derived class should hide this instead of overriding. Not even private, so user can also access this from outside, for any reason like controlling log filtering per logger module name.
Definition at line 591 of file PureMesh3D.cpp.
CConsole & PureMesh3D::getManagedConsole | ( | ) | const |
Returns access to console preset with logger module name as this class.
Intentionally not virtual, so the getConsole() in derived class should hide this instead of overriding.
Definition at line 578 of file PureMesh3D.cpp.
PureMaterial & PureMesh3D::getMaterial | ( | TPureBool | implicitAccessSubobject = true | ) |
Gets the material.
Note that some properties of a level-1 mesh are irrelevant because renderer doesn't even access them, e.g. texture, because they are fetched from the level-2 meshes. Some other material properties of level-2 meshes are irrelevant because they are inherited from the material of their parent level-1 mesh, e.g. texture environment color. Thus make sure you are careful when you specify the argument as described below.
implicitAccessSubobject | If true (default), and this mesh has exactly 1 submesh, the accessed value will be that submesh's value. If false, the accessed value will be this mesh's value. |
Definition at line 918 of file PureMesh3D.cpp.
const PureMaterial & PureMesh3D::getMaterial | ( | TPureBool | implicitAccessSubobject = true | ) | const |
Gets the material.
Note that some properties of a level-1 mesh are irrelevant because renderer doesn't even access them, e.g. texture, because they are fetched from the level-2 meshes. Some other material properties of level-2 meshes are irrelevant because they are inherited from the material of their parent level-1 mesh, e.g. texture environment color. Thus make sure you are careful when you specify the argument as described below.
implicitAccessSubobject | If true (default), and this mesh has exactly 1 submesh, the accessed value will be that submesh's value. If false, the accessed value will be this mesh's value. |
Definition at line 899 of file PureMesh3D.cpp.
Gets the greatest index in the vertex indices array.
This value is irrelevant for a level-1 mesh since the geometry is owned by its level-2 submeshes and it is unique for each submesh. Still the returned value for a level-1 mesh can be a positive value, see below.
implicitAccessSubobject | If true (default), and this mesh has exactly 1 submesh, the accessed value will be that submesh's value. If false, the accessed value will be this mesh's value. |
Reimplemented in PureObject3D.
Definition at line 757 of file PureMesh3D.cpp.
Gets the smallest index in the vertex indices array.
This value is irrelevant for a level-1 mesh since the geometry is owned by its level-2 submeshes and it is unique for each submesh. Still the returned value for a level-1 mesh can be a positive value, see below.
implicitAccessSubobject | If true (default), and this mesh has exactly 1 submesh, the accessed value will be that submesh's value. If false, the accessed value will be this mesh's value. |
Reimplemented in PureObject3D.
Definition at line 740 of file PureMesh3D.cpp.
Gets the pointer to normals.
Pointer to normals is NULL for a level-1 mesh since the geometry is owned by its level-2 submeshes. Note: in special case this returns non-NULL value even for a level-1 mesh, see below.
In indexed vertex referencing mode, the vertex indices can be used to reference normals in the array, same way as how vertices can be referenced.
implicitAccessSubobject | If true (default), and this mesh has exactly 1 submesh, the accessed value will be that submesh's value. If false, the accessed value will be this mesh's value. |
Reimplemented in PureObject3D.
Definition at line 797 of file PureMesh3D.cpp.
PureVector & PureMesh3D::getPosVec | ( | ) |
Gets the position.
For a level-1 mesh object, this vector is always zero. It can be utilized by a descendant class though. For a level-2 (sub)mesh object, this vector represents the position of the submesh relative to the position of its parent mesh object.
Definition at line 838 of file PureMesh3D.cpp.
const PureVector & PureMesh3D::getPosVec | ( | ) | const |
Gets the position.
For a level-1 mesh object, this vector is always zero. It can be utilized by a descendant class though. For a level-2 (sub)mesh object, this vector represents the position of the submesh relative to the position of its parent mesh object.
Definition at line 850 of file PureMesh3D.cpp.
|
virtual |
Gets the primitives' format.
Primitive format is the same for the mesh and its submeshes.
Reimplemented in PureObject3D.
Definition at line 626 of file PureMesh3D.cpp.
|
virtual |
Gets the mesh-local relative position.
This position tells the offset of the vertex positions relative to the center of the mesh [0,0,0]. For level-2 (sub)mesh, this vector is always expected to be [0,0,0] since the position of submeshes is calculated with vertex positions and size.
Reimplemented in PureObject3D.
Definition at line 862 of file PureMesh3D.cpp.
|
virtual |
Gets the base sizes.
Reimplemented in PureObject3D.
Definition at line 871 of file PureMesh3D.cpp.
|
virtual |
Gets the number of triangles formed by the vertices.
Triangle count doesn't only depend on vertex or vertex index count but also on the primitive format (see: getPrimitiveFormat()). Note that triangle count is not necessarily equal to getFaceCount() because e.q. if primitive format is quads/quadrilaterals, then obviously triangle count will be greater than face count. Even if primitive format indicates quads/quadrilaterals, they are split into triangles at some point when transferred through the graphics pipeline.
Reimplemented in PureObject3D.
Definition at line 826 of file PureMesh3D.cpp.
|
virtual |
Gets the amount of allocated system memory.
It includes the allocated Material size as well (getMaterial()). Level-1 (parent) meshes summarize the memory usage of their level-2 submeshes and include it in the returned value.
Reimplemented from PureFiledManaged.
Reimplemented in PureObject3D, and PureVertexTransfer.
Definition at line 931 of file PureMesh3D.cpp.
|
virtual |
Gets an index value from the vertex indices array.
This function is highly recommended to be used for reading indices from the index array since the type of indices can vary from subobject to subobject and this function considers the index type. This function is irrelevant for a level-1 mesh since the geometry is owned by its level-2 submeshes. Still the returned value for a level-1 mesh can be a valid value, see below.
implicitAccessSubobject | If true (default), and this mesh has exactly 1 submesh, the accessed value will be that submesh's value. If false, the accessed value will be this mesh's value. |
Reimplemented in PureObject3D.
Definition at line 776 of file PureMesh3D.cpp.
|
virtual |
Gets the pointer to vertex indices.
Pointer to vertex indices is NULL for a level-1 mesh since the geometry is owned by its level-2 submeshes. Note: in special case this returns non-NULL value even for a level-1 mesh, see below.
implicitAccessSubobject | If true (default), and this mesh has exactly 1 submesh, the accessed value will be that submesh's value. If false, the accessed value will be this mesh's value. |
Reimplemented in PureObject3D.
Definition at line 704 of file PureMesh3D.cpp.
|
virtual |
Gets the number of total vertex indices.
Number of total vertex indices for a level-1 mesh is the sum of number of vertex indices of its level-2 submeshes.
Reimplemented in PureObject3D.
Definition at line 686 of file PureMesh3D.cpp.
|
virtual |
Gets the type of the indices.
Index type is irrelevant for a level-1 mesh since the geometry is owned by its level-2 submeshes and it is unique for each submesh.
implicitAccessSubobject | If true (default), and this mesh has exactly 1 submesh, the accessed value will be that submesh's value. If false, the accessed value will be this mesh's value. |
Reimplemented in PureObject3D.
Definition at line 722 of file PureMesh3D.cpp.
Gets the pointer to vertices.
Pointer to vertices is NULL for a level-1 mesh since the geometry is owned by its level-2 submeshes. Note: in special case this returns non-NULL value even for a level-1 mesh, see below.
implicitAccessSubobject | If true (default), and this mesh has exactly 1 submesh, the accessed value will be that submesh's value. If false, the accessed value will be this mesh's value. |
Reimplemented in PureObject3D.
Definition at line 674 of file PureMesh3D.cpp.
Gets the pointer to vertices.
Pointer to vertices is NULL for a level-1 mesh since the geometry is owned by its level-2 submeshes. Note: in special case this returns non-NULL value even for a level-1 mesh, see below.
implicitAccessSubobject | If true (default), and this mesh has exactly 1 submesh, the accessed value will be that submesh's value. If false, the accessed value will be this mesh's value. |
Reimplemented in PureObject3D.
Definition at line 656 of file PureMesh3D.cpp.
|
virtual |
Gets the number of total vertices.
Number of total vertices for a level-1 mesh is the sum of number of vertices of its level-2 submeshes.
Reimplemented in PureObject3D.
Definition at line 638 of file PureMesh3D.cpp.
|
virtual |
Tells if the mesh is a level-1 parent mesh.
A mesh cannot be both level-1 and level-2 at the same time. A level-1 mesh does not have vertex data on its own, but its level-2 submeshes own vertex data.
Reimplemented in PureObject3D.
Definition at line 604 of file PureMesh3D.cpp.
|
virtual |
Tells if the mesh is a level-2 submesh.
A mesh cannot be both level-1 and level-2 at the same time. A level-1 mesh does not have vertex data on its own, but its level-2 submeshes own vertex data.
Reimplemented in PureObject3D.
Definition at line 616 of file PureMesh3D.cpp.
|
protected |
Definition at line 966 of file PureMesh3D.cpp.
void PureMesh3D::RecalculateSize | ( | ) |
Recalculates the sizes.
Definition at line 880 of file PureMesh3D.cpp.
|
friend |
Definition at line 116 of file PureMesh3DManager.h.
|
friend |
Definition at line 117 of file PureMesh3DManager.h.
|
friend |
Definition at line 118 of file PureMesh3DManager.h.
|
private |
Definition at line 114 of file PureMesh3DManager.h.