Navigation
API > API/Plugins > API/Plugins/UVEditorTools
UBasic2DLineSetComponent and UBasic3DLineSetComponent are components that draw a set of lines as small squares. The 2D version stores XY coordinates with Z set to 0 whereas the 3D version stores XYZ coordinates. All lines have the same color, size, and depth bias based on what is set via SetLineSetParameters(). The lines are drawn as two triangles, i.e. a square, orthogonal to the view direction. The actual line size is calculated in the shader using a custom material.
Before inserting any lines via AddElement(), the maximum number of lines that will be added needs to be declared via ReserveElements(). The actual number of lines that were added is available via NumElements().
To support both 2D and 3D with minimal code duplication, the line set components are composed from the UBasicLineSetComponentBase class for the component specific functionality, and an instantiation of the TBasicElementSet template class for either FVector2f or FVector3f that encapsulates all line specific functionality. The final derived classes UBasic2DLineSetComponent and UBasic3DLineSetComponent contain identical boilerplate code to facilitate calls that need to go both to the component base class and the line base class, e.g. Clear() will both mark the component as dirty and delete all lines. Base class for component specific functionality independent of the type of line stored in the component.
| Name | UBasicLineSetComponentBase |
| Type | class |
| Header File | /Engine/Plugins/Editor/UVEditor/Source/UVEditorTools/Public/Drawing/BasicLineSetComponent.h |
| Include Path | #include "Drawing/BasicLineSetComponent.h" |
Syntax
UCLASS (MinimalAPI)
class UBasicLineSetComponentBase : public UMeshComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → UPrimitiveComponent → UMeshComponent → UBasicLineSetComponentBase
Implements Interfaces
- IAsyncPhysicsStateProcessor
- IInterface_AssetUserData
- IInterface_AsyncCompilation
- INavRelevantInterface
- IPhysicsComponent
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UBasicLineSetComponentBase() |
Drawing/BasicLineSetComponent.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ClearComponent() |
Clears the component state and marks component as dirty. | Drawing/BasicLineSetComponent.h | |
void SetColor
(
FColor InColor |
Set per line material Line Color parameter that is uniform for all lines | Drawing/BasicLineSetComponent.h | |
void SetLineMaterial
(
UMaterialInterface* InLineMaterial |
Specify material that handles lines. | Drawing/BasicLineSetComponent.h | |
void SetLineSetParameters
(
FColor InColor, |
Set per line material parameters that are uniform for all lines. | Drawing/BasicLineSetComponent.h | |
void SetLineThickness
(
float InSize |
Set per line material Line Size/Thickness parameter that is uniform for all lines | Drawing/BasicLineSetComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual int32 GetNumMaterials() |
Drawing/BasicLineSetComponent.h | ||
FBoxSphereBounds UpdateComponentBounds
(
const FTransform& LocalToWorld, |
Update component bounds using a provided function that determines the box around all line positions. | Drawing/BasicLineSetComponent.h |