API Documentation
Loading...
Searching...
No Matches
PolyLine.hpp
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: PolyLine
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/BaseValues.h>
34#include <NDEVR/Buffer.h>
35#include <NDEVR/Vertex.h>
36#include <NDEVR/Bounds.h>
37#include <NDEVR/LineSegment.h>
38
39/**--------------------------------------------------------------------------------------------------
40Namespace: Parke
41Namespace that wraps all Logic created by Tyler Parke
42 *-----------------------------------------------------------------------------------------------**/
43
44namespace NDEVR
45{
46
47 /**--------------------------------------------------------------------------------------------------
48 Class: Polyline
49
50 \brief A polyline which stores vertex information for many points along a given path
51
52 Author: Tyler Parke
53
54 Date: 2017-11-19
55 *-----------------------------------------------------------------------------------------------**/
56 template<uint01 t_dims, class t_type, class t_vertex = Vertex<t_dims, t_type>>
57 class Polyline
58 {
59 public:
60 Polyline(uint04 size = 0)
61 : m_vertices(size)
62 , m_cache_bounds(Constant<Bounds<t_dims, t_type>>::NaN)
63 , m_cache_length(Constant<t_type>::NaN)
64 /** . */
65 {}
67 : m_vertices(vertices)
68 , m_cache_bounds(Constant<Bounds<t_dims, t_type>>::NaN)
69 , m_cache_length(Constant<t_type>::NaN)
70 /** . */
71 {}
72 Polyline(const Polyline& polygon) noexcept
73 : m_vertices(polygon.m_vertices)
74 , m_cache_bounds(polygon.m_cache_bounds)
75 , m_cache_length(polygon.m_cache_length)
76 /** . */
77 {}
78 Polyline(Polyline&& polygon) noexcept
79 : m_vertices()
80 , m_cache_bounds()
81 , m_cache_length()
82 {
83 std::swap(m_vertices, polygon.m_vertices);
84 std::swap(m_cache_bounds, polygon.m_cache_bounds);
85 std::swap(m_cache_length, polygon.m_cache_length);
86 }
87
88 /**--------------------------------------------------------------------------------------------------
89 Fn: Bounds<t_dims, t_type, t_vertex> Polyline::bounds() const
90
91 Gets the bounds.
92
93 Author: Tyler Parke
94
95 Date: 2017-11-19
96
97 Returns: A Bounds&lt;t_dims,t_type,t_vertex&gt;
98 *-----------------------------------------------------------------------------------------------**/
99
101 {
102 if (isNaN(m_cache_bounds))
103 {
104 m_cache_bounds = Constant<Bounds<t_dims, t_type, t_vertex>>::Min;
105 for (uint04 i = 0; i < m_vertices.size(); i++)
106 {
107 m_cache_bounds.addToBounds(m_vertices[i]);
108 }
109 }
110 return m_cache_bounds;
111 }
112
113 decltype(auto) begin()
114 {
115 return m_vertices.begin();
116 }
117 decltype(auto) begin() const
118 {
119 return m_vertices.begin();
120 }
121
122 decltype(auto) begin(uint04 index) const
123 {
124 return m_vertices.begin(index);
125 }
126 decltype(auto) begin(uint04 index)
127 {
128 return m_vertices.begin(index);
129 }
130
131 decltype(auto) end()
132 {
133 return m_vertices.end();
134 }
135 decltype(auto) end() const
136 {
137 return m_vertices.end();
138 }
139
140 /**--------------------------------------------------------------------------------------------------
141 Fn: const t_vertex& Polyline::vertex(uint04 index) const
142
143 Vertices the given index.
144
145 Author: Tyler Parke
146
147 Date: 2017-11-19
148
149 Parameters:
150 index - Zero-based index of the.
151
152 Returns: A reference to a const t_vertex.
153 *-----------------------------------------------------------------------------------------------**/
154
155 const t_vertex& vertex(uint04 index) const
156 {
157 return m_vertices[index];
158 }
159
160 /**--------------------------------------------------------------------------------------------------
161 Fn: LineSegment<t_dims, t_type, t_vertex> Polyline::segment(uint04 index) const
162
163 Segments the given index.
164
165 Author: Tyler Parke
166
167 Date: 2017-11-19
168
169 Parameters:
170 index - Zero-based index of the.
171
172 Returns: A LineSegment&lt;t_dims,t_type,t_vertex&gt;
173 *-----------------------------------------------------------------------------------------------**/
174
179
180 /**--------------------------------------------------------------------------------------------------
181 Fn: inline const Buffer<t_vertex>& Polyline::vertices() const
182
183 Gets the vertices.
184
185 Author: Tyler Parke
186
187 Date: 2017-11-19
188
189 Returns: A reference to a const Buffer&lt;t_vertex&gt;
190 *-----------------------------------------------------------------------------------------------**/
191
192 inline const Buffer<t_vertex>& vertices() const
193 {
194 return m_vertices;
195 }
196
197 /**--------------------------------------------------------------------------------------------------
198 Fn: inline uint04 Polyline::visibleVertexCount() const
199
200 Vertex count.
201
202 Author: Tyler Parke
203
204 Date: 2017-11-19
205
206 Returns: An uint04.
207 *-----------------------------------------------------------------------------------------------**/
208
209 inline uint04 vertexCount() const
210 {
211 return m_vertices.size();
212 }
213
214 /**--------------------------------------------------------------------------------------------------
215 Fn: inline uint04 Polyline::segmentCount() const
216
217 Segment count.
218
219 Author: Tyler Parke
220
221 Date: 2018-10-29
222
223 Returns: An uint04.
224 *-----------------------------------------------------------------------------------------------**/
225
226 inline uint04 segmentCount() const
227 {
228 if (m_vertices.size() == 0)
229 return 0;
230 else
231 return m_vertices.size() - 1;
232 }
233
234 /**--------------------------------------------------------------------------------------------------
235 Fn: inline void Polyline::setVertices(const Buffer<t_vertex>& vertices)
236
237 Sets the vertices.
238
239 Author: Tyler Parke
240
241 Date: 2017-11-19
242
243 Parameters:
244 vertices - The vertices.
245 *-----------------------------------------------------------------------------------------------**/
246
248 {
249 updateVertices(vertices);
250 }
251
252 /**--------------------------------------------------------------------------------------------------
253 Fn: void Polyline::add(const t_vertex& vertex)
254
255 Adds vertex.
256
257 Author: Tyler Parke
258
259 Date: 2017-11-19
260
261 Parameters:
262 vertex - The vertex to add.
263 *-----------------------------------------------------------------------------------------------**/
264
265 void add(const t_vertex& vertex)
266 {
267 m_vertices.add(vertex);
268 invalidateCache();
269 }
270 void addAndSimplify(const t_vertex& vertex)
271 {
273 }
274
275 /**--------------------------------------------------------------------------------------------------
276 Fn: void Polyline::add(uint04 index, const t_vertex& vertex)
277
278 Adds index.
279
280 Author: Tyler Parke
281
282 Date: 2017-11-19
283
284 Parameters:
285 index - Zero-based index of the.
286 vertex - The vertex.
287 *-----------------------------------------------------------------------------------------------**/
288
289 void add(uint04 index, const t_vertex& vertex)
290 {
291 m_vertices.add(index, vertex);
292 invalidateCache();
293 }
294 void addAndSimplify(uint04 index, const t_vertex& vertex)
295 {
296 if (isNaN(vertex))
297 {
298 if (index < vertexCount() && isNaN(this->vertex(index)))
299 return;//nothing to do
300 if (index > 1 && isNaN(this->vertex(index - 1)))
301 return;//nothing to do
302 m_vertices.add(index, vertex);
303 invalidateCache();
304 }
305 else
306 {
307 m_vertices.add(index, vertex);
308 if (index < vertexCount() - 1)
309 {
310 if (segment(index).template isParallel<t_type>(segment(index - 1), 0.00001))
311 {
312 remove(index);
313 }
314 }
315 if (index > 2)
316 {
317 if (segment(index - 1).template isParallel<t_type>(segment(index - 2), 0.00001))
318 {
319 remove(index - 1);
320 }
321 }
322 }
323 invalidateCache();
324 }
325
326 /**--------------------------------------------------------------------------------------------------
327 Fn: void Polyline::replace(uint04 index, const t_vertex& vector)
328
329 Replaces.
330
331 Author: Tyler Parke
332
333 Date: 2017-11-19
334
335 Parameters:
336 index - Zero-based index of the.
337 vector - The vector.
338 *-----------------------------------------------------------------------------------------------**/
339
340 void replace(uint04 index, const t_vertex& vertex)
341 {
342 if (m_vertices[index] != vertex)
343 {
344 m_vertices[index] = vertex;
345 invalidateCache();
346 }
347 }
348
349 /**--------------------------------------------------------------------------------------------------
350 Fn: void Polyline::removeRows(uint04 index)
351
352 Removes the given index.
353
354 Author: Tyler Parke
355
356 Date: 2017-11-19
357
358 Parameters:
359 index - The index to removeRows.
360 *-----------------------------------------------------------------------------------------------**/
361
362 void remove(uint04 index)
363 {
364 m_vertices.removeIndex(index);
365 invalidateCache();
366 }
367
368 /**--------------------------------------------------------------------------------------------------
369 Fn: void Polyline::lastVertex()
370
371 The last vertex in the polyline
372
373 Author: Tyler Parke
374
375 Date: 2019-01-12
376
377 Returns: The last vertex in the polyline
378 *-----------------------------------------------------------------------------------------------**/
379 const t_vertex& lastVertex() const
380 {
381 return m_vertices.last();
382 }
383 /**--------------------------------------------------------------------------------------------------
384 Fn: void Polyline::removeLastVertex()
385
386 Removes the last vertex from the polyline.
387
388 Author: Tyler Parke
389
390 Date: 2019-01-12
391
392 *-----------------------------------------------------------------------------------------------**/
394 {
395 m_vertices.removeLast();
396 }
397 /**--------------------------------------------------------------------------------------------------
398 Fn: void Polyline::simplify()
399
400 Removes all duplicate adjacent vertices.
401
402 Author: Tyler Parke
403
404 Date: 2019-01-12
405 *-----------------------------------------------------------------------------------------------**/
406 void simplify()
407 {
408 if (vertexCount() <= 1)
409 return;
410 for (uint04 i = 0; i < vertexCount() - 1; i++)
411 {
412 if (vertex(i) == vertex(i + 1))
413 {
414 remove(i + 1);
415 i--;
416 }
417 else if (i > 0 && segment(i).template isParallel<t_type>(segment(i - 1), 0.00001))
418 {
419 remove(i);
420 i--;
421 }
422 }
423 }
424 /**--------------------------------------------------------------------------------------------------
425 Fn: void Polyline::clear()
426
427 Clears this object to its blank/initial state.
428
429 Author: Tyler Parke
430
431 Date: 2017-11-19
432 *-----------------------------------------------------------------------------------------------**/
433
434 void clear()
435 {
436 m_vertices.clear();
437 invalidateCache();
438 }
439
440 /**--------------------------------------------------------------------------------------------------
441 Fn: Polyline<t_new_type, t_new_vertex_type> Polyline::as() const
442
443 Gets as.
444
445 Author: Tyler Parke
446
447 Date: 2017-11-19
448
449 Returns: A Polyline&lt;t_new_type,t_new_vertex_type&gt;
450 *-----------------------------------------------------------------------------------------------**/
451 template<uint01 t_new_dims, class t_new_type, class t_new_vertex_type = Vertex<t_new_dims, t_new_type>>
453 {
455 for (uint04 i = 0; i < vertexCount(); i++)
456 {
457 poly.add(t_new_vertex_type(vertex(i).template as<t_dims, t_new_type, t_new_vertex_type>()));
458 }
459 return poly;
460 }
461
462 /**--------------------------------------------------------------------------------------------------
463 Fn: t_type Polyline::length() const
464
465 Gets the length.
466
467 Author: Tyler Parke
468
469 Date: 2017-11-19
470
471 Returns: A t_type.
472 *-----------------------------------------------------------------------------------------------**/
473 template<class t_precision>
474 t_precision length() const
475 {
476 if (isNaN(m_cache_length))
477 {
478 if (vertexCount() <= 1)
479 {
480 m_cache_length = cast<t_precision>(0);
481 }
482 else
483 {
484 m_cache_length = cast<t_precision>(0);
485 for (uint04 i = 0; i < segmentCount(); i++)
486 {
487 if(!isNaN(segment(i)))
488 m_cache_length += segment(i).template length<t_precision>();
489 }
490 }
491 }
492 return m_cache_length;
493 }
494
495
496 /**--------------------------------------------------------------------------------------------------
497 Fn: constexpr inline t_vertex Polyline::pointAt(t_inter_type value) const
498
499 Point at.
500
501 Author: Tyler Parke
502
503 Date: 2017-11-19
504
505 Parameters:
506 value - The value.
507
508 Returns: A t_vertex.
509 *-----------------------------------------------------------------------------------------------**/
510 template<class t_inter_type>
511 constexpr inline t_vertex pointAt(t_inter_type value) const
512 {
513 uint04 index = cast<uint04>(value);
514 return segment(index).pointAt(value - cast<t_inter_type>(index));
515 }
516
517 constexpr inline t_vertex pointAtLength(fltp08 value) const
518 {
519 if (vertexCount() == 0)
521 fltp08 accumulated_distance = 0;
522 for (uint04 i = 1; i < vertexCount(); i++)
523 {
524 fltp08 local_distance = distance<fltp08>(vertex(i - 1), vertex(i));
525 if (accumulated_distance + local_distance > value)
526 {
527 fltp08 line_percent = clip((value - accumulated_distance) / local_distance, 0.0, 1.0);
528 return (vertex(i - 1).template as<t_dims, fltp08>() * (1.0 - line_percent)
529 + vertex(i).template as<t_dims, fltp08>() * line_percent).template as<t_dims, t_type>();
530
531 }
532 accumulated_distance += local_distance;
533 }
534 return lastVertex();
535 }
536
537 /**--------------------------------------------------------------------------------------------------
538 Fn: bool Polyline::operator==(const Polyline& polygon) const
539
540 Equality operator.
541
542 Author: Tyler Parke
543
544 Date: 2017-11-19
545
546 Parameters:
547 polygon - The polygon.
548
549 Returns: True if the parameters are considered equivalent.
550 *-----------------------------------------------------------------------------------------------**/
551
552 bool operator==(const Polyline& polygon) const
553 {
554 return (m_vertices == polygon.m_vertices);
555 }
556 Polyline& operator=(const Polyline& polygon)
557 {
558 m_vertices = polygon.m_vertices;
559 m_cache_length = polygon.m_cache_length;
560 m_cache_bounds = polygon.m_cache_bounds;
561 return *this;
562 }
563 Polyline& operator=(Polyline&& polygon) noexcept
564 {
565 std::swap(m_vertices, polygon.m_vertices);
566 m_cache_length = polygon.m_cache_length;
567 m_cache_bounds = polygon.m_cache_bounds;
568 return *this;
569 }
571 {
573 if (vertexCount() == 0)
574 return new_poly;
575
576 t_type remainder_distance(0);
577 new_poly.add(vertex(0));//add initial vertex
578 for (uint04 i = 0; i < segmentCount(); i++)
579 {
580 const t_type seg_length = segment(i).template length<t_type>();
581 if (seg_length + remainder_distance > length)
582 {
583 t_type local_accumulation = length - remainder_distance;
584 lib_assert(local_accumulation > 0.0, "Bad accumulation");
585 auto ray = segment(i).ray().template normalized<fltp08>();
586 do
587 {
588 new_poly.add(segment(i).vertex(A) + ray * local_accumulation);
589 local_accumulation += length;
590 } while (local_accumulation < seg_length);
591 remainder_distance = length + seg_length - local_accumulation;
592 }
593 else if (!isNaN(seg_length))
594 {
595 remainder_distance += seg_length;
596 }
597 }
598 return new_poly;
599 }
601 {
602 t_type dist_squared = d * d;
604 if (vertexCount() == 0)
605 return new_poly;
606 new_poly.add(vertex(0));
607 for (uint04 i = 1; i < vertexCount(); i++)
608 {
609 if (distanceSquared(new_poly.lastVertex(), vertex(i)) > dist_squared)
610 {
611
613 const Vector<t_dims, t_type> ab = seg.ray();
614 const Vector<t_dims, t_type> ap = new_poly.lastVertex() - seg[A];
615 Vector<t_dims, t_type> normal = ab.template normalized<t_type>();
616 if(ap != 0.0 && !equals(ab, ap, 0.000001) && !equals(ab, -ap, 0.000001))//check if collinear
617 {
618 //project P onto AB
619 //use triangle to solve for point on line d distance away from last vertex
620 t_type sum = (ab * ap).sum();
621 const t_type mag_squared = ab.magnitudeSquared();
622 sum /= mag_squared;
623 const Vector<t_dims, t_type> p0 = seg[A] + (ab * sum);
624 t_type new_distance = sqrt(dist_squared - distanceSquared(p0, new_poly.lastVertex()));
625 new_poly.add(new_distance * normal + p0);
626 }
627 //simplified when back on line
628 while (distanceSquared(new_poly.lastVertex(), vertex(i)) > dist_squared)
629 {
630 new_poly.add(d * normal + new_poly.lastVertex());
631 }
632 }
633 }
634 return new_poly;
635 }
636
638 {
640 if (vertexCount() == 0)
641 return new_polys;
643 new_poly.add(vertex(0));
644 t_type accumulated_distance = 0;
645 for (uint04 i = 1; i < vertexCount(); i++)
646 {
647 t_type local_distance = distance<t_type>(vertex(i - 1), vertex(i));
648 while (accumulated_distance + local_distance > max_distance)
649 {
650 auto direction = (vertex(i) - new_poly.lastVertex()).template normalized<t_type>();
651 t_type adjusted_distance = max_distance - accumulated_distance;
652
653 auto final_vertex = adjusted_distance * direction + new_poly.lastVertex();
654 new_poly.add(final_vertex);
655 new_polys.add(new_poly);
656
657 new_poly.clear();
658 new_poly.add(final_vertex);
659 local_distance = local_distance - adjusted_distance;
660 accumulated_distance = 0.0;
661
662 }
663 new_poly.add(vertex(i));
664 accumulated_distance += local_distance;
665 }
666 new_polys.add(new_poly);
667 return new_polys;
668 }
669
670 Polyline<t_dims, t_type> clipPolyline(const Bounds<t_vertex::NumberOfDimensions(), t_type>& bounds) const
671 {
672 if (bounds.contains<true>(this->bounds()))
673 return *this;
674 if (!bounds.intersects(this->bounds()))
675 return Polyline();
676 Polyline polyline(vertexCount());
677 for (uint04 ii = 0; ii < vertexCount() - 1; ++ii)
678 {
679 LineSegment<t_vertex::NumberOfDimensions(), t_type> line(vertex(ii), vertex(ii + 1));
680 line = intersection(bounds, line);
681 if (!isNaN(line))
682 {
683 if (polyline.vertexCount() == 0 || polyline.lastVertex() != line.vertex(A))
684 polyline.add(line.vertex(A));
685 polyline.add(line.vertex(B));
686 }
687 }
688 polyline.simplify();
689 return polyline;
690 }
691 private:
692
693 /**--------------------------------------------------------------------------------------------------
694 Fn: inline void Polyline::invalidateCache() const
695
696 Invalidate cache.
697
698 Author: Tyler Parke
699
700 Date: 2017-11-19
701 *-----------------------------------------------------------------------------------------------**/
702
703 inline void invalidateCache() const
704 {
705 m_cache_length = Constant<t_type>::NaN;
706 m_cache_bounds = Constant<Bounds<t_dims, t_type>>::NaN;
707 }
708
709 /**--------------------------------------------------------------------------------------------------
710 Fn: void Polyline::updateVertices(const Buffer<t_vertex>& vertices)
711
712 Updates the vertices described by given vertices.
713
714 Author: Tyler Parke
715
716 Date: 2017-11-19
717
718 Parameters:
719 vertices - The vertices.
720 *-----------------------------------------------------------------------------------------------**/
721
722 void updateVertices(const Buffer<t_vertex>& vertices)
723 {
724 m_vertices = vertices;
725 invalidateCache();
726 }
727 private:
728 /** The vertices. */
729 Buffer<t_vertex> m_vertices;
730
731 /**--------------------------------------------------------------------------------------------------
732 Property: mutable Bounds<t_dims, t_type, t_vertex> m_cache_bounds
733
734 Gets the cache bounds.
735
736 Returns: The m cache bounds.
737 *-----------------------------------------------------------------------------------------------**/
738
739 mutable Bounds<t_dims, t_type, t_vertex> m_cache_bounds;
740
741 /**--------------------------------------------------------------------------------------------------
742 Property: mutable t_type m_cache_length
743
744 Gets the length of the cache.
745
746 Returns: The length of the cache.
747 *-----------------------------------------------------------------------------------------------**/
748
749 mutable t_type m_cache_length;
750 };
751}
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:57
constexpr void addToBounds(const t_vertex &vector)
Adds to the bounds such that the new bounds fully encompasses the argument.
Definition Bounds.hpp:498
constexpr bool contains(const t_type &value) const
Query if this object contains the given value.
Definition Bounds.hpp:329
constexpr bool intersects(const Bounds< t_dims, t_type, t_other_vertex_type > &bounds) const
Query if this object intersects the given pair.
Definition Bounds.hpp:737
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
void add(t_type &&object)
Definition Buffer.hpp:199
constexpr t_index_type size() const
Definition Buffer.hpp:1461
decltype(auto) last()
Definition Buffer.hpp:977
decltype(auto) end()
Definition Buffer.hpp:746
void removeIndex(t_index_type location)
Definition Buffer.hpp:1037
decltype(auto) begin()
Definition Buffer.hpp:504
void clear()
Definition Buffer.hpp:572
void removeLast()
Definition Buffer.hpp:1099
A line segment represented by two vertices, a start and end.
Definition Line.hpp:55
constexpr t_vertex ray() const
Definition Line.hpp:134
Definition MemoryManager.h:283
A polyline which stores vertex information for many points along a given path.
Definition CoordinateProjectionManager.h:44
Polyline(Buffer< t_vertex > &vertices)
Definition PolyLine.hpp:66
void simplify()
Definition PolyLine.hpp:406
Polyline & operator=(const Polyline &polygon)
Definition PolyLine.hpp:556
Polyline & operator=(Polyline &&polygon) noexcept
Definition PolyLine.hpp:563
t_precision length() const
Definition PolyLine.hpp:474
Buffer< Polyline< t_dims, t_type >, uint04, ObjectAllocator< false > > breakIntoPolylinesByLength(t_type max_distance) const
Definition PolyLine.hpp:637
decltype(auto) begin(uint04 index)
Definition PolyLine.hpp:126
Bounds< t_dims, t_type, t_vertex > bounds() const
Definition PolyLine.hpp:100
uint04 vertexCount() const
Definition PolyLine.hpp:209
void replace(uint04 index, const t_vertex &vertex)
Definition PolyLine.hpp:340
constexpr t_vertex pointAtLength(fltp08 value) const
Definition PolyLine.hpp:517
uint04 segmentCount() const
Definition PolyLine.hpp:226
Polyline(Polyline &&polygon) noexcept
Definition PolyLine.hpp:78
void removeLastVertex()
Definition PolyLine.hpp:393
bool operator==(const Polyline &polygon) const
Definition PolyLine.hpp:552
void addAndSimplify(uint04 index, const t_vertex &vertex)
Definition PolyLine.hpp:294
void setVertices(const Buffer< t_vertex > &vertices)
Definition PolyLine.hpp:247
void remove(uint04 index)
Definition PolyLine.hpp:362
decltype(auto) end()
Definition PolyLine.hpp:131
Polyline< t_dims, t_type > clipPolyline(const Bounds< t_vertex::NumberOfDimensions(), t_type > &bounds) const
Definition PolyLine.hpp:670
Polyline< t_dims, t_type > breakIntoSegmentsByDistance(t_type d) const
Definition PolyLine.hpp:600
Polyline(uint04 size=0)
Definition PolyLine.hpp:60
Polyline< t_dims, t_type > breakIntoSegmentsByLength(t_type length) const
Definition PolyLine.hpp:570
LineSegment< t_dims, t_type, t_vertex > segment(uint04 index) const
Definition PolyLine.hpp:175
decltype(auto) begin()
Definition PolyLine.hpp:113
constexpr t_vertex pointAt(t_inter_type value) const
Definition PolyLine.hpp:511
decltype(auto) begin(uint04 index) const
Definition PolyLine.hpp:122
void add(const t_vertex &vertex)
Definition PolyLine.hpp:265
void clear()
Definition PolyLine.hpp:434
void addAndSimplify(const t_vertex &vertex)
Definition PolyLine.hpp:270
decltype(auto) begin() const
Definition PolyLine.hpp:117
Polyline< t_dims, t_new_type, t_new_vertex_type > as() const
Definition PolyLine.hpp:452
const t_vertex & vertex(uint04 index) const
Definition PolyLine.hpp:155
const t_vertex & lastVertex() const
Definition PolyLine.hpp:379
const Buffer< t_vertex > & vertices() const
Definition PolyLine.hpp:192
decltype(auto) end() const
Definition PolyLine.hpp:135
void add(uint04 index, const t_vertex &vertex)
Definition PolyLine.hpp:289
Polyline(const Polyline &polygon) noexcept
Definition PolyLine.hpp:72
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
constexpr t_type magnitudeSquared() const
Definition Vector.hpp:458
Definition ACIColor.h:37
constexpr t_type clip(const t_type &value, const t_type &lower_bound, const t_type &upper_bound)
Clips the value given so that that the returned value falls between upper and lower bound.
Definition BaseFunctions.hpp:240
t_type distanceSquared(const Bounds< t_dims, t_type, t_vertex > &bounds, const Vector< t_dims, t_type > &vertex)
Definition Distance.hpp:42
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
t_type sqrt(const t_type &value)
Definition VectorFunctions.hpp:1309
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514
constexpr t_type distance(const t_vertex &vertex, const LineSegment< t_dims, t_type, t_vertex > &line)
Definition Distance.hpp:250
constexpr bool equals(const LineSegment< t_dims, t_type, t_vertex > &left, const LineSegment< t_dims, t_type, t_vertex > &right, const t_type &epsilon=cast< t_type >(0))
Definition Line.hpp:819
constexpr bool isNaN(const t_type &value)
Query if 'value' is valid or invalid.
Definition BaseFunctions.hpp:200
@ B
Definition BaseValues.hpp:203
@ A
Definition BaseValues.hpp:201
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
Definition BaseValues.hpp:272