Files
Plugin/Source/SenseGloveCore/Public/SGCore/SGNovaGloveHandProfile.h
T
Mamadou Babaei a17b63bb0a * Expose SenseGloveTypes as a public dependency in SenseGloveConnect and
SenseGloveCore modules, so that the C++ users of the API don't need to
 explicitly add it as a dependency
* Clean up the redundant headers/modules dependency from SGCore headers
* Fix RunUAT build issues for Epic Store submission
2022-11-25 15:09:37 +01:00

158 lines
4.2 KiB
C++

/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
* Input for Nova kinematics to calculate a HandPose.
* Output of calibration algorithms.
*/
#pragma once
#include "Containers/UnrealString.h"
#include "HAL/Platform.h"
#include "Templates/UniquePtr.h"
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGNovaGloveHandProfile.generated.h"
class FSGNovaGloveHandProfileImpl;
class USGHandInterpolator;
/**
* Contains user-specific data for the Nova to convert sensor data into a hand pose.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGNovaGloveHandProfile final : public UObject
{
GENERATED_BODY()
public:
static USGNovaGloveHandProfile* NewNovaGloveHandProfile(
UObject* Outer, const FSGNovaGloveHandProfileImpl& NovaGloveHandProfileImpl);
public:
/**
* The default constructor.
*/
static USGNovaGloveHandProfile* NewNovaGloveHandProfile(UObject* Outer);
/**
* Create a new instance of a Nova-Profile.
*/
static USGNovaGloveHandProfile* NewNovaGloveHandProfile(
UObject* Outer, bool bRightHanded, const USGHandInterpolator* Interpolator);
public:
/**
* Creates a default Nova Profile for a left or right hand.
*/
static USGNovaGloveHandProfile* Default(UObject* Outer, bool bRightHanded);
/**
* Convert a string notation of a NovaGloveHandProfile into a new instance.
*/
static USGNovaGloveHandProfile* Deserialize(UObject* Outer, const FString& SerializedString);
private:
struct FImpl;
struct FImplDeleter
{
void operator()(const FImpl* P) const;
};
TUniquePtr<FImpl, FImplDeleter> Pimpl;
FImplDeleter PimplDeleter;
public:
/**
* The default constructor.
*/
USGNovaGloveHandProfile();
/**
* Create a new instance of a Nova-Profile.
*/
USGNovaGloveHandProfile(bool bRightHanded, const USGHandInterpolator* Interpolator);
public:
/**
* The cast from underlying type constructor.
*/
explicit USGNovaGloveHandProfile(const FSGNovaGloveHandProfileImpl& NovaGloveHandProfileImpl);
public:
/**
* The destructor.
*/
virtual ~USGNovaGloveHandProfile() override;
protected:
/**
* Allows to set the underlying object after construction.
*/
void SetNovaGloveHandProfileImpl(const FSGNovaGloveHandProfileImpl& NovaGloveHandProfileImpl);
public:
/**
* The cast to underlying type method.
*/
const FSGNovaGloveHandProfileImpl& ToNovaGloveHandProfileImpl() const;
public:
/**
* Whether this profile was created for a right- or left hand.
*/
bool IsRight() const;
/**
* Interpolation sets to convert sensor data into a hand pose.
*/
USGHandInterpolator* GetInterpolationSet(UObject* Outer) const;
public:
/**
*
*/
bool Equals(const USGNovaGloveHandProfile* NovaGloveHandProfile) const;
/**
*
*/
void Reset();
public:
/**
* Convert this NovaGloveHandProfile into a string notation so it can be stored on disk.
*/
FString SGSerialize() const;
};