- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

# src/TaskBasedFlockSim/Flock.h

    00001
    00002
    00003
    00004
    00005
    00006
    00007
    00008
    00009
    00010
    00011
    00012
    00013
    00014
    00015
    00016
    00017
    00018
    00019
    00020 #ifndef _FLOCK_H_
    00021 #define _FLOCK_H_
    00022
    00023 #include "Vector3.h"
    00024 #include <boost\shared_array.hpp>
    00025
    00026 namespace TaskBasedFlockSim
    00027 {
    00028
    00029 typedef boost::shared_array<TestFrameWork::Vector3> Positions;
    00030 typedef boost::shared_array<TestFrameWork::Vector3> Velocities;
    00031 typedef boost::shared_array<float> Angles;
    00032
    00033 class Flock
    00034 {
    00035 public:
    00036         Flock(size_t boidsCount = 0);
    00037
    00038         ~Flock(void);
    00039
    00040         void SetMaxSize(size_t boidsCount);
    00041
    00042         float GetMaxSize(void) const;
    00043
    00044         void SetAngleIncrement(float angle);
    00045
    00046         float GetAngleIncrement(void) const;
    00047
    00048         void SetSeparationWeight(float weight);
    00049
    00050         float GetSeparationWeight(void) const;
    00051
    00052         void SetCohesionWeight(float weight);
    00053
    00054         float GetCohesionWeight(void) const;
    00055
    00056         void SetAlignmentWeight(float weight);
    00057
    00058         float GetAlignmentWeight(void) const;
    00059
    00060         void SetTrefoilKnotPathWeight(float weight);
    00061
    00062         float GetTrefoilKnotPathWeight(void) const;
    00063
    00064         size_t GetBoidsCount(void) const;
    00065
    00066         Positions& GetPositions(void);
    00067
    00068         Velocities& GetVelocities(void);
    00069
    00070         Angles& GetAngles(void);
    00071
    00072         const Positions& GetPositions(void) const;
    00073
    00074         const Velocities& GetVelocities(void) const;
    00075
    00076         const Angles& GetAngles(void) const;
    00077
    00078         Flock& operator=(const Flock& flock);
    00079
    00080         void SetMaxSpeed(const TestFrameWork::Vector3& speed);
    00081
    00082         void SetSeparationDistance(float distance);
    00083
    00084         void SetGroupDistance(float distance);
    00085
    00086         const TestFrameWork::Vector3& GetMaxSpeed(void) const;
    00087
    00088         float GetSeparationDistance(void) const;
    00089
    00090         float GetGroupDistance(void) const;
    00091
    00092         void Resize(size_t boidsCount);
    00093
    00094 private:
    00095         size_t m_maxFlockSize;
    00096
    00097         float m_angleIncrement;
    00098
    00099         float m_separationWeight;
    00100         float m_cohesionWeight;
    00101         float m_alignmentWeight;
    00102         float m_trefoilknotPathWeight;
    00103
    00104         TestFrameWork::Vector3 m_maxSpeed;
    00105         float m_separationDistance;
    00106         float m_groupDistance;
    00107
    00108         size_t m_boidsCount;
    00109
    00110         Positions m_positions;
    00111         Velocities m_velocities;
    00112         Angles m_angles;
    00113 };
    00114
    00115 }
    00116
    00117 #endif