Atoms Crowd  7.0.0
HeightFields.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 <Atoms/HeightField.h>
13 #include <map>
14 
15 namespace Atoms
16 {
18  class ATOMS_EXPORT HeightFields
19  {
20  public:
21 
24 
27 
30 
33 
36 
38 
42  AtomsPtr<HeightField> heightField(const std::string& name);
43  AtomsWPtr<HeightField> heightFieldWPtr(const std::string& name);
44  HeightField* heightFieldPtr(const std::string& name);
45 
47  bool hasHeightField(const std::string& name);
48 
50 
54  void addHeightField(const std::string& name, AtomsPtr<HeightField>& field, bool replace = false, bool animated = false, short gridMode = 0);
55 
57  void insertHeightField(const std::string& name, AtomsPtr<HeightField>& field, bool replace = false, bool animated = false);
58 
60 
63  void removeHeightField(const std::string& name);
64 
66 
69  std::vector<std::string> heightFieldNames();
70 
72 
76  bool heightFieldExists(const std::string& name);
77 
79 
83  void setAnimated(const std::string& name, bool value);
84 
86 
90  bool isAnimated(const std::string& name);
91 
93  unsigned int numHeightFields();
94 
96  void clear();
97 
98  private:
99 
100  typedef std::map<std::string, std::pair<AtomsPtr<HeightField>, bool>> HeightFieldsMap;
101 
103 
106  HeightFieldsMap m_heightFieldsMap;
107  };
108 }
Container for all agent types.
Definition: HeightField.h:17
Container for all agent types.
Definition: HeightFields.h:19
void addHeightField(const std::string &name, AtomsPtr< HeightField > &field, bool replace=false, bool animated=false, short gridMode=0)
Adds an hf to the map.
HeightFields()
Private constructor.
void setAnimated(const std::string &name, bool value)
Sets the hf animated flag.
static HeightFields & instance()
Singleton access.
bool isAnimated(const std::string &name)
Checks if an hf is animated.
std::vector< std::string > heightFieldNames()
Gets all hf names.
void removeHeightField(const std::string &name)
Removes an hf from the map.
HeightFields(const HeightFields &)
Private copy constructor.
bool hasHeightField(const std::string &name)
Checks if an height field with the given name exists.
AtomsPtr< HeightField > heightField(const std::string &name)
Gets an hf.
void insertHeightField(const std::string &name, AtomsPtr< HeightField > &field, bool replace=false, bool animated=false)
Adds an hf to the map.
~HeightFields()
Private destructor.
bool heightFieldExists(const std::string &name)
Checks if a hf exists.
void clear()
Removes all hf.
unsigned int numHeightFields()
Gets the number of hf.
HeightFields & operator=(const HeightFields &)
Private assign operator.
Atoms namespace.
Definition: Agent.h:29