NDEVR
API Documentation
SnapController

Allows for mouse snaps to certain key points of interest in the software. More...

Inheritance diagram for SnapController:
[legend]
Collaboration diagram for SnapController:
[legend]

Classes

struct  EditDimensionLockInformation
 Holds information about a user-initiated dimension lock edit, including per-axis text and the currently active dimension and cursor position. More...

Public Types

enum  LockMode {
  e_lock_ignore_snap , e_lock_to_nearest_snap , e_lock_if_no_snap , e_only_allow_snap ,
  e_ignore
}
 Controls how axis/plane locking interacts with snapping behavior. More...
enum  PointsDrawMode {
  e_points , e_triangle , e_lines , e_line_fan ,
  e_polyline
}
 Determines how snapped points are drawn or connected visually in the viewport. More...

Public Member Functions

 SnapController (DesignObjectLookup *manager)
 Constructs a SnapController associated with the given DesignObjectLookup.
virtual void cancel ()
 Cancels the current snap operation and cleans up any active state or visuals.
void clearSnapSelection ()
 Clears all currently accumulated snap selection points and resets the visual state.
Vertex< 3, fltp08currentLocation () const
 Returns the current snap location in 3D space.
Vertex< 3, fltp08lastPoint () const
 Returns the most recent snap location.
const Buffer< SnapPoint > & lastSnapPoints () const
 Returns the buffer of snap points from the most recent snap calculation.
void lockAxis (uint01 axis, fltp08 lock)
 Locks a specific axis to a fixed coordinate value.
uint04 pointCount () const
 Returns the number of points currently recorded by the snap controller.
const Buffer< Vertex< 3, fltp08 > > & points () const
 Returns the buffer of all accumulated snap points.
virtual bool processKeyEvent (const KeyEvent &event, DesignObjectLookup *lookup, Camera *camera) override
 Processes an incoming keyboard event for snap-related shortcuts and dimension locking.
virtual bool processMouseEvent (MouseControllerEvent &event, SelectionInfo &info) override
 Processes an incoming mouse event for snapping and selection.
SelectionMode selectionMode () const
 Returns the current selection mode.
void setCustomSnapManager (const ConstPointer< SnapsManager > &snap_manager)
 Sets a custom snap manager to override the default snapping behavior.
virtual void setFinishedCallback (const std::function< void(bool is_accepted)> &callback)
 Sets a callback invoked when the snap operation finishes.
void setLocation (const Vertex< 3, fltp08 > &location, bool is_click=false, Camera *camera=nullptr)
 Sets the current snap location, optionally registering it as a click.
void setLockLine (const LineSegment< 3, fltp08 > &line)
 Sets a line segment to constrain snap positions along.
void setLockMode (LockMode mode)
 Sets the lock mode that controls how axis/plane locking interacts with snapping.
void setLockPlane (const Plane< 3, fltp08 > &plane)
 Sets a plane to constrain snap positions onto.
void setPointsDrawMode (PointsDrawMode mode)
 Sets the visual draw mode for how accumulated points are rendered.
void setSelectionMode (SelectionMode mode)
 Sets the selection mode used during snap interaction.
void setShowLengthLabels (bool show)
 Sets whether length labels are displayed along guide lines.
void setShowPointLabels (bool show)
 Sets whether coordinate labels are displayed at snap points.
virtual void setUpdateCallback (const std::function< void()> &callback)
 Sets a callback invoked whenever the snap location or state is updated.

Public Attributes

Resource< SnapPointcurrent_snap_point
 The currently active snap point resource, updated as the mouse moves.

Protected Member Functions

void addGuideLineModel ()
 Adds a guide line model to the scene for visual feedback.
void addGuidePlaneModel ()
 Adds a guide plane model to the scene for visual feedback.
void addGuidePointModel ()
 Adds a guide point model to the scene for visual feedback.
virtual void addPoint (const SnapPoint &point)
 Adds a snap point (with snap metadata) to the accumulated points buffer.
virtual void addPoint (const Vertex< 3, fltp08 > &point)
 Adds a 3D point to the accumulated points buffer.
virtual void begin ()
 Called when a snap operation begins.
void calcLockLineLocation (SnapPoint &point, const SelectionInfo &info)
 Calculates the constrained snap point position along a lock line.
void calcLockPlaneLocation (SnapPoint &point, const SelectionInfo &info)
 Calculates the constrained snap point position on a lock plane.
SnapPoint calcSnapPoint (const SelectionInfo &info, DesignObjectLookup *lookup)
 Calculates the best snap point for the current selection context.
void drawDefaultGuideLines (const SnapPoint &point)
 Draws the default set of guide lines based on the current snap point context.
void drawDefaultGuidePlane (const SnapPoint &point)
 Draws the default guide plane based on the current snap point context.
virtual void finish ()
 Called when the snap operation is finished.
UUID lineMaterial (const SnapPoint &point)
 Returns the material UUID appropriate for the given snap point's guide line type.
UUID pointMaterial (const SnapPoint &point)
 Returns the material UUID appropriate for the given snap point type.
bool processMouseSelection (MouseControllerEvent &event)
 Processes a mouse event for object selection (non-snap interaction).
bool processMouseSnap (MouseControllerEvent &event, SelectionInfo &info)
 Processes a mouse event specifically for snapping logic.
void processUserInput ()
 Processes any pending user text input for dimension locking.
void setGuideLine (uint04 index, const Vertex< 3, fltp08 > &p1, const Vector< 3, fltp08 > &p2, const UUID &material)
 Sets the start position, direction, and material of a guide line at the given index.
void setGuideLineVisible (bool visible)
 Sets the visibility of all guide lines.
void setGuideLineVisible (uint04 index, bool visible)
 Sets the visibility of a specific guide line by index.
void setGuidePlane (uint04 index, const Vector< 3, fltp08 > &normal, const Vertex< 3, fltp08 > &location, fltp08 radius)
 Sets the orientation, position, and size of a guide plane at the given index.
void setGuidePlaneVisible (bool visible)
 Sets the visibility of all guide planes.
void setGuidePlaneVisible (uint04 index, bool visible)
 Sets the visibility of a specific guide plane by index.
void setGuidePoint (uint04 index, const Vertex< 3, fltp08 > &p1, const UUID &material)
 Sets the position and material of a guide point at the given index.
void setGuidePointVisible (bool visible)
 Sets the visibility of all guide points.
void setGuidePointVisible (uint04 index, bool visible)
 Sets the visibility of a specific guide point by index.
Model setupGuideModel ()
 Creates and returns a Model configured as a guide visual element.
virtual void setupSelectionInfo (const MouseEvent &event, Camera *camera, SelectionInfo &info)
 Populates a SelectionInfo from the given mouse event and camera.
virtual void updateLocation (const Vertex< 3, fltp08 > &location, bool is_click, Camera *camera)
 Called when the snap location is updated.
void updateRecentGeometry (const SnapPoint &point)
 Updates the recent geometry cache with the latest snap point for extending/snapping to nearby geometry in future operations.

Protected Attributes

UUID m_blue_line_material = Constant<UUID>::Invalid
 Material for Z-axis (blue) guide lines.
UUID m_center_point_material = Constant<UUID>::Invalid
 Material for snap points at center points.
UUID m_current_line_material = Constant<UUID>::Invalid
 Material UUID for the current guide line being drawn.
ConstPointer< SnapsManagerm_custom_snap_manager
 Optional custom snap manager overriding default snap behavior.
UUID m_edge_point_material = Constant<UUID>::Invalid
 Material for snap points on edges.
UUID m_end_point_material = Constant<UUID>::Invalid
 Material for snap points at endpoints.
UUID m_extend_line_material = Constant<UUID>::Invalid
 Material for extension guide lines.
std::function< void(bool is_accepted)> m_finished_callback
 Callback invoked when the snap operation finishes.
UUID m_free_line_material = Constant<UUID>::Invalid
 Material for free (unconstrained) guide lines.
UUID m_free_point_material = Constant<UUID>::Invalid
 Material for free (unconstrained) snap points.
UUID m_green_line_material = Constant<UUID>::Invalid
 Material for Y-axis (green) guide lines.
Buffer< UUIDm_guide_line_material
 Materials assigned to each guide line.
Buffer< UUIDm_guide_line_model
 UUIDs of individual guide line models.
UUID m_guide_model = Constant<UUID>::Invalid
 UUID of the root guide model in the scene.
Buffer< UUIDm_guide_plane_material
 Materials assigned to each guide plane.
Buffer< UUIDm_guide_plane_model
 UUIDs of individual guide plane models.
Buffer< UUIDm_guide_point_material
 Materials assigned to each guide point.
Buffer< UUIDm_guide_point_model
 UUIDs of individual guide point models.
bool m_is_active
 Whether the snap controller is currently active.
bool m_is_horizontal_locked = false
 Whether horizontal axis locking is currently active.
bool m_is_using_lock_plane = false
 Whether a lock plane is currently in use for constraining.
bool m_is_vertical_locked = false
 Whether vertical axis locking is currently active.
Cameram_last_camera = nullptr
 The camera used in the last event processing.
Buffer< std::pair< UUID, uint04 > > m_last_lines
 Recently snapped line geometry (UUID and vertex index pairs).
DesignObjectLookupm_last_lookup = nullptr
 The DesignObjectLookup used in the last event processing.
Buffer< std::pair< UUID, uint04 > > m_last_meshes
 Recently snapped mesh geometry (UUID and face index pairs).
MouseEvent m_last_mouse_event
 The most recently processed mouse event.
Buffer< std::pair< UUID, uint04 > > m_last_points
 Recently snapped point geometry (UUID and vertex index pairs).
UUID m_last_selection_camera = Constant<UUID>::Invalid
 UUID of the camera used in the last selection operation.
Buffer< SnapPointm_last_snap_points
 The most recently computed set of candidate snap points.
Buffer< UUIDm_line_guide_text
 UUIDs of text labels attached to guide lines.
UUID m_line_mesh = Constant<UUID>::Invalid
 UUID of the mesh used for guide lines.
Vertex< 3, fltp08m_location
 The current snap location in 3D space.
Vertex< 3, fltp08m_lock_axis
 Per-axis lock values (NaN or invalid means unlocked).
LineSegment< 3, fltp08m_lock_line
 The line segment used for line-lock constraining.
Vertex< 3, fltp08m_lock_location
 The reference location used for lock calculations.
LockMode m_lock_mode
 The active lock mode controlling snap-lock interaction.
Plane< 3, fltp08m_lock_plane
 The plane used for plane-lock constraining.
UUID m_locked_line_material = Constant<UUID>::Invalid
 Material for locked/constrained guide lines.
DesignObjectLookupm_manager
 The DesignObjectLookup this controller operates on.
UUID m_mid_point_material = Constant<UUID>::Invalid
 Material for snap points at midpoints.
UUID m_on_face_point_material = Constant<UUID>::Invalid
 Material for snap points on faces.
SnapPoint m_original_snap
 The original snap point before lock adjustments.
UUID m_perpendicular_line_material = Constant<UUID>::Invalid
 Material for perpendicular guide lines.
UUID m_plane_mesh = Constant<UUID>::Invalid
 UUID of the mesh used for guide planes.
PointsDrawMode m_point_draw_mode
 The current draw mode for accumulated points.
Buffer< UUIDm_point_guide_text
 UUIDs of text labels attached to guide points.
UUID m_point_material = Constant<UUID>::Invalid
 Material for generic snap points.
UUID m_point_mesh = Constant<UUID>::Invalid
 UUID of the mesh used for guide points.
Buffer< Vertex< 3, fltp08 > > m_points
 Accumulated 3D snap points from user clicks.
UUID m_red_line_material = Constant<UUID>::Invalid
 Material for X-axis (red) guide lines.
SelectionMode m_selection_mode
 The current selection mode used during interaction.
bool m_show_length_label
 Whether length labels are displayed on guide lines.
bool m_show_location_label
 Whether coordinate labels are displayed at snap points.
UUID m_tangent_line_material = Constant<UUID>::Invalid
 Material for tangent guide lines.
std::function< void()> m_update_callback
 Callback invoked when the snap state is updated.
EditDimensionLockInformation m_user_edit
 Current user dimension lock edit state.

Detailed Description

Allows for mouse snaps to certain key points of interest in the software.


Can also create visuals to help with user mouse interaction with DesignObjectLookup.

Definition at line 51 of file SnapController.h.

Member Enumeration Documentation

◆ LockMode

Controls how axis/plane locking interacts with snapping behavior.


Enumerator
e_lock_ignore_snap 

Ignores all snapping; lock takes full precedence.

e_lock_to_nearest_snap 

First snaps, then constrains the result to the closest position along the lock.

e_lock_if_no_snap 

Only applies the lock constraint if no snap point is found.

e_only_allow_snap 

Only allows snapped positions; ignores lock guides.

e_ignore 

Ignores lock guides entirely; snapping operates freely.

Definition at line 86 of file SnapController.h.

◆ PointsDrawMode

Determines how snapped points are drawn or connected visually in the viewport.


Enumerator
e_points 

Draw individual unconnected points.

e_triangle 

Draw points as filled triangles.

e_lines 

Draw points connected as discrete line segments (pairs of vertices).

e_line_fan 

Draw lines radiating from the first point to each subsequent point.

e_polyline 

Draw points connected as a continuous polyline.

Definition at line 75 of file SnapController.h.

Constructor & Destructor Documentation

◆ SnapController()

SnapController::SnapController ( DesignObjectLookup * manager)
explicit

Constructs a SnapController associated with the given DesignObjectLookup.


Parameters
[in]managerThe DesignObjectLookup that this controller uses for snap calculations and scene access.

References SnapController().

Referenced by SnapController().

Member Function Documentation

◆ addGuideLineModel()

void SnapController::addGuideLineModel ( )
protected

Adds a guide line model to the scene for visual feedback.


◆ addGuidePlaneModel()

void SnapController::addGuidePlaneModel ( )
protected

Adds a guide plane model to the scene for visual feedback.


◆ addGuidePointModel()

void SnapController::addGuidePointModel ( )
protected

Adds a guide point model to the scene for visual feedback.


◆ addPoint() [1/2]

virtual void SnapController::addPoint ( const SnapPoint & point)
protectedvirtual

Adds a snap point (with snap metadata) to the accumulated points buffer.


Parameters
[in]pointThe SnapPoint to add.

Reimplemented in GeometryMaker, and ModelEditController.

◆ addPoint() [2/2]

virtual void SnapController::addPoint ( const Vertex< 3, fltp08 > & point)
protectedvirtual

Adds a 3D point to the accumulated points buffer.


Parameters
[in]pointThe 3D vertex to add.

Reimplemented in ModelEditController.

◆ begin()

virtual void SnapController::begin ( )
protectedvirtual

Called when a snap operation begins.


Sets up initial state and visuals.

Reimplemented in GeometryMaker, ModelEditController, and SelectionController.

◆ calcLockLineLocation()

void SnapController::calcLockLineLocation ( SnapPoint & point,
const SelectionInfo & info )
protected

Calculates the constrained snap point position along a lock line.


Parameters
[in]pointThe snap point to constrain (modified in place).
[in]infoThe selection info providing ray/context data.

◆ calcLockPlaneLocation()

void SnapController::calcLockPlaneLocation ( SnapPoint & point,
const SelectionInfo & info )
protected

Calculates the constrained snap point position on a lock plane.


Parameters
[in]pointThe snap point to constrain (modified in place).
[in]infoThe selection info providing ray/context data.

◆ calcSnapPoint()

SnapPoint SnapController::calcSnapPoint ( const SelectionInfo & info,
DesignObjectLookup * lookup )
protected

Calculates the best snap point for the current selection context.


Parameters
[in]infoThe selection info providing ray and context.
[in]lookupThe DesignObjectLookup to query for snap candidates.
Returns
The computed SnapPoint representing the best match.

◆ cancel()

virtual void SnapController::cancel ( )
virtual

Cancels the current snap operation and cleans up any active state or visuals.


Reimplemented in GeometryMaker, ModelEditController, and SelectionController.

◆ clearSnapSelection()

void SnapController::clearSnapSelection ( )

Clears all currently accumulated snap selection points and resets the visual state.


◆ currentLocation()

Vertex< 3, fltp08 > SnapController::currentLocation ( ) const
inline

Returns the current snap location in 3D space.


Returns
The current location as a 3D vertex.

Definition at line 162 of file SnapController.h.

References m_location.

◆ drawDefaultGuideLines()

void SnapController::drawDefaultGuideLines ( const SnapPoint & point)
protected

Draws the default set of guide lines based on the current snap point context.


Parameters
[in]pointThe snap point to draw guide lines for.

◆ drawDefaultGuidePlane()

void SnapController::drawDefaultGuidePlane ( const SnapPoint & point)
protected

Draws the default guide plane based on the current snap point context.


Parameters
[in]pointThe snap point to draw the guide plane for.

◆ finish()

virtual void SnapController::finish ( )
protectedvirtual

Called when the snap operation is finished.


Triggers the finished callback.

Reimplemented in GeometryMaker, ModelEditController, and SelectionController.

◆ lastPoint()

Vertex< 3, fltp08 > SnapController::lastPoint ( ) const
inline

Returns the most recent snap location.


Returns
The last recorded location as a 3D vertex.

Definition at line 214 of file SnapController.h.

References m_location.

◆ lastSnapPoints()

const Buffer< SnapPoint > & SnapController::lastSnapPoints ( ) const
inline

Returns the buffer of snap points from the most recent snap calculation.


Returns
Const reference to the buffer of the last computed SnapPoints.

Definition at line 219 of file SnapController.h.

References m_last_snap_points.

◆ lineMaterial()

UUID SnapController::lineMaterial ( const SnapPoint & point)
protected

Returns the material UUID appropriate for the given snap point's guide line type.


Parameters
[in]pointThe snap point to determine line material for.
Returns
The UUID of the material to use for rendering the guide line.

◆ lockAxis()

void SnapController::lockAxis ( uint01 axis,
fltp08 lock )
inline

Locks a specific axis to a fixed coordinate value.


Parameters
[in]axisThe axis index to lock (0=X, 1=Y, 2=Z).
[in]lockThe coordinate value to lock the axis to.

Definition at line 147 of file SnapController.h.

References m_lock_axis.

◆ pointCount()

uint04 SnapController::pointCount ( ) const
inline

Returns the number of points currently recorded by the snap controller.


Returns
The number of accumulated snap points.

Definition at line 130 of file SnapController.h.

References m_points.

◆ pointMaterial()

UUID SnapController::pointMaterial ( const SnapPoint & point)
protected

Returns the material UUID appropriate for the given snap point type.


Parameters
[in]pointThe snap point to determine material for.
Returns
The UUID of the material to use for rendering the snap point indicator.

◆ points()

const Buffer< Vertex< 3, fltp08 > > & SnapController::points ( ) const
inline

Returns the buffer of all accumulated snap points.


Returns
Const reference to the buffer of 3D snap point positions.

Definition at line 209 of file SnapController.h.

References m_points.

◆ processKeyEvent()

virtual bool SnapController::processKeyEvent ( const KeyEvent & event,
DesignObjectLookup * lookup,
Camera * camera )
overridevirtual

Processes an incoming keyboard event for snap-related shortcuts and dimension locking.


Parameters
[in]eventThe key event to process.
[in]lookupThe DesignObjectLookup for scene context.
[in]cameraThe active camera at the time of the event.
Returns
True if the event was handled by the snap controller, false otherwise.

Implements KeyControllerBase.

Reimplemented in GeometryMaker, ModelEditController, and SelectionController.

◆ processMouseEvent()

virtual bool SnapController::processMouseEvent ( MouseControllerEvent & event,
SelectionInfo & info )
overridevirtual

Processes an incoming mouse event for snapping and selection.


Parameters
[in]eventThe mouse controller event to process.
[in]infoThe selection info providing context about the current selection state.
Returns
True if the event was handled by the snap controller, false otherwise.

Implements MouseControllerBase.

Reimplemented in GeometryMaker, ModelEditController, and SelectionController.

◆ processMouseSelection()

bool SnapController::processMouseSelection ( MouseControllerEvent & event)
protected

Processes a mouse event for object selection (non-snap interaction).


Parameters
[in]eventThe mouse controller event.
Returns
True if a selection was processed, false otherwise.

◆ processMouseSnap()

bool SnapController::processMouseSnap ( MouseControllerEvent & event,
SelectionInfo & info )
protected

Processes a mouse event specifically for snapping logic.


Parameters
[in]eventThe mouse controller event.
[in]infoThe selection info for context.
Returns
True if a snap was processed, false otherwise.

◆ processUserInput()

void SnapController::processUserInput ( )
protected

Processes any pending user text input for dimension locking.


◆ selectionMode()

SelectionMode SnapController::selectionMode ( ) const
inline

Returns the current selection mode.


Returns
The active SelectionMode.

Definition at line 152 of file SnapController.h.

References m_selection_mode.

◆ setCustomSnapManager()

void SnapController::setCustomSnapManager ( const ConstPointer< SnapsManager > & snap_manager)
inline

Sets a custom snap manager to override the default snapping behavior.


Parameters
[in]snap_managerThe custom SnapsManager to use for snap calculations.

Definition at line 182 of file SnapController.h.

References m_custom_snap_manager.

◆ setFinishedCallback()

virtual void SnapController::setFinishedCallback ( const std::function< void(bool is_accepted)> & callback)
inlinevirtual

Sets a callback invoked when the snap operation finishes.


Parameters
[in]callbackThe function to call on finish; the bool parameter indicates whether the operation was accepted (true) or cancelled (false).

Definition at line 141 of file SnapController.h.

References m_finished_callback.

◆ setGuideLine()

void SnapController::setGuideLine ( uint04 index,
const Vertex< 3, fltp08 > & p1,
const Vector< 3, fltp08 > & p2,
const UUID & material )
protected

Sets the start position, direction, and material of a guide line at the given index.


Parameters
[in]indexThe guide line index.
[in]p1The start position of the guide line.
[in]p2The direction vector of the guide line.
[in]materialThe UUID of the material to apply.

◆ setGuideLineVisible() [1/2]

void SnapController::setGuideLineVisible ( bool visible)
protected

Sets the visibility of all guide lines.


Parameters
[in]visibleTrue to show, false to hide.

◆ setGuideLineVisible() [2/2]

void SnapController::setGuideLineVisible ( uint04 index,
bool visible )
protected

Sets the visibility of a specific guide line by index.


Parameters
[in]indexThe guide line index.
[in]visibleTrue to show, false to hide.

◆ setGuidePlane()

void SnapController::setGuidePlane ( uint04 index,
const Vector< 3, fltp08 > & normal,
const Vertex< 3, fltp08 > & location,
fltp08 radius )
protected

Sets the orientation, position, and size of a guide plane at the given index.


Parameters
[in]indexThe guide plane index.
[in]normalThe plane normal direction.
[in]locationThe center position of the plane.
[in]radiusThe visual radius/extent of the guide plane.

◆ setGuidePlaneVisible() [1/2]

void SnapController::setGuidePlaneVisible ( bool visible)
protected

Sets the visibility of all guide planes.


Parameters
[in]visibleTrue to show, false to hide.

◆ setGuidePlaneVisible() [2/2]

void SnapController::setGuidePlaneVisible ( uint04 index,
bool visible )
protected

Sets the visibility of a specific guide plane by index.


Parameters
[in]indexThe guide plane index.
[in]visibleTrue to show, false to hide.

◆ setGuidePoint()

void SnapController::setGuidePoint ( uint04 index,
const Vertex< 3, fltp08 > & p1,
const UUID & material )
protected

Sets the position and material of a guide point at the given index.


Parameters
[in]indexThe guide point index.
[in]p1The 3D position of the guide point.
[in]materialThe UUID of the material to apply.

◆ setGuidePointVisible() [1/2]

void SnapController::setGuidePointVisible ( bool visible)
protected

Sets the visibility of all guide points.


Parameters
[in]visibleTrue to show, false to hide.

◆ setGuidePointVisible() [2/2]

void SnapController::setGuidePointVisible ( uint04 index,
bool visible )
protected

Sets the visibility of a specific guide point by index.


Parameters
[in]indexThe guide point index.
[in]visibleTrue to show, false to hide.

◆ setLocation()

void SnapController::setLocation ( const Vertex< 3, fltp08 > & location,
bool is_click = false,
Camera * camera = nullptr )

Sets the current snap location, optionally registering it as a click.


Parameters
[in]locationThe 3D position to set as the current location.
[in]is_clickWhether this location represents an actual user click (default false).
[in]cameraThe camera active at the time of the location update (default nullptr).

◆ setLockLine()

void SnapController::setLockLine ( const LineSegment< 3, fltp08 > & line)

Sets a line segment to constrain snap positions along.


Parameters
[in]lineThe line segment to lock snapping to.

◆ setLockMode()

void SnapController::setLockMode ( LockMode mode)

Sets the lock mode that controls how axis/plane locking interacts with snapping.


Parameters
[in]modeThe LockMode to apply.

◆ setLockPlane()

void SnapController::setLockPlane ( const Plane< 3, fltp08 > & plane)

Sets a plane to constrain snap positions onto.


Parameters
[in]planeThe plane to lock snapping to.

◆ setPointsDrawMode()

void SnapController::setPointsDrawMode ( PointsDrawMode mode)
inline

Sets the visual draw mode for how accumulated points are rendered.


Parameters
[in]modeThe PointsDrawMode to use for rendering.

Definition at line 204 of file SnapController.h.

References m_point_draw_mode.

◆ setSelectionMode()

void SnapController::setSelectionMode ( SelectionMode mode)
inline

Sets the selection mode used during snap interaction.


Parameters
[in]modeThe SelectionMode to use.

Definition at line 157 of file SnapController.h.

References m_selection_mode.

◆ setShowLengthLabels()

void SnapController::setShowLengthLabels ( bool show)

Sets whether length labels are displayed along guide lines.


Parameters
[in]showTrue to show length labels, false to hide them.

◆ setShowPointLabels()

void SnapController::setShowPointLabels ( bool show)

Sets whether coordinate labels are displayed at snap points.


Parameters
[in]showTrue to show point labels, false to hide them.

◆ setUpdateCallback()

virtual void SnapController::setUpdateCallback ( const std::function< void()> & callback)
inlinevirtual

Sets a callback invoked whenever the snap location or state is updated.


Parameters
[in]callbackThe function to call on each update.

Definition at line 135 of file SnapController.h.

References m_update_callback.

◆ setupGuideModel()

Model SnapController::setupGuideModel ( )
protected

Creates and returns a Model configured as a guide visual element.


Returns
The newly created guide Model.

◆ setupSelectionInfo()

virtual void SnapController::setupSelectionInfo ( const MouseEvent & event,
Camera * camera,
SelectionInfo & info )
protectedvirtual

Populates a SelectionInfo from the given mouse event and camera.


Parameters
[in]eventThe mouse event providing screen coordinates.
[in]cameraThe camera used for projection calculations.
[in]infoThe SelectionInfo to populate with ray and selection data.

Reimplemented in GeometryMaker, and ModelEditController.

◆ updateLocation()

virtual void SnapController::updateLocation ( const Vertex< 3, fltp08 > & location,
bool is_click,
Camera * camera )
protectedvirtual

Called when the snap location is updated.


Subclasses can override to react to location changes.

Parameters
[in]locationThe new 3D location.
[in]is_clickWhether the update represents a user click.
[in]cameraThe camera active during the update.

Reimplemented in GeometryMaker, and ModelEditController.

◆ updateRecentGeometry()

void SnapController::updateRecentGeometry ( const SnapPoint & point)
protected

Updates the recent geometry cache with the latest snap point for extending/snapping to nearby geometry in future operations.


Parameters
[in]pointThe snap point to record.

The documentation for this class was generated from the following file: