Drawing API

instant3Dhub: Drawing API
instant3Dhub

Detailed Description

Drawings are freeform 2D or 3D markups that are stored in the session.

In addition to this API the Instant3DHubDrawings module provides many tools to help you build a first-class drawing experience in Unreal. See AI3DHDrawingEditor for more information.

Classes

class  FI3DHDrawingAPI
 

Functions

UMaterialInterfaceAI3DHConnector::GetDrawingMaterial (FLinearColor Color)
 
class AI3DHDrawingAI3DHConnector::FindDrawingActor (int DrawingHandle)
 
void AI3DHConnector::SetClipDrawingsByClipPlane (const bool bClipDrawingsByClipPlaneEnabled)
 
bool AI3DHConnector::GetClipDrawingsByClipPlane ()
 
void FI3DHDrawingAPI::CreateDrawing (FI3DHDrawingResult DrawingResult, const FI3DHDrawingProperties &Properties, TUniqueFunction< void(int DrawingHandle, EI3DHErrorCode ErrorCode)> OnComplete)
 
virtual void FI3DHDrawingAPI::CreateDrawing (FI3DHDrawingResult DrawingResult, const FI3DHDrawingProperties &Properties, TSubclassOf< class AI3DHDrawing > OverrideDrawingClass, TUniqueFunction< void(int DrawingHandle, EI3DHErrorCode ErrorCode)> OnComplete)=0
 
virtual void FI3DHDrawingAPI::RemoveDrawing (int DrawingHandle, TUniqueFunction< void(EI3DHRemoveState RemoveState, EI3DHErrorCode ErrorCode)> OnComplete)=0
 
virtual void FI3DHDrawingAPI::ChangeDrawing (int DrawingHandle, const FI3DHDrawingProperties &Properties, TUniqueFunction< void(const FI3DHDrawingProperties &Properties, EI3DHErrorCode ErrorCode)> OnComplete)=0
 
virtual void FI3DHDrawingAPI::GetDrawings (TUniqueFunction< void(TArray< int > Drawings, EI3DHErrorCode ErrorCode)> OnComplete)=0
 
virtual void FI3DHDrawingAPI::RequestDrawingData (int DrawingHandle, bool bSkipDrawingResultParsing, TUniqueFunction< void(FI3DHDrawingData DrawingData, EI3DHErrorCode ErrorCode)> OnComplete)=0
 

Variables

TObjectPtr< UMaterialInterfaceAI3DHConnector::DrawingBaseMaterial {nullptr}
 
float AI3DHConnector::DrawingSyncHz = 1.0
 

Function Documentation

◆ ChangeDrawing()

virtual void FI3DHDrawingAPI::ChangeDrawing ( int DrawingHandle,
const FI3DHDrawingProperties & Properties,
TUniqueFunction< void(const FI3DHDrawingProperties &Properties, EI3DHErrorCode ErrorCode)> OnComplete )
pure virtual

Change the properties of a drawing.

Parameters
DrawingHandleHandle of the drawing.
PropertiesThe properties.
OnCompleteCallback called on completion:

◆ CreateDrawing() [1/2]

virtual void FI3DHDrawingAPI::CreateDrawing ( FI3DHDrawingResult DrawingResult,
const FI3DHDrawingProperties & Properties,
TSubclassOf< class AI3DHDrawing > OverrideDrawingClass,
TUniqueFunction< void(int DrawingHandle, EI3DHErrorCode ErrorCode)> OnComplete )
pure virtual

Creates a drawing in the instant3Dhub session and spawns an Actor of provided OverrideDrawingClass if successful.

Parameters
DrawingResultThe drawing result containing the drawing geometry.
PropertiesThe drawing properties.
OverrideDrawingClassA subclass of AI3DHDrawing to use when spawning the Drawing Actor.
OnCompleteCallback called on completion with the following arguments.

◆ CreateDrawing() [2/2]

void FI3DHDrawingAPI::CreateDrawing ( FI3DHDrawingResult DrawingResult,
const FI3DHDrawingProperties & Properties,
TUniqueFunction< void(int DrawingHandle, EI3DHErrorCode ErrorCode)> OnComplete )
inline

Creates a drawing in the instant3Dhub session and spawns an Actor of type AI3DHDrawing if successful.

Parameters
DrawingResultThe drawing result containing the drawing geometry.
PropertiesThe drawing properties.
OnCompleteCallback called on completion:

◆ FindDrawingActor()

class AI3DHDrawing * AI3DHConnector::FindDrawingActor ( int DrawingHandle)

Search the Drawing Actor for the provided DrawingHandle.

Note
Must be called from the game thread.
Parameters
DrawingHandleHandle of the drawing.
Returns
Nullptr if it fails, else the found drawing actor.

◆ GetClipDrawingsByClipPlane()

bool AI3DHConnector::GetClipDrawingsByClipPlane ( )

Whether Drawings are clipped by ClipPlanes.

Note
This only applies to Unreal Engine and is not synced with the instant3Dhub Session.
Returns
True if drawings are clipped by ClipPlanes, false if not.

◆ GetDrawingMaterial()

UMaterialInterface * AI3DHConnector::GetDrawingMaterial ( FLinearColor Color)

Retrieve a drawing material with the specified color from the internal cache.

If no material is found, it is created for you.

Note
Must be called from the game thread.
Parameters
ColorColor of the Drawing.
Returns
The drawing material.

◆ GetDrawings()

virtual void FI3DHDrawingAPI::GetDrawings ( TUniqueFunction< void(TArray< int > Drawings, EI3DHErrorCode ErrorCode)> OnComplete)
pure virtual

Gets a list of all drawing handles.

Parameters
OnCompleteCallback called on completion:

◆ RemoveDrawing()

virtual void FI3DHDrawingAPI::RemoveDrawing ( int DrawingHandle,
TUniqueFunction< void(EI3DHRemoveState RemoveState, EI3DHErrorCode ErrorCode)> OnComplete )
pure virtual

Removes a drawing matching the specified drawing handle.

Parameters
DrawingHandleHandle of the drawing.
OnCompleteCallback called on completion.

◆ RequestDrawingData()

virtual void FI3DHDrawingAPI::RequestDrawingData ( int DrawingHandle,
bool bSkipDrawingResultParsing,
TUniqueFunction< void(FI3DHDrawingData DrawingData, EI3DHErrorCode ErrorCode)> OnComplete )
pure virtual

Request the drawing data of a specified Drawing.

Parameters
DrawingHandleHandle of the drawing.
bSkipDrawingResultParsingTrue to skip drawing result parsing. In this case the result only contains the Drawing Properties.
OnCompleteCallback called on completion:

◆ SetClipDrawingsByClipPlane()

void AI3DHConnector::SetClipDrawingsByClipPlane ( const bool bClipDrawingsByClipPlaneEnabled)

Use to globally control whether Drawings are clipped by ClipPlanes.

Note
This only applies to Unreal Engine and is not synced with the instant3Dhub Session.
Parameters
bClipDrawingsByClipPlaneEnabledTrue to enable drawings being clipped by ClipPlanes, false to disable it.

Variable Documentation

◆ DrawingBaseMaterial

TObjectPtr<UMaterialInterface> AI3DHConnector::DrawingBaseMaterial {nullptr}

Default material to render drawings.

Requires a specific layout (e.g. for creating dynamic instances).

Note
Use the material delivered with the plugin or at least copy it for support.