Atoms Crowd  7.0.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 void setCenterOffset(const AtomsCore::Vector3 offset);
81 
82  inline const char* typeName() override { return "stadiumLayout"; };
83 
84  private:
85 
86  unsigned short m_shapeType;
87 
88  unsigned int m_steps;
89 
90  bool m_doTopLeft;
91  bool m_doTop;
92  bool m_doTopRight;
93  bool m_doLeft;
94  bool m_doRight;
95  bool m_doBottomLeft;
96  bool m_doBottom;
97  bool m_doBottomRight;
98 
99  double m_stepWidth;
100 
101  double m_stepDepth;
102 
103  double m_stepHeight;
104 
105  AtomsCore::Vector2 m_size;
106 
107  double m_cornerRadius;
108 
109  AtomsCore::Matrix m_matrix;
110 
111  AtomsCore::Vector3 m_randomDirection;
112 
113  AtomsCore::Vector3 m_centerOffset;
114 
115  unsigned int m_seed;
116  };
117 }
118 
119 #include "StadiumLayoutGenerator.impl.h"
Layout generator.
Definition: LayoutGenerator.h:31
Definition: StadiumLayoutGenerator.h:15
const char * typeName() override
Get the type name for this generator.
Definition: StadiumLayoutGenerator.h:82
virtual std::vector< AgentInitData > generate(double time)
Generate a vector of agent init data.
AtomsMath::Vector2 Vector2
Vector2 class.
Definition: AtomsMath.h:54
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
AtomsMath::Matrix Matrix
Matrix class.
Definition: AtomsMath.h:63
Atoms namespace.
Definition: Agent.h:29