37 template <
typename Po
intType>
57 for (
auto const& m : *
this)
58 if (m.contains(aPoint))
70 intersect() : iX(), iSkip() {}
71 intersect(
coordinate_type aX,
bool aSkip =
false) : iX(aX), iSkip(aSkip) {}
75 bool skip()
const {
return iSkip; }
76 bool operator==(
const intersect& aOther)
const {
return iX == aOther.iX; }
77 bool operator<(
const intersect& aOther)
const {
return iX < aOther.iX; }
83 typedef std::vector<intersect> intersect_list;
88 iSubPaths.
reserve(aPathCountHint);
114 iPosition = aPosition;
115 iBoundingRect = invalid;
129 if (aPath.size() >= 2)
134 auto const& center = boundingRect.center();
137 for (
auto vi = aPath.begin(); vi != aPath.end(); ++vi)
142 if (vi + 1 != aPath.end())
162 result.push_back(
xyz{ aPath[0].
x, aPath[0].y });
170 iLineCountHint = aLineCountHint;
181 if (iLineCountHint != 0)
183 iSubPaths.
back().reserve(iLineCountHint + 1);
186 iSubPaths.
back().push_back(*iPointFrom);
187 iPointFrom = std::nullopt;
191 if (iSubPaths.
empty())
194 if (iSubPaths.
back().empty() || iSubPaths.
back().back() != aPoint)
195 iSubPaths.
back().push_back(aPoint);
196 iBoundingRect = invalid;
206 auto const center = boundingRect.center();
207 for (
auto& segment : iSubPaths)
208 for (
auto&
point : segment)
219 iBoundingRect = invalid;
239 std::optional<point_type> iPointFrom;
242 mutable cache<std::tuple<bool, size_type, mesh_type>> iBoundingRect;
250 typedef basic_path<point> path;
251 typedef std::optional<path> optional_path;
void set_shape(path_shape aShape)
vertices to_vertices(const typename sub_paths_type::value_type &aPath) const
basic_rect< coordinate_type > mesh_type
point_type position() const
mesh_type bounding_rect(bool aOffsetPosition=true, size_type aPixelWidthAdjustment=size_type{}) const
clip_rect_list clip_rects(const point &aOrigin) const
void set_position(point_type aPosition)
point_type::coordinate_type dimension_type
void inflate(const delta_type &aDelta)
void deflate(coordinate_delta_type aDeltaX, coordinate_delta_type aDeltaY)
basic_line< coordinate_type > line_type
const sub_paths_type & sub_paths() const
void add_rect(const mesh_type &aRectangle)
basic_path(const mesh_type &aRect, path_shape aShape=path_shape::ConvexPolygon)
basic_delta< coordinate_type > delta_type
sub_paths_type::size_type sub_paths_size_type
basic_path(path_shape aShape=path_shape::ConvexPolygon, sub_paths_size_type aPathCountHint=0)
void deflate(const delta_type &aDeltas)
basic_size< coordinate_type > size_type
neolib::vecarray< sub_path_type, 1, -1 > sub_paths_type
void move_to(coordinate_type aX, coordinate_type aY, sub_paths_size_type aLineCountHint=0)
void move_to(const point_type &aPoint, sub_paths_size_type aLineCountHint=0)
void line_to(const point_type &aPoint)
neolib::vecarray< point_type, 16, -1 > sub_path_type
point_type::coordinate_type coordinate_delta_type
void line_to(coordinate_type aX, coordinate_type aY)
void inflate(coordinate_delta_type aDeltaX, coordinate_delta_type aDeltaY)
point_type::coordinate_type coordinate_type
sub_paths_type & sub_paths()
point_type top_left() const
point_type top_right() const
point_type bottom_left() const
point_type bottom_right() const
void reserve(size_type n)
void push_back(const value_type &value)
bool operator<(const basic_rect< CoordinateType, CoordinateSystem > &left, const basic_rect< CoordinateType, CoordinateSystem > &right)
bool operator==(const basic_rect< CoordinateType, CoordinateSystem > &left, const basic_rect< CoordinateType, CoordinateSystem > &right)
basic_point< coordinate > point
bool contains(const point_type &aPoint) const