Navigation
Unreal Engine C++ API Reference > Plugins > ModelingComponents > Mechanics
Inheritance Hierarchy
- UObject
- UInteractionMechanic
- UCurveControlPointsMechanic
References
Module | ModelingComponents |
Header | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Mechanics/CurveControlPointsMechanic.h |
Include | #include "Mechanics/CurveControlPointsMechanic.h" |
Syntax
UCLASS ()
class UCurveControlPointsMechanic :
public UInteractionMechanic ,
public IClickBehaviorTarget ,
public IHoverBehaviorTarget
Remarks
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.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
bool | bAddToSelectionToggle | Support for Shift and Ctrl toggles. |
![]() |
bool | bAutoRevertToInteractiveInitialization | |
![]() |
bool | 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. |
![]() |
bool | bInsertPointToggle | |
![]() |
bool | bInteractiveInitializationMode | |
![]() |
bool | bIsLoop | |
![]() |
bool | bSnappingEnabled | |
![]() |
bool | bSnapToggle | |
![]() |
FViewCameraState | CameraState | Support for hovering. |
![]() ![]() |
TObjectPtr< USingleClickInputBehavior > | ClickBehavior | Behaviors used for moving points around and hovering them. |
![]() |
FOrderedPoints | ControlPoints | This actually stores the sequence of point IDs, and their coordinates. |
![]() |
int32 | CtrlModifierId | |
![]() |
int32 | CurrentChangeStamp | Used for expiring undo/redo changes, which compare this to their stored value and expire themselves if they do not match. |
![]() |
FColor | CurrentPointsColor | |
![]() |
FColor | CurrentSegmentsColor | |
![]() |
float | DepthBias | |
![]() ![]() |
TObjectPtr< UPointSetComponent > | DrawnControlPoints | |
![]() ![]() |
TObjectPtr< ULineSetComponent > | DrawnControlSegments | |
![]() |
UE::Geometry::FFrame3d | DrawPlane | Used for adding new points on the ends and for limiting point movement. |
![]() |
int32 | EndpointSnapPriority | |
![]() |
int32 | FirstPointSnapID | Used for snapping to the start/end of the curve to get out of initialization mode. |
![]() |
UE::Geometry::FGeometrySet3 | GeometrySet | Used for spatial queries. |
![]() |
TFunction< bool(const FVector3d &, const FVector3d &)> | GeometrySetToleranceTest | |
![]() |
FVector | GizmoStartPosition | The starting point of the gizmo is needed to determine the offset by which to move the points. |
![]() |
FColor | HighlightColor | |
![]() ![]() |
TObjectPtr< UMouseHoverBehavior > | HoverBehavior | |
![]() |
FColor | HoverColor | |
![]() |
int32 | HoveredPointID | |
![]() |
FColor | InitializationCurveColor | Variables for drawing. |
![]() |
int32 | LastPointSnapID | |
![]() |
int32 | 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. |
![]() |
int32 | LineSnapPriority | |
![]() |
int32 | MinPointsForLoop | |
![]() |
int32 | MinPointsForNonLoop | |
![]() |
FColor | NormalCurveColor | |
![]() |
OnModeChangedEvent | OnModeChanged | |
![]() |
OnPointsChangedEvent | OnPointsChanged | |
![]() |
float | PointsSize | |
![]() ![]() |
TObjectPtr< UCombinedTransformGizmo > | PointTransformGizmo | |
![]() ![]() |
TObjectPtr< UTransformProxy > | PointTransformProxy | Support for gizmo. |
![]() |
FColor | PreHoverPointColor | Used to unhover a point, since this will differ depending on whether the point is selected. |
![]() |
FColor | PreviewColor | |
![]() ![]() |
TObjectPtr< APreviewGeometryActor > | PreviewGeometryActor | Used for displaying points/segments |
![]() ![]() |
TObjectPtr< UPointSetComponent > | 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< ULineSetComponent > | PreviewSegment | |
![]() |
float | SegmentsThickness | |
![]() |
FColor | SelectedColor | |
![]() |
TArray< int32 > | SelectedPointIDs | Support for selection. |
![]() |
TArray< FVector3d > | SelectedPointStartPositions | We need the selected point start positions so we can move multiple points appropriately. |
![]() |
int32 | ShiftModifierId | |
![]() |
UE::Geometry::FPointPlanarSnapSolver | SnapEngine | |
![]() |
FColor | SnapLineColor |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
Some other standard functions. |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | AddSnapLine
(
int32 LineID, |
Adds additional line to snap points to. |
![]() |
int32 | AppendPoint
(
const FVector3d& PointCoordinates |
|
![]() |
void | ChangeSelection
(
int32 NewPointID, |
These issue undo/redo change objects, and must therefore not be called in undo/redo code. |
![]() |
void | ClearHover () |
|
![]() |
void | ClearPoints () |
Clears all points in the mechanic. |
![]() |
void | ||
![]() |
int32 | DeletePoint
(
int32 SequencePosition |
|
![]() |
void | Deletes currently selected points- can be called on a key press from the parent tool. | |
![]() |
bool | DeselectPoint
(
int32 PointID |
|
![]() |
void | Expires any changes currently associated with the mechanic in the undo/redo stack. | |
![]() |
void | ExtractPointPositions
(
TArray< FVector3d >& PositionsOut |
Outputs the positions of the points in the control point sequence. |
![]() |
bool | GetIsLoop () |
Returns whether the underlying sequence of control points is a loop. |
![]() |
int32 | GetNumPoints () |
Gives number of points currently managed by the mechanic. |
![]() |
void | GizmoTransformChanged
(
UTransformProxy* Proxy, |
Callbacks we'll receive from the gizmo proxy. |
![]() |
void | GizmoTransformEnded
(
UTransformProxy* Proxy |
|
![]() |
void | GizmoTransformStarted
(
UTransformProxy* Proxy |
|
![]() |
bool | HitTest
(
const FInputDeviceRay& ClickPos, |
|
![]() ![]() |
void | Initialize
(
const TArray< FVector3d >& Points, |
Functions used for initializing the mechanic. |
![]() |
int32 | InsertPointAt
(
int32 SequencePosition, |
All of the following do not issue undo/redo change objects. |
![]() |
bool | ||
![]() |
void | RemoveSnapLine
(
int32 LineID |
|
![]() |
void | SelectPoint
(
int32 PointID |
|
![]() |
void | SetAutoRevertToInteractiveInitialization
(
bool bOn |
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. |
![]() |
void | SetInteractiveInitialization
(
bool bOn |
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) |
![]() |
void | SetIsLoop
(
bool bIsLoop |
|
![]() |
void | SetMinPointsToLeaveInteractiveInitialization
(
int32 MinForLoop, |
In interactive intialization mode, these minimums determine how many points must exist before initialization mode can be left. |
![]() |
void | SetPlane
(
const UE::Geometry::FFrame3d& DrawPlaneIn |
Sets the plane on which new points are added on the ends and in which the points are moved. |
![]() |
void | SetSnappingEnabled
(
bool bOn |
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. |
![]() |
void | SetWorld
(
UWorld* World |
|
![]() |
void | ||
![]() |
void | ||
![]() |
void | UpdatePointLocation
(
int32 PointID, |
|
![]() |
void | UpdateSnapHistoryPoint
(
int32 Index, |
|
![]() |
void |
Overridden from UInteractionMechanic
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | Render
(
IToolsContextRenderAPI* RenderAPI |
Allow the Mechanic to do any custom drawing (ie via PDI/RHI) |
![]() ![]() |
void | Setup
(
UInteractiveTool* ParentTool |
Called to initialize the InteractionMechanic |
![]() ![]() |
void | Shutdown () |
Called to clean up the InteractionMechanic |
Overridden from IClickBehaviorTarget
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
FInputRayHit | IsHitByClick
(
const FInputDeviceRay& ClickPos |
IClickBehaviorTarget implementation. |
![]() ![]() |
void | OnClicked
(
const FInputDeviceRay& ClickPos |
Notify Target that click ocurred |
Overridden from IModifierToggleBehaviorTarget
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | OnUpdateModifierState
(
int ModifierID, |
IModifierToggleBehaviorTarget implementation, inherited through IClickBehaviorTarget. |
Overridden from IHoverBehaviorTarget
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
FInputRayHit | BeginHoverSequenceHitTest
(
const FInputDeviceRay& PressPos |
IHoverBehaviorTarget implementation. |
![]() ![]() |
void | OnBeginHover
(
const FInputDeviceRay& DevicePos |
Initialize hover sequence at given position |
![]() ![]() |
void | OnEndHover () |
Terminate active hover sequence |
![]() ![]() |
bool | OnUpdateHover
(
const FInputDeviceRay& DevicePos |
Update active hover sequence with new input position |
Classes
Type | 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. |
Typedefs
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. |