Atoms Crowd  7.0.0
PointsLayoutGenerator.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/LayoutGenerators/LayoutGenerator.h>
11 #include <vector>
12 
13 namespace Atoms
14 {
15  class ATOMS_EXPORT PointsLayoutGenerator : public LayoutGenerator
16  {
17  public:
18 
20 
21  virtual ~PointsLayoutGenerator();
22 
23  virtual std::vector<AgentInitData> generate(double time)
24  #ifdef __APPLE__
25  override
26  #endif
27  ;
28 
29  inline AtomsCore::Matrix matrix();
30 
31  inline void setMatrix(const AtomsCore::Matrix& mtx);
32 
33  inline std::vector<AtomsCore::Vector3>& positions();
34 
35  inline void setPositions(const std::vector<AtomsCore::Vector3>& pos);
36 
37  inline std::vector<AtomsCore::Vector3>& directions();
38 
39  inline void setDirections(const std::vector<AtomsCore::Vector3>& dir);
40 
41  inline std::vector<AtomsCore::Vector3>& upVectors();
42 
43  inline void setUpVectors(const std::vector<AtomsCore::Vector3>& dir);
44 
45  inline std::vector<std::string>& agentTypes();
46 
47  inline void setAgentTypes(const std::vector<std::string>& aTypes);
48 
49  inline std::vector<int>& ids();
50 
51  inline void setIds(const std::vector<int>& id);
52 
53  inline const char* typeName() override { return "pointsLayout"; };
54 
55  inline bool allowMultiple() override { return false; };
56 
57  inline bool mustBeFirst() override { return true; };
58 
59  private:
60 
61  AtomsCore::Matrix m_matrix;
62 
63  std::vector<AtomsCore::Vector3> m_positions;
64 
65  std::vector<AtomsCore::Vector3> m_directions;
66 
67  std::vector<AtomsCore::Vector3> m_upVectors;
68 
69  std::vector<std::string> m_agentTypes;
70 
71  std::vector<int> m_ids;
72 
73 #ifdef ATOMS_UNREAL
74  std::vector<int> m_dynamicOldIds;
75 #endif
76  };
77 }
78 
79 #include "PointsLayoutGenerator.impl.h"
Layout generator.
Definition: LayoutGenerator.h:31
Definition: PointsLayoutGenerator.h:16
bool mustBeFirst() override
Returns wheter this layout generator should be the first one in the stack.
Definition: PointsLayoutGenerator.h:57
virtual std::vector< AgentInitData > generate(double time)
Generate a vector of agent init data.
bool allowMultiple() override
Returns whether an Agent Group can have multiple instances of this layout generator.
Definition: PointsLayoutGenerator.h:55
const char * typeName() override
Get the type name for this generator.
Definition: PointsLayoutGenerator.h:53
AtomsMath::Matrix Matrix
Matrix class.
Definition: AtomsMath.h:63
Atoms namespace.
Definition: Agent.h:29