53 virtual void accept(
Drawable &drawable,
float time) = 0;
56 #define TRASE_BACKEND_VISITABLE() \ 57 void accept(Drawable &drawable, float time) override { \ 58 drawable.dispatch(*this, time); \ 65 using Backend::accept;
68 virtual void accept(
Drawable &drawable) = 0;
71 #define TRASE_ANIMATED_BACKEND_VISITABLE() \ 72 void accept(Drawable &drawable) override { drawable.dispatch(*this); } 76 3.141592653589793238462643383279502884197169399375105820974944592307816406286f;
85 float a{1}, b{0}, c{0}, d{1}, e{0}, f{0};
88 return a == 1.0f && b == 0.0f && c == 0.0f && d == 1.0f && e == 0.0f &&
110 e += a * t[0] + c * t[1];
111 f += b * t[0] + d * t[1];
114 const float cos_t = std::cos(angle);
115 const float sin_t = std::sin(angle);
138 const float a0 = a * cos_t + c * sin_t;
139 c = -a * sin_t + c * cos_t;
140 const float b0 = b * cos_t + d * sin_t;
141 d = -b * sin_t + d * cos_t;
146 std::string to_string() {
147 std::stringstream stream;
148 stream <<
"transform=\"matrix(" << a <<
' ' << b <<
' ' << c <<
' ' << d
149 <<
' ' << e <<
' ' << f <<
")\"";
154 enum Align :
unsigned int {
156 ALIGN_LEFT = 1u << 0u,
157 ALIGN_CENTER = 1u << 1u,
158 ALIGN_RIGHT = 1u << 2u,
160 ALIGN_TOP = 1u << 3u,
161 ALIGN_MIDDLE = 1u << 4u,
162 ALIGN_BOTTOM = 1u << 5u,
163 ALIGN_BASELINE = 1u << 6u,
167 CLOCKWISE = 1u << 0u,
168 COUNTER_CLOCKWISE = 1u << 1u,
173 std::vector<std::string> m_list_of_available_fonts;
174 std::vector<std::string> m_font_dirs;
181 std::string find_font(
const std::string &name1,
const std::string &name2);
183 void add_system_fonts();
184 void add_font_dir(
const std::string &path);
185 void clear_font_dirs();
188 void list_fonts(
const std::string &path);
a base class for all the backends that support drawing a single frame
Definition: Backend.hpp:50
Base class for drawable objects in a figure.
Definition: Drawable.hpp:99
An N-dimensional vector class.
Definition: Vector.hpp:59
a base class for all the backends that support animation over time
Definition: Backend.hpp:62
Definition: Backend.hpp:171
Definition: Backend.cpp:39