Atoms Crowd  4.1.0
StadiumLayoutGenerator.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 
12 namespace Atoms
13 {
14  class ATOMS_EXPORT StadiumLayoutGenerator : public LayoutGenerator
15  {
16  public:
17 
18  enum
19  {
20  kSquare = 0,
21  kEllipse,
22  };
23 
25 
26  virtual ~StadiumLayoutGenerator();
27 
28  virtual std::vector<AgentInitData> generate(double time)
29  #ifdef __APPLE__
30  override
31  #endif
32  ;
33 
34  inline unsigned short shapeType() const;
35 
36  inline void setShapeType(unsigned short value);
37 
38  inline void setSides(bool m_doTopLeft, bool m_doTop, bool m_doTopRight, bool m_doLeft, bool m_doRight, bool m_doBottomLeft, bool m_doBottom, bool m_doBottomRight);
39 
40  inline unsigned int steps() const;
41 
42  inline void setSteps(unsigned int value);
43 
44  inline double stepWidth() const;
45 
46  inline void setStepWidth(double value);
47 
48  inline double stepDepth() const;
49 
50  inline void setStepDepth(double value);
51 
52  inline double stepHeight() const;
53 
54  inline void setStepHeight(double value);
55 
56  inline const AtomsCore::Vector2& size() const;
57 
58  inline void setSize(const AtomsCore::Vector2& value);
59 
60  inline const double cornerRadius() const;
61 
62  inline void setCornerRadius(double cornerRadius);
63 
64  inline AtomsCore::Vector3 upVector();
65 
66  inline void setUpVector(const AtomsCore::Vector3& dir);
67 
68  inline AtomsCore::Vector3 randomDirection();
69 
70  inline void setRandomDirection(const AtomsCore::Vector3& dir);
71 
72  inline AtomsCore::Matrix matrix();
73 
74  inline void setMatrix(const AtomsCore::Matrix& mtx);
75 
76  inline unsigned int seed();
77 
78  inline void setSeed(unsigned int value);
79 
80  inline const std::map<int, std::string>& agentTypeOverride() const;
81 
82  inline void setAgentTypeOverride(const std::map<int, std::string>& value);
83 
84  inline const std::map<int, AtomsCore::Vector3>& directionOverride() const;
85 
86  inline void setDirectionOverride(const std::map<int, AtomsCore::Vector3>& value);
87 
88  inline const std::map<int, AtomsCore::Vector3>& upVectorOverride() const;
89 
90  inline void setUpVectorOverride(const std::map<int, AtomsCore::Vector3>& value);
91 
92  inline void setCenterOffset(const AtomsCore::Vector3 offset);
93 
94  inline const char* typeName() override { return "stadiumLayout"; };
95 
96  private:
97 
98  unsigned short m_shapeType;
99 
100  unsigned int m_steps;
101 
102  bool m_doTopLeft;
103  bool m_doTop;
104  bool m_doTopRight;
105  bool m_doLeft;
106  bool m_doRight;
107  bool m_doBottomLeft;
108  bool m_doBottom;
109  bool m_doBottomRight;
110 
111  double m_stepWidth;
112 
113  double m_stepDepth;
114 
115  double m_stepHeight;
116 
117  AtomsCore::Vector2 m_size;
118 
119  double m_cornerRadius;
120 
121  AtomsCore::Matrix m_matrix;
122 
123  AtomsCore::Vector3 m_upVector;
124 
125  AtomsCore::Vector3 m_randomDirection;
126 
127  std::map<int, std::string> m_agentTypeOverride;
128 
129  std::map<int, AtomsCore::Vector3> m_directionOverride;
130 
131  std::map<int, AtomsCore::Vector3> m_upVectorOverride;
132 
133  AtomsCore::Vector3 m_centerOffset;
134 
135  unsigned int m_seed;
136  };
137 }
138 
139 #include "StadiumLayoutGenerator.impl.h"
Atoms::StadiumLayoutGenerator::generate
virtual std::vector< AgentInitData > generate(double time)
Generate a vector of agent init data.
AtomsCore::Vector2
AtomsMath::Vector2 Vector2
Vector2 class.
Definition: AtomsMath.h:54
AtomsCore::Matrix
AtomsMath::Matrix Matrix
Matrix class.
Definition: AtomsMath.h:63
AtomsCore::Vector3
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
Atoms
Atoms namespace.
Definition: Agent.h:28
Atoms::LayoutGenerator
Layout generator.
Definition: LayoutGenerator.h:29
Atoms::StadiumLayoutGenerator::typeName
const char * typeName() override
Get the type name for this generator.
Definition: StadiumLayoutGenerator.h:94
Atoms::StadiumLayoutGenerator
Definition: StadiumLayoutGenerator.h:15