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>
50 template<u
int01 t_dims,
class t_type>
79 default:
lib_assert(
false,
"unknown selection copy");
140 default:
lib_assert(
false,
"unknown selection copy");
260 for (
uint01 dim = 0; dim < t_dims; dim++)
264 else if (
m_plane.normal[dim] == -1)
269 default:
lib_assert(
false,
"Unknown selection area mode in as()");
break;
274 template<u
int01 t_new_dims,
class t_new_type>
285 default:
lib_assert(
false,
"Unknown selection area mode in as()");
break;
291 return new_selection;
297 template<u
int01 t_new_dims,
class t_new_type>
301 if (
sizeof(t_new_type) >
sizeof(t_type))
311 default:
lib_assert(
false,
"Unknown object to pre-transform");
323 default:
lib_assert(
false,
"Unknown object to pre-transform");
340 default:
lib_assert(
false,
"Unknown object to pre-transform");
464 template<
class t_other_type, u
int01 t_dims,
class t_type>
531 template<
class t_other_type, u
int01 t_dims,
class t_type>
553 intersection =
classify(area.
polygon(), other.template as<2, t_type>());
584 switch (intersection)
594 template<
class t_other_type, u
int01 t_dims,
class t_type>
599 template<
class t_other_type, u
int01 t_dims,
class t_type>
#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
A line segment represented by two vertices, a start and end.
Definition Line.hpp:55
Definition Matrix.hpp:173
Matrix< t_type, t_cols, t_rows > invert() const
Definition Matrix.hpp:649
An N-sided polygon.
Definition Polygon.hpp:58
Definition SelectionArea.hpp:52
void setProjectionMatrix(const Matrix< t_type > &matrix)
Definition SelectionArea.hpp:224
void setSelection(const Plane< t_dims, t_type > &plane)
Definition SelectionArea.hpp:192
Bounds< t_dims, t_type > & bounds()
Definition SelectionArea.hpp:207
void preTransform(const Matrix< t_type > &mat)
Definition SelectionArea.hpp:332
void setSelection(const Polygon< t_type > &poly)
Definition SelectionArea.hpp:170
const Vertex< t_dims, t_type > & point() const
Definition SelectionArea.hpp:200
SelectionMode mode() const
Definition SelectionArea.hpp:198
Polygon< t_type > & polygon()
Definition SelectionArea.hpp:210
Vertex< t_dims, t_type > m_point
Definition SelectionArea.hpp:437
const Bounds< t_dims, t_type > & bounds() const
Definition SelectionArea.hpp:206
const Matrix< t_type > & inversePerspectiveTransform() const
Definition SelectionArea.hpp:245
Plane< t_dims, t_type > m_plane
Definition SelectionArea.hpp:441
const Matrix< t_type > & inverseTransform() const
Definition SelectionArea.hpp:241
Polygon< t_type > m_polygon
Definition SelectionArea.hpp:440
bool m_is_inverse
Definition SelectionArea.hpp:445
Bounds< t_dims, t_type > m_bounds
Definition SelectionArea.hpp:439
void cleanup()
Definition SelectionArea.hpp:422
void setTransform(const Matrix< t_type > &matrix)
Definition SelectionArea.hpp:217
bool isPreTransformed() const
Definition SelectionArea.hpp:293
void setSelection(Polygon< t_type > &&poly)
Definition SelectionArea.hpp:177
~SelectionArea()
Definition SelectionArea.hpp:151
void setSelection(const LineSegment< t_dims, t_type > &segment)
Definition SelectionArea.hpp:163
Vertex< t_dims, t_type > & point()
Definition SelectionArea.hpp:201
SelectionArea(const Plane< t_dims, t_type > &plane)
Definition SelectionArea.hpp:121
SelectionArea(const Bounds< t_dims, t_type > &bounds)
Definition SelectionArea.hpp:113
const Polygon< t_type > & polygon() const
Definition SelectionArea.hpp:209
void setIsInverse(bool is_inverse)
Definition SelectionArea.hpp:347
Bounds< t_dims, t_type > selectionBounds() const
Definition SelectionArea.hpp:249
LineSegment< t_dims, t_type > & line()
Definition SelectionArea.hpp:204
Matrix< t_type > m_projection_matrix
Definition SelectionArea.hpp:433
SelectionMode m_mode
Definition SelectionArea.hpp:443
bool operator==(const SelectionArea &area) const
Definition SelectionArea.hpp:359
Matrix< t_type > m_inverse_matrix
Definition SelectionArea.hpp:432
const LineSegment< t_dims, t_type > & line() const
Definition SelectionArea.hpp:203
SelectionArea(const Vertex< t_dims, t_type > &point)
Definition SelectionArea.hpp:82
void setSelection(const Bounds< t_dims, t_type > &bounds)
Definition SelectionArea.hpp:185
bool isEnabled() const
Definition SelectionArea.hpp:351
bool m_is_enabled
Definition SelectionArea.hpp:446
const Matrix< t_type > & transform() const
Definition SelectionArea.hpp:232
SelectionArea & operator=(const SelectionArea &area)
Definition SelectionArea.hpp:129
const Matrix< t_type > & projectionTransform() const
Definition SelectionArea.hpp:237
const Plane< t_dims, t_type > & plane() const
Definition SelectionArea.hpp:212
SelectionArea(const LineSegment< t_dims, t_type > &segment)
Definition SelectionArea.hpp:89
bool isInverse() const
Definition SelectionArea.hpp:343
Plane< t_dims, t_type > & plane()
Definition SelectionArea.hpp:213
SelectionArea< t_new_dims, t_new_type > as() const
Definition SelectionArea.hpp:275
SelectionArea(Polygon< t_type > &&poly)
Definition SelectionArea.hpp:105
SelectionArea(const Polygon< t_type > &poly)
Definition SelectionArea.hpp:97
void setIsEnabled(bool is_enabled)
Definition SelectionArea.hpp:355
void setSelection(const Vertex< t_dims, t_type > &point)
Definition SelectionArea.hpp:156
SelectionArea()
Definition SelectionArea.hpp:54
bool m_is_pre_transformed
Definition SelectionArea.hpp:444
LineSegment< t_dims, t_type > m_line
Definition SelectionArea.hpp:438
Matrix< t_type > m_projection_inverse_matrix
Definition SelectionArea.hpp:434
SelectionArea< t_new_dims, t_new_type > preTransformed() const
Definition SelectionArea.hpp:298
SelectionArea(const SelectionArea &area)
Definition SelectionArea.hpp:62
bool operator!=(const SelectionArea &area) const
Definition SelectionArea.hpp:390
Matrix< t_type > m_matrix
Definition SelectionArea.hpp:431
A vertex.
Definition Vertex.hpp:54
@ MIN
Definition BaseValues.hpp:226
@ MAX
Definition BaseValues.hpp:227
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
SelectionMode
Definition SelectionArea.hpp:43
@ e_selection_line
Definition SelectionArea.hpp:45
@ e_selection_plane
Definition SelectionArea.hpp:48
@ e_selection_bounds
Definition SelectionArea.hpp:47
@ e_selection_polygon
Definition SelectionArea.hpp:46
@ e_selection_point
Definition SelectionArea.hpp:44
t_type distanceSquared(const Bounds< t_dims, t_type, t_vertex > &bounds, const Vector< t_dims, t_type > &vertex)
Definition Distance.hpp:42
IntersectionTypes
Used for classifying shape intersections.
Definition BaseValues.hpp:241
@ inside
Definition BaseValues.hpp:243
@ outside
Definition BaseValues.hpp:242
IntersectionTypes classify(const Vector< t_dims, t_type > &v1, const Vector< t_dims, t_type > &v2)
Definition Intersection.hpp:338
constexpr bool isNaN(const t_type &value)
Query if 'value' is valid or invalid.
Definition BaseFunctions.hpp:200
Definition BaseValues.hpp:272