Atoms Crowd  7.0.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"
Agent behaviour network.
Definition: AgentBehaviourNetwork.h:29
AgentBehaviourNetwork & operator=(const AgentBehaviourNetwork &other)
Assign operator.
void removePostBuildPoseNode(const std::string &name)
Remove a node from the post build pose list by name.
void reset()
Reset the network.
void removePostBuildPoseNode(AtomsGraph::Node *node)
Remove a node from the post build pose list.
void clear()
Clear all data.
void clearNodeCache()
Clear the node cache.
void buildNetworkCaches()
Compute the network caches for the pre, post and build pose nodes.
void postBuildPose()
Compute all nodes in the post build pose list.
void preBuildPose()
Compute all nodes in the pre build pose list.
~AgentBehaviourNetwork()
Destructor.
void removePreBuildPoseNode(AtomsGraph::Node *node)
Remove a node from the pre build pose list.
void removePreBuildPoseNode(const std::string &name)
Remove a node from the pre build pose list by name.
void setFps(double value)
Set frame per seconds.
void buildPose()
Compute the build pose operator.
AgentBehaviourNetwork()
Constructor.
void setSimulationTime(double value)
Set the simulation time.
AgentBehaviourNetwork(const AgentBehaviourNetwork &other)
Copy constructor.
Operator node.
Definition: Operator.h:26
Definition: utilsNodes.h:22
Definition: Node.h:21
Network manager class.
Definition: NetworkManager.h:27
Definition: Node.h:31
Definition: utilsNodes.h:69
Atoms namespace.
Definition: Agent.h:29