I3DHDrawingEditor.h Source File#
|
instant3Dhub
|
I3DHDrawingEditor.h
Go to the documentation of this file.
58DECLARE_DYNAMIC_DELEGATE_ThreeParams(FI3DHDrawingFinalizedDelegate, const FI3DHDrawingResult&, DrawingResult, const FI3DHDrawingProperties&, DrawingProperties, const TArray<FI3DHSplineData>&, Splines);
61class INSTANT3DHUB_EXPERIMENTAL(0.0.27, "The instant3Dhub Drawings feature is available as a preview and is actively under development.") AI3DHDrawingEditor;
81UCLASS(Experimental, Abstract, NotPlaceable, meta = (DisplayName = "I3DH DrawingEditor (Experimental)"))
82class INSTANT3DHUBDRAWINGS_API AI3DHDrawingEditor
125 UFUNCTION(BlueprintCallable, meta = (DefaultToSelf = "HubConnector", DeterminesOutputType = "DrawingClass"), Category = "{instant3DhubDrawings}")
126 static AI3DHDrawingEditor* CreateDrawingEditor(AI3DHConnector* HubConnector, TSubclassOf<AI3DHDrawingEditor> DrawingClass);
143 UFUNCTION(BlueprintCallable, meta = (AutoCreateRefTerm = "Color"), Category = "{instant3DhubDrawings}")
175 INSTANT3DHUB_DEPRECATED(1.1.0, "Will be removed because it is not supported for LineStrip drawings.")
180 UFUNCTION(BlueprintCallable, Category = "{instant3DhubDrawings}", meta = (DisplayName = "Set Omit Stroke Start and End Joints (Deprecated)"))
284 void CreateHubDrawingAndDestroy(const FString& Name, TUniqueFunction<void(int32 DrawingHandle, EI3DHErrorCode ErrorCode)> OnComplete);
414 virtual bool IsReadyForFinishDestroy() override { return Super::IsReadyForFinishDestroy() && (!AsyncTaskFence.IsValid() || AsyncTaskFence->GetRefCount() <= 1); }
418 bool ShouldShowCursor() const { return GetDrawingEditorMode() == EI3DHDrawingEditorMode::Draw; }
420 void InsertPointInternal(const FVector& RelativeLocation, const int32 SplineIndex, const int32 PointIndex);
421 void RemovePointsInternal(const int32 SplineIndex, const int32 StartPointIndex, const int32 NumRemovals);
429 bool ShouldCreateCollidersForTriangleMeshDrawings() const { return bCreateCollidersForTriangleMeshDrawings; }
436 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "{instant3DhubDrawings}", AdvancedDisplay)
563UCLASS(Experimental, MinimalAPI, meta = (DisplayName = "I3DH Transient EditableDrawing (Experimental)"))
EI3DHDrawingEditorMode
DrawingEditor Modes describe how the editor visualizes the drawing and what actions are available.
Definition I3DHDrawingEditor.h:32
DECLARE_DYNAMIC_DELEGATE void FI3DHDrawingFinalizedDelegate(const FI3DHDrawingResult &DrawingResult, const FI3DHDrawingProperties &DrawingProperties, const TArray< FI3DHSplineData > &Splines)
Drawing Finalized Delegate Type.
EI3DHErrorCode
Enumeration of Error Codes returned from various instant3Dhub API Calls.
Definition I3DHError.h:16
The HubConnector is the central actor for communication with an instant3Dhub instance in your network...
Definition I3DHConnector.h:214
Actor for creating line-based 3D drawings that sync to instant3Dhub when finished.
Definition I3DHDrawingEditor.h:85
bool AddPoint(const FVector &Location, bool bIsWorldSpace=false)
Adds a Spline point at the given location to the active Spline (actor local space unless bIsWorldSpac...
void AddPointAtCursor()
Adds a Spline point at the cursor position to the active Spline.
double MinimumPointDistance
Minimum world-space distance (Unreal units) between consecutive points added to the active Spline.
Definition I3DHDrawingEditor.h:448
double HoverPointDistance
World-space distance (Unreal units) used to hover/select ControlPoints.
Definition I3DHDrawingEditor.h:452
TArray< int32 > GetFinalizedSplineIndices() const
Returns the indices (into AI3DHDrawingEditor::GetSplines) of all splines that produced exportable geo...
Definition I3DHDrawingEditor.h:372
FString ThumbnailBase64DataURI
Data-URI string, e.g.
Definition I3DHDrawingEditor.h:456
bool bCreateCollidersForTriangleMeshDrawings
Whether to create complex colliders for triangle mesh drawings.
Definition I3DHDrawingEditor.h:444
void BeginNewSplineSlice()
Begins a new Slice; the next points belong to this Slice.
void SetDrawingMode(EI3DHDrawingEditorMode InDrawingMode)
Sets the DrawingEditor Mode.
bool bCreateLineStripDrawings
If enabled, export LINE_STRIP drawings.
Definition I3DHDrawingEditor.h:437
bool SelectNearestPoint(const FVector &Location, bool bIsWorldSpace=false)
Selects the nearest endpoint (start or end) within AI3DHDrawingEditor::HoverPointDistance of the give...
AI3DHConnector * GetHubConnector() const
Returns the parent hub connector.
Definition I3DHDrawingEditor.h:133
FLinearColor GetDrawingColor() const
Retrieves the color currently used for drawing.
const FString & GetEditedDrawingName() const
Returns the name of drawing if this editor is editing an existing drawing.
Definition I3DHDrawingEditor.h:173
void InitFromSplines(const TArray< FI3DHSplineData > &InSplines)
Clears all Splines and initializes the editor from the provided Splines.
void FinalizeDrawing(TUniqueFunction< void(FI3DHDrawingResult)> OnComplete)
Finalizes the drawing.
int32 GetNumFinalizedSplines() const
Returns the number of splines that produced exportable geometry during finalize.
Definition I3DHDrawingEditor.h:360
int32 NumSplines() const
Returns the number of Splines the drawing consists of.
const TArray< FI3DHSplineData > & GetSplines() const
Returns all Spline data currently in the editor.
Definition I3DHDrawingEditor.h:333
void SetDrawingScale(const double &Scale)
Sets the scale used for drawing and applies it to the active Spline.
bool RemoveLastSplineSlice()
Removes the last Slice from the active Spline.
bool WasSplineFinalized(int32 SplineIndex) const
Tests whether the given editor spline index produced exportable geometry during the last finalize.
Definition I3DHDrawingEditor.h:393
void SetDrawingColor(const FLinearColor &Color)
Sets the color used for drawing and applies it to the active Spline.
double GetDrawingScale() const
Retrieves the scale currently used for drawing.
void BeginNewSpline()
Begins a new Spline that is discontinuous from the previous Spline.
void CreateHubDrawingAndDestroy(const FString &Name, TUniqueFunction< void(int32 DrawingHandle, EI3DHErrorCode ErrorCode)> OnComplete)
Finalizes the drawing, synchronizes it with instant3Dhub and destroys this actor.
const TBitArray & GetFinalizedSplineMask() const
Returns the bitmask of finalized splines.
Definition I3DHDrawingEditor.h:405
void SetShowActiveSliceControlPoints(bool bNewShowActiveSliceControlPoints)
Controls whether all ControlPoints belonging to the active Slice should be visualized.
static AI3DHDrawingEditor * CreateDrawingEditor(AI3DHConnector *HubConnector, TSubclassOf< AI3DHDrawingEditor > DrawingClass)
Creates an actor which can be used for drawing and syncing to instant3Dhub when finished.
EI3DHDrawingEditorMode GetDrawingEditorMode() const
Returns the current DrawingEditor Mode.
Definition I3DHDrawingEditor.h:298
void SetOmitStrokeStartAndEndJoints(bool bNewOmitJoints)
Controls whether the first and last sample point of Splines are rendered with a joint.
void Clear()
Removes all Splines and points from this drawing, leaving it empty.
bool SelectNearestPointAtCursor()
Selects the nearest endpoint (start or end) within AI3DHDrawingEditor::HoverPointDistance of the curr...
This actor is the scene representation of drawings in the session.
Definition I3DHDrawing.h:47
Interface that can be implemented to provide drawing editing functionality.
Definition I3DHDataTypes.h:2261
Provides access to geometry of an instant3Dhub drawing.
Definition I3DHDataTypes.h:2134
#define INSTANT3DHUB_DEPRECATED(Version, Message)
Macro for marking up deprecated code, functions and types.
Definition I3DHVersion.h:203
#define INSTANT3DHUB_EXPERIMENTAL(Version, Message)
Macro for marking up experimental code, functions and types.
Definition I3DHVersion.h:246
Encapsulates the result of an instant3Dhub drawing.
Definition I3DHDataTypes.h:2093
Raw data of a single spline created by the AI3DHDrawingEditor.
Definition I3DHSplineData.h:21
Generated by