44 #ifndef __NAV_MESH_DATA_H__
45 #define __NAV_MESH_DATA_H__
47 #include "mengeCommon.h"
57 class SimulatorInterface;
64 class NavMeshLocalizer;
106 class NavMeshFactory;
127 NavMesh(
const std::string & name );
310 void setVertex(
unsigned int i,
float x,
float y );
355 bool addGroup(
const std::string & grpName,
size_t grpSize );
379 friend class NavMeshFactory;
445 #endif // __NAV_MESH_DATA_H__
void setVertex(unsigned int i, float x, float y)
Sets the value of the ith vertex.
Definition: NavMesh.cpp:158
NavMeshPtr loadNavMesh(const std::string &fileName)
Loads the navigation mesh of the given name.
Definition: NavMesh.cpp:528
NavMesh(const std::string &name)
Constructor.
Definition: NavMesh.cpp:59
size_t _nCount
The number of nodes (aka polygons in the mesh).
Definition: NavMesh.h:396
NavMeshEdge * _edges
An array containing all edges.
Definition: NavMesh.h:411
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
NavMeshObstacle * _obstacles
An array of obstacles.
Definition: NavMesh.h:421
NavMeshObstacle & getObstacle(unsigned int i)
Returns a reference to the ith obstacle.
Definition: NavMesh.cpp:120
std::map< const std::string, NMNodeGroup > _nodeGroups
The mapping from node group name to an instance of a NMNodeGroup.
Definition: NavMesh.h:426
bool addGroup(const std::string &grpName, size_t grpSize)
Adds a group of polygons to the navigation mesh.
Definition: NavMesh.cpp:195
void setVertexCount(size_t count)
Allocates memory for the given number of vertices. All previous vertices will be deleted.
Definition: NavMesh.cpp:148
unsigned int _first
The first index in the group.
Definition: NavMesh.h:98
const Vector2 * getVertices() const
Returns a const pointer to the array of vertices.
Definition: NavMesh.h:250
The navigation mesh adjacency graph node. It corresponds to a convex polygon in the navigation mesh...
Definition: NavMeshNode.h:64
bool finalize()
After initializing the navigation mesh's components this function needs to be called to make the mesh...
Definition: NavMesh.cpp:225
Vector2 getGradient(unsigned int nodeID, const Vector2 &p) const
Computes the gradient at a particular point based on the given node's geometry.
Definition: NavMesh.cpp:141
Basic class for managing on-disk resources.
Definition: Resource.h:98
size_t groupSize() const
Reports the number of nodes in this group.
Definition: NavMesh.h:93
The definition of the set of vertices for an explicit obstacle definition.
A base exception for resources to throw.
Definition: Resource.h:58
NMNodeGroup()
Default constructor.
Definition: NavMesh.h:79
The navigation mesh adjacency graph edge.
Definition: NavMeshEdge.h:72
ResourcePtr< NavMesh > NavMeshPtr
The definition of the managed pointer for NavMesh data.
Definition: NavMesh.h:432
Class for computing paths through a navigation mesh.
Definition: PathPlanner.h:133
std::vector< Agents::ObstacleVertexList > getObstacles()
Gets the navigation mesh's obstacles for the simulator.
Definition: NavMesh.cpp:364
Vector2 * _vertices
An array containing all vertices.
Definition: NavMesh.h:391
unsigned int _last
The last index in the group.
Definition: NavMesh.h:103
size_t _vCount
The number of vertices.
Definition: NavMesh.h:386
size_t getVertexCount() const
Reports the number of vertices in the navigation mesh.
Definition: NavMesh.h:157
size_t getEdgeCount() const
Reports the number of edges in the navigation mesh.
Definition: NavMesh.h:191
void setNodeCount(size_t count)
Allocates memory for the given number of nodes. All previous nodes will be deleted.
Definition: NavMesh.cpp:165
virtual const std::string & getLabel() const
Returns a unique resource label to be used to identify different resource types which use the same un...
Definition: NavMesh.h:146
Specification of an obstacle. It is the same as a pedModel specification but includes a pointer to a ...
Definition: NavMeshObstacle.h:61
NMNodeGroup(unsigned int first, unsigned int last)
Constructor.
Definition: NavMesh.h:88
size_t getObstacleCount() const
Returns the number of obstacles connected to this node.
Definition: NavMesh.h:218
static Resource * load(const std::string &fileName)
Parses a navigation mesh definition and returns a pointer to it.
Definition: NavMesh.cpp:417
size_t _obstCount
The number of obstacles in the scene.
Definition: NavMesh.h:416
A navigation mesh node group.
Definition: NavMesh.h:74
void setObstacleCount(size_t count)
Allocates memory for the given number of obstacles. All previous obstacles will be delete...
Definition: NavMesh.cpp:185
float getElevation(unsigned int nodeID, const Vector2 &p) const
Computes the elevation at a particular point based on the given node's geometry.
Definition: NavMesh.cpp:134
The class for defining a navigation mesh. A decomposition of the free space into a connected mesh of ...
Definition: NavMesh.h:120
size_t _eCount
The number of edges (aka portals or shared edges between polygons).
Definition: NavMesh.h:406
Specification for obstacles in a navigation mesh file.
The basic class for all on-disk resources.
NavMeshNode & getNode(unsigned int i)
Returns a reference to the ith node.
Definition: NavMesh.cpp:92
size_t getNodeCount() const
Reports the number of nodes in the navigation mesh.
Definition: NavMesh.h:164
void clear()
Clears the navigation mesh - removes edges and nodes.
Definition: NavMesh.cpp:70
The namespace that contains the basic simulation mechanisms.
NavMeshEdge & getEdge(unsigned int i)
Returns a reference to the ith edge.
Definition: NavMesh.cpp:106
static const std::string LABEL
The unique label for this data type to be used with resource management.
Definition: NavMesh.h:377
void setEdgeCount(size_t count)
Allocates memory for the given number of edges. All previous edges will be deleted.
Definition: NavMesh.cpp:175
~NavMesh()
Destructor.
Definition: NavMesh.cpp:64
Vector2 * getVertices()
Returns a pointer to the array of vertices.
Definition: NavMesh.h:243
NavMeshNode * _nodes
An array containing all nodes.
Definition: NavMesh.h:401