OpenVSP API Documentation 3.41.0
 
Loading...
Searching...
No Matches
Parm Container Functions

All Parms in OpenVSP are stored in Parm Containers. The functions in this group can be used to work with Parm Containers through the API. Click here to return to the main page. More...

Functions

std::vector< std::string > vsp::FindContainers ()
 
std::vector< std::string > vsp::FindContainersWithName (const std::string &name)
 
std::string vsp::FindContainer (const std::string &name, int index)
 
std::string vsp::GetContainerName (const std::string &parm_container_id)
 
std::vector< std::string > vsp::FindContainerGroupNames (const std::string &parm_container_id)
 
std::vector< std::string > vsp::FindContainerParmIDs (const std::string &parm_container_id)
 
std::string vsp::GetVehicleID ()
 
int vsp::GetNumUserParms ()
 
int vsp::GetNumPredefinedUserParms ()
 
std::vector< std::string > vsp::GetAllUserParms ()
 
std::string vsp::GetUserParmContainer ()
 
string vsp::AddUserParm (int type, const string &name, const string &group)
 
void vsp::DeleteUserParm (const std::string &id)
 
void vsp::DeleteAllUserParm ()
 

Detailed Description

Function Documentation

◆ AddUserParm()

string vsp::AddUserParm ( int type,
const string & name,
const string & group )
extern

Function to add a new user Parm of input type, name, and group

string length = AddUserParm( PARM_DOUBLE_TYPE, "Length", "Design" );
SetParmValLimits( length, 10.0, 0.001, 1.0e12 );
SetParmDescript( length, "Length user parameter" );
@ PARM_DOUBLE_TYPE
Definition APIDefines.h:981
string AddUserParm(int type, const string &name, const string &group)
void SetParmDescript(const std::string &parm_id, const std::string &desc)
double SetParmValLimits(const std::string &parm_id, double val, double lower_limit, double upper_limit)
See also
PARM_TYPE
Parameters
[in]typeParm type enum (i.e. PARM_DOUBLE_TYPE)
[in]nameParm name
[in]groupParm group
Returns
Parm ID

◆ DeleteAllUserParm()

void vsp::DeleteAllUserParm ( )
extern

Get the user parm container ID

void DeleteAllUserParm()

◆ DeleteUserParm()

void vsp::DeleteUserParm ( const std::string & id)
extern

Get the user parm container ID

array<string> @id_arr = GetAllUserParms();
if ( id_arr.size() > n )
{
DeleteUserParm( id_arr[n] );
}
std::vector< std::string > GetAllUserParms()
void DeleteUserParm(const std::string &id)
int GetNumPredefinedUserParms()

◆ FindContainer()

std::string vsp::FindContainer ( const std::string & name,
int index )
extern

Get the ID of a Parm Container with specified name at input index

//===== Get Vehicle Parm Container ID ====//
string veh_id = FindContainer( "Vehicle", 0 );
std::string FindContainer(const std::string &name, int index)
See also
FindContainersWithName
Parameters
[in]nameParm Container name
[in]indexParm Container index
Returns
Parm Container ID

◆ FindContainerGroupNames()

std::vector< std::string > vsp::FindContainerGroupNames ( const std::string & parm_container_id)
extern

Get an array of Parm group names included in the specified Container

string user_ctr = FindContainer( "UserParms", 0 );
array<string> @grp_arr = FindContainerGroupNames( user_ctr );
Print( "---> UserParms Container Group IDs: " );
for ( int i = 0; i < int( grp_arr.size() ); i++ )
{
string message = "\t" + grp_arr[i] + "\n";
Print( message );
}
std::vector< std::string > FindContainerGroupNames(const std::string &parm_container_id)
Parameters
[in]parm_container_idParm Container ID
Returns
Array of Parm group names

◆ FindContainerParmIDs()

std::vector< std::string > vsp::FindContainerParmIDs ( const std::string & parm_container_id)
extern

Get an array of Parm IDs included in the specified Container

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Get Structure Name and Parm Container ID ====//
string parm_container_name = GetFeaStructName( pod_id, struct_ind );
string parm_container_id = FindContainer( parm_container_name, struct_ind );
//==== Get and List All Parms in the Container ====//
array<string> parm_ids = FindContainerParmIDs( parm_container_id );
for ( uint i = 0; i < uint(parm_ids.length()); i++ )
{
string name_id = GetParmName( parm_ids[i] ) + string(": ") + parm_ids[i] + string("\n");
Print( name_id );
}
std::string GetFeaStructName(const std::string &geom_id, int fea_struct_ind)
int AddFeaStruct(const std::string &geom_id, bool init_skin=true, int surfindex=0)
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
std::vector< std::string > FindContainerParmIDs(const std::string &parm_container_id)
std::string GetParmName(const std::string &parm_id)
Parameters
[in]parm_container_idParm Container ID
Returns
Array of Parm IDs

◆ FindContainers()

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

Get an array of all Parm Container IDs

array<string> @ctr_arr = FindContainers();
Print( "---> API Parm Container IDs: " );
for ( int i = 0; i < int( ctr_arr.size() ); i++ )
{
string message = "\t" + ctr_arr[i] + "\n";
Print( message );
}
std::vector< std::string > FindContainers()
Returns
Array of Parm Container IDs

◆ FindContainersWithName()

std::vector< std::string > vsp::FindContainersWithName ( const std::string & name)
extern

Get an array of Parm Container IDs for Containers with the specified name

array<string> @ctr_arr = FindContainersWithName( "UserParms" );
if ( ctr_arr.size() > 0 ) { Print( ( "UserParms Parm Container ID: " + ctr_arr[0] ) ); }
std::vector< std::string > FindContainersWithName(const std::string &name)
Parameters
[in]nameParm Container name
Returns
Array of Parm Container IDs

◆ GetAllUserParms()

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

Get the vector of id's for all user parameters

array<string> @id_arr = GetAllUserParms();
Print( "---> User Parm IDs: " );
for ( int i = 0; i < int( id_arr.size() ); i++ )
{
string message = "\t" + id_arr[i] + "\n";
Print( message );
}
Returns
Array of user parameter ids

◆ GetContainerName()

std::string vsp::GetContainerName ( const std::string & parm_container_id)
extern

Get the name of the specified Parm Container

string veh_id = FindContainer( "Vehicle", 0 );
if ( GetContainerName( veh_id ) != "Vehicle" ) { Print( "---> Error: API GetContainerName" ); }
std::string GetContainerName(const std::string &parm_container_id)
Parameters
[in]parm_container_idParm Container ID
Returns
Parm Container name

◆ GetNumPredefinedUserParms()

int vsp::GetNumPredefinedUserParms ( )
extern

Get the number of pre-defined user parameters

Returns
Number of pre-defined user Parms

◆ GetNumUserParms()

int vsp::GetNumUserParms ( )
extern

Get the number of user parameters

int n = GetNumUserParms();
int GetNumUserParms()
Returns
Number of user Parms

◆ GetUserParmContainer()

std::string vsp::GetUserParmContainer ( )
extern

Get the user parm container ID

string up_id = GetUserParmContainer();
std::string GetUserParmContainer()
Returns
User parm container ID

◆ GetVehicleID()

std::string vsp::GetVehicleID ( )
extern

Get the ID of the Vehicle Parm Container

//===== Get Vehicle Parm Container ID ====//
string veh_id = GetVehicleID();
std::string GetVehicleID()
Returns
Vehicle ID