Files
Plugin/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveHandProfilesKismetLibrary.h
T

146 lines
5.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
*
* An interface to get calibration to / from disk.
*/
#pragma once
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGHapticGloveHandProfilesKismetLibrary.generated.h"
class USGHandProfile;
class USGHapticGlove;
class USGSensorRange;
/**
* A glove developed by SenseGlove, that has hand tracking and/or haptic feedback functionality.
*/
UCLASS(meta=(ScriptName = "SesneGloveHapticGloveHandProfilesKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGHapticGloveHandProfilesKismetLibrary final : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/**
* Returns the directory where our HandProfiles are stored.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles")
static FString GetProfileDirectory();
/**
* Set the directory where our HandProfiles are stored.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles")
static void SetProfileDirectory(const FString& Directory);
/**
* Access the latest Left Hand Profile from disk.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles",
meta=(WorldContext="WorldContextObject"))
static void GetLeftHandProfile(UObject* WorldContextObject, USGHandProfile*& OutHandProfile);
/**
* Sets the newest Left Hand Profile - also stores it on disk.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles")
static void SetLeftHandProfile(const USGHandProfile* HandProfile);
/**
* Access the latest Right Hand Profile from disk.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles",
meta=(WorldContext="WorldContextObject"))
static void GetRightHandProfile(UObject* WorldContextObject, USGHandProfile*& OutHandProfile);
/**
* Sets the newest Right Hand Profile - also stores it on disk.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles")
static void SetRightHandProfile(const USGHandProfile* HandProfile);
/**
* Retrieve a left- or right handed profile.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles",
meta=(WorldContext="WorldContextObject"))
static void GetProfile(UObject* WorldContextObject, 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.
*/
UFUNCTION(BlueprintCallable, DisplayName="Set Profile", Category="SenseGlove | Core | Haptic Glove Hand Profiles")
static void SetProfile_HP(const USGHandProfile* HandProfile);
/**
* Store a profile in the global variables and on disk. You determine if this is a left or right hand.
*/
UFUNCTION(BlueprintCallable, DisplayName="Set Profile", Category="SenseGlove | Core | Haptic Glove Hand Profiles")
static void SetProfile_HP_bRH(const USGHandProfile* HandProfile, bool bRightHanded);
/**
* Restore both profiles back to their default values.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles")
static void RestoreDefaults();
/**
* Restore the left- or right hand profiles back to their default values.
*/
UFUNCTION(BlueprintCallable, DisplayName="Restore Defaults",
Category="SenseGlove | Core | Haptic Glove Hand Profiles")
static void RestoreDefaults_bRH(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.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles")
static void TryLoadingFromDisk();
/**
* Stores the last sensor range of a glove.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles")
static bool SaveLastRange(const USGSensorRange* CurrentRange, const USGHapticGlove* ForGlove);
/**
* Loads the last sensor range of a glove.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove Hand Profiles",
meta=(WorldContext="WorldContextObject"))
static bool LoadLastRange(UObject* WorldContextObject,
const USGHapticGlove* ForGlove, USGSensorRange*& OutLastRange);
};