|
enum | MainFileKeys { fileSettings
, tools
} |
| The top level keys we are expecting to read in the config file.
|
|
enum | FileSettingsKeys { units
} |
| The current iteration of 'settings' related to the config object, which should contain right-handed information only, but can have metres or millimetres as units.
|
|
enum | ToolKeys { name
, id
, coordinates
} |
| The info we require for each trackable tool definition as specified in ToolTrackingUtils.TrackedTool.
|
|
|
static bool | CheckEnumKeys< TEnum > (JObject jsonObject) |
| Template function to validate if a JObject contains some desired keys.
|
|
static JObject | TryReadingToolConfigJSON (string filepath) |
| Function which returns a properly populated JObject if it matches the expected config file structure for this app.
|
|
static List< TrackedTool > | CreateTrackedToolsetFromJSON (JObject configObject) |
| Reads configObject and tries to return a list of TrackedTool based on info contained in the JObject.
|
|
static bool | IsValidToolPacket (JObject toolObject, JObject configSettings, ref int integerID, ref string stringID, ref List< Vector3 > CoordinateSet) |
| Reads the toolObject and then tries to populate the other fields passed in if valid.
|
|
static List< Vector3 > | GetCoordinatesList (JObject toolObject, JObject configSettings) |
| Construct a List of Vector3 of marker coordinate centres, as parsed from toolObject .
|
|
static string | GetJSONToolStringHL2 (string JSONFilepath) |
| Publicly available helper function, to prepare a JSON string to pass into the HL2-DINO-DLL which will be used to set up the Tool Dictionary on the C++ side.
|
|
◆ CheckEnumKeys< TEnum >()
static bool ToolConfigUtilities.JSONUtils.CheckEnumKeys< TEnum > |
( |
JObject |
jsonObject | ) |
|
|
inlinestatic |
Template function to validate if a JObject contains some desired keys.
- Template Parameters
-
TEnum | Enum of keys to check against |
- Parameters
-
jsonObject | JObject to 'validate' |
- Returns
True only if all keys in
TEnum are contained in
jsonObject
◆ CreateTrackedToolsetFromJSON()
static List< TrackedTool > ToolConfigUtilities.JSONUtils.CreateTrackedToolsetFromJSON |
( |
JObject |
configObject | ) |
|
|
inlinestatic |
Reads configObject
and tries to return a list of TrackedTool
based on info contained in the JObject.
- Parameters
-
configObject | Configuration JSON object to parse |
- Returns
- A list of
TrackedTool
if valid
◆ GetCoordinatesList()
static List< Vector3 > ToolConfigUtilities.JSONUtils.GetCoordinatesList |
( |
JObject |
toolObject, |
|
|
JObject |
configSettings |
|
) |
| |
|
inlinestatic |
Construct a List of Vector3 of marker coordinate centres, as parsed from toolObject
.
- Parameters
-
toolObject | JSON object to parse |
configSettings | File settings |
- Returns
- A list of marker coordinates if valid, empty list otherwise
◆ GetJSONToolStringHL2()
static string ToolConfigUtilities.JSONUtils.GetJSONToolStringHL2 |
( |
string |
JSONFilepath | ) |
|
|
inlinestatic |
Publicly available helper function, to prepare a JSON string to pass into the HL2-DINO-DLL which will be used to set up the Tool Dictionary on the C++ side.
- Parameters
-
JSONFilepath | JSON filepath |
- Returns
- Formatted JSON string, if filepath contains a valid JSON file. Empty string otherwise
◆ IsValidCoordinateArray()
static bool ToolConfigUtilities.JSONUtils.IsValidCoordinateArray |
( |
JToken |
coordinateSet | ) |
|
|
inlinestaticprivate |
Helper function to check we have an array of 3 values.
- Parameters
-
- Returns
◆ IsValidToolPacket()
static bool ToolConfigUtilities.JSONUtils.IsValidToolPacket |
( |
JObject |
toolObject, |
|
|
JObject |
configSettings, |
|
|
ref int |
integerID, |
|
|
ref string |
stringID, |
|
|
ref List< Vector3 > |
CoordinateSet |
|
) |
| |
|
inlinestatic |
Reads the toolObject
and then tries to populate the other fields passed in if valid.
- Parameters
-
toolObject | The JSON equivalent of a TrackedTool |
configSettings | File settings |
integerID | Tool ID (numeric) |
stringID | Tool String ID (for labelling) |
CoordinateSet | Vector3 coordinate list (for positioning objects) |
- Returns
- True if
toolObject
contains all the necessary info, false otherwise
◆ PrepareJObjectForHL2()
static JObject ToolConfigUtilities.JSONUtils.PrepareJObjectForHL2 |
( |
JObject |
configObject | ) |
|
|
inlinestaticprivate |
A sanitising function which checks.
- Parameters
-
configObject | is in the right format for the HL2-DINO Plugin (only works in metres in this version) |
configObject | |
- Returns
- Reconfigured JObject which should have all coordinates in metres.
◆ TryReadingToolConfigJSON()
static JObject ToolConfigUtilities.JSONUtils.TryReadingToolConfigJSON |
( |
string |
filepath | ) |
|
|
inlinestatic |
Function which returns a properly populated JObject if it matches the expected config file structure for this app.
- Parameters
-
filepath | String filepath for .json config file |
- Returns
- Null if invalid, or a JObject if valid
The documentation for this class was generated from the following file: