xtd 0.2.0
Loading...
Searching...
No Matches
graphics_path.h
Go to the documentation of this file.
1
4#pragma once
5#include "../../drawing_export.h"
6#include "../font_family.h"
7#include "../font_style.h"
8#include "../rectangle.h"
9#include "../rectangle_f.h"
10#include "../string_format.h"
11#include "fill_mode.h"
12#include <xtd/object>
13#include <xtd/string>
14#include <cstdint>
15#include <memory>
16#include <ostream>
17
19namespace xtd {
21 namespace drawing {
23 namespace drawing_2d {
35 class drawing_export_ graphics_path final : public xtd::object, xtd::iequatable<graphics_path> {
36 struct data;
37
38 public:
40
48
54
56
60 intptr handle() const noexcept;
61
62
65 xtd::drawing::drawing_2d::fill_mode fill_mode() const noexcept;
68 graphics_path& fill_mode(xtd::drawing::drawing_2d::fill_mode value) noexcept;
70
72
80 void add_arc(const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle);
87 void add_arc(const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle);
97 void add_arc(int32 x, int32 y, int32 width, int32 height, float start_angle, float sweep_angle);
107 void add_arc(float x, float y, float width, float height, float start_angle, float sweep_angle);
108
116 void add_bezier(const xtd::drawing::point& pt1, const xtd::drawing::point& pt2, const xtd::drawing::point& pt3, const xtd::drawing::point& pt4);
124 void add_bezier(const xtd::drawing::point_f& pt1, const xtd::drawing::point_f& pt2, const xtd::drawing::point_f& pt3, const xtd::drawing::point_f& pt4);
136 void add_bezier(int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, int32 x4, int32 y4);
148 void add_bezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
149
154 void add_beziers(const std::vector<xtd::drawing::point>& points);
159 void add_beziers(const std::vector<xtd::drawing::point_f>& points);
160
164 void add_closed_curve(const std::vector<xtd::drawing::point>& points);
168 void add_closed_curve(const std::vector<xtd::drawing::point_f>& points);
173 void add_closed_curve(const std::vector<xtd::drawing::point>& points, float tension);
178 void add_closed_curve(const std::vector<xtd::drawing::point_f>& points, float tension);
179
184 void add_curve(const std::vector<xtd::drawing::point>& points);
188 void add_curve(const std::vector<xtd::drawing::point_f>& points);
193 void add_curve(const std::vector<xtd::drawing::point>& points, float tension);
198 void add_curve(const std::vector<xtd::drawing::point_f>& points, float tension);
206 void add_curve(const std::vector<xtd::drawing::point>& points, size_t offset, size_t number_of_segments, float tension);
214 void add_curve(const std::vector<xtd::drawing::point_f>& points, size_t offset, size_t number_of_segments, float tension);
215
218 void add_ellipse(const xtd::drawing::rectangle& rect);
221 void add_ellipse(const xtd::drawing::rectangle_f& rect);
227 void add_ellipse(int32 x, int32 y, int32 width, int32 height);
233 void add_ellipse(float x, float y, float width, float height);
234
239 void add_line(const xtd::drawing::point& pt1, const xtd::drawing::point& pt2);
244 void add_line(const xtd::drawing::point_f& pt1, const xtd::drawing::point_f& pt2);
251 void add_line(int32 x1, int32 y1, int32 x2, int32 y2);
258 void add_line(float x1, float y1, float x2, float y2);
259
263 void add_lines(const std::vector<xtd::drawing::point>& points);
267 void add_lines(const std::vector<xtd::drawing::point_f>& points);
268
272 void add_path(const graphics_path& adding_path, bool connect);
273
279 void add_pie(const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle);
285 void add_pie(const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle);
294 void add_pie(int32 x, int32 y, int32 width, int32 height, float start_angle, float sweep_angle);
303 void add_pie(float x, float y, float width, float height, float start_angle, float sweep_angle);
304
308 void add_polygon(const std::vector<xtd::drawing::point>& points);
312 void add_polygon(const std::vector<xtd::drawing::point_f>& points);
313
316 void add_rectangle(const xtd::drawing::rectangle& rect);
319 void add_rectangle(const xtd::drawing::rectangle_f& rect);
325 void add_rectangle(int32 x, int32 y, int32 width, int32 height);
331 void add_rectangle(float x, float y, float width, float height);
332
335 void add_rectangles(const std::vector<xtd::drawing::rectangle>& rects);
338 void add_rectangles(const std::vector<xtd::drawing::rectangle_f>& rects);
339
343 void add_rounded_rectangle(const xtd::drawing::rectangle& rect, float radius);
347 void add_rounded_rectangle(const xtd::drawing::rectangle_f& rect, float radius);
354 void add_rounded_rectangle(int32 x, int32 y, int32 width, int32 height, float radius);
361 void add_rounded_rectangle(float x, float y, float width, float height, float radius);
362
369 void add_string(const xtd::string& s, const xtd::drawing::font_family& family, xtd::drawing::font_style style, float em_size, const xtd::drawing::point& origin, const xtd::drawing::string_format& format);
376 void add_string(const xtd::string& s, const xtd::drawing::font_family& family, xtd::drawing::font_style style, float em_size, const xtd::drawing::point_f& origin, const xtd::drawing::string_format& format);
383 void add_string(const xtd::string& s, const xtd::drawing::font_family& family, xtd::drawing::font_style style, float em_size, const xtd::drawing::rectangle& layout_rect, const xtd::drawing::string_format& format);
390 void add_string(const xtd::string& s, const xtd::drawing::font_family& family, xtd::drawing::font_style style, float em_size, const xtd::drawing::rectangle_f& layout_rect, const xtd::drawing::string_format& format);
391
393 void close_all_figures();
394
396 void close_figure();
397
398 using object::equals;
399 bool equals(const xtd::drawing::drawing_2d::graphics_path& value) const noexcept override;
400
402 void flatten();
403
407 xtd::drawing::rectangle_f get_bounds() const;
408
411 xtd::drawing::point_f get_lat_point() const;
412
416 bool is_vsible(const xtd::drawing::point& point) const;
420 bool is_vsible(const xtd::drawing::point_f& point) const;
425 bool is_vsible(int32 x, int32 y) const;
430 bool is_vsible(float x, float y) const;
431
433 void reset();
434
436 void reverse();
437
441 void start_figure();
442
443 xtd::string to_string() const noexcept override;
445
446 private:
447 void recreate_handle();
448
449 xtd::sptr<data> data_;
450 };
451 }
452 }
453}
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics_path.h:35
graphics_path()
Initializes a new instance of the xtd::drawing::drawing_2d::graphics_path class with a xtd::drawing::...
intptr handle() const noexcept
Gets the handle of the graphics path.
graphics_path(xtd::drawing::drawing_2d::fill_mode mode)
Initializes a new instance of the xtd::drawing::drawing_2d::graphics_path class with the specified xt...
Defines a group of type faces having a similar basic design and certain variations in styles....
Definition font_family.h:38
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.h:35
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.h:54
Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.h:34
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.h:44
Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulat...
Definition string_format.h:30
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
Contains xtd::drawing::drawing_2d::fill_mode enum class.
font_style
Specifies style information applied to text. This enumeration has a flags attribute that allows a bit...
Definition font_style.h:17
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.h:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
fill_mode
Specifies how the interior of a closed path is filled.
Definition fill_mode.h:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10