Atoms Crowd  4.1.0
AgentBehaviourNetwork.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 <Atoms/Globals.h>
11 #include <Atoms/Graph/Operator.h>
12 #include <AtomsGraph/NetworkManager.h>
13 #include <AtomsGraph/Nodes/utilsNodes.h>
14 #include <list>
15 
16 namespace Atoms
17 {
19 
28  class ATOMS_EXPORT AgentBehaviourNetwork
29  {
30  public:
31 
34 
37 
40 
43 
45  inline AtomsGraph::NetworkManager& manager();
46 
48  void preBuildPose();
49 
51  void buildPose();
52 
54  void postBuildPose();
55 
57  inline Operator* buildPoseNode();
58 
60  inline void setBuildPoseNode(Operator* node);
61 
63  inline void addPreBuildPoseNode(AtomsGraph::Node* node);
64 
67 
69  void removePreBuildPoseNode(const std::string& name);
70 
72  inline std::list<AtomsGraph::Node*>& preBuildPoseNodes();
73 
75  inline void cleanPreBuildPoseNodes();
76 
78  inline void addPostBuildPoseNode(AtomsGraph::Node* node);
79 
82 
84  void removePostBuildPoseNode(const std::string& name);
85 
87  inline std::list<AtomsGraph::Node*>& postBuildPoseNodes();
88 
90  inline void cleanPostBuildPoseNodes();
91 
93  void setSimulationTime(double value);
94 
96  void setFps(double value);
97 
99  inline AtomsGraph::TimeNode* timeNode();
100 
102  inline AtomsGraph::BufferDouble* globalTimeNode();
103 
106 
108  void reset();
109 
112 
114  void clear();
115 
117  inline void setComputeData(const AtomsGraph::ComputeData* computeData);
118 
119  private:
120 
122  AtomsGraph::NetworkManager m_network;
123 
125  std::list<AtomsGraph::Node*> m_prePoseNodes;
126 
128  std::list<AtomsGraph::Node*> m_postPoseNodes;
129 
131  std::vector<AtomsGraph::Node*> m_globalTimeChildNodes;
132 
134  Operator* m_buildPoseNode;
135 
137  AtomsGraph::TimeNode* m_timeNode;
138 
140  AtomsGraph::BufferDouble* m_globalTimeNode;
141 
143  const AtomsGraph::ComputeData* m_computeData;
144  };
145 }
146 
147 #include "AgentBehaviourNetwork.impl.h"
Atoms::AgentBehaviourNetwork::reset
void reset()
Reset the network.
Atoms::AgentBehaviourNetwork
Agent behaviour network.
Definition: AgentBehaviourNetwork.h:29
Atoms::AgentBehaviourNetwork::AgentBehaviourNetwork
AgentBehaviourNetwork(const AgentBehaviourNetwork &other)
Copy constructor.
Atoms::AgentBehaviourNetwork::buildPose
void buildPose()
Compute the build pose operator.
Atoms::AgentBehaviourNetwork::removePostBuildPoseNode
void removePostBuildPoseNode(const std::string &name)
Remove a node from the post build pose list by name.
Atoms::AgentBehaviourNetwork::clear
void clear()
Clear all data.
AtomsGraph::Node
Definition: Node.h:31
AtomsGraph::NetworkManager
Network manager class.
Definition: NetworkManager.h:27
AtomsGraph::TimeNode
Definition: utilsNodes.h:69
Atoms::AgentBehaviourNetwork::setSimulationTime
void setSimulationTime(double value)
Set the simulation time.
Atoms::AgentBehaviourNetwork::buildNetworkCaches
void buildNetworkCaches()
Compute the network caches for the pre, post and build pose nodes.
Atoms::AgentBehaviourNetwork::preBuildPose
void preBuildPose()
Compute all nodes in the pre build pose list.
Atoms::AgentBehaviourNetwork::removePreBuildPoseNode
void removePreBuildPoseNode(const std::string &name)
Remove a node from the pre build pose list by name.
Atoms::AgentBehaviourNetwork::clearNodeCache
void clearNodeCache()
Clear the node cache.
Atoms::AgentBehaviourNetwork::AgentBehaviourNetwork
AgentBehaviourNetwork()
Constructor.
Atoms::AgentBehaviourNetwork::postBuildPose
void postBuildPose()
Compute all nodes in the post build pose list.
Atoms::AgentBehaviourNetwork::operator=
AgentBehaviourNetwork & operator=(const AgentBehaviourNetwork &other)
Assign operator.
Atoms
Atoms namespace.
Definition: Agent.h:28
Atoms::AgentBehaviourNetwork::removePostBuildPoseNode
void removePostBuildPoseNode(AtomsGraph::Node *node)
Remove a node from the post build pose list.
Atoms::Operator
Operator node.
Definition: Operator.h:26
AtomsGraph::ComputeData
Definition: Node.h:21
Atoms::AgentBehaviourNetwork::setFps
void setFps(double value)
Set frame per seconds.
Atoms::AgentBehaviourNetwork::removePreBuildPoseNode
void removePreBuildPoseNode(AtomsGraph::Node *node)
Remove a node from the pre build pose list.
AtomsGraph::BufferDouble
Definition: utilsNodes.h:22
Atoms::AgentBehaviourNetwork::~AgentBehaviourNetwork
~AgentBehaviourNetwork()
Destructor.