Navigation
API > API/Plugins > API/Plugins/ModelingComponents
FBasePositionSnapSolver3 is a base class for 3D position snapping implementations. It is not usable on its own and the split between this class and the implementations is not incredibly clean. However there is lots of shared functionality that is placed here.
3D Point and Line targets are supported. Targets can also be "ignored".
The actual snap "solve" must be implemented by subclasses, depending on their input data (ray, point, line, etc)
| Name | FBasePositionSnapSolver3 |
| Type | class |
| Header File | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Snapping/BasePositionSnapSolver3.h |
| Include Path | #include "Snapping/BasePositionSnapSolver3.h" |
Syntax
class FBasePositionSnapSolver3
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FBasePositionSnapSolver3() |
Snapping/BasePositionSnapSolver3.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FBasePositionSnapSolver3() |
Snapping/BasePositionSnapSolver3.h |
Structs
| Name | Remarks |
|---|---|
| FCustomMetric | FCustomMetric overrides/modifies the default should-snap-happen metric |
| FSnapTargetCircle | |
| FSnapTargetLine | Target line that might be snapped to |
| FSnapTargetPoint | Target point that might be snapped to |
Enums
Public
| Name | Remarks |
|---|---|
| ECustomMetricType | Setup ECustomMetricType defines how a FCustomMetric should be interpreted |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| BaseExternalLineID | int | Subclasses may have internal TargetID values, so external lines should have IDs larger than this | Snapping/BasePositionSnapSolver3.h |
| BaseExternalPointID | int | Subclasses may have internal TargetID values, so external points should have IDs larger than this | Snapping/BasePositionSnapSolver3.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bEnableStableSnap | bool | If true, then we will prefer to keep current snap point over a new one | Snapping/BasePositionSnapSolver3.h | |
| SnapMetricFunc | TFunction< double(const FVector3d &, const FVector3d &)> | Parameters This is the function we use to measure distances between snap points. | Snapping/BasePositionSnapSolver3.h | |
| SnapMetricTolerance | double | Tolerance for snapping, in unit relative to SnapMetricFunc | Snapping/BasePositionSnapSolver3.h | |
| StableSnapImproveThresh | double | How much we have to improve the snap metric to discard the current stable snap | Snapping/BasePositionSnapSolver3.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AddCircleTarget
(
const FCircle3d& Circle, |
Add a snap target Circle | Snapping/BasePositionSnapSolver3.h | |
virtual void AddIgnoreTarget
(
int TargetID |
Add given TargetID to the ignore list, so any points/lines with that ID will not be snapped-to | Snapping/BasePositionSnapSolver3.h | |
virtual void AddLineTarget
(
const FLine3d& Line, |
Add a snap target line | Snapping/BasePositionSnapSolver3.h | |
virtual void AddPointTarget
(
const FVector3d& Position, |
Add a snap target point at the given Position | Snapping/BasePositionSnapSolver3.h | |
virtual void AddPointTarget
(
const FVector3d& Position, |
Add a snap target point at the given Position | Snapping/BasePositionSnapSolver3.h | |
int GetActiveSnapDistanceID() |
Snapping/BasePositionSnapSolver3.h | ||
FVector3d GetActiveSnapFromPoint() |
Snapping/BasePositionSnapSolver3.h | ||
const FLine3d & GetActiveSnapLine() |
Snapping/BasePositionSnapSolver3.h | ||
int GetActiveSnapTargetID() |
Snapping/BasePositionSnapSolver3.h | ||
FVector3d GetActiveSnapToPoint() |
Snapping/BasePositionSnapSolver3.h | ||
bool HaveActiveSnap() |
Solving output | Snapping/BasePositionSnapSolver3.h | |
bool HaveActiveSnapDistance() |
Snapping/BasePositionSnapSolver3.h | ||
bool HaveActiveSnapLine() |
Snapping/BasePositionSnapSolver3.h | ||
virtual bool IsIgnored
(
int TargetID |
Snapping/BasePositionSnapSolver3.h | ||
virtual bool RemoveCircleTargetsByID
(
int TargetID |
Remove any line targets with this TargetID | Snapping/BasePositionSnapSolver3.h | |
virtual void RemoveIgnoreTarget
(
int TargetID |
Add given TargetID from the ignore list | Snapping/BasePositionSnapSolver3.h | |
virtual bool RemoveLineTargetsByID
(
int TargetID |
Remove any line targets with this TargetID | Snapping/BasePositionSnapSolver3.h | |
virtual bool RemovePointTargetsByID
(
int TargetID |
Remove any point targets with this TargetID | Snapping/BasePositionSnapSolver3.h | |
virtual void Reset() |
Discard the set of snap points and lines and clear the active snap | Snapping/BasePositionSnapSolver3.h | |
virtual void ResetActiveSnap() |
Clear the active snap | Snapping/BasePositionSnapSolver3.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ClearActiveSnapData() |
Snapping/BasePositionSnapSolver3.h | ||
const FSnapTargetPoint * FindBestSnapInSet
(
const TArray< FSnapTargetPoint >& TestTargets, |
Snapping/BasePositionSnapSolver3.h | ||
int32 FindIndexOfBestSnapInSet
(
const TArray< FSnapTargetPoint >& TestTargets, |
Snap measurement functions | Snapping/BasePositionSnapSolver3.h | |
virtual void SetActiveSnapData
(
const FSnapTargetPoint& TargetPoint, |
Snapping/BasePositionSnapSolver3.h | ||
bool TestSnapTarget
(
const FSnapTargetPoint& Target, |
Snapping/BasePositionSnapSolver3.h |