|
Atoms Crowd
4.1.0
|
10 #include <Atoms/Globals.h>
11 #include <AtomsCore/Metadata/MapMetadata.h>
12 #include <AtomsCore/Metadata/MetadataImpl.h>
130 virtual const std::string&
typeName()
const {
return m_typeName; }
133 virtual void setTypeName(
const std::string& typeName) { m_typeName = typeName; }
136 virtual void addAttribute(
const std::string& attributeName, AtomsPtr<AtomsCore::Metadata>& metadata,
bool perAgent =
false);
137 virtual void addAttribute(
const std::string& attributeName,
AtomsCore::Metadata* metadata,
bool perAgent =
false);
140 virtual void addAttributeProperty(
const std::string& attributeName,
const std::string& propertyName, AtomsPtr<AtomsCore::Metadata>& metadata);
141 virtual void addAttributeProperty(
const std::string& attributeName,
const std::string& propertyName,
AtomsCore::Metadata* metadata);
153 virtual const std::string&
name()
const {
return m_name; }
156 virtual void setName(
const std::string& name) { m_name = name; }
169 T getAttributePerAgent(
const T& defaultValue,
AtomsCore::MapMetadata* overrideMap,
const std::string&
id);
178 void setProfileTime(
unsigned short index,
size_t us);
180 static bool ignoreCurrentModule(
Atoms::Agent* agent,
const std::string& currentModuleName,
const std::vector<std::string>& moduleNames,
const std::string& metadataName);
181 static void enableCurrentActiveModuleMetadata(
Atoms::Agent* agent,
const std::string& currentModuleName,
const std::string& metadataName,
const bool enable);
183 static void initializeAngularVelocity(
Atoms::Agent* agent);
191 std::string m_typeName;
195 size_t m_profileTime[10];
206 if (dataPtr)
return dataPtr->
value();
217 return agentDataPtr->
value();
223 if (dataPtr)
return dataPtr->
value();
virtual void draw(DrawContext *context, const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
Draw.
virtual void agentsCreated(const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
Agents Created.
Agent group.
Definition: AgentGroup.h:35
virtual void addAttribute(const std::string &attributeName, AtomsPtr< AtomsCore::Metadata > &metadata, bool perAgent=false)
Add an attribute to the module, if the perAgent flag is set to true an extra attribute is added with ...
virtual ~BehaviourModule()
Destructor.
virtual bool isEnabled() const
Gets the enabled state for this module.
Definition: BehaviourModule.h:150
virtual void preFrame(AgentGroup *agentGroup=nullptr)
Pre frame.
T getAttributePerAgent(const T &defaultValue, AtomsCore::MapMetadata *overrideMap, const std::string &id)
Utils to get per agent attributes.
Definition: BehaviourModule.h:201
virtual bool removeAttribute(const std::string &attributeName)
Removes an attribute from the module, this also removes the _override entry if present.
Agent.
Definition: Agent.h:38
BehaviourModule()
Constructor.
virtual void addAttributeProperty(const std::string &attributeName, const std::string &propertyName, AtomsPtr< AtomsCore::Metadata > &metadata)
Add an attribute property to the module.
virtual void initSimulation(AgentGroup *agentGroup=nullptr)
Init simulation.
virtual const std::string & name() const
Gets the module name.
Definition: BehaviourModule.h:153
virtual void resetSimulation(const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
Reset simulation.
virtual void setTypeName(const std::string &typeName)
Sets the module type name.
Definition: BehaviourModule.h:133
size_t profileTime(unsigned short index) const
Get profile time.
Definition: DrawContext.h:17
virtual bool hasDynamicAttributes() const
Check if this module can generate attribute dynamically.
Atoms namespace.
Definition: Agent.h:28
Behaviour module.
Definition: BehaviourModule.h:31
virtual void initFrame(const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
Init frame.
virtual void postPhysics(const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
Post Physics.
virtual void prePhysics(const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
Pre Physics.
virtual AtomsCore::MapMetadata & attributes()
Returns the module attributes map.
Definition: BehaviourModule.h:124
virtual const std::string & typeName() const
Gets the module type name.
Definition: BehaviourModule.h:130
virtual void agentsKilled(const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
Post frame.
virtual void endFrame(const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
End frame.
virtual void setEnabled(bool value)
Set the enabled state for this module.
Definition: BehaviourModule.h:147
virtual AtomsCore::MapMetadata & attributeProperties()
Returns the module attribute properties map.
Definition: BehaviourModule.h:127
virtual void setName(const std::string &name)
Sets the module name.
Definition: BehaviourModule.h:156
virtual void preDraw(DrawContext *context, const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
Pre draw.
virtual void endSimulation(const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
End simulation.
virtual void refreshAttributes()
Refresh the attribute map metadata.