Atoms Crowd  7.0.0
LayoutGenerator.impl.h
1 // ===========================================================================
2 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
3 //
4 // Use of this software is subject to the terms of the Toolchefs license
5 // agreement provided at the time of installation or download, or which
6 // otherwise accompanies this software in either electronic or hard copy form.
7 // ===========================================================================
8 
9 namespace Atoms
10 {
12  {
13  return m_staticGenerator;
14  }
15 
17  {
18  m_staticGenerator = value;
19  }
20 
21  AgentTypePtr LayoutGenerator::agentType(const int groupId, const std::string& groupIdStr)
22  {
23  return Atoms::AgentTypes::instance().agentType(m_agentTypeAttributeCache.getAttributeValue(groupId, groupIdStr, NULL));
24  }
25 
26  std::atomic<size_t>& LayoutGenerator::nextFreeId()
27  {
28  return m_nextFreeId;
29  }
30 
31  const std::atomic<size_t>& LayoutGenerator::nextFreeId() const
32  {
33  return m_nextFreeId;
34  }
35 
36  const std::string &LayoutGenerator::name()
37  {
38  return m_name;
39  }
40 
41  void LayoutGenerator::setName(const std::string &name)
42  {
43  m_name = name;
44  }
45 
46  void LayoutGenerator::setAgentTypeAttributeCache(const BehaviourModuleAttributeCache<std::string>& agentTypeAttributeCache)
47  {
48  m_agentTypeAttributeCache = agentTypeAttributeCache;
49  };
50 
52  {
53  m_applyPelvisHeightOffsetCache = offsetPelvisHeightCache;
54  };
55 
56  void LayoutGenerator::setDirectionAttributeCache(const BehaviourModuleAttributeCache<AtomsCore::Vector3>& directionAttributeCache)
57  {
58  m_directionAttributeCache = directionAttributeCache;
59  };
60 
61  void LayoutGenerator::setUpVectorAttributeCache(const BehaviourModuleAttributeCache<AtomsCore::Vector3>& upVectorAttributeCache)
62  {
63  m_upVectorAttributeCache = upVectorAttributeCache;
64  };
65 }
static AgentTypes & instance()
Singleton access for global data.
AgentTypePtr agentType(const std::string &typeName)
Gets the agent type with the given name.
const T getAttributeValue(const int groupId, const std::string &groupIdStr, class Agent *agent) const
generates a random value
Definition: BehaviourModuleAttributeCache.h:154
void setAsStaticGenerator(bool value)
Set the static state for this generator.
Definition: LayoutGenerator.impl.h:16
const std::string & name()
Get the name of this generator.
Definition: LayoutGenerator.impl.h:36
void setOffsetPelvisHeightAttributeCache(const BehaviourModuleAttributeCache< bool > &offsetPelvisHeightCache)
Sets offset pelvis height attribute cache.
Definition: LayoutGenerator.impl.h:51
void setName(const std::string &name)
Set the name of this generator.
Definition: LayoutGenerator.impl.h:41
bool isStaticGenerator() const
Get the static state for this generator.
Definition: LayoutGenerator.impl.h:11
virtual AgentTypePtr agentType(const int groupId, const std::string &groupIdStr)
Get the agent type used by this generator.
Definition: LayoutGenerator.impl.h:21
Atoms namespace.
Definition: Agent.h:29
AtomsPtr< AgentType > AgentTypePtr
Agent type pointer.
Definition: AgentType.h:17