Atoms Crowd  7.0.0
NavigationMeshes.h
1 #pragma once
2 // ===========================================================================
3 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4 //
5 // Use of this software is subject to the terms of the Toolchefs license
6 // agreement provided at the time of installation or download, or which
7 // otherwise accompanies this software in either electronic or hard copy form.
8 // ===========================================================================
9 
10 #include <AtomsCore/Globals.h>
11 #include <Atoms/Globals.h>
12 #include <AtomsUtils/NavigationMesh/NavMesh.h>
13 #include <map>
14 #include <mutex>
15 
16 namespace Atoms
17 {
19  class ATOMS_EXPORT NavigationMeshes
20  {
21  typedef std::map<std::string, AtomsPtr<AtomsUtils::NavMesh>> NavMeshMap;
22 
23  public:
24 
27 
30 
33 
36 
39 
41 
45  AtomsPtr<AtomsUtils::NavMesh> navMesh(const std::string& name);
46 
48 
52  AtomsUtils::NavMesh* navMeshPtr(const std::string& name);
53 
55 
59  AtomsWPtr<AtomsUtils::NavMesh> navMeshWPtr(const std::string& name);
60 
62  bool hasNavMesh(const std::string& name);
63 
65 
69  void addNavMesh(const std::string& name, AtomsPtr<AtomsUtils::NavMesh>& navmesh, bool replace = false);
70 
72  void insertNavMesh(const std::string& name, AtomsPtr<AtomsUtils::NavMesh>& navmesh, bool replace = false);
73 
75 
78  void removeNavMesh(const std::string& name);
79 
81 
84  std::vector<std::string> navMeshNames();
85 
87 
91  bool navMeshExists(const std::string& name);
92 
94  unsigned int numNavMeshes();
95 
97  void clear();
98 
99  NavMeshMap::iterator begin();
100 
101  NavMeshMap::iterator end();
102 
103  private:
104 
105 
106 
108 
111  NavMeshMap m_navMeshMap;
112 
114  std::mutex m_mutex;
115  };
116 }
Container for all agent types.
Definition: NavigationMeshes.h:20
std::vector< std::string > navMeshNames()
Gets all nav mesh names.
~NavigationMeshes()
Destructor.
bool navMeshExists(const std::string &name)
Checks if a nav mesh exists.
NavigationMeshes()
Constructor.
void removeNavMesh(const std::string &name)
Removes an nav mesh from the map.
AtomsPtr< AtomsUtils::NavMesh > navMesh(const std::string &name)
Gets an nav mesh.
NavigationMeshes(const NavigationMeshes &)
Copy constructor.
unsigned int numNavMeshes()
Gets the number of nav mesh.
void insertNavMesh(const std::string &name, AtomsPtr< AtomsUtils::NavMesh > &navmesh, bool replace=false)
Adds an nav mesh to the map.
NavigationMeshes & operator=(const NavigationMeshes &)
Private assign operator.
AtomsWPtr< AtomsUtils::NavMesh > navMeshWPtr(const std::string &name)
Gets an nav mesh.
void clear()
Removes all nav meshes.
void addNavMesh(const std::string &name, AtomsPtr< AtomsUtils::NavMesh > &navmesh, bool replace=false)
Adds an nav mesh to the map.
bool hasNavMesh(const std::string &name)
Checks if an nav mesh with the given name exists.
AtomsUtils::NavMesh * navMeshPtr(const std::string &name)
Gets an nav mesh.
static NavigationMeshes & instance()
Singleton access.
Definition: NavMesh.h:45
Atoms namespace.
Definition: Agent.h:29