Pathfinder
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Pathfinder::MeshAccessor Class Reference

This class is used to simplify the accessing of meshes, their vertices and polygons. More...

#include <MeshAccessor.h>

Collaboration diagram for Pathfinder::MeshAccessor:

Public Member Functions

 MeshAccessor (MinSG::GeometryNode *geoNodePtr)
 A constructor which initializes all member variables. More...
 
void deletePolygons ()
 Delete all allocated polygon objects. More...
 
PolygongetPolygonPtr (const uint32_t &id)
 For a given Id, return the corresponding polygon in world coordinates. More...
 
Geometry::Vec3 getVertex (const uint32_t &id)
 Return the positon of the vertex corresponding to the given Id. More...
 
std::vector< uint32_t > getAdjacentVertexIds (const uint32_t &id)
 Return a list containing all ids of vertices adjacent to the vertex id. More...
 
AABB getAABB ()
 Return the aabb member variable. More...
 
uint32_t getVertexCount ()
 Return the number of vertices in the managed mesh. More...
 
uint32_t getIndexCount ()
 Return the number of indices in the managed mesh. More...
 
MinSG::GeometryNode * getGeoNodePtr () const
 Return the pointer stored in the member variable geoNodePtr. More...
 

Private Member Functions

bool triIdValid (const uint32_t &id)
 For a given Id, decide if this Id is a valid Id for accessing a polygon of this mesh. More...
 
bool vertexIdValid (const uint32_t &id)
 For a given Id, decide if this Id is a valid Id for accessing a vertex of this mesh. More...
 
PolygonnewPolygonPtr (const uint32_t &id)
 For a given Id, create a new Polygon object for the corresponding polygon in the managed mesh. More...
 

Private Attributes

MinSG::GeometryNode * geoNodePtr
 A pointer to the GeometryNode which holds the mesh that is to be managed. More...
 
Rendering::Mesh * meshPtr
 A pointer to the managed mesh. More...
 
Rendering::MeshVertexData & meshVertexData
 The VertexData which holds information about the vertices of the mesh. More...
 
Rendering::MeshIndexData & meshIndexData
 The IndexData which holds information about the indices of the vertices of the mesh. More...
 
Geometry::Matrix4x4 worldTransformationMatrix
 The matrix to convert local to world coordinates. More...
 
Util::Reference< Rendering::MeshUtils::ConnectivityAccessor > connectivityAccessorRef
 A reference to the ConnectivityAccessor which enables access to the connectivity between vertices. More...
 
Util::Reference< Rendering::MeshUtils::TriangleAccessor > triAccessorRef
 A reference to the triangle accessor which enables polygon access. More...
 
AABB aabb
 The AABB of the managed mesh. More...
 
std::vector< Polygon * > polygons
 A list of pointers to Polygon objects. More...
 

Detailed Description

This class is used to simplify the accessing of meshes, their vertices and polygons.

Constructor & Destructor Documentation

◆ MeshAccessor()

Pathfinder::MeshAccessor::MeshAccessor ( MinSG::GeometryNode *  geoNodePtr)

A constructor which initializes all member variables.

Parameters
geoNodePtrA pointer to a GeometryNode.

Member Function Documentation

◆ deletePolygons()

void Pathfinder::MeshAccessor::deletePolygons ( )

Delete all allocated polygon objects.

◆ getAABB()

AABB Pathfinder::MeshAccessor::getAABB ( )

Return the aabb member variable.

Returns
Return the contents of aabb.

◆ getAdjacentVertexIds()

std::vector< uint32_t > Pathfinder::MeshAccessor::getAdjacentVertexIds ( const uint32_t &  id)

Return a list containing all ids of vertices adjacent to the vertex id.

Parameters
idThe id of the vertex whose neighbours shall be returned.
Returns
Return a list of the ids of all adjacent vertices.

◆ getGeoNodePtr()

MinSG::GeometryNode * Pathfinder::MeshAccessor::getGeoNodePtr ( ) const

Return the pointer stored in the member variable geoNodePtr.

Returns
Return the contents of geoNodePtr.

◆ getIndexCount()

uint32_t Pathfinder::MeshAccessor::getIndexCount ( )

Return the number of indices in the managed mesh.

Returns
Return the number of indices in the mesh.

◆ getPolygonPtr()

Polygon * Pathfinder::MeshAccessor::getPolygonPtr ( const uint32_t &  id)

For a given Id, return the corresponding polygon in world coordinates.

Parameters
idThe polygon's Id.
Returns
Return a pointer to a polygon object that represents the queried polygon of the mesh.

◆ getVertex()

Geometry::Vec3 Pathfinder::MeshAccessor::getVertex ( const uint32_t &  id)

Return the positon of the vertex corresponding to the given Id.

The position is given in world coordinates.

Parameters
idThe index of the vertex.
Returns
Return the postion of the vertex with the Id id in world coordinates.

◆ getVertexCount()

uint32_t Pathfinder::MeshAccessor::getVertexCount ( )

Return the number of vertices in the managed mesh.

Returns
return the number of vertices in the mesh.

◆ newPolygonPtr()

Polygon * Pathfinder::MeshAccessor::newPolygonPtr ( const uint32_t &  id)
private

For a given Id, create a new Polygon object for the corresponding polygon in the managed mesh.

Parameters
idThe polygon's Id in the managed mesh.
Returns
Return a pointer to a polygon object that represents the queried polygon of the mesh.

◆ triIdValid()

bool Pathfinder::MeshAccessor::triIdValid ( const uint32_t &  id)
private

For a given Id, decide if this Id is a valid Id for accessing a polygon of this mesh.

Parameters
idThe Id which is to be checked.
Returns
Return true if id is valid. Return false otherwise.

◆ vertexIdValid()

bool Pathfinder::MeshAccessor::vertexIdValid ( const uint32_t &  id)
private

For a given Id, decide if this Id is a valid Id for accessing a vertex of this mesh.

Parameters
idThe Id which is to be checked.
Returns
Return true if it is valid. Return false otherwise.

Member Data Documentation

◆ aabb

AABB Pathfinder::MeshAccessor::aabb
private

The AABB of the managed mesh.

◆ connectivityAccessorRef

Util::Reference<Rendering::MeshUtils::ConnectivityAccessor> Pathfinder::MeshAccessor::connectivityAccessorRef
private

A reference to the ConnectivityAccessor which enables access to the connectivity between vertices.

◆ geoNodePtr

MinSG::GeometryNode* Pathfinder::MeshAccessor::geoNodePtr
private

A pointer to the GeometryNode which holds the mesh that is to be managed.

◆ meshIndexData

Rendering::MeshIndexData& Pathfinder::MeshAccessor::meshIndexData
private

The IndexData which holds information about the indices of the vertices of the mesh.

◆ meshPtr

Rendering::Mesh* Pathfinder::MeshAccessor::meshPtr
private

A pointer to the managed mesh.

◆ meshVertexData

Rendering::MeshVertexData& Pathfinder::MeshAccessor::meshVertexData
private

The VertexData which holds information about the vertices of the mesh.

◆ polygons

std::vector<Polygon*> Pathfinder::MeshAccessor::polygons
private

A list of pointers to Polygon objects.

◆ triAccessorRef

Util::Reference<Rendering::MeshUtils::TriangleAccessor> Pathfinder::MeshAccessor::triAccessorRef
private

A reference to the triangle accessor which enables polygon access.

◆ worldTransformationMatrix

Geometry::Matrix4x4 Pathfinder::MeshAccessor::worldTransformationMatrix
private

The matrix to convert local to world coordinates.


The documentation for this class was generated from the following files: