Atoms Crowd  7.0.0
CurvePairLayoutGenerator.h
1 #pragma once
2 #include <Atoms/LayoutGenerators/DynamicLayoutGenerator.h>
3 #include <AtomsUtils/Curve.h>
4 
5 namespace Atoms
6 {
7  class ATOMS_EXPORT CurvePairLayoutGenerator : public DynamicLayoutGenerator
8  {
9  public:
10 
12 
13  virtual ~CurvePairLayoutGenerator();
14 
15  // the generator function
16  virtual std::vector<AgentInitData> generate(double time)
17  #ifdef __APPLE__
18  override
19  #endif
20  ;
21 
22  inline void setCurves(AtomsUtils::Curve& curve1, AtomsUtils::Curve& curve2) { m_curve1 = curve1; m_curve2 = curve2; }
23 
24  inline void setSeed(const int value) { m_seed = value; }
25 
26  inline void setRandomRange(const int minValue, const int maxValue) { m_minRandomRange = minValue; m_maxRandomRange = maxValue; }
27 
28  inline void setNumberOfAgents(size_t value1, size_t value2) { m_numberOfAgents1 = value1; m_numberOfAgents2 = value2; }
29 
30  inline void setNumberOfRows(size_t value) { m_numberOfRows = value; }
31 
32  inline void setUseCVs(bool value) { m_useCVs = value; }
33 
34  inline void setDirectionType(short value) { m_directionType = value; }
35 
36  inline void setInvertDirection(bool value) { m_invertDirection = value; }
37 
38  inline void setRandomDistribution(const bool randomDistribution) { m_randomDistribution = randomDistribution;}
39 
40  inline void setRandomDistributionRange(const float minValue, const float maxValue) { m_minRandomDistribution = minValue; m_maxRandomDistribution = maxValue; }
41 
42  inline const char* typeName() override { return "curvePairLayout"; };
43 
44  inline void setOffset(const AtomsCore::Vector3& offset) { m_offset = offset; };
45 
46 
47  private:
48 
49  // Input curve
50  AtomsUtils::Curve m_curve1;
51  AtomsUtils::Curve m_curve2;
52 
53  // Offset
54  AtomsCore::Vector3 m_offset;
55 
56  // Number of agents along the curves
57  size_t m_numberOfAgents1;
58  size_t m_numberOfAgents2;
59 
60  // Number of rows
61  size_t m_numberOfRows;
62 
63  // Direction type: 0 - tangent, 1 - normal, 2 - custom
64  short m_directionType;
65 
66  // Invert the direction
67  bool m_invertDirection;
68 
69  // Use cvs instead num agents
70  bool m_useCVs;
71 
72  // seed for random generation
73  int m_seed;
74 
75  // Random range values
76  int m_minRandomRange;
77  int m_maxRandomRange;
78 
79  // Random distribution flag
80  bool m_randomDistribution;
81  float m_minRandomDistribution;
82  float m_maxRandomDistribution;
83  };
84 }
Definition: CurvePairLayoutGenerator.h:8
const char * typeName() override
Get the type name for this generator.
Definition: CurvePairLayoutGenerator.h:42
virtual std::vector< AgentInitData > generate(double time)
Generate a vector of agent init data.
Definition: DynamicLayoutGenerator.h:15
Nurbs curve.
Definition: Curve.h:18
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
Atoms namespace.
Definition: Agent.h:29