FToolDataVisualizer

[FToolDataVisualizer](API\Runtime\InteractiveToolsFramework\FToolDataVisualizer) is a utility class for Tool and Gizmo implementations to use to draw 3D lines, points, etc.

Windows
MacOS
Linux

References

Module

InteractiveToolsFramework

Header

/Engine/Source/Runtime/Experimental/InteractiveToolsFramework/Public/ToolDataVisualizer.h

Include

#include "ToolDataVisualizer.h"

Syntax

class FToolDataVisualizer

Remarks

FToolDataVisualizer is a utility class for Tool and Gizmo implementations to use to draw 3D lines, points, etc.

Currently uses PDI drawing but may use different back-ends in the future

Variables

Name Description

Public variable

bool

 

bDepthTested

Should lines be clipped by 3D geometry, or should they be drawn with quasi-transparency

Protected variable

bool

 

bHaveCameraState

Protected variable

FViewCameraStat...

 

CameraState

Protected variable

FPrimitiveDrawI...

 

CurrentPDI

We use this for drawing, extracted in InitializeFrame

Public variable

float

 

DepthBias

Depth bias applied to lines

Public variable

FLinearColor

 

LineColor

Default color used for drawing lines

Public variable

float

 

LineThickness

Default thickness used for drawing lines

Public variable

FLinearColor

 

PointColor

Default color used for drawing points

Public variable

float

 

PointSize

Default size used for drawing points

Protected variable

FTransform

 

TotalTransform

Protected variable

TArray< FTransf...

 

TransformStack

Constructors

Name Description

Public function

FToolDataVisualizer()

Destructors

Name Description

Public function Virtual

~FToolDataVisualizer()

Functions

Name Description

Public function

void

 

BeginFrame

(
    IToolsContextRenderAPI* Render...,
    const FViewCameraState& CameraStat...
)

Frame initialization/cleanupThis must be called every frame to allow Visualizer to extract necessary rendering data/objects

Public function

void

 

BeginFrame

(
    IToolsContextRenderAPI* Render...
)

This must be called every frame to allow Visualizer to extract necessary rendering data/objects

Public function

void

 

DrawCircle

(
    const PointType& Position,
    const PointType& Normal,
    float Radius,
    int Steps,
    const FLinearColor& Color,
    float LineThicknessIn,
    bool bDepthTestedIn
)

Draw a 3D circle at given position/normal with the given parameters.

Public function

void

 

DrawLine

(
    const PointType& A,
    const PointType& B
)

Drawing functionsDraw a line with default parameters

Public function

void

 

DrawLine

(
    const PointType& A,
    const PointType& B,
    const FLinearColor& Color
)

Draw a line with the given Color, otherwise use default parameters

Public function

void

 

DrawLine

(
    const PointType& A,
    const PointType& B,
    const FLinearColor& Color,
    float LineThicknessIn
)

Draw a line with the given Color and Thickness, otherwise use default parameters

Public function

void

 

DrawLine

(
    const PointType& A,
    const PointType& B,
    const FLinearColor& Color,
    float LineThicknessIn,
    bool bDepthTestedIn
)

Draw a line with the given parameters

Public function

void

 

DrawPoint

(
    const PointType& Position
)

Draw a point with default parameters

Public function

void

 

DrawPoint

(
    const PointType& Position,
    const FLinearColor& Color
)

Draw a point with the given Color, otherwise use default parameters

Public function

void

 

DrawPoint

(
    const PointType& Position,
    const FLinearColor& Color,
    float PointSizeIn,
    bool bDepthTestedIn
)

Draw a point with the given parameters

Public function

void

 

DrawSquare

(
    const PointType& Center,
    const PointType& SideA,
    const PointType& SideB
)

Public function

void

 

DrawSquare

(
    const PointType& Center,
    const PointType& SideA,
    const PointType& SideB,
    const FLinearColor& Color,
    float LineThicknessIn,
    bool bDepthTestedIn
)

Public function

void

 

DrawViewFacingCircle

(
    const PointType& Position,
    float Radius,
    int Steps,
    const FLinearColor& Color,
    float LineThicknessIn,
    bool bDepthTestedIn
)

Draw a 3D circle at given position/normal with the given parameters.

Public function

void

 

DrawWireBox

(
    const FBox& Box
)

Draw a 3D box, parameterized the same as the 3D circle but extruded by Height

Public function

void

 

DrawWireBox

(
    const FBox& Box,
    const FLinearColor& Color,
    float LineThicknessIn,
    bool bDepthTestedIn
)

Public function

void

 

DrawWireCylinder

(
    const PointType& Position,
    const PointType& Normal,
    float Radius,
    float Height,
    int Steps
)

Draw a 3D cylinder, parameterized the same as the 3D circle but extruded by Height

Public function

void

 

DrawWireCylinder

(
    const PointType& Position,
    const PointType& Normal,
    float Radius,
    float Height,
    int Steps,
    const FLinearColor& Color,
    float LineThicknessIn,
    bool bDepthTestedIn
)

Draw a 3D cylinder, parameterized the same as the 3D circle but extruded by Height

Public function

void

 

EndFrame()

This should be called at the end of every frame to allow for necessary cleanup

Protected function Virtual

void

 

InternalDrawCircle

(
    const FVector& Position,
    const FVector& Normal,
    float Radius,
    int Steps,
    const FLinearColor& Color,
    float LineThickness,
    bool bDepthTested
)

Actually does the circle drawing

Protected function Virtual

void

 

InternalDrawSquare

(
    const FVector& Center,
    const FVector& SideA,
    const FVector& SideB,
    const FLinearColor& Color,
    float LineThickness,
    bool bDepthTested
)

Actually does the square drawing

Protected function Virtual

void

 

InternalDrawTransformedLine

(
    const FVector& A,
    const FVector& B,
    const FLinearColor& Color,
    float LineThickness,
    bool bDepthTested
)

Actually does the line drawing; assumes A and B are already transformed

Protected function Virtual

void

 

InternalDrawTransformedPoint

(
    const FVector& Position,
    const FLinearColor& Color,
    float PointSize,
    bool bDepthTested
)

Actually does the point drawing; assumes Position is already transformed

Protected function Virtual

void

 

InternalDrawViewFacingCircle

(
    const FVector& Position,
    float Radius,
    int Steps,
    const FLinearColor& Color,
    float LineThickness,
    bool bDepthTested
)

Actually does the circle drawing

Protected function Virtual

void

 

InternalDrawWireBox

(
    const FBox& Box,
    const FLinearColor& Color,
    float LineThickness,
    bool bDepthTested
)

Actually does the box drawing

Protected function Virtual

void

 

InternalDrawWireCylinder

(
    const FVector& Position,
    const FVector& Normal,
    float Radius,
    float Height,
    int Steps,
    const FLinearColor& Color,
    float LineThickness,
    bool bDepthTested
)

Actually does the cylinder drawing

Public function

void

 

PopAllTransforms()

Clear the transform stack to identity

Public function

void

 

PopTransform()

Pop a transform from the transform stack

Public function

void

 

PushTransform

(
    const FTransform& Transform
)

Push a Transform onto the transform stack

Public function

void

 

SetLineParameters

(
    const FLinearColor& Color,
    float Thickness
)

ParametersUpdate the default line color and thickness

Public function

void

 

SetPointParameters

(
    const FLinearColor& Color,
    float Size
)

Update the default point color and size

Public function

void

 

SetTransform

(
    const FTransform& Transform
)

Transform supportClear transform stack and push the given Transform

Public function

FVector

 

TransformN

(
    const FVector& Normal
)

Public function

FVector

 

TransformP

(
    const FVector& Point
)

Public function

FVector

 

TransformV

(
    const FVector& Vector
)

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