Files
matija kecman d8e6b45610 Add a reusable geometry selection visualization system intended to be used in modeling tools with minimal boilerplate
This CL was reviewed here: https://p4-swarm.epicgames.net/reviews/26051575 but needs to be merged into //Fortnite/Release-26.00, not //Fortnite/Main

#jira UE-183457
#rb ryan.schmidt, nathan.mitchell

[CL 26180658 by matija kecman in ue5-main branch]
2023-06-22 09:28:20 -04:00

55 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "BoxTypes.h"
#include "HAL/Platform.h" // Required by MODELINGCOMPONENTS_API
class UPreviewGeometry;
class UGeometrySelectionVisualizationProperties;
namespace UE::Geometry
{
struct FGeometrySelection;
class FDynamicMesh3;
class FGroupTopology;
/**
* Initialize the geometry selection preview geometry. Call this in your tool Setup function
*/
void MODELINGCOMPONENTS_API InitializeGeometrySelectionVisualization(
UPreviewGeometry* PreviewGeom,
UGeometrySelectionVisualizationProperties* Settings,
const FDynamicMesh3& SourceMesh,
const FGeometrySelection& Selection,
const FGroupTopology* GroupTopology = nullptr,
const FGeometrySelection* TriangleVertexSelection = nullptr,
const TArray<int>* TriangleROI = nullptr,
const FTransform* ApplyTransform = nullptr);
/**
* Update the geometry selection preview geometry according to Settings. Call this in your tool OnTick function
*/
void MODELINGCOMPONENTS_API UpdateGeometrySelectionVisualization(
UPreviewGeometry* PreviewGeom,
UGeometrySelectionVisualizationProperties* Settings);
/**
* Computes the axis aligned bounding box from a given triangle region of interest, useful to compute a DepthBias
*/
FAxisAlignedBox3d MODELINGCOMPONENTS_API ComputeBoundsFromTriangleROI(
const FDynamicMesh3& Mesh,
const TArray<int32>& TriangleROI,
const FTransform3d* Transform = nullptr);
/**
* Computes the axis aligned bounding box from a given vertex region of interest, useful to compute a DepthBias
*/
FAxisAlignedBox3d MODELINGCOMPONENTS_API ComputeBoundsFromVertexROI(
const FDynamicMesh3& Mesh,
const TArray<int32>& VertexROI,
const FTransform3d* Transform = nullptr);
} // namespace UE::Geometry