OpenVSP API Documentation 3.41.0
 
Loading...
Searching...
No Matches
Variable Preset Functions

This group of functions can be used to add, remove, and modify Variable Presets through the API. Click here to return to the main page. More...

Functions

void vsp::AddVarPresetGroup (const std::string &group_name)
 
void vsp::AddVarPresetSetting (const std::string &setting_name)
 
void vsp::AddVarPresetParm (const std::string &parm_id)
 
void vsp::AddVarPresetParm (const std::string &parm_id, const std::string &group_name)
 
void vsp::EditVarPresetParm (const std::string &parm_id, double parm_val)
 
void vsp::EditVarPresetParm (const std::string &parm_id, double parm_val, const std::string &group_name, const std::string &setting_name)
 
void vsp::DeleteVarPresetParm (const std::string &parm_id)
 
void vsp::DeleteVarPresetParm (const std::string &parm_id, const std::string &group_name)
 
void vsp::SwitchVarPreset (const std::string &group_name, const std::string &setting_name)
 
bool vsp::DeleteVarPresetSet (const std::string &group_name, const std::string &setting_name)
 
std::string vsp::GetCurrentGroupName ()
 
std::string vsp::GetCurrentSettingName ()
 
std::vector< std::string > vsp::GetVarPresetGroupNames ()
 
std::vector< std::string > vsp::GetVarPresetSettingNamesWName (const std::string &group_name)
 
std::vector< std::string > vsp::GetVarPresetSettingNamesWIndex (int group_index)
 
std::vector< double > vsp::GetVarPresetParmVals ()
 
std::vector< double > vsp::GetVarPresetParmValsWNames (const std::string &group_name, const std::string &setting_name)
 
std::vector< std::string > vsp::GetVarPresetParmIDs ()
 
std::vector< std::string > vsp::GetVarPresetParmIDsWName (const std::string &group_name)
 

Detailed Description

Function Documentation

◆ AddVarPresetGroup()

void vsp::AddVarPresetGroup ( const std::string & group_name)
extern

Add a Variable Presets group

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
if ( GetVarPresetGroupNames().size() != 1 ) { Print( "---> Error: API AddVarPresetGroup" ); }
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
std::vector< std::string > GetVarPresetGroupNames()
void AddVarPresetGroup(const std::string &group_name)
Parameters
[in]group_nameVariable Presets group name

◆ AddVarPresetParm() [1/2]

void vsp::AddVarPresetParm ( const std::string & parm_id)
extern

Add a Parm to the currently active Variable Preset

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
std::string FindParm(const std::string &parm_container_id, const std::string &parm_name, const std::string &group_name)
void AddVarPresetParm(const std::string &parm_id)
void AddVarPresetSetting(const std::string &setting_name)
Parameters
[in]parm_idstring Parm ID

◆ AddVarPresetParm() [2/2]

void vsp::AddVarPresetParm ( const std::string & parm_id,
const std::string & group_name )
extern

Add a Parm to the currently active Variable Preset

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
Parameters
[in]parm_idstring Parm ID
[in]group_namestring Variable Presets group name

◆ AddVarPresetSetting()

void vsp::AddVarPresetSetting ( const std::string & setting_name)
extern

Add a setting to the currently active Variable Preset

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
if ( GetVarPresetSettingNamesWName( "Tess" ).size() != 1 ) { Print( "---> Error: API AddVarPresetSetting" ); }
std::vector< std::string > GetVarPresetSettingNamesWName(const std::string &group_name)
Parameters
[in]setting_nameVariable Presets setting name

◆ DeleteVarPresetParm() [1/2]

void vsp::DeleteVarPresetParm ( const std::string & parm_id)
extern

Remove a Parm from the currently active Variable Preset group

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
void DeleteVarPresetParm(const std::string &parm_id)
Parameters
[in]parm_idstring Parm ID

◆ DeleteVarPresetParm() [2/2]

void vsp::DeleteVarPresetParm ( const std::string & parm_id,
const std::string & group_name )
extern

Remove a Parm from the currently active Variable Preset group

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
Parameters
[in]parm_idstring Parm ID
[in]group_namestring Variable Presets group name

◆ DeleteVarPresetSet()

bool vsp::DeleteVarPresetSet ( const std::string & group_name,
const std::string & setting_name )
extern

Delete a Variable Preset

DeleteVarPresetSet( "Tess", "Fine" );
if ( GetVarPresetSettingNamesWName( "Tess" ).size() != 0 ) { Print ( "---> Error: DeleteVarPresetSet" ); }
bool DeleteVarPresetSet(const std::string &group_name, const std::string &setting_name)
Parameters
[in]group_nameVariable Presets group
[in]setting_nameVariable Presets setting name
Returns
true is successful, false otherwise

◆ EditVarPresetParm() [1/2]

void vsp::EditVarPresetParm ( const std::string & parm_id,
double parm_val )
extern

Edit the value of a Parm in the currently active Variable Preset

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
void EditVarPresetParm(const std::string &parm_id, double parm_val)
Parameters
[in]parm_idstring Parm ID
[in]parm_valdouble Parm value

◆ EditVarPresetParm() [2/2]

void vsp::EditVarPresetParm ( const std::string & parm_id,
double parm_val,
const std::string & group_name,
const std::string & setting_name )
extern

Edit the value of a Parm in the currently active Variable Preset

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
Parameters
[in]parm_idstring Parm ID
[in]parm_valdouble Parameter value
[in]group_namestring Variable Presets group name
[in]setting_namestring Variable Presets setting name

◆ GetCurrentGroupName()

std::string vsp::GetCurrentGroupName ( )
extern

Get the currently active Variable Presets group name

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
AddVarPresetGroup( "New_Group" );
AddVarPresetSetting( "New_Setting" );
Print( "Current Group: " );
std::string GetCurrentGroupName()
Returns
Variable Presets group name

◆ GetCurrentSettingName()

std::string vsp::GetCurrentSettingName ( )
extern

Get the currently active Variable Presets setting name

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
AddVarPresetGroup( "New_Group" );
AddVarPresetSetting( "New_Setting" );
Print( "Current Setting: " );
std::string GetCurrentSettingName()
Returns
Variable Presets setting name

◆ GetVarPresetGroupNames()

std::vector< std::string > vsp::GetVarPresetGroupNames ( )
extern

Get all Variable Preset group names

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
if ( GetVarPresetGroupNames().size() != 1 ) { Print( "---> Error: API AddVarPresetGroup" ); }
Returns
Array of Variable Presets group names

◆ GetVarPresetParmIDs()

std::vector< std::string > vsp::GetVarPresetParmIDs ( )
extern

Get the Parm IDs contained in the currently active Variable Presets group

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
array <string> p_IDs = GetVarPresetParmIDs();
if ( p_IDs.size() != 1 ) { Print( "---> Error: API AddVarPresetParm" ); }
std::vector< std::string > GetVarPresetParmIDs()
Returns
Array of Variable Presets Parm IDs

◆ GetVarPresetParmIDsWName()

std::vector< std::string > vsp::GetVarPresetParmIDsWName ( const std::string & group_name)
extern

Get the Parm IDs contained in the specitied Variable Presets group

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetGroup( "New_Group" );
AddVarPresetSetting( "New_Setting_1" );
AddVarPresetSetting( "New_Setting_2" );
string p1 = FindParm( pod1, "Y_Rel_Rotation", "XForm" );
string p2 = FindParm( pod1, "Z_Rel_Rotation", "XForm" );
array < string > parm_ids = GetVarPresetParmIDsWName( "New_Group" );
if ( parm_ids.size() != 2 ) { Print( "---> Error: API GetVarPresetParmIDsWName" ); }
std::vector< std::string > GetVarPresetParmIDsWName(const std::string &group_name)
Parameters
[in]group_nameVariable Presets group name
Returns
Array of Parm IDs

◆ GetVarPresetParmVals()

std::vector< double > vsp::GetVarPresetParmVals ( )
extern

Get the value of each Parm in the currently active Variable Preset group and setting

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
array <double> p_vals = GetVarPresetParmVals();
if ( p_vals[0] != 5 ) { Print ( "---> Error: API EditVarPresetParm" ); }
std::vector< double > GetVarPresetParmVals()
Returns
Array of Variable Presets Parm values

◆ GetVarPresetParmValsWNames()

std::vector< double > vsp::GetVarPresetParmValsWNames ( const std::string & group_name,
const std::string & setting_name )
extern

Get the value of each Parm in the specified Variable Preset group and setting param [in] group_name Variable Presets group name param [in] setting_name Variable Presets setting name

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetGroup( "New_Group" );
AddVarPresetSetting( "New_Setting_1" );
AddVarPresetSetting( "New_Setting_2" );
string p1 = FindParm( pod1, "Y_Rel_Rotation", "XForm" );
string p2 = FindParm( pod1, "Z_Rel_Rotation", "XForm" );
EditVarPresetParm( p2, 2, "New_Group", "New_Setting_2" );
array < double > parm_vals = GetVarPresetParmValsWNames( "New_Group", "New_Setting_2" );
if ( parm_vals.size() != 2 ) { Print( "---> Error: API GetVarPresetParmValsWNames" ); }
std::vector< double > GetVarPresetParmValsWNames(const std::string &group_name, const std::string &setting_name)
Returns
Array of Variable Presets Parm values

◆ GetVarPresetSettingNamesWIndex()

std::vector< std::string > vsp::GetVarPresetSettingNamesWIndex ( int group_index)
extern

Get the name of each settings in the specified Variable Presets group index

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
string p1 = FindParm( pod1, "Tess_U", "Shape" );
AddVarPresetGroup( "New_Group" );
AddVarPresetSetting( "New_Setting_1" );
AddVarPresetSetting( "New_Setting_2" );
array < string > group_1_settings = GetVarPresetSettingNamesWIndex( 1 );
if ( group_1_settings.size() != 2 ) { Print( "---> Error: API GetVarPresetSettingNamesWIndex" ); }
std::vector< std::string > GetVarPresetSettingNamesWIndex(int group_index)
Parameters
[in]group_indexVariable Presets group index
Returns
Array of Variable Presets setting names

◆ GetVarPresetSettingNamesWName()

std::vector< std::string > vsp::GetVarPresetSettingNamesWName ( const std::string & group_name)
extern

Get the name of each settings in the specified Variable Presets group name

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetSetting( "Coarse" );
if ( GetVarPresetSettingNamesWName( "Tess" ).size() != 1 ) { Print( "---> Error: API AddVarPresetSetting" ); }
Parameters
[in]group_nameVariable Presets group name
Returns
Array of Variable Presets setting names

◆ SwitchVarPreset()

void vsp::SwitchVarPreset ( const std::string & group_name,
const std::string & setting_name )
extern

Change the currently active Variable Preset

// Add Pod Geom
string pod1 = AddGeom( "POD", "" );
AddVarPresetGroup( "Config" );
AddVarPresetSetting( "Default" );
string p1 = FindParm( pod1, "Y_Rel_Rotation", "XForm" );
string p2 = FindParm( pod1, "Z_Rel_Rotation", "XForm" );
SwitchVarPreset( "Config", "Default" );
void SwitchVarPreset(const std::string &group_name, const std::string &setting_name)
Parameters
[in]group_nameVariable Presets group name
[in]setting_nameVariable Presets setting name