diff --git a/Core/Inc/point.h b/Core/Inc/point.h new file mode 100644 index 0000000..3022a4b --- /dev/null +++ b/Core/Inc/point.h @@ -0,0 +1,51 @@ +/* + * point.h + * + * Created on: Mar 24, 2025 + * Author: CHAUVEAU Maxime + */ + +#ifndef INC_POINT_H_ +#define INC_POINT_H_ + +#include +#include + +enum class StatePoint { + UNKNOWN, + START, + END, + INTERMEDIATE +}; + +class Point { +private: + float x; + float y; + float theta; + uint32_t id; + StatePoint state; + +public: + // Constructeur + Point(float x = 0.0, float y = 0.0, float theta = 0.0, StatePoint state = StatePoint::UNKNOWN); + + // Setters + void setX(float x); + void setY(float y); + void setTheta(float theta); + void setState(StatePoint s); + void setID(uint32_t id); + + // Getters + float getX(); + float getY(); + float getTheta(); + std::array getPoint(); + StatePoint getState(); + uint32_t getID(); +}; + + + +#endif /* INC_POINT_H_ */ diff --git a/Core/Src/point.cpp b/Core/Src/point.cpp new file mode 100644 index 0000000..77870b2 --- /dev/null +++ b/Core/Src/point.cpp @@ -0,0 +1,55 @@ + + +#include "point.h" + +Point::Point(float x, float y, float theta, StatePoint state){ + this->x = x; + this->y = y; + this->theta = theta; + this->state = state; +} + +void Point::setX(float x){ + this->x = x; +} + +void Point::setY(float y){ + this->y = y; +} + +void Point::setTheta(float theta){ + this->theta = theta; +} + +void Point::setState(StatePoint s){ + this->state = s; +} + +void Point::setID(uint32_t id){ + this->id = id; +} + + +float Point::getX(){ + return x; +} + +float Point::getY(){ + return y; +} + +float Point::getTheta(){ + return theta; +} + +std::array Point::getPoint(){ + return {this->x, this->y, this->theta}; +} + +StatePoint Point::getState(){ + return state; +} + +uint32_t Point::getID(){ + return id; +}