Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

Parameter< Type > Struct Template Reference

Last update: 16.07.2025

This class provides functions to work with a singleton parameter of the givien type. More...

Static Public Member Functions

static Type load (JsonValue root)
 Static function that deserializaes the value of a parameter with the given type. More...
 
static JsonValue save (Type t, string="")
 Static function that takes an instance of a type and renders a Json representation. It uses the default range given in the SerializationTraits. More...
 
static JsonValue save (Type t, CreateRangeBase range, string="")
 Static function that takes an instance of a type and renders a Json representation. It uses the specific range given by the user. More...
 
static JsonValue save (Type t, Type min_value, Type max_value, Type auto_value, string="")
 Static function that takes an instance of a type and renders a Json representation. It uses the specific min, max and auto values given by the user. More...
 

Detailed Description

template<typename Type>
struct Parameter< Type >

This class provides functions to work with a singleton parameter of the givien type.

Template Parameters
TThe type of the parameter

Member Function Documentation

◆ load()

static Type load ( JsonValue  root)
static

Static function that deserializaes the value of a parameter with the given type.

Parameters
rootThe Json object contained the serialized data
Returns
An instance of Type containing the value present in the serialization

◆ save() [1/3]

static JsonValue save ( Type  t,
string  = "" 
)
static

Static function that takes an instance of a type and renders a Json representation. It uses the default range given in the SerializationTraits.

Parameters
tThe instance to serialize
display_nameThe name to display in the GUI
Returns
The Json serialization

◆ save() [2/3]

static JsonValue save ( Type  t,
CreateRangeBase  range,
string  = "" 
)
static

Static function that takes an instance of a type and renders a Json representation. It uses the specific range given by the user.

Parameters
tThe instance to serialize
rangethe custom range to use for this instance
display_nameThe name to display in the GUI
Returns
The Json serialization

◆ save() [3/3]

static JsonValue save ( Type  t,
Type  min_value,
Type  max_value,
Type  auto_value,
string  = "" 
)
static

Static function that takes an instance of a type and renders a Json representation. It uses the specific min, max and auto values given by the user.

Parameters
tThe instance to serialize
minThe custom minimum value for the range to use for this instance
maxThe custom maximum value for the range to use for this instance
autoThe custom auto value to use for this instance
display_nameThe name to display in the GUI
Returns
The Json serialization

Connect with Ansys