Atoms Crowd  7.0.0
SphereLayoutGenerator.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/DynamicLayoutGenerator.h>
11 
12 namespace Atoms
13 {
14  class ATOMS_EXPORT SphereLayoutGenerator: public DynamicLayoutGenerator
15  {
16  public:
17 
19 
20  virtual ~SphereLayoutGenerator();
21 
22  virtual std::vector<AgentInitData> generate(double time)
23  #ifdef __APPLE__
24  override
25  #endif
26  ;
27 
28  inline const AtomsCore::Vector3& size();
29 
30  inline void setSize(const AtomsCore::Vector3& size);
31 
32  inline double defaultRadius() const;
33 
34  inline void setDefaultRadius(double radius);
35 
36  inline double maxRadius() const;
37 
38  inline void setMaxRadius(double radius);
39 
40  inline bool randomizeRadius() const;
41 
42  inline void setRandomizeRadius(bool randomize);
43 
44  inline int iterations() const;
45 
46  inline void setIterations(int iterations);
47 
48  inline const AtomsCore::Vector3& randomDirection() const;
49 
50  inline void setRandomDirection(const AtomsCore::Vector3& dir);
51 
52  inline const AtomsCore::Vector3& randomUpVector() const;
53 
54  inline void setRandomUpVector(const AtomsCore::Vector3& up);
55 
56  inline const AtomsCore::Matrix& matrix() const;
57 
58  inline void setMatrix(const AtomsCore::Matrix& mtx);
59 
60  inline unsigned int seed() const;
61 
62  inline void setSeed(unsigned int value);
63 
64  inline void setCenterOffset(const AtomsCore::Vector3 offset);
65 
66  inline const char* typeName() override { return "sphereLayout"; };
67 
68  private:
69 
70  AtomsCore::Matrix m_matrix;
71 
72  AtomsCore::Vector3 m_randomDirection;
73 
74  AtomsCore::Vector3 m_randomUpVector;
75 
76  AtomsCore::Vector3 m_centerOffset;
77 
78  AtomsCore::Vector3 m_size;
79 
80  double m_defaultRadius;
81 
82  double m_maxRadius;
83 
84  int m_iterations;
85 
86  unsigned int m_seed;
87 
88  AtomsCore::Rand48 m_random;
89 
90  AtomsCore::Rand48 m_randomRadius;
91 
92  bool m_randomizeRadius;
93  };
94 }
95 
96 #include "SphereLayoutGenerator.impl.h"
Definition: DynamicLayoutGenerator.h:15
Definition: SphereLayoutGenerator.h:15
virtual std::vector< AgentInitData > generate(double time)
Generate a vector of agent init data.
const char * typeName() override
Get the type name for this generator.
Definition: SphereLayoutGenerator.h:66
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
AtomsMath::Matrix Matrix
Matrix class.
Definition: AtomsMath.h:63
Atoms namespace.
Definition: Agent.h:29