FBasePositionSnapSolver3

[FBasePositionSnapSolver3](API\Plugins\ModelingComponents\Snapping\FBasePositionSnapSolver3) is a base class for 3D position snapping implementations.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

ModelingComponents

Header

/Engine/Plugins/Experimental/MeshModelingToolset/Source/ModelingComponents/Public/Snapping/BasePositionSnapSolver3.h

Include

#include "Snapping/BasePositionSnapSolver3.h"

Syntax

class FBasePositionSnapSolver3

Remarks

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)

Variables

Name Description

Protected variable

FVector3d

 

ActiveSnapFromPoint

Protected variable

FSnapTargetPoin...

 

ActiveSnapTarget

Protected variable

FVector3d

 

ActiveSnapToPoint

Public variable

bool

 

bEnableStableSnap

If true, then we will prefer to keep current snap point over a new one

Protected variable

bool

 

bHaveActiveSnap

Information about active snap

Protected variable

TSet< int >

 

IgnoreTargets

List of TargetID values to ignore in snap queries

Public variable

TFunction< doub...

 

SnapMetricFunc

ParametersThis is the function we use to measure distances between snap points.

Public variable

double

 

SnapMetricTolerance

Tolerance for snapping, in unit relative to SnapMetricFunc

Protected variable

double

 

SnappedPointMetric

Public variable

double

 

StableSnapImproveThresh

How much we have to improve the snap metric to discard the current stable snap

Protected variable

TArray< FSnapTa...

 

TargetCircles

Protected variable

TArray< FSnapTa...

 

TargetLines

Protected variable

TArray< FSnapTa...

 

TargetPoints

Constructors

Name Description

Public function

FBasePositionSnapSolver3()

Destructors

Name Description

Public function Virtual

~FBasePositionSnapSolver3()

Functions

Name Description

Public function Virtual

void

 

AddCircleTarget

(
    const FCircle3d& Circle,
    int TargetID,
    int Priority
)

Add a snap target Circle

Public function Virtual

void

 

AddIgnoreTarget

(
    int TargetID
)

Add given TargetID to the ignore list, so any points/lines with that ID will not be snapped-to

Public function Virtual

void

 

AddLineTarget

(
    const FLine3d& Line,
    int TargetID,
    int Priority
)

Add a snap target line

Public function Virtual

void

 

AddPointTarget

(
    const FVector3d& Position,
    int TargetID,
    int Priority
)

Add a snap target point at the given Position

Public function Virtual

void

 

AddPointTarget

(
    const FVector3d& Position,
    int TargetID,
    const FCustomMetric& CustomMetric,
    int Priority
)

Add a snap target point at the given Position

Protected function Virtual

void

 

ClearActiveSnapData()

Protected function

const FSnapT...

 

FindBestSnapInSet

(
    const TArray< FSnapTargetPoint >& ...,
    double& MinMetric,
    int& MinPriority,
    const TFunction< FVector3d...
)

Snap measurement functions

Public function Const

int

 

GetActiveSnapDistanceID()

Public function Const

FVector3d

 

GetActiveSnapFromPoint()

Public function Const

const FLine3...

 

GetActiveSnapLine()

Public function Const

int

 

GetActiveSnapTargetID()

Public function Const

FVector3d

 

GetActiveSnapToPoint()

Public function Const

bool

 

HaveActiveSnap()

Solving output

Public function Const

bool

 

HaveActiveSnapDistance()

Public function Const

bool

 

HaveActiveSnapLine()

Public function Virtual Const

bool

 

IsIgnored

(
    int TargetID
)

Public function Virtual

bool

 

RemoveCircleTargetsByID

(
    int TargetID
)

Remove any line targets with this TargetID

Public function Virtual

void

 

RemoveIgnoreTarget

(
    int TargetID
)

Add given TargetID from the ignore list

Public function Virtual

bool

 

RemoveLineTargetsByID

(
    int TargetID
)

Remove any line targets with this TargetID

Public function Virtual

bool

 

RemovePointTargetsByID

(
    int TargetID
)

Remove any point targets with this TargetID

Public function Virtual

void

 

Reset()

Discard the set of snap points and lines and clear the active snap

Public function Virtual

void

 

ResetActiveSnap()

Clear the active snap

Protected function Virtual

void

 

SetActiveSnapData

(
    const FSnapTargetPoint& TargetPoin...,
    const FVector3d& FromPoint,
    const FVector3d& ToPoint,
    double Metric
)

Protected function

bool

 

TestSnapTarget

(
    const FSnapTargetPoint& Target,
    double MinMetric,
    int MinPriority,
    const TFunction< FVector3d...
)

Classes

Name

Description

Public struct

FCustomMetric

FCustomMetric overrides/modifies the default should-snap-happen metric

Protected struct

FSnapTargetCircle

Protected struct

FSnapTargetLine

Target line that might be snapped to

Protected struct

FSnapTargetPoint

Target point that might be snapped to

Enums

Name

Description

Public enum

ECustomMetricType

SetupECustomMetricType defines how a FCustomMetric should be interpreted

Constants

Name

Description

BaseExternalLineID

Subclasses may have internal TargetID values, so external lines should have IDs larger than this

BaseExternalPointID

Subclasses may have internal TargetID values, so external points should have IDs larger than this

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss