Navigation
API > API/Plugins > API/Plugins/ModelingComponents
Base class mechanic for selecting a subset of mesh elements (edge loops, groups, corners, etc.) Internally it relies on an FMeshTopologySelector to define which type of mesh topology is selectable.
NOTE: Users should not use this class directly, but rather subclass it and specify a particular FMeshTopologySelector to use.
| Name | UMeshTopologySelectionMechanic |
| Type | class |
| Header File | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Selection/MeshTopologySelectionMechanic.h |
| Include Path | #include "Selection/MeshTopologySelectionMechanic.h" |
Syntax
UCLASS (MinimalAPI, Abstract)
class UMeshTopologySelectionMechanic :
public UInteractionMechanic ,
public IClickBehaviorTarget ,
public IHoverBehaviorTarget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInteractionMechanic → UMeshTopologySelectionMechanic
Implements Interfaces
Derived Classes
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~UMeshTopologySelectionMechanic() |
Selection/MeshTopologySelectionMechanic.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FAxisAlignedBox3d | UE::Geometry::FAxisAlignedBox3d | Selection/MeshTopologySelectionMechanic.h | |
| FFrame3d | UE::Geometry::FFrame3d | Selection/MeshTopologySelectionMechanic.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| CtrlModifierID | const int32 | Selection/MeshTopologySelectionMechanic.h | |
| ShiftModifierID | const int32 | Selection/MeshTopologySelectionMechanic.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bAddSelectionFilterPropertiesToParentTool | bool | Configuration variables that must be set before bSetup is called | Selection/MeshTopologySelectionMechanic.h | |
| HilightRenderer | FToolDataVisualizer | Selection/MeshTopologySelectionMechanic.h | ||
| OnFaceSelectionPreviewChanged | FSimpleMulticastDelegate | This is broadcast during marquee rectangle dragging if selected faces change, to allow user to dynamically update face highlighting if desired (needed because OnSelectionChanged is only fired once the rectangle is completed, not while it is being updated). | Selection/MeshTopologySelectionMechanic.h | |
| OnSelectionChanged | FSimpleMulticastDelegate | OnSelectionChanged is broadcast whenever the selection is modified (including by FChanges, which means that called functions should not issue undo transactions. | Selection/MeshTopologySelectionMechanic.h | |
| PolyEdgesRenderer | FToolDataVisualizer | Selection/MeshTopologySelectionMechanic.h | ||
| Properties | TObjectPtr< UMeshTopologySelectionMechanicProperties > | TODO: Is it worth issuing separate callbacks in normal selection changes and in FChange ones, to allow the user to bundle in some FChanges into the normal callback? | Selection/MeshTopologySelectionMechanic.h | |
| SelectionRenderer | FToolDataVisualizer | Selection/MeshTopologySelectionMechanic.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bRenderTopology | bool | Selection/MeshTopologySelectionMechanic.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void BeginChange () |
Change Tracking Begin a change record. | Selection/MeshTopologySelectionMechanic.h | |
void ClearHighlight() |
Clear current hover-highlight | Selection/MeshTopologySelectionMechanic.h | |
void ClearSelection() |
Clear the current selection. | Selection/MeshTopologySelectionMechanic.h | |
void ConvertSelectionToBorder() |
Selection/MeshTopologySelectionMechanic.h | ||
void DisableBehaviors
(
UInteractiveTool* ParentToolIn |
Removes the mechanic's own click/hover handlers, which means that the parent tool will need to call UpdateSelection(), UpdateHighlight(), ClearHighlight(), and ClearSelection() from its own hover/click handlers. | Selection/MeshTopologySelectionMechanic.h | |
virtual void DrawHUD
(
FCanvas* Canvas, |
Selection/MeshTopologySelectionMechanic.h | ||
TUniquePtr< FToolCommandChange > EndChange() |
End the active change and return it. Returns empty change if the selection was not modified! | Selection/MeshTopologySelectionMechanic.h | |
bool EndChangeAndEmitIfModified() |
Ends the active change and emits it via the parent tool, if the selection has been modified. | Selection/MeshTopologySelectionMechanic.h | |
void FloodSelection() |
Selection/MeshTopologySelectionMechanic.h | ||
const FGroupTopologySelection & GetActiveSelection() |
Selection/MeshTopologySelectionMechanic.h | ||
void GetClickedHitPosition
(
FVector3d& PositionOut, |
Can be used by in an OnSelectionChanged event to inspect the clicked location (i.e., the values returned by the UpdateSelection() function when the click happened). | Selection/MeshTopologySelectionMechanic.h | |
TPair< FInputCapturePriority, FInputCapturePriority > GetPriorityRange () |
Gets the current priority range used by behaviors in the mechanic. | Selection/MeshTopologySelectionMechanic.h | |
FAxisAlignedBox3d GetSelectionBounds
(
bool bWorld |
Selection/MeshTopologySelectionMechanic.h | ||
| Selection/MeshTopologySelectionMechanic.h | |||
TSharedPtr< FMeshTopologySelector, ESPMode::ThreadSafe > GetTopologySelector() |
Selection/MeshTopologySelectionMechanic.h | ||
void GrowSelection() |
Selection/MeshTopologySelectionMechanic.h | ||
bool HasSelection() |
Selection/MeshTopologySelectionMechanic.h | ||
void Initialize
(
const FDynamicMesh3* MeshIn, |
Selection/MeshTopologySelectionMechanic.h | ||
void InvertSelection() |
Selection/MeshTopologySelectionMechanic.h | ||
bool IsCurrentlyMarqueeDragging() |
When true, the selection mechanic is currently tracking a marquee rectangle drag, and acting on the selection may be unwise until it is over (and an OnSelectionChanged event is fired). | Selection/MeshTopologySelectionMechanic.h | |
void NotifyMeshChanged
(
bool bTopologyModified |
Notify internal data structures that the associated MeshComponent has been modified. | Selection/MeshTopologySelectionMechanic.h | |
void RenderMarquee
(
IToolsContextRenderAPI* RenderAPI |
Render only the MarqueeMechanic, without rendering the current selection | Selection/MeshTopologySelectionMechanic.h | |
void SelectAll() |
Selection/MeshTopologySelectionMechanic.h | ||
void SetBasePriority
(
const FInputCapturePriority& Priority |
Sets the base priority so that tools can make sure that their own behaviors are higher priority. | Selection/MeshTopologySelectionMechanic.h | |
void SetIsEnabled
(
bool bBehaviorsEnabled, |
Enable/disable the selection behaviors in the mechanic without permanently removing them or shutting the mechanic down. | Selection/MeshTopologySelectionMechanic.h | |
void SetMarqueeSelectionUpdateType
(
EMarqueeSelectionUpdateType InType |
Sets how/when the selection updates are handled. | Selection/MeshTopologySelectionMechanic.h | |
void SetSelection
(
const FGroupTopologySelection& Selection, |
Replace the current selection with an external selection. | Selection/MeshTopologySelectionMechanic.h | |
void SetShouldAddToSelectionFunc
(
TFunction< bool(void)> Func |
By default, the shift key will cause new clicks to add to the selection. | Selection/MeshTopologySelectionMechanic.h | |
void SetShouldRemoveFromSelectionFunc
(
TFunction< bool(void)> Func |
By default, the Ctrl key will cause new clicks to remove from the existing selection. | Selection/MeshTopologySelectionMechanic.h | |
void SetShouldSelectEdgeLoopsFunc
(
TFunction< bool(void)> Func |
Selection/MeshTopologySelectionMechanic.h | ||
void SetShouldSelectEdgeRingsFunc
(
TFunction< bool(void)> Func |
Selection/MeshTopologySelectionMechanic.h | ||
void SetShowEdges
(
const bool bRenderEdges |
Toggle rendering of edges | Selection/MeshTopologySelectionMechanic.h | |
void SetShowSelectableCorners
(
bool bShowCorners |
Selection/MeshTopologySelectionMechanic.h | ||
void SetTransform
(
const FTransform3d& InTargetTransform |
Update the location of the mesh after Initialize() | Selection/MeshTopologySelectionMechanic.h | |
void ShrinkSelection() |
Selection/MeshTopologySelectionMechanic.h | ||
bool TopologyHitTest
(
const FRay& WorldRay, |
Selection/MeshTopologySelectionMechanic.h | ||
bool TopologyHitTest
(
const FRay& WorldRay, |
Perform a hit test on the topology using the current selection settings. | Selection/MeshTopologySelectionMechanic.h | |
virtual bool UpdateHighlight
(
const FRay& WorldRay |
Hover API Update the hover highlight based on the hit elements at the given World Ray | Selection/MeshTopologySelectionMechanic.h | |
virtual bool UpdateSelection
(
const FRay& WorldRay, |
Selection API Intersect the ray with the mesh and update the selection based on the hit element, modifier states, etc | Selection/MeshTopologySelectionMechanic.h |
Overridden from UInteractionMechanic
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Render
(
IToolsContextRenderAPI* RenderAPI |
Selection/MeshTopologySelectionMechanic.h | ||
virtual void Setup
(
UInteractiveTool* ParentTool |
Selection/MeshTopologySelectionMechanic.h | ||
virtual void Shutdown() |
Selection/MeshTopologySelectionMechanic.h | ||
virtual void Tick
(
float DeltaTime |
Selection/MeshTopologySelectionMechanic.h |
Overridden from IClickBehaviorTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FInputRayHit IsHitByClick
(
const FInputDeviceRay& ClickPos |
IClickBehaviorTarget implementation. | Selection/MeshTopologySelectionMechanic.h | |
virtual void OnClicked
(
const FInputDeviceRay& ClickPos |
Selection/MeshTopologySelectionMechanic.h |
Overridden from IModifierToggleBehaviorTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnUpdateModifierState
(
int ModifierID, |
Selection/MeshTopologySelectionMechanic.h |
Overridden from IHoverBehaviorTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FInputRayHit BeginHoverSequenceHitTest
(
const FInputDeviceRay& PressPos |
IHoverBehaviorTarget implementation. | Selection/MeshTopologySelectionMechanic.h | |
virtual void OnBeginHover
(
const FInputDeviceRay& DevicePos |
Selection/MeshTopologySelectionMechanic.h | ||
virtual void OnEndHover() |
Selection/MeshTopologySelectionMechanic.h | ||
virtual bool OnUpdateHover
(
const FInputDeviceRay& DevicePos |
Selection/MeshTopologySelectionMechanic.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FGroupTopologySelector::FSelectionSettings GetTopoSelectorSettings
(
bool bUseOrthoSettings |
Get the topology selector settings to use given the current selection settings. | Selection/MeshTopologySelectionMechanic.h | |
void HandleRectangleChanged
(
const FCameraRectangle& InRectangle |
Calls actual selection using the input marquee rectangle. | Selection/MeshTopologySelectionMechanic.h | |
virtual void OnDragRectangleChanged
(
const FCameraRectangle& CurrentRectangle |
Selection/MeshTopologySelectionMechanic.h | ||
virtual void OnDragRectangleFinished
(
const FCameraRectangle& Rectangle, |
Selection/MeshTopologySelectionMechanic.h | ||
virtual void OnDragRectangleStarted() |
These get bound to marquee mechanic delegates. | Selection/MeshTopologySelectionMechanic.h | |
virtual void UpdateMarqueeEnabled() |
Selection/MeshTopologySelectionMechanic.h |