Choose your operating system:
Windows
macOS
Linux
| UObjectBase
|
Module |
|
Header |
/Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Mechanics/CurveControlPointsMechanic.h |
Include |
#include "Mechanics/CurveControlPointsMechanic.h" |
UCLASS()
class UCurveControlPointsMechanic :
public UInteractionMechanic,
public IClickBehaviorTarget,
public IHoverBehaviorTarget
A mechanic for displaying a sequence of control points and moving them about. Has an interactive initialization mode for first setting the points.
When editing, hold shift to select multiple points. Hold Ctrl to add an extra point along an edge. To add points to either end of the sequence, first select either the first or last point and then hold Ctrl. Backspace deletes currently selected points. In edit mode, holding Shift generally toggles the snapping behavior (makes it opposite of the current SnappingEnabled setting), though this is not yet implemented while the gizmo is being dragged.
TODO:
Make it possible to open/close loop in edit mode
Improve display of occluded control points (checkerboard the material)
Allow deselection of vertices by clicking away?
Lump the point/line set components into PreviewGeometryActor.
Name | Description | ||
---|---|---|---|
|
bAddToSelectionToggle |
Support for Shift and Ctrl toggles. |
|
|
bAutoRevertToInteractiveInitialization |
||
|
bGizmoBeingDragged |
Used to make it easy to tell whether the gizmo was moved by the user or by undo/redo or some other change that we shoulnd't respond to. |
|
|
bInsertPointToggle |
||
|
bInteractiveInitializationMode |
||
|
bIsLoop |
||
|
bSnappingEnabled |
||
|
bSnapToggle |
||
|
CameraState |
Support for hovering. |
|
|
TObjectPtr< USi... |
ClickBehavior |
Behaviors used for moving points around and hovering them. |
|
ControlPoints |
This actually stores the sequence of point IDs, and their coordinates. |
|
|
CtrlModifierId |
||
|
CurrentChangeStamp |
Used for expiring undo/redo changes, which compare this to their stored value and expire themselves if they do not match. |
|
|
CurrentPointsColor |
||
|
CurrentSegmentsColor |
||
|
float |
DepthBias |
|
|
TObjectPtr< UPo... |
DrawnControlPoints |
|
|
TObjectPtr< ULi... |
DrawnControlSegments |
|
|
DrawPlane |
Used for adding new points on the ends and for limiting point movement. |
|
|
EndpointSnapPriority |
||
|
FirstPointSnapID |
Used for snapping to the start/end of the curve to get out of initialization mode. |
|
|
GeometrySet |
Used for spatial queries. |
|
|
GeometrySetToleranceTest |
||
|
GizmoStartPosition |
The starting point of the gizmo is needed to determine the offset by which to move the points. |
|
|
HighlightColor |
||
|
TObjectPtr< UMo... |
HoverBehavior |
|
|
HoverColor |
||
|
HoveredPointID |
||
|
InitializationCurveColor |
Variables for drawing. |
|
|
LastPointSnapID |
||
|
LineSnapIDMin |
When storing user-defined lines to snap to, we add this to the user-provided id to avoid conflicting with any lines generated by the snap engine. |
|
|
LineSnapPriority |
||
|
MinPointsForLoop |
||
|
MinPointsForNonLoop |
||
|
NormalCurveColor |
||
|
OnModeChanged |
||
|
OnPointsChanged |
||
|
float |
PointsSize |
|
|
TObjectPtr< UCo... |
PointTransformGizmo |
|
|
TObjectPtr< UTr... |
PointTransformProxy |
Support for gizmo. |
|
PreHoverPointColor |
Used to unhover a point, since this will differ depending on whether the point is selected. |
|
|
PreviewColor |
||
|
TObjectPtr< APr... |
PreviewGeometryActor |
Used for displaying points/segments |
|
TObjectPtr< UPo... |
PreviewPoint |
These get drawn separately because the other components have to be 1:1 with the control points structure, which would make it complicated to keep track of special id's. |
|
TObjectPtr< ULi... |
PreviewSegment |
|
|
float |
SegmentsThickness |
|
|
SelectedColor |
||
|
SelectedPointIDs |
Support for selection. |
|
|
SelectedPointStartPositions |
We need the selected point start positions so we can move multiple points appropriately. |
|
|
ShiftModifierId |
||
|
SnapEngine |
||
|
SnapLineColor |
Name | Description | |
---|---|---|
|
~UCurveControlPointsMechanic() |
Some other standard functions. |
Name | Description | ||
---|---|---|---|
|
AddSnapLine ( |
Adds additional line to snap points to. |
|
|
AppendPoint ( |
||
|
ChangeSelection |
These issue undo/redo change objects, and must therefore not be called in undo/redo code. |
|
|
ClearHover() |
||
|
ClearPoints() |
Clears all points in the mechanic. |
|
|
ClearSelection() |
||
|
DeletePoint ( |
||
|
DeleteSelectedPoints() |
Deletes currently selected points- can be called on a key press from the parent tool. |
|
|
DeselectPoint ( |
||
|
ExpireChanges() |
Expires any changes currently associated with the mechanic in the undo/redo stack. |
|
|
ExtractPointPositions |
Outputs the positions of the points in the control point sequence. |
|
|
GetIsLoop() |
Returns whether the underlying sequence of control points is a loop. |
|
|
GetNumPoints() |
Gives number of points currently managed by the mechanic. |
|
|
GizmoTransformChanged ( |
Callbacks we'll receive from the gizmo proxy. |
|
|
GizmoTransformEnded ( |
||
|
GizmoTransformStarted ( |
||
|
HitTest ( |
||
|
Initialize |
Functions used for initializing the mechanic. |
|
|
InsertPointAt |
All of the following do not issue undo/redo change objects. |
|
|
IsInInteractiveIntialization() |
||
|
RemoveSnapLine ( |
||
|
SelectPoint ( |
||
|
SetAutoRevertToInteractiveInitialization ( |
When true, if the number of control points falls below the mins required (through deletion by the user), the mechanic automatically falls back into interactive intialization mode. |
|
|
SetInteractiveInitialization ( |
Interactive initialization mode allows the user to click multiple times to initialize the curve (without having to hold Ctrl), and to transition to edit mode by clicking the last or first points (provided the minimal numbers of points have been met) |
|
|
SetIsLoop ( |
||
|
SetMinPointsToLeaveInteractiveInitialization |
In interactive intialization mode, these minimums determine how many points must exist before initialization mode can be left. |
|
|
SetPlane ( |
Sets the plane on which new points are added on the ends and in which the points are moved. |
|
|
SetSnappingEnabled ( |
TODO: It is simple to allow the points to be moved arbitrarily, not just inside the plane, if we ever want to use the mechanic somewhere where that is desirable. |
|
|
SetWorld ( |
||
|
UpdateGizmoLocation() |
||
|
UpdateGizmoVisibility() |
||
|
UpdatePointLocation |
||
|
UpdateSnapHistoryPoint |
||
|
UpdateSnapTargetsForHover() |
Name | Description | ||
---|---|---|---|
|
Render ( |
Allow the Mechanic to do any custom drawing (ie via PDI/RHI) |
|
|
Setup ( |
Called to initialize the InteractionMechanic |
|
|
Shutdown() |
Called to clean up the InteractionMechanic |
Name | Description | ||
---|---|---|---|
|
IsHitByClick ( |
IClickBehaviorTarget implementation. |
|
|
OnClicked ( |
Notify Target that click ocurred |
Name | Description | ||
---|---|---|---|
|
OnUpdateModifierState ( |
IModifierToggleBehaviorTarget implementation, inherited through IClickBehaviorTarget. |
Name | Description | ||
---|---|---|---|
|
BeginHoverSequenceHitTest ( |
IHoverBehaviorTarget implementation. |
|
|
OnBeginHover ( |
Initialize hover sequence at given position |
|
|
OnEndHover() |
Terminate active hover sequence |
|
|
OnUpdateHover ( |
Update active hover sequence with new input position |
Name |
Description |
|
---|---|---|
|
FOrderedPoints |
We want some way to store the control point sequence that lets us easily associate points with their renderable and hit-testable representations, since we need to alter all of these together as points get moved or added. |
Name |
Description |
---|---|
OnModeChangedEvent |
This delegate is called when the mode of the mechanic changes (i.e., we leave or re-enter interactive initialization) |
OnPointsChangedEvent |
This delegate is called every time the control point sequence is altered. |