33#include <NDEVR/LineSegment.h>
34#include <NDEVR/Polygon.h>
35#include <NDEVR/RadialObject.h>
36#include <NDEVR/Bounds.h>
37#include <NDEVR/Matrix.h>
38#include <NDEVR/Intersection.h>
39#include <NDEVR/Plane.h>
57 template<u
int01 t_dims,
class t_type>
86 default:
lib_assert(
false,
"unknown selection copy");
147 default:
lib_assert(
false,
"unknown selection copy");
267 for (
uint01 dim = 0; dim < t_dims; dim++)
271 else if (
m_plane.normal[dim] == -1)
276 default:
lib_assert(
false,
"Unknown selection area mode in as()");
break;
281 template<u
int01 t_new_dims,
class t_new_type>
292 default:
lib_assert(
false,
"Unknown selection area mode in as()");
break;
298 return new_selection;
304 template<u
int01 t_new_dims,
class t_new_type>
308 if (
sizeof(t_new_type) >
sizeof(t_type))
318 default:
lib_assert(
false,
"Unknown object to pre-transform");
330 default:
lib_assert(
false,
"Unknown object to pre-transform");
347 default:
lib_assert(
false,
"Unknown object to pre-transform");
469 template<
class t_other_type, u
int01 t_dims,
class t_type>
536 template<
class t_other_type, u
int01 t_dims,
class t_type>
558 intersection =
classify(area.
polygon(), other.template as<2, t_type>());
589 switch (intersection)
599 template<
class t_other_type, u
int01 t_dims,
class t_type>
604 template<
class t_other_type, u
int01 t_dims,
class t_type>
#define lib_assert(expression, message)
Definition LibAssert.h:61
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
A line segment represented by two vertices, a start and end.
Definition Line.hpp:49
Definition Matrix.hpp:176
Matrix< t_type, t_cols, t_rows > invert() const
Definition Matrix.hpp:652
Logic for a given plane or N-dimensions. Planes are coordinate systems of one less dimension than the...
Definition Geometry.h:41
An N-sided polygon.
Definition Polygon.hpp:53
An area of N-dimensional space that is considered selected.
Definition SelectionArea.hpp:59
void setProjectionMatrix(const Matrix< t_type > &matrix)
Definition SelectionArea.hpp:231
void setSelection(const Plane< t_dims, t_type > &plane)
Definition SelectionArea.hpp:199
Bounds< t_dims, t_type > & bounds()
Definition SelectionArea.hpp:214
void preTransform(const Matrix< t_type > &mat)
Definition SelectionArea.hpp:339
void setSelection(const Polygon< t_type > &poly)
Definition SelectionArea.hpp:177
const Vertex< t_dims, t_type > & point() const
Definition SelectionArea.hpp:207
SelectionMode mode() const
Definition SelectionArea.hpp:205
Polygon< t_type > & polygon()
Definition SelectionArea.hpp:217
Vertex< t_dims, t_type > m_point
Definition SelectionArea.hpp:444
const Bounds< t_dims, t_type > & bounds() const
Definition SelectionArea.hpp:213
const Matrix< t_type > & inversePerspectiveTransform() const
Definition SelectionArea.hpp:252
Plane< t_dims, t_type > m_plane
Definition SelectionArea.hpp:448
const Matrix< t_type > & inverseTransform() const
Definition SelectionArea.hpp:248
Polygon< t_type > m_polygon
Definition SelectionArea.hpp:447
bool m_is_inverse
Definition SelectionArea.hpp:452
Bounds< t_dims, t_type > m_bounds
Definition SelectionArea.hpp:446
void cleanup()
Definition SelectionArea.hpp:429
void setTransform(const Matrix< t_type > &matrix)
Definition SelectionArea.hpp:224
bool isPreTransformed() const
Definition SelectionArea.hpp:300
void setSelection(Polygon< t_type > &&poly)
Definition SelectionArea.hpp:184
~SelectionArea()
Definition SelectionArea.hpp:158
void setSelection(const LineSegment< t_dims, t_type > &segment)
Definition SelectionArea.hpp:170
Vertex< t_dims, t_type > & point()
Definition SelectionArea.hpp:208
SelectionArea(const Plane< t_dims, t_type > &plane)
Definition SelectionArea.hpp:128
SelectionArea(const Bounds< t_dims, t_type > &bounds)
Definition SelectionArea.hpp:120
const Polygon< t_type > & polygon() const
Definition SelectionArea.hpp:216
void setIsInverse(bool is_inverse)
Definition SelectionArea.hpp:354
Bounds< t_dims, t_type > selectionBounds() const
Definition SelectionArea.hpp:256
LineSegment< t_dims, t_type > & line()
Definition SelectionArea.hpp:211
Matrix< t_type > m_projection_matrix
Definition SelectionArea.hpp:440
SelectionMode m_mode
Definition SelectionArea.hpp:450
bool operator==(const SelectionArea &area) const
Definition SelectionArea.hpp:366
Matrix< t_type > m_inverse_matrix
Definition SelectionArea.hpp:439
const LineSegment< t_dims, t_type > & line() const
Definition SelectionArea.hpp:210
SelectionArea(const Vertex< t_dims, t_type > &point)
Definition SelectionArea.hpp:89
void setSelection(const Bounds< t_dims, t_type > &bounds)
Definition SelectionArea.hpp:192
bool isEnabled() const
Definition SelectionArea.hpp:358
bool m_is_enabled
Definition SelectionArea.hpp:453
const Matrix< t_type > & transform() const
Definition SelectionArea.hpp:239
SelectionArea & operator=(const SelectionArea &area)
Definition SelectionArea.hpp:136
const Matrix< t_type > & projectionTransform() const
Definition SelectionArea.hpp:244
const Plane< t_dims, t_type > & plane() const
Definition SelectionArea.hpp:219
SelectionArea(const LineSegment< t_dims, t_type > &segment)
Definition SelectionArea.hpp:96
bool isInverse() const
Definition SelectionArea.hpp:350
Plane< t_dims, t_type > & plane()
Definition SelectionArea.hpp:220
SelectionArea< t_new_dims, t_new_type > as() const
Definition SelectionArea.hpp:282
SelectionArea(Polygon< t_type > &&poly)
Definition SelectionArea.hpp:112
SelectionArea(const Polygon< t_type > &poly)
Definition SelectionArea.hpp:104
void setIsEnabled(bool is_enabled)
Definition SelectionArea.hpp:362
void setSelection(const Vertex< t_dims, t_type > &point)
Definition SelectionArea.hpp:163
SelectionArea()
Definition SelectionArea.hpp:61
bool m_is_pre_transformed
Definition SelectionArea.hpp:451
LineSegment< t_dims, t_type > m_line
Definition SelectionArea.hpp:445
Matrix< t_type > m_projection_inverse_matrix
Definition SelectionArea.hpp:441
SelectionArea< t_new_dims, t_new_type > preTransformed() const
Definition SelectionArea.hpp:305
SelectionArea(const SelectionArea &area)
Definition SelectionArea.hpp:69
bool operator!=(const SelectionArea &area) const
Definition SelectionArea.hpp:397
Matrix< t_type > m_matrix
Definition SelectionArea.hpp:438
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
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
@ MIN
Definition BaseValues.hpp:196
@ MAX
Definition BaseValues.hpp:197
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
SelectionMode
Definition SelectionArea.hpp:46
@ e_selection_line
Definition SelectionArea.hpp:48
@ e_selection_plane
Definition SelectionArea.hpp:51
@ e_selection_bounds
Definition SelectionArea.hpp:50
@ e_selection_polygon
Definition SelectionArea.hpp:49
@ e_selection_point
Definition SelectionArea.hpp:47
t_type distanceSquared(const Bounds< t_dims, t_type, t_vertex > &bounds, const Vector< t_dims, t_type > &vertex)
Definition Distance.hpp:46
IntersectionTypes
Used for classifying shape intersections.
Definition BaseValues.hpp:210
@ inside
Definition BaseValues.hpp:212
@ outside
Definition BaseValues.hpp:211
IntersectionTypes classify(const Vector< t_dims, t_type > &v1, const Vector< t_dims, t_type > &v2)
Definition Intersection.hpp:329
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233