![]() |
PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
|
VertexTransfer class extends Mesh3D by providing ways to transfer vertices of the mesh over the vertex pipeline. More...
VertexTransfer class extends Mesh3D by providing ways to transfer vertices of the mesh over the vertex pipeline.
Similar to Mesh3D, VertexTransfer objects are 2-level entities:
The biggest addition of VertexTransfer to Mesh3D is the wide selection of vertex transfer modes and management of the related OpenGL resources such as vertex buffer objects.
Definition at line 173 of file PureVertexTransferMode.h.
#include <PureVertexTransferMode.h>
Classes | |
class | PureVertexTransferImpl |
Public Member Functions | |
virtual | ~PureVertexTransfer () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
virtual TPURE_VERTEX_MODIFYING_HABIT | getVertexModifyingHabit () const |
Gets vertex modifying habit. | |
virtual TPureBool | setVertexModifyingHabit (TPURE_VERTEX_MODIFYING_HABIT vmod) |
Sets vertex modifying habit. | |
virtual TPURE_VERTEX_REFERENCING_MODE | getVertexReferencingMode () const |
Gets vertex referencing mode. | |
virtual TPureBool | setVertexReferencingMode (TPURE_VERTEX_REFERENCING_MODE vref) |
Sets vertex referencing mode. | |
virtual TPURE_VERTEX_TRANSFER_MODE | getVertexTransferMode () const |
Gets vertex transfer mode. | |
virtual TPureBool | setVertexTransferMode (TPURE_VERTEX_TRANSFER_MODE vtrans) |
Sets vertex transfer mode. | |
virtual TPureUInt | getLastTransferredVertexCount () const |
Gets the number of vertices sent to graphics pipeline by the last transferVertices() call. | |
virtual TPureUInt | getLastTransferredTriangleCount () const |
Gets the number of triangles sent to graphics pipeline by the last transferVertices() call. | |
virtual TPureUInt | getUsedSystemMemory () const |
Gets the amount of allocated system memory. | |
virtual TPureUInt | getUsedVideoMemory () const |
Gets the amount of allocated video memory. | |
![]() | |
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. | |
![]() | |
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 TPureBool | isVertexTransferModeSelectable (TPURE_VERTEX_TRANSFER_MODE vtrans) |
Tells whether the given Vertex Transfer Mode is available on the current hardware. | |
static TPureBool | isVertexReferencingIndexed (TPURE_VERTEX_TRANSFER_MODE vtrans) |
Tells whether the given Vertex Transfer Mode references vertices by indexing. | |
static TPureBool | isVertexModifyingDynamic (TPURE_VERTEX_TRANSFER_MODE vtrans) |
Tells whether the given Vertex Transfer Mode means dynamic modifying habit. | |
static TPureBool | isVideoMemoryUsed (TPURE_VERTEX_TRANSFER_MODE vtrans) |
Tells whether the given Vertex Transfer Mode uses VRAM. | |
static TPURE_VERTEX_TRANSFER_MODE | selectVertexTransferMode (TPURE_VERTEX_MODIFYING_HABIT vmod, TPURE_VERTEX_REFERENCING_MODE vref, TPureBool bForceUseClientMemory) |
Selects a suitable vertex transfer mode. | |
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. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
Protected Member Functions | |
PureVertexTransfer (PureMaterialManager &matMgr, const TPURE_VERTEX_MODIFYING_HABIT &vmod=PURE_VMOD_STATIC, const TPURE_VERTEX_REFERENCING_MODE &vref=PURE_VREF_DIRECT, TPureBool bForceUseClientMemory=false) | |
Only PureObject3D or PureObject3DManager creates it. | |
PureVertexTransfer () | |
PureVertexTransfer (const PureVertexTransfer &) | |
PureVertexTransfer & | operator= (const PureVertexTransfer &) |
TPureUInt | transferVertices () |
Sends vertices to the graphics pipeline. | |
virtual void | ResetLastTransferredCounts () |
Reset counters used for measuring number of vertices, triangles, etc. | |
![]() | |
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 | |
PureVertexTransferImpl * | pImpl |
Friends | |
class | SampleManagerForDescendantFromVertexTransfer |
|
virtual |
Definition at line 1054 of file PureVertexTransferMode.cpp.
|
protected |
Only PureObject3D or PureObject3DManager creates it.
matMgr | A MaterialManager instance to be used for constructing of ancestor class. |
vmod | What vertex modifying habit to be set for the new Mesh3D instance. |
vref | What vertex referencing mode to be set for the new Mesh3D instance. |
bForceUseClientMemory | Force-select a vertex transfer mode storing geometry in client memory instead of server memory. Please note that this is considered only if dynamic modifying habit is specified. Specifying static modifying habit will always select a mode which places geometry data into server memory. |
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 1281 of file PureVertexTransferMode.cpp.
|
protected |
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 1296 of file PureVertexTransferMode.cpp.
|
protected |
Definition at line 1304 of file PureVertexTransferMode.cpp.
|
virtual |
Gets the number of triangles sent to graphics pipeline by the last transferVertices() call.
Reimplemented in PureObject3D.
Definition at line 1179 of file PureVertexTransferMode.cpp.
|
virtual |
Gets the number of vertices sent to graphics pipeline by the last transferVertices() call.
Reimplemented in PureObject3D.
Definition at line 1170 of file PureVertexTransferMode.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 1080 of file PureVertexTransferMode.cpp.
CConsole & PureVertexTransfer::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 1067 of file PureVertexTransferMode.cpp.
|
virtual |
Gets the amount of allocated system memory.
Level-1 (parent) objects summarize the memory usage of their level-2 subobjects and include it in the returned value.
Reimplemented from PureMesh3D.
Reimplemented in PureObject3D.
Definition at line 1191 of file PureVertexTransferMode.cpp.
|
virtual |
Gets the amount of allocated video memory.
This function considers only the rough required video memory for storing the geometry of its underlying mesh. This function doesn't consider any related textures in video memory that might be associated with the Material of this object or its subobjects. Level-1 (parent) objects summarize the video memory usage of their level-2 subobjects and include it in the returned value.
Reimplemented in PureObject3D.
Definition at line 1215 of file PureVertexTransferMode.cpp.
|
virtual |
Gets vertex modifying habit.
It applies to the entire geometry of the mesh, including all of its submeshes. Level-2 objects use the property of their parent mesh.
Reimplemented in PureObject3D.
Definition at line 1091 of file PureVertexTransferMode.cpp.
|
virtual |
Gets vertex referencing mode.
It applies to the entire geometry of the mesh, including all of its submeshes. Level-2 objects use the property of their level-1 parent mesh.
Reimplemented in PureObject3D.
Definition at line 1115 of file PureVertexTransferMode.cpp.
|
virtual |
Gets vertex transfer mode.
It applies to the entire geometry of the mesh, including all of its submeshes. Level-2 objects use the property of their level-1 parent mesh.
Reimplemented in PureObject3D.
Definition at line 1139 of file PureVertexTransferMode.cpp.
|
static |
Tells whether the given Vertex Transfer Mode means dynamic modifying habit.
Definition at line 965 of file PureVertexTransferMode.cpp.
|
static |
Tells whether the given Vertex Transfer Mode references vertices by indexing.
Definition at line 955 of file PureVertexTransferMode.cpp.
|
static |
Tells whether the given Vertex Transfer Mode is available on the current hardware.
The following modes are always available with accelerated renderer:
The following modes are always available with non-accelerated renderer:
Definition at line 919 of file PureVertexTransferMode.cpp.
|
static |
Tells whether the given Vertex Transfer Mode uses VRAM.
Note that the result does not always tell the truth. For example, we can expect that geometry draw calls stored in an OpenGL display list are cached somehow in video memory or implicitly stored as a static VBO in video memory, but this might not be the case with nowadays old/rare driver-GPU/VPU combo which might not even have enough video memory to store OpenGL display list, or the driver is not prepared for that.
Definition at line 979 of file PureVertexTransferMode.cpp.
|
protected |
Definition at line 1309 of file PureVertexTransferMode.cpp.
|
protectedvirtual |
Reset counters used for measuring number of vertices, triangles, etc.
sent to the graphics pipeline by the last transferVertices().
sent to the graphics pipeline by the last transferVertices(). Derived class can reset the counters when needed. Useful before iterating over its level-2 managed PureVertexTransfer-derived instances, because they implicitly increase counters in their level-1 parent.
Reimplemented in PureObject3D.
Definition at line 1332 of file PureVertexTransferMode.cpp.
|
static |
Selects a suitable vertex transfer mode.
The selected mode is compatible with the current hardware and complies with the given arguments. Please note that bForceUseClientMemory = true is considered only if dynamic modifying habit is specified. Specifying static modifying habit will always select a mode which places geometry data into server memory.
Definition at line 996 of file PureVertexTransferMode.cpp.
|
virtual |
Sets vertex modifying habit.
It applies to the entire geometry of the mesh, including all of its submeshes. The setting is ignored for level-2 objects as it is applied to them by their level-1 parent mesh.
vmod | Vertex modifying habit to be set. |
Definition at line 1104 of file PureVertexTransferMode.cpp.
|
virtual |
Sets vertex referencing mode.
It applies to the entire geometry of the mesh, including all of its submeshes. The setting is ignored for level-2 objects as it is applied to them by their level-1 parent mesh.
vref | Vertex referencing mode to be set. |
Definition at line 1128 of file PureVertexTransferMode.cpp.
|
virtual |
Sets vertex transfer mode.
Vertex transfer mode gets selected automatically by PPP. However, it can be also set manually for custom reasons. The setting does not happen if the selected transfer mode is not available for some reason, for example, if the selected mode is not supported on the current hardware. In such case, the existing vertex transfer mode and HW resources are kept unchanged. If the function encounters issue during allocating needed resources, vertex transfer mode is reset to 0 and HW resources are freed up. It applies to the entire geometry of the mesh, including all of its submeshes. The setting is ignored for level-2 meshes as it is applied to them by their level-1 parent mesh.
vtrans | Vertex referencing mode to be set. |
Reimplemented in PureObject3D.
Definition at line 1161 of file PureVertexTransferMode.cpp.
|
protected |
Sends vertices to the graphics pipeline.
Should be invoked for level-2 submesh, i.e. a PureVertexTransfer instance having geometry, and having another PureVertexTransfer as parent.
Definition at line 1321 of file PureVertexTransferMode.cpp.
|
friend |
Definition at line 241 of file PureVertexTransferMode.h.
|
private |
Definition at line 239 of file PureVertexTransferMode.h.