![]() |
NDEVR
API Documentation
|
Forward declaration for the NDEVR string type. More...
Public Member Functions | |
| SnapsManager () | |
| Constructs a SnapsManager with default snap settings. | |
| bool | checkLine (const SelectionInfo &info, const LineSegment< 3, fltp08 > &seg, bool infinite_length, SnapPoint &closest_snap, SnapPoint::SnapLocationType line_snap, SnapPoint::SnapLocationType edge_snap, UUID id, uint04 index, bool is_smooth) const |
| Checks whether a line segment qualifies as a snap candidate and updates the closest snap if so. | |
| bool | checkTriangle (const SelectionInfo &info, const Triangle< 3, fltp08 > &tri, SnapPoint &closest_snap, UUID id, uint04 index, bool is_smooth) const |
| Checks whether a triangle qualifies as a snap candidate and updates the closest snap if so. | |
| bool | checkVertex (SnapPoint::SnapLocationType snap, const SelectionInfo &info, const Vertex< 3, fltp08 > &point, SnapPoint &closest_snap, UUID id, uint04 index) const |
| Checks whether a vertex qualifies as a snap candidate and updates the closest snap if so. | |
| SnapPoint | getSnapLinePoint (const DesignObjectLookup *manager, const SelectionInfo &info, const SnapPoint &last, const Buffer< std::pair< UUID, uint04 > > &locations_of_interest, bool use_worldspace) const |
| Finds the best snap point constrained to a line from a previous snap point. | |
| void | getSnapLinePoint (SnapPoint ¤t, const DesignObjectLookup *manager, const SelectionInfo &info, const SnapPoint &last, const Buffer< std::pair< UUID, uint04 > > &locations_of_interest, bool use_worldspace) const |
| Finds the best snap point constrained to a line, updating an existing SnapPoint in place. | |
| SnapPoint | getSnapPoint (const DesignObjectLookup *manager, const SelectionInfo &info, bool use_worldspace) const |
| Finds the best snap point for the given selection info. | |
| void | getSnapPoint (SnapPoint ¤t, const DesignObjectLookup *manager, const SelectionInfo &info, bool use_worldspace) const |
| Finds the best snap point, updating an existing SnapPoint in place. | |
| bool | isSnapEnabled (SnapPoint::SnapLocationType snap) const |
| Checks whether a specific snap location type is currently enabled. | |
| void | setAllEnabled (bool use_snap) |
| Enables or disables all snap location types at once. | |
| void | setPriority (SnapPoint::SnapLocationType type, uint04 priority) |
| Sets the priority for a specific snap location type. | |
| void | setSensitivity (SnapPoint::SnapLocationType type, fltp08 sensitivity) |
| Sets the sensitivity radius for a specific snap location type. | |
| void | setSnapEnabled (SnapPoint::SnapLocationType snap, bool use_snap) |
| Enables or disables a specific snap location type. | |
Static Public Member Functions | |
| static StringView | SnapIcon (SnapPoint::SnapLocationType snap_type) |
| Returns the icon name associated with a snap location type. | |
Protected Attributes | |
| Dictionary< SnapPoint::SnapLocationType, bool > | m_enabled_snaps |
| Maps each snap type to its enabled/disabled state. | |
| Dictionary< SnapPoint::SnapLocationType, uint04 > | m_priority |
| Maps each snap type to its priority for conflict resolution. | |
| Dictionary< SnapPoint::SnapLocationType, fltp08 > | m_sensitivity |
| Maps each snap type to its sensitivity distance threshold. | |
Forward declaration for the NDEVR string type.
Manages which points are considered interesting based on defined criteria.
Provides snap-to-point functionality for design objects, allowing the user to snap to vertices, edges, midpoints, intersections, and other geometric features. Each snap type can be individually enabled/disabled and configured with its own sensitivity and priority.
Definition at line 55 of file SnapsManager.h.
| bool SnapsManager::checkLine | ( | const SelectionInfo & | info, |
| const LineSegment< 3, fltp08 > & | seg, | ||
| bool | infinite_length, | ||
| SnapPoint & | closest_snap, | ||
| SnapPoint::SnapLocationType | line_snap, | ||
| SnapPoint::SnapLocationType | edge_snap, | ||
| UUID | id, | ||
| uint04 | index, | ||
| bool | is_smooth ) const |
Checks whether a line segment qualifies as a snap candidate and updates the closest snap if so.
| [in] | info | The current selection info describing the cursor or pick location. |
| [in] | seg | The 3D line segment to evaluate. |
| [in] | infinite_length | Whether to treat the segment as an infinite line. |
| [in,out] | closest_snap | The current closest snap point, updated if a point on the line is closer. |
| [in] | line_snap | The snap type to use for the line body (e.g., nearest point on line). |
| [in] | edge_snap | The snap type to use for edge endpoints or midpoints. |
| [in] | id | The UUID of the design object owning this line. |
| [in] | index | The index of the line within its parent object. |
| [in] | is_smooth | Whether the line belongs to a smooth curve, affecting snap behavior. |
| bool SnapsManager::checkTriangle | ( | const SelectionInfo & | info, |
| const Triangle< 3, fltp08 > & | tri, | ||
| SnapPoint & | closest_snap, | ||
| UUID | id, | ||
| uint04 | index, | ||
| bool | is_smooth ) const |
Checks whether a triangle qualifies as a snap candidate and updates the closest snap if so.
| [in] | info | The current selection info describing the cursor or pick location. |
| [in] | tri | The 3D triangle to evaluate. |
| [in,out] | closest_snap | The current closest snap point, updated if a point on the triangle is closer. |
| [in] | id | The UUID of the design object owning this triangle. |
| [in] | index | The index of the triangle within its parent object. |
| [in] | is_smooth | Whether the triangle belongs to a smooth surface, affecting snap behavior. |
| bool SnapsManager::checkVertex | ( | SnapPoint::SnapLocationType | snap, |
| const SelectionInfo & | info, | ||
| const Vertex< 3, fltp08 > & | point, | ||
| SnapPoint & | closest_snap, | ||
| UUID | id, | ||
| uint04 | index ) const |
Checks whether a vertex qualifies as a snap candidate and updates the closest snap if so.
| [in] | snap | The snap location type to check against. |
| [in] | info | The current selection info describing the cursor or pick location. |
| [in] | point | The 3D vertex position to evaluate. |
| [in,out] | closest_snap | The current closest snap point, updated if this vertex is closer. |
| [in] | id | The UUID of the design object owning this vertex. |
| [in] | index | The index of the vertex within its parent object. |
| SnapPoint SnapsManager::getSnapLinePoint | ( | const DesignObjectLookup * | manager, |
| const SelectionInfo & | info, | ||
| const SnapPoint & | last, | ||
| const Buffer< std::pair< UUID, uint04 > > & | locations_of_interest, | ||
| bool | use_worldspace ) const |
Finds the best snap point constrained to a line from a previous snap point.
| [in] | manager | The design object lookup used to query scene objects. |
| [in] | info | The current selection info describing the cursor or pick location. |
| [in] | last | The previous snap point used to define the constraint line. |
| [in] | locations_of_interest | Buffer of UUID and index pairs identifying objects of interest. |
| [in] | use_worldspace | Whether to perform snapping in world space coordinates. |
| void SnapsManager::getSnapLinePoint | ( | SnapPoint & | current, |
| const DesignObjectLookup * | manager, | ||
| const SelectionInfo & | info, | ||
| const SnapPoint & | last, | ||
| const Buffer< std::pair< UUID, uint04 > > & | locations_of_interest, | ||
| bool | use_worldspace ) const |
Finds the best snap point constrained to a line, updating an existing SnapPoint in place.
| [in,out] | current | The current snap point to compare against and potentially update. |
| [in] | manager | The design object lookup used to query scene objects. |
| [in] | info | The current selection info describing the cursor or pick location. |
| [in] | last | The previous snap point used to define the constraint line. |
| [in] | locations_of_interest | Buffer of UUID and index pairs identifying objects of interest. |
| [in] | use_worldspace | Whether to perform snapping in world space coordinates. |
| SnapPoint SnapsManager::getSnapPoint | ( | const DesignObjectLookup * | manager, |
| const SelectionInfo & | info, | ||
| bool | use_worldspace ) const |
Finds the best snap point for the given selection info.
| [in] | manager | The design object lookup used to query scene objects. |
| [in] | info | The current selection info describing the cursor or pick location. |
| [in] | use_worldspace | Whether to perform snapping in world space coordinates. |
| void SnapsManager::getSnapPoint | ( | SnapPoint & | current, |
| const DesignObjectLookup * | manager, | ||
| const SelectionInfo & | info, | ||
| bool | use_worldspace ) const |
Finds the best snap point, updating an existing SnapPoint in place.
| [in,out] | current | The current snap point to compare against and potentially update. |
| [in] | manager | The design object lookup used to query scene objects. |
| [in] | info | The current selection info describing the cursor or pick location. |
| [in] | use_worldspace | Whether to perform snapping in world space coordinates. |
|
inline |
Checks whether a specific snap location type is currently enabled.
| [in] | snap | The snap location type to query. |
Definition at line 141 of file SnapsManager.h.
References m_enabled_snaps.
| void SnapsManager::setAllEnabled | ( | bool | use_snap | ) |
Enables or disables all snap location types at once.
| [in] | use_snap | Whether to enable or disable all snap types. |
| void SnapsManager::setPriority | ( | SnapPoint::SnapLocationType | type, |
| uint04 | priority ) |
Sets the priority for a specific snap location type.
Higher priority snaps are preferred when multiple snap candidates are within range.
| [in] | type | The snap location type to configure. |
| [in] | priority | The priority value to assign. |
| void SnapsManager::setSensitivity | ( | SnapPoint::SnapLocationType | type, |
| fltp08 | sensitivity ) |
Sets the sensitivity radius for a specific snap location type.
| [in] | type | The snap location type to configure. |
| [in] | sensitivity | The sensitivity distance threshold for snapping. |
|
inline |
Enables or disables a specific snap location type.
| [in] | snap | The snap location type to configure. |
| [in] | use_snap | Whether to enable or disable the snap type. |
Definition at line 146 of file SnapsManager.h.
References m_enabled_snaps.
|
static |
Returns the icon name associated with a snap location type.
| [in] | snap_type | The snap location type to get the icon for. |