Files
UnrealEngineUWP/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Public/MinVolumeSphere3.h
ryan schmidt 6437ecc4a1 GeometryCore: replace all usage of GeometryCore FVector3<T> with TVector<T>, remove FVector3<T> and GVector4<T>
#rb none
#rnx
#jira none
#preflight 614ce33574f7e70001ea822b

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 17617027 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 17617043 by ryan schmidt in ue5-release-engine-test branch]
2021-09-23 19:38:55 -04:00

49 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "VectorTypes.h"
#include "SphereTypes.h"
#include "Templates/PimplPtr.h"
namespace UE {
namespace Geometry {
using namespace UE::Math;
template <typename RealType> struct TMinVolumeSphere3Internal;
/**
* Calculate a Minimal-Volume Sphere for a set of 3D points.
*
* @warning Currently this processes input points in a randomized order so the results are not strictly deterministic. In particular if it fails you might try calling it again...
*/
template<typename RealType>
class TMinVolumeSphere3
{
public:
/**
* Calculate the minimal sphere for the given point set.
* @param bUseExactComputation If true, high-precision Rational number types are used for the calculation, rather than doubles. This is slower but more precise.
* @return true if minimal sphere was found
*/
bool Solve(int32 NumPoints, TFunctionRef<TVector<RealType>(int32)> GetPointFunc, bool bUseExactComputation = false);
/** @return true if minimal box is available */
bool IsSolutionAvailable() const;
/** @return minimal sphere in SphereOut */
void GetResult(TSphere3<RealType>& SphereOut);
protected:
void Initialize(int32 NumPoints, bool bUseExactComputation);
TPimplPtr<TMinVolumeSphere3Internal<RealType>> Internal;
};
typedef TMinVolumeSphere3<float> FMinVolumeSphere3f;
typedef TMinVolumeSphere3<double> FMinVolumeSphere3d;
} // end namespace UE::Geometry
} // end namespace UE