Circle+Line: documentation

This commit is contained in:
arthur.jamet
2021-05-14 20:06:18 +02:00
parent aafc9a80b7
commit b6ba173e72
2 changed files with 42 additions and 2 deletions
+19 -2
View File
@@ -15,19 +15,36 @@ namespace Ray {
class Circle: public Drawable
{
public:
Circle(Vector2 topLeftPos, int radius, Color);
//! @brief Circle constructor
//! @param topLeftPos position of top-left point (in percentage)
//! @param radius radius of the circle(in percentage)
//! @param Color Color of the circle
Circle(Vector2 topLeftPos, int radius, Color color);
Circle(int topLeftX, int topLeftY, int radius, Color);
//! @brief Circle constructor
//! @param topLeftX x-position of top-left point (in percentage)
//! @param topLeftY y-position of top-left point (in percentage)
//! @param radius radius of the circle(in percentage)
//! @param Color Color of the circle
Circle(int topLeftX, int topLeftY, int radius, Color color);
//! @brief A default copy constructor
Circle(const Circle &) = default;
//! @brief A circle is assignable
Circle &operator=(const Circle &) = default;
//! @brief A default destructor
~Circle() = default;
//! @return the radius of the circle
int getRadius(void) const;
//! @brief set radius
Circle &setRadius(int radius) const;
private:
//! @brief Radius of the circle (in percentage)
int _radius;
};
};
+23
View File
@@ -15,21 +15,44 @@ namespace Ray {
class Line: public Drawable
{
public:
//! @brief Line constructor
//! @param position position of top-left point (in percentage)
//! @param length length of the line(in percentage)
//! @param rotation Color of the line (in degrees)
Line(Vector2 position, int length, Color);
//! @brief Line constructor
//! @param x x-position of top-left point (in percentage)
//! @param y y-position of top-left point (in percentage)
//! @param length length of the line(in percentage)
//! @param rotation Color of the line (in degrees)
Line(int x, int y, int length, Color);
//! @brief A default copy constructor
Line(const Line &) = default;
//! @brief A line is assignable
Line &operator=(const Line &) = default;
//! @brief A default destructor
~Line() = default;
//! @return the length of the line
int getLength(void) const;
//! @return the rotation of the line
int getRotation(void) const;
//! @brief set length
Line &setLength(int);
//! @brief set rotation
Line &setRotation(int);
private:
//! @brief Length of the line (in percentage)
int _length;
//! @brief Rotation of the line (from origin, in degree)
int _rotation;
};
};