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
39namespace NDEVR
40{
41
42 /**--------------------------------------------------------------------------------------------------
43 Class: Polyline
44
45 \brief A polyline which stores vertex information for many points along a given path.
46
47 Author: Tyler Parke
48
49 Date: 2017-11-19
50 **/
51 template<uint01 t_dims, class t_type, class t_vertex = Vertex<t_dims, t_type>>
52 class Polyline
53 {
54 public:
55 Polyline(uint04 size = 0)
56 : m_vertices(size)
57 , m_cache_bounds(Constant<Bounds<t_dims, t_type>>::Invalid)
58 , m_cache_length(Constant<t_type>::Invalid)
59 {}
61 : m_vertices(vertices)
62 , m_cache_bounds(Constant<Bounds<t_dims, t_type>>::Invalid)
63 , m_cache_length(Constant<t_type>::Invalid)
64 {}
65 Polyline(const Polyline& polygon) noexcept
66 : m_vertices(polygon.m_vertices)
67 , m_cache_bounds(polygon.m_cache_bounds)
68 , m_cache_length(polygon.m_cache_length)
69 {}
70 Polyline(Polyline&& polygon) noexcept
71 : m_vertices()
72 , m_cache_bounds()
73 , m_cache_length()
74 {
75 std::swap(m_vertices, polygon.m_vertices);
76 std::swap(m_cache_bounds, polygon.m_cache_bounds);
77 std::swap(m_cache_length, polygon.m_cache_length);
78 }
79
80 /**--------------------------------------------------------------------------------------------------
81 Gets the bounds.
82
83 Author: Tyler Parke
84
85 Date: 2017-11-19
86
87 \returns A Bounds&lt;t_dims,t_type,t_vertex&gt;
88 **/
89
91 {
92 if (IsInvalid(m_cache_bounds))
93 {
94 m_cache_bounds = Constant<Bounds<t_dims, t_type, t_vertex>>::Min;
95 for (uint04 i = 0; i < m_vertices.size(); i++)
96 {
97 m_cache_bounds.addToBounds(m_vertices[i]);
98 }
99 }
100 return m_cache_bounds;
101 }
102
103 decltype(auto) begin()
104 {
105 return m_vertices.begin();
106 }
107 decltype(auto) begin() const
108 {
109 return m_vertices.begin();
110 }
111
112 decltype(auto) begin(uint04 index) const
113 {
114 return m_vertices.begin(index);
115 }
116 decltype(auto) begin(uint04 index)
117 {
118 return m_vertices.begin(index);
119 }
120
121 decltype(auto) end()
122 {
123 return m_vertices.end();
124 }
125 decltype(auto) end() const
126 {
127 return m_vertices.end();
128 }
129
130 /**--------------------------------------------------------------------------------------------------
131 Vertices the given index.
132
133 Author: Tyler Parke
134
135 Date: 2017-11-19
136
137 Parameters:
138 index - Zero-based index of the.
139
140 \returns A reference to a const t_vertex.
141 **/
142
143 const t_vertex& vertex(uint04 index) const
144 {
145 return m_vertices[index];
146 }
147
148 /**--------------------------------------------------------------------------------------------------
149 Segments the given index.
150
151 Author: Tyler Parke
152
153 Date: 2017-11-19
154
155 Parameters:
156 index - Zero-based index of the.
157
158 \returns A LineSegment&lt;t_dims,t_type,t_vertex&gt;
159 **/
160
165
166 /**--------------------------------------------------------------------------------------------------
167 Gets the vertices.
168
169 Author: Tyler Parke
170
171 Date: 2017-11-19
172
173 \returns A reference to a const Buffer&lt;t_vertex&gt;
174 **/
175
176 inline const Buffer<t_vertex>& vertices() const
177 {
178 return m_vertices;
179 }
180
181 /**--------------------------------------------------------------------------------------------------
182 Vertex count.
183
184 Author: Tyler Parke
185
186 Date: 2017-11-19
187
188 \returns An uint04.
189 **/
190
191 inline uint04 vertexCount() const
192 {
193 return m_vertices.size();
194 }
195
196 /**--------------------------------------------------------------------------------------------------
197 Segment count.
198
199 Author: Tyler Parke
200
201 Date: 2018-10-29
202
203 \returns An uint04.
204 **/
205
206 inline uint04 segmentCount() const
207 {
208 if (m_vertices.size() == 0)
209 return 0;
210 else
211 return m_vertices.size() - 1;
212 }
213
214 /**--------------------------------------------------------------------------------------------------
215 Sets the vertices.
216
217 Author: Tyler Parke
218
219 Date: 2017-11-19
220
221 Parameters:
222 vertices - The vertices.
223 **/
224
226 {
227 updateVertices(vertices);
228 }
229
230 /**--------------------------------------------------------------------------------------------------
231 Adds vertex.
232
233 Author: Tyler Parke
234
235 Date: 2017-11-19
236
237 Parameters:
238 vertex - The vertex to add.
239 **/
240
241 void add(const t_vertex& vertex)
242 {
243 m_vertices.add(vertex);
244 invalidateCache();
245 }
246 void addAndSimplify(const t_vertex& vertex)
247 {
249 }
250
251 /**--------------------------------------------------------------------------------------------------
252 Adds index.
253
254 Author: Tyler Parke
255
256 Date: 2017-11-19
257
258 Parameters:
259 index - Zero-based index of the.
260 vertex - The vertex.
261 **/
262
263 void add(uint04 index, const t_vertex& vertex)
264 {
265 m_vertices.add(index, vertex);
266 invalidateCache();
267 }
268 void addAndSimplify(uint04 index, const t_vertex& vertex)
269 {
270 if (IsInvalid(vertex))
271 {
272 if (index < vertexCount() && IsInvalid(this->vertex(index)))
273 return;//nothing to do
274 if (index > 1 && IsInvalid(this->vertex(index - 1)))
275 return;//nothing to do
276 m_vertices.add(index, vertex);
277 invalidateCache();
278 }
279 else
280 {
281 m_vertices.add(index, vertex);
282 if (index < vertexCount() - 1)
283 {
284 if (segment(index).template isParallel<t_type>(segment(index - 1), 0.00001))
285 {
286 remove(index);
287 }
288 }
289 if (index > 2)
290 {
291 if (segment(index - 1).template isParallel<t_type>(segment(index - 2), 0.00001))
292 {
293 remove(index - 1);
294 }
295 }
296 }
297 invalidateCache();
298 }
299
300 /**--------------------------------------------------------------------------------------------------
301 Replaces.
302
303 Author: Tyler Parke
304
305 Date: 2017-11-19
306
307 Parameters:
308 index - Zero-based index of the.
309 vector - The vector.
310 **/
311
312 void replace(uint04 index, const t_vertex& vertex)
313 {
314 if (m_vertices[index] != vertex)
315 {
316 m_vertices[index] = vertex;
317 invalidateCache();
318 }
319 }
320
321 /**--------------------------------------------------------------------------------------------------
322 Removes the given index.
323
324 Author: Tyler Parke
325
326 Date: 2017-11-19
327
328 Parameters:
329 index - The index to removeRows.
330 **/
331
332 void remove(uint04 index)
333 {
334 m_vertices.removeIndex(index);
335 invalidateCache();
336 }
337
338 /**--------------------------------------------------------------------------------------------------
339 The last vertex in the polyline
340
341 Author: Tyler Parke
342
343 Date: 2019-01-12
344
345 \returns The last vertex in the polyline
346 **/
347 const t_vertex& lastVertex() const
348 {
349 return m_vertices.last();
350 }
351 /**--------------------------------------------------------------------------------------------------
352 Removes the last vertex from the polyline.
353
354 Author: Tyler Parke
355
356 Date: 2019-01-12
357
358 **/
360 {
361 m_vertices.removeLast();
362 }
363 /**--------------------------------------------------------------------------------------------------
364 Removes all duplicate adjacent vertices.
365
366 Author: Tyler Parke
367
368 Date: 2019-01-12
369 **/
370 void simplify()
371 {
372 if (vertexCount() <= 1)
373 return;
374 for (uint04 i = 0; i < vertexCount() - 1; i++)
375 {
376 if (vertex(i) == vertex(i + 1))
377 {
378 remove(i + 1);
379 i--;
380 }
381 else if (i > 0 && segment(i).template isParallel<t_type>(segment(i - 1), 0.00001))
382 {
383 remove(i);
384 i--;
385 }
386 }
387 }
388 /**--------------------------------------------------------------------------------------------------
389 Clears this object to its blank/initial state.
390
391 Author: Tyler Parke
392
393 Date: 2017-11-19
394 **/
395
396 void clear()
397 {
398 m_vertices.clear();
399 invalidateCache();
400 }
401
402 /**--------------------------------------------------------------------------------------------------
403 Gets as.
404
405 Author: Tyler Parke
406
407 Date: 2017-11-19
408
409 \returns A Polyline&lt;t_new_type,t_new_vertex_type&gt;
410 **/
411 template<uint01 t_new_dims, class t_new_type, class t_new_vertex_type = Vertex<t_new_dims, t_new_type>>
413 {
415 for (uint04 i = 0; i < vertexCount(); i++)
416 {
417 poly.add(t_new_vertex_type(vertex(i).template as<t_dims, t_new_type, t_new_vertex_type>()));
418 }
419 return poly;
420 }
421
422 /**--------------------------------------------------------------------------------------------------
423 Gets the length.
424
425 Author: Tyler Parke
426
427 Date: 2017-11-19
428
429 \returns A t_type.
430 **/
431 template<class t_precision>
432 t_precision length() const
433 {
434 if (IsInvalid(m_cache_length))
435 {
436 if (vertexCount() <= 1)
437 {
438 m_cache_length = cast<t_precision>(0);
439 }
440 else
441 {
442 m_cache_length = cast<t_precision>(0);
443 for (uint04 i = 0; i < segmentCount(); i++)
444 {
445 if(!IsInvalid(segment(i)))
446 m_cache_length += segment(i).template length<t_precision>();
447 }
448 }
449 }
450 return m_cache_length;
451 }
452
453
454 /**--------------------------------------------------------------------------------------------------
455 Point at.
456
457 Author: Tyler Parke
458
459 Date: 2017-11-19
460
461 Parameters:
462 value - The value.
463
464 \returns A t_vertex.
465 **/
466 template<class t_inter_type>
467 constexpr inline t_vertex pointAt(t_inter_type value) const
468 {
469 uint04 index = cast<uint04>(value);
470 return segment(index).pointAt(value - cast<t_inter_type>(index));
471 }
472
473 constexpr inline t_vertex pointAtLength(fltp08 value) const
474 {
475 if (vertexCount() == 0)
477 fltp08 accumulated_distance = 0;
478 for (uint04 i = 1; i < vertexCount(); i++)
479 {
480 fltp08 local_distance = distance<fltp08>(vertex(i - 1), vertex(i));
481 if (accumulated_distance + local_distance > value)
482 {
483 fltp08 line_percent = clip((value - accumulated_distance) / local_distance, 0.0, 1.0);
484 return (vertex(i - 1).template as<t_dims, fltp08>() * (1.0 - line_percent)
485 + vertex(i).template as<t_dims, fltp08>() * line_percent).template as<t_dims, t_type>();
486
487 }
488 accumulated_distance += local_distance;
489 }
490 return lastVertex();
491 }
492
493 /**--------------------------------------------------------------------------------------------------
494 Equality operator.
495
496 Author: Tyler Parke
497
498 Date: 2017-11-19
499
500 Parameters:
501 polygon - The polygon.
502
503 \returns True if the parameters are considered equivalent.
504 **/
505
506 bool operator==(const Polyline& polygon) const
507 {
508 return (m_vertices == polygon.m_vertices);
509 }
510 Polyline& operator=(const Polyline& polygon)
511 {
512 m_vertices = polygon.m_vertices;
513 m_cache_length = polygon.m_cache_length;
514 m_cache_bounds = polygon.m_cache_bounds;
515 return *this;
516 }
517 Polyline& operator=(Polyline&& polygon) noexcept
518 {
519 std::swap(m_vertices, polygon.m_vertices);
520 m_cache_length = polygon.m_cache_length;
521 m_cache_bounds = polygon.m_cache_bounds;
522 return *this;
523 }
525 {
527 if (vertexCount() == 0)
528 return new_poly;
529
530 t_type remainder_distance(0);
531 new_poly.add(vertex(0));//add initial vertex
532 for (uint04 i = 0; i < segmentCount(); i++)
533 {
534 const t_type seg_length = segment(i).template length<t_type>();
535 if (seg_length + remainder_distance > length)
536 {
537 t_type local_accumulation = length - remainder_distance;
538 lib_assert(local_accumulation > 0.0, "Bad accumulation");
539 auto ray = segment(i).ray().template normalized<fltp08>();
540 do
541 {
542 new_poly.add(segment(i).vertex(A) + ray * local_accumulation);
543 local_accumulation += length;
544 } while (local_accumulation < seg_length);
545 remainder_distance = length + seg_length - local_accumulation;
546 }
547 else if (!IsInvalid(seg_length))
548 {
549 remainder_distance += seg_length;
550 }
551 }
552 return new_poly;
553 }
555 {
556 t_type dist_squared = d * d;
558 if (vertexCount() == 0)
559 return new_poly;
560 new_poly.add(vertex(0));
561 for (uint04 i = 1; i < vertexCount(); i++)
562 {
563 if (distanceSquared(new_poly.lastVertex(), vertex(i)) > dist_squared)
564 {
565
567 const Vector<t_dims, t_type> ab = seg.ray();
568 const Vector<t_dims, t_type> ap = new_poly.lastVertex() - seg[A];
569 Vector<t_dims, t_type> normal = ab.template normalized<t_type>();
570 if(ap != 0.0 && !equals(ab, ap, 0.000001) && !equals(ab, -ap, 0.000001))//check if collinear
571 {
572 //project P onto AB
573 //use triangle to solve for point on line d distance away from last vertex
574 t_type sum = (ab * ap).sum();
575 const t_type mag_squared = ab.magnitudeSquared();
576 sum /= mag_squared;
577 const Vector<t_dims, t_type> p0 = seg[A] + (ab * sum);
578 t_type new_distance = sqrt(dist_squared - distanceSquared(p0, new_poly.lastVertex()));
579 new_poly.add(new_distance * normal + p0);
580 }
581 //simplified when back on line
582 while (distanceSquared(new_poly.lastVertex(), vertex(i)) > dist_squared)
583 {
584 new_poly.add(d * normal + new_poly.lastVertex());
585 }
586 }
587 }
588 return new_poly;
589 }
590
592 {
594 if (vertexCount() == 0)
595 return new_polys;
597 new_poly.add(vertex(0));
598 t_type accumulated_distance = 0;
599 for (uint04 i = 1; i < vertexCount(); i++)
600 {
601 t_type local_distance = distance<t_type>(vertex(i - 1), vertex(i));
602 while (accumulated_distance + local_distance > max_distance)
603 {
604 auto direction = (vertex(i) - new_poly.lastVertex()).template normalized<t_type>();
605 t_type adjusted_distance = max_distance - accumulated_distance;
606
607 auto final_vertex = adjusted_distance * direction + new_poly.lastVertex();
608 new_poly.add(final_vertex);
609 new_polys.add(new_poly);
610
611 new_poly.clear();
612 new_poly.add(final_vertex);
613 local_distance = local_distance - adjusted_distance;
614 accumulated_distance = 0.0;
615
616 }
617 new_poly.add(vertex(i));
618 accumulated_distance += local_distance;
619 }
620 new_polys.add(new_poly);
621 return new_polys;
622 }
623
624 Polyline<t_dims, t_type> clipPolyline(const Bounds<t_vertex::NumberOfDimensions(), t_type>& bounds) const
625 {
626 if (bounds.contains<true>(this->bounds()))
627 return *this;
628 if (!bounds.intersects(this->bounds()))
629 return Polyline();
630 Polyline polyline(vertexCount());
631 for (uint04 ii = 0; ii < vertexCount() - 1; ++ii)
632 {
633 LineSegment<t_vertex::NumberOfDimensions(), t_type> line(vertex(ii), vertex(ii + 1));
634 line = intersection(bounds, line);
635 if (!IsInvalid(line))
636 {
637 if (polyline.vertexCount() == 0 || polyline.lastVertex() != line.vertex(A))
638 polyline.add(line.vertex(A));
639 polyline.add(line.vertex(B));
640 }
641 }
642 polyline.simplify();
643 return polyline;
644 }
645 private:
646
647 /**--------------------------------------------------------------------------------------------------
648 Invalidate cache.
649
650 Author: Tyler Parke
651
652 Date: 2017-11-19
653 **/
654
655 inline void invalidateCache() const
656 {
657 m_cache_length = Constant<t_type>::Invalid;
659 }
660
661 /**--------------------------------------------------------------------------------------------------
662 Updates the vertices described by given vertices.
663
664 Author: Tyler Parke
665
666 Date: 2017-11-19
667
668 Parameters:
669 vertices - The vertices.
670 **/
671
672 void updateVertices(const Buffer<t_vertex>& vertices)
673 {
674 m_vertices = vertices;
675 invalidateCache();
676 }
677 private:
678 /** The vertices. */
679 Buffer<t_vertex> m_vertices;
680
681 /**--------------------------------------------------------------------------------------------------
682 Property: mutable Bounds<t_dims, t_type, t_vertex> m_cache_bounds
683
684 Gets the cache bounds.
685
686 \returns The m cache bounds.
687 **/
688
689 mutable Bounds<t_dims, t_type, t_vertex> m_cache_bounds;
690
691 /**--------------------------------------------------------------------------------------------------
692 Property: mutable t_type m_cache_length
693
694 Gets the length of the cache.
695
696 \returns The length of the cache.
697 **/
698
699 mutable t_type m_cache_length;
700 };
701}
#define lib_assert(expression, message)
Definition LibAssert.h:61
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
constexpr void addToBounds(const t_vertex &vector)
Definition Bounds.hpp:390
constexpr bool contains(const t_type &value) const
Query if this object contains the given value. t_allow_bounds - whether or not to allow boundary case...
Definition Bounds.hpp:237
constexpr bool intersects(const Bounds< t_dims, t_type, t_other_vertex_type > &bounds) const
Definition Bounds.hpp:611
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
void add(t_type &&object)
Adds object to the end of the buffer.
Definition Buffer.hpp:186
constexpr t_index_type size() const
Definition Buffer.hpp:823
decltype(auto) last()
Definition Buffer.hpp:588
decltype(auto) end()
Definition Buffer.hpp:507
void removeIndex(t_index_type location)
Definition Buffer.hpp:606
decltype(auto) begin()
Definition Buffer.hpp:402
void clear()
Definition Buffer.hpp:422
void removeLast()
Definition Buffer.hpp:629
A line segment represented by two vertices, a start and end.
Definition Line.hpp:49
constexpr t_vertex ray() const
Definition Line.hpp:120
Definition MemoryManager.h:261
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:60
void simplify()
Definition PolyLine.hpp:370
Polyline & operator=(const Polyline &polygon)
Definition PolyLine.hpp:510
Polyline & operator=(Polyline &&polygon) noexcept
Definition PolyLine.hpp:517
t_precision length() const
Definition PolyLine.hpp:432
Buffer< Polyline< t_dims, t_type >, uint04, ObjectAllocator< false > > breakIntoPolylinesByLength(t_type max_distance) const
Definition PolyLine.hpp:591
decltype(auto) begin(uint04 index)
Definition PolyLine.hpp:116
Bounds< t_dims, t_type, t_vertex > bounds() const
Definition PolyLine.hpp:90
uint04 vertexCount() const
Definition PolyLine.hpp:191
void replace(uint04 index, const t_vertex &vertex)
Definition PolyLine.hpp:312
constexpr t_vertex pointAtLength(fltp08 value) const
Definition PolyLine.hpp:473
uint04 segmentCount() const
Definition PolyLine.hpp:206
Polyline(Polyline &&polygon) noexcept
Definition PolyLine.hpp:70
void removeLastVertex()
Definition PolyLine.hpp:359
bool operator==(const Polyline &polygon) const
Definition PolyLine.hpp:506
void addAndSimplify(uint04 index, const t_vertex &vertex)
Definition PolyLine.hpp:268
void setVertices(const Buffer< t_vertex > &vertices)
Definition PolyLine.hpp:225
void remove(uint04 index)
Definition PolyLine.hpp:332
decltype(auto) end()
Definition PolyLine.hpp:121
Polyline< t_dims, t_type > clipPolyline(const Bounds< t_vertex::NumberOfDimensions(), t_type > &bounds) const
Definition PolyLine.hpp:624
Polyline< t_dims, t_type > breakIntoSegmentsByDistance(t_type d) const
Definition PolyLine.hpp:554
Polyline(uint04 size=0)
Definition PolyLine.hpp:55
Polyline< t_dims, t_type > breakIntoSegmentsByLength(t_type length) const
Definition PolyLine.hpp:524
LineSegment< t_dims, t_type, t_vertex > segment(uint04 index) const
Definition PolyLine.hpp:161
decltype(auto) begin()
Definition PolyLine.hpp:103
constexpr t_vertex pointAt(t_inter_type value) const
Definition PolyLine.hpp:467
decltype(auto) begin(uint04 index) const
Definition PolyLine.hpp:112
void add(const t_vertex &vertex)
Definition PolyLine.hpp:241
void clear()
Definition PolyLine.hpp:396
void addAndSimplify(const t_vertex &vertex)
Definition PolyLine.hpp:246
decltype(auto) begin() const
Definition PolyLine.hpp:107
Polyline< t_dims, t_new_type, t_new_vertex_type > as() const
Definition PolyLine.hpp:412
const t_vertex & vertex(uint04 index) const
Definition PolyLine.hpp:143
const t_vertex & lastVertex() const
Definition PolyLine.hpp:347
const Buffer< t_vertex > & vertices() const
Definition PolyLine.hpp:176
decltype(auto) end() const
Definition PolyLine.hpp:125
void add(uint04 index, const t_vertex &vertex)
Definition PolyLine.hpp:263
Polyline(const Polyline &polygon) noexcept
Definition PolyLine.hpp:65
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
constexpr t_type magnitudeSquared() const
Definition Vector.hpp:426
Definition ACIColor.h:37
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170
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:207
t_type distanceSquared(const Bounds< t_dims, t_type, t_vertex > &bounds, const Vector< t_dims, t_type > &vertex)
Definition Distance.hpp:46
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
t_type sqrt(const t_type &value)
Definition VectorFunctions.hpp:1225
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
constexpr t_type distance(const t_vertex &vertex, const LineSegment< t_dims, t_type, t_vertex > &line)
Definition Distance.hpp:171
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:757
@ B
Definition BaseValues.hpp:170
@ A
Definition BaseValues.hpp:168
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233