Files
Plugin/Source/SenseGloveCoreKismet/Private/SGCoreKismet/SGHandProfileKismetLibrary.cpp
T

140 lines
4.6 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
*
*
*/
#include "SGCoreKismet/SGHandProfileKismetLibrary.h"
#include "SGCore/SGHandProfile.h"
USGHandProfile* USGHandProfileKismetLibrary::MakeHandProfile(UObject* WorldContextObject)
{
return USGHandProfile::NewHandProfile(WorldContextObject);
}
USGHandProfile* USGHandProfileKismetLibrary::MakeHandProfile_bRH_SGHP_NGHP(
UObject* WorldContextObject,
const bool bRightHanded,
const USGSenseGloveHandProfile* SenseGloveHandProfile, const USGNovaGloveHandProfile* NovaGloveHandProfile)
{
return USGHandProfile::NewHandProfile(WorldContextObject,
bRightHanded, SenseGloveHandProfile, NovaGloveHandProfile);
}
USGHandProfile* USGHandProfileKismetLibrary::Default(UObject* WorldContextObject, const bool bRightHanded)
{
return USGHandProfile::Default(WorldContextObject, bRightHanded);
}
USGHandProfile* USGHandProfileKismetLibrary::Deserialize(UObject* WorldContextObject, const FString& SerializedString)
{
return USGHandProfile::Deserialize(WorldContextObject, SerializedString);
}
FString USGHandProfileKismetLibrary::GetProfileDirectory()
{
return USGHandProfile::GetProfileDirectory();
}
FString USGHandProfileKismetLibrary::GetLeftHandFileName()
{
return USGHandProfile::GetLeftHandFileName();
}
FString USGHandProfileKismetLibrary::GetRightHandFileName()
{
return USGHandProfile::GetRightHandFileName();
}
FString USGHandProfileKismetLibrary::GetProfileFileName(const bool bRightHanded)
{
return USGHandProfile::GetProfileFileName(bRightHanded);
}
bool USGHandProfileKismetLibrary::GetLatestProfile(
UObject* WorldContextObject, const bool bRightHanded, USGHandProfile*& OutLatestProfile)
{
return USGHandProfile::GetLatestProfile(WorldContextObject, bRightHanded, OutLatestProfile);
}
bool USGHandProfileKismetLibrary::StoreProfile(const USGHandProfile* ProfileToStore)
{
return USGHandProfile::StoreProfile(ProfileToStore);
}
bool USGHandProfileKismetLibrary::ResetCalibration_bRightHanded_bOnDisk(const bool bRightHanded, const bool bOnDisk)
{
return USGHandProfile::ResetCalibration(bRightHanded, bOnDisk);
}
void USGHandProfileKismetLibrary::ResetCalibration_bObDisk(const bool bOnDisk)
{
/// NOTE
/// Due to overload method with a default parameter value, the compiler will get confused and stops with the error:
/// "call to 'ResetCalibration' is ambiguous"
/// So:
void (*RC)(bool) = &USGHandProfile::ResetCalibration;
RC(bOnDisk);
}
bool USGHandProfileKismetLibrary::IsRight(const USGHandProfile* HandProfile)
{
return HandProfile->IsRight();
}
USGSenseGloveHandProfile* USGHandProfileKismetLibrary::GetSenseGloveHandProfile(
UObject* WorldContextObject, const USGHandProfile* HandProfile)
{
return HandProfile->GetSenseGloveHandProfile(WorldContextObject);
}
USGNovaGloveHandProfile* USGHandProfileKismetLibrary::GetNovaGloveHandProfile(
UObject* WorldContextObject, const USGHandProfile* HandProfile)
{
return HandProfile->GetNovaGloveHandProfile(WorldContextObject);
}
bool USGHandProfileKismetLibrary::Equals(const USGHandProfile* A, const USGHandProfile* B)
{
return A->Equals(B);
}
void USGHandProfileKismetLibrary::Reset(USGHandProfile* HandProfile)
{
HandProfile->Reset();
}
FString USGHandProfileKismetLibrary::SGSerialize(const USGHandProfile* HandProfile)
{
return HandProfile->SGSerialize();
}