14 std::map<std::string, AgentTypeVariation>::iterator it = m_agentTypeVariations.find(agentTypeName);
15 if (it != m_agentTypeVariations.end())
17 m_agentTypeVariations.erase(it);
25 std::vector<std::string> names;
26 names.reserve(m_agentTypeVariations.size());
27 for (
auto it = m_agentTypeVariations.cbegin(); it != m_agentTypeVariations.cend(); it++)
28 names.push_back(it->first);
34 std::map<std::string, AgentTypeVariation>::const_iterator it = m_agentTypeVariations.find(agentTypeName);
35 if (it != m_agentTypeVariations.cend())
42 std::map<std::string, VariationGeometry>::const_iterator it = m_geos.find(name);
43 if (it != m_geos.cend())
50 std::map<std::string, VariationMaterial>::const_iterator it = m_mats.find(name);
51 if (it != m_mats.cend())
58 std::map<std::string, VariationGroup>::const_iterator it = m_groups.find(name);
59 if (it != m_groups.cend())
66 std::map<std::string, VariationOverride>::const_iterator it = m_overrides.find(name);
67 if (it != m_overrides.cend())
83 std::vector<std::string> names;
84 names.reserve(m_geos.size());
85 for (
auto it = m_geos.cbegin(); it != m_geos.cend(); it++)
86 names.push_back(it->first);
92 std::vector<std::string> names;
93 names.reserve(m_mats.size());
94 for (
auto it = m_mats.cbegin(); it != m_mats.cend(); it++)
95 names.push_back(it->first);
101 std::vector<std::string> names;
102 names.reserve(m_groups.size());
103 for (
auto it = m_groups.cbegin(); it != m_groups.cend(); it++)
104 names.push_back(it->first);
110 std::vector<std::string> names;
111 names.reserve(m_overrides.size());
112 for (
auto it = m_overrides.cbegin(); it != m_overrides.cend(); it++)
113 names.push_back(it->first);
119 std::map<std::string, VariationGeometry>::iterator it = m_geos.find(name);
120 if (it != m_geos.end())
130 std::map<std::string, VariationMaterial>::iterator it = m_mats.find(name);
131 if (it != m_mats.end())
141 std::map<std::string, VariationGroup>::iterator it = m_groups.find(name);
142 if (it != m_groups.end())
158 std::map<std::string, VariationOverride>::iterator it = m_overrides.find(name);
159 if (it != m_overrides.end())
161 m_overrides.erase(it);
175 std::map<std::string, VariationGroupLod>::const_iterator it = m_lods.find(name);
176 if (it != m_lods.cend())
188 std::map<std::string, VariationGroupLod>::iterator it = m_lods.find(name);
189 if (it != m_lods.end())
216 std::vector<std::string> names;
217 names.reserve(m_lods.size());
218 for (
auto it = m_lods.cbegin(); it != m_lods.cend(); it++)
219 names.push_back(it->first);
223 size_t Variations::size()
const
225 return m_agentTypeVariations.size();
230 return std::find(m_geometryFilter.begin(), m_geometryFilter.end(), geometryName) != m_geometryFilter.end();
235 if (index < m_geometryFilter.size())
236 return m_geometryFilter[index];
237 return m_emptyString;
242 if (index < m_geometryFilter.size())
244 m_geometryFilter.erase(m_geometryFilter.begin() + index);
252 m_variationTypes.clear();
254 m_materialConstraints.clear();
255 m_geoMatAlias.clear();
256 m_geoMatSuffixRepl.first =
"";
257 m_geoMatSuffixRepl.second =
"";
258 m_materialPrefix =
"";
263 m_variationTypes.insert({ name, vg });
268 m_extraGeos.insert({ name, vg });
273 m_materialConstraints.insert({ name, mc });
278 if (!m_atVariation->
hasGeometry(eg.getSourceGeometry()))
280 AtomsUtils::Logger::error() <<
"Can't add exclude geometry " << name <<
". Geometry " << eg.getSourceGeometry() <<
" does not exist";
284 if (!m_atVariation->
hasGeometry(eg.getDestinationGeometry()))
286 AtomsUtils::Logger::error() <<
"Can't add exclude geometry " << name <<
". Geometry " << eg.getDestinationGeometry() <<
" does not exist";
290 m_excludeGeometries.insert({ name, eg });
295 return std::find(m_materialNames.begin(), m_materialNames.end(), materialName) != m_materialNames.end();
300 m_materialNames.push_back(materialName);
301 m_materialWeights.push_back(weight);
306 if (index >= 0 && index < m_materialNames.size())
307 return m_materialNames[index];
308 return m_emptyString;
313 if (index >= 0 && index < m_materialWeights.size())
314 return m_materialWeights[index];
320 if (index >= 0 && index < m_materialNames.size())
322 m_materialNames.erase(m_materialNames.begin() + index);
323 m_materialWeights.erase(m_materialWeights.begin() + index);
Agent type variation class.
Definition: Variations.h:685
bool removeGeometry(const std::string &name)
Removes a geometry.
Definition: Variations.impl.h:117
bool removeOverride(const std::string &name)
Removes an override.
Definition: Variations.impl.h:156
std::vector< std::string > getOverrideNames() const
Gets the override names.
Definition: Variations.impl.h:108
std::vector< std::string > getMaterialNames() const
Gets the material names.
Definition: Variations.impl.h:90
std::vector< std::string > getGeometryNames() const
Gets the geometry names.
Definition: Variations.impl.h:81
VariationGroupCPtr getGroupPtr(const std::string &name) const
Gets a group.
Definition: Variations.impl.h:56
VariationOverrideCPtr getOverridePtr(const std::string &name) const
Gets an override.
Definition: Variations.impl.h:64
bool removeMaterial(const std::string &name)
Removes a material.
Definition: Variations.impl.h:128
VariationMaterialCPtr getMaterialPtr(const std::string &name) const
Gets a material.
Definition: Variations.impl.h:48
bool removeAllGroups()
Removes all groups.
Definition: Variations.impl.h:150
bool hasGeometry(const std::string &name) const
Checks if this object contains a geometry.
Definition: Variations.h:766
void clear()
Clear the greomeitres, materials and variaiton groups.
Definition: Variations.impl.h:72
bool removeGroup(const std::string &name)
Removes a group.
Definition: Variations.impl.h:139
bool removeAllOverrides()
Removes all override.
Definition: Variations.impl.h:167
std::vector< std::string > getGroupNames() const
Gets the group names.
Definition: Variations.impl.h:99
VariationGeometryCPtr getGeometryPtr(const std::string &name) const
Gets a geometry.
Definition: Variations.impl.h:40
const std::pair< std::string, std::string > & getCombinationAtIndex(unsigned int index) const
Gets a combination.
Definition: Variations.impl.h:197
bool removeCombinationAtIndex(unsigned int index)
Removes a combination.
Definition: Variations.impl.h:204
bool hasCombination(const std::string &geometryName, const std::string &materialName)
Checks if this object contains this combination.
Definition: Variations.impl.h:181
std::pair< std::string, std::string > m_emptyPair
Empty combination.
Definition: Variations.h:349
std::vector< std::pair< std::string, std::string > > m_combinations
Map of combinations.
Definition: Variations.h:346
Exclude Geometry.
Definition: Variations.h:405
Material Constraint class.
Definition: Variations.h:555
void addMaterial(const std::string &materialName, const double weight=1.0)
Adds a material.
Definition: Variations.impl.h:298
bool removeMaterialAtIndex(unsigned int index)
Removes a geometry filter.
Definition: Variations.impl.h:318
const double getMaterialWeightAtIndex(unsigned int index) const
Gets a material weight.
Definition: Variations.impl.h:311
const std::string & getMaterialNameAtIndex(unsigned int index) const
Gets a material name.
Definition: Variations.impl.h:304
bool hasMaterial(const std::string &materialName) const
Checks if this object contains this materia.
Definition: Variations.impl.h:293
VariationGeometry class.
Definition: Variations.h:64
Variation group class.
Definition: Variations.h:367
VariationGroupLodCPtr getLodPtr(const std::string &name) const
Gets a lod variation group.
Definition: Variations.impl.h:173
bool removeLod(const std::string &name)
Removes a lod.
Definition: Variations.impl.h:186
std::vector< std::string > getLodNames() const
Gets all lod names stored.
Definition: Variations.impl.h:214
Variation group lod class.
Definition: Variations.h:357
Variation Material.
Definition: Variations.h:135
Variation override class.
Definition: Variations.h:427
bool removeGeometryFilterAtIndex(unsigned int index)
Removes a geometry filter.
Definition: Variations.impl.h:240
bool hasGeometryFilter(const std::string &geometryName) const
Checks if this object contains this geometry filter.
Definition: Variations.impl.h:228
const std::string & getGeometryFilterAtIndex(unsigned int index) const
Gets a geometry filter.
Definition: Variations.impl.h:233
Variation Tree Geo class.
Definition: Variations.h:500
Variation Tree class.
Definition: Variations.h:580
void addExcludeGeometry(const std::string &name, const ExcludeGeometry &mc)
add exclude geometry
Definition: Variations.impl.h:276
void addExtraGeo(const std::string &name, const VariationTreeGeo &vg)
add extra geo
Definition: Variations.impl.h:266
void clear()
clear
Definition: Variations.impl.h:250
void addMaterialConstraint(const std::string &name, const MaterialConstraint &mc)
add material constraint
Definition: Variations.impl.h:271
void addVariationType(const std::string &name, const VariationTreeGeo &vg)
add variation type
Definition: Variations.impl.h:261
std::vector< std::string > getAgentTypeNames() const
Gets the agent type names.
Definition: Variations.impl.h:23
AgentTypeVariationCPtr getAgentTypeVariationPtr(const std::string &agentTypeName) const
Gets an agent type variation.
Definition: Variations.impl.h:32
bool removeAgentTypeVariation(const std::string &agentTypeName)
Removes an agent type variation.
Definition: Variations.impl.h:12
static LogProxy error()
Get logger proxy error.
Atoms namespace.
Definition: Agent.h:29