NDEVR
API Documentation
SnapPoint.h
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: Design
28File: SnapPoint
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Vertex.h>
34#include <NDEVR/UUID.h>
35#include <NDEVR/LineSegment.h>
36#include <NDEVR/Buffer.h>
37#include <NDEVR/Matrix.h>
38namespace NDEVR
39{
113}
114
115
116
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Class: LineSegment.
Definition Line.hpp:52
Templated logic for doing matrix multiplication.
Definition Matrix.hpp:182
fltp08 closest_snap_distance
The screen-space or world-space distance from the cursor to this snap point.
Definition SnapPoint.h:110
SnapLocationType
Defines the type of geometric feature that was snapped to.
Definition SnapPoint.h:52
@ e_x
Snapped along the X axis.
Definition SnapPoint.h:70
@ e_extension
Snapped along the extension of an edge beyond its endpoints.
Definition SnapPoint.h:63
@ e_no_snap
No snap was found.
Definition SnapPoint.h:53
@ e_midpoint
Snapped to the midpoint of an edge.
Definition SnapPoint.h:58
@ e_y
Snapped along the Y axis.
Definition SnapPoint.h:71
@ e_center
Snapped to the center of a circle, arc, or polygon.
Definition SnapPoint.h:59
@ e_point
Snapped to a generic point.
Definition SnapPoint.h:54
@ e_normal
Snapped along the surface normal direction.
Definition SnapPoint.h:66
@ e_model_node
Snapped to a model node origin.
Definition SnapPoint.h:60
@ e_z
Snapped along the Z axis.
Definition SnapPoint.h:72
@ e_tangent
Snapped to a tangent point on a curve.
Definition SnapPoint.h:64
@ e_snap_type_size
The number of snap location types (used for sizing arrays).
Definition SnapPoint.h:74
@ e_on_face
Snapped to a point on a face or surface.
Definition SnapPoint.h:68
@ e_parallel
Snapped along a direction parallel to a reference edge.
Definition SnapPoint.h:65
@ e_edge
Snapped to an edge of geometry.
Definition SnapPoint.h:56
@ e_endpoint
Snapped to an endpoint of a line segment or edge.
Definition SnapPoint.h:57
@ e_perpendicular
Snapped to a point forming a perpendicular with a reference line.
Definition SnapPoint.h:62
Vertex< 3, fltp08 > location
The 3D world-space position of the snap point.
Definition SnapPoint.h:109
LineSegment< 3, fltp08 > preferred_line
A preferred reference line associated with this snap (e.g., the edge snapped to). [Note: possible typ...
Definition SnapPoint.h:105
uint04 vertex_id
The vertex index within the geometry that was snapped to.
Definition SnapPoint.h:104
SnapLocationType location_type
The primary snap type that was matched.
Definition SnapPoint.h:107
UUID geometry_id
The UUID of the specific geometry object that was snapped to.
Definition SnapPoint.h:102
UUID layer_id
The UUID of the layer containing the snapped geometry.
Definition SnapPoint.h:101
SnapPoint()
Constructs a SnapPoint with all fields set to invalid/default values.
Definition SnapPoint.h:79
UUID model_id
The UUID of the model containing the snapped geometry.
Definition SnapPoint.h:100
Buffer< SnapLocationType > all_types
All snap types that apply to this point (e.g., a midpoint may also be on an edge).
Definition SnapPoint.h:108
bool is_smooth
Whether the snapped surface or edge is smooth (e.g., part of a curved surface).
Definition SnapPoint.h:111
Matrix< fltp08 > geometry_transform
The world transform matrix of the geometry at the time of snapping.
Definition SnapPoint.h:106
uint04 index_id
The index within the geometry (e.g., face or primitive index).
Definition SnapPoint.h:103
bool operator==(const SnapPoint &point) const
Compares two SnapPoints for equality based on location, model ID, and snap type.
Definition SnapPoint.h:96
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
A point in N-dimensional space, used primarily for spatial location information.
Definition Vertex.hpp:44
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...