Files
Plugin/Source/SenseGloveCore/Public/SGCore/SGHapticGloveHandProfiles.h
T
Mamadou Babaei ba716b269d * 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:08:41 +01:00

126 lines
3.9 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
*
* An interface to get calibration to / from disk.
*/
#pragma once
#include "Containers/UnrealString.h"
#include "SGHapticGloveHandProfiles.generated.h"
class USGHandProfile;
class USGHapticGlove;
class USGSensorRange;
/**
* A glove developed by SenseGlove, that has hand tracking and/or haptic feedback functionality.
*/
USTRUCT()
struct SENSEGLOVECORE_API FSGHapticGloveHandProfiles
{
GENERATED_BODY()
public:
/**
* Returns the directory where our HandProfiles are stored.
*/
static FString GetProfileDirectory();
/**
* Set the directory where our HandProfiles are stored.
*/
static void SetProfileDirectory(const FString& Directory);
/**
* Access the latest Left Hand Profile from disk.
*/
static void GetLeftHandProfile(UObject* Outer, USGHandProfile*& OutHandProfile);
/**
* Sets the newest Left Hand Profile - also stores it on disk.
*/
static void SetLeftHandProfile(const USGHandProfile* HandProfile);
/**
* Access the latest Right Hand Profile from disk.
*/
static void GetRightHandProfile(UObject* Outer, USGHandProfile*& OutHandProfile);
/**
* Sets the newest Right Hand Profile - also stores it on disk.
*/
static void SetRightHandProfile(const USGHandProfile* HandProfile);
/**
* Retrieve a left- or right handed profile.
*/
static void GetProfile(UObject* Outer, bool bRightHanded, USGHandProfile*& OutHandProfile);
/**
* Store a profile in the global variables and on disk. The profile determines if this is a left or right hand.
*/
static void SetProfile(const USGHandProfile* HandProfile);
/**
* Store a profile in the global variables and on disk. You determine if this is a left or right hand.
*/
static void SetProfile(const USGHandProfile* HandProfile, bool bRightHanded);
/**
* Restore both profiles back to their default values.
*/
static void RestoreDefaults();
/**
* Restore the left- or right hand profiles back to their default values.
*/
static void RestoreDefaults(bool bRightHanded);
/**
* Load the latest profiles from disk. Automatically called when you first try to access a profile.
* Exposed so you can force-reload profiles.
*/
static void TryLoadingFromDisk();
/**
* Stores the last sensor range of a glove.
*/
static bool SaveLastRange(const USGSensorRange* CurrentRange, const USGHapticGlove* ForGlove);
/**
* Loads the last sensor range of a glove.
*/
static bool LoadLastRange(UObject* Outer, const USGHapticGlove* ForGlove, USGSensorRange*& OutLastRange);
};