Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
Line.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_MIMICS_MODEL_SUPPORT_LINE_HPP_
2#define IV_SRC_MIMICS_MODEL_SUPPORT_LINE_HPP_
3
4#include "math/structs.hpp"
6
8{
9class Line
10{
11 //TODO RAG: Molaría hacer esta clase amiga de linea y polilínea, y hacer privados los atributos de Line, pero no hay tiempo y no encuentra
12 // la clase línea :( [26 Jun 2024]
13public:
14 Line();
16 Line(const Line &other);
17 ~Line() = default;
18
19 bool load(const iv::file::xml::node &nodeLine);
20 bool save(iv::file::xml::node &nodeLine) const;
21
22 void draw(IGraphics *graphics, std::optional<iv::types::color> colorState) const;
23
24 void move(double dx, double dy);
25
30 double length;
31
32private:
33
34 struct Keys
35 {
36 static constexpr std::string_view color {"Color"};
37 static constexpr std::string_view lineWidth {"LineWidth"};
38 };
40 {
41 static constexpr std::string string {};
43 static constexpr iv::types::width lineWidth {2};
44 };
45 struct Sections
46 {
47 static constexpr std::string_view start {"Start"};
48 static constexpr std::string_view end {"End"};
49 static constexpr std::string_view attributes {"Attributes"};
50 };
51};
52
53}// namespace iv::mimics::support
54#endif//IV_SRC_MIMICS_MODEL_SUPPORT_LINE_HPP_
Definition IGraphics.hpp:20
Definition xmlFile.hpp:15
Definition Line.hpp:10
iv::types::width m_lineWidth
Definition Line.hpp:27
Line()
Definition Line.cpp:6
void move(double dx, double dy)
Definition Line.cpp:80
bool save(iv::file::xml::node &nodeLine) const
Definition Line.cpp:54
iv::math::geometry::Point2d m_start
Definition Line.hpp:28
void draw(IGraphics *graphics, std::optional< iv::types::color > colorState) const
Definition Line.cpp:71
iv::types::color m_color
Definition Line.hpp:26
bool load(const iv::file::xml::node &nodeLine)
Definition Line.cpp:31
double length
Definition Line.hpp:30
iv::math::geometry::Point2d m_end
Definition Line.hpp:29
constexpr iv::types::color LineElementDefault
Definition color.hpp:480
Definition Attempt.cpp:9
double width
Definition types.hpp:23
uint32_t color
Definition types.hpp:12
Definition structs.hpp:16
static constexpr iv::types::width lineWidth
Definition Line.hpp:43
static constexpr iv::types::color color
Definition Line.hpp:42
Definition Line.hpp:35
static constexpr std::string_view color
Definition Line.hpp:36
static constexpr std::string_view lineWidth
Definition Line.hpp:37
static constexpr std::string_view attributes
Definition Line.hpp:49
static constexpr std::string_view end
Definition Line.hpp:48
static constexpr std::string_view start
Definition Line.hpp:47