OpenVSP API Documentation 3.51.3
Loading...
Searching...
No Matches
GearGeom Functions

This group of functions is available for interacting with the Bogie list of a GearGeom through the API. Click here to return to the main page. More...

Functions

std::string vsp::CreateAndAddBogie (const std::string &gear_id)
int vsp::GetNumBogies (const std::string &gear_id)
std::vector< std::string > vsp::GetAllBogies (const std::string &gear_id)
void vsp::DelBogie (const std::string &gear_id, const std::string &bogie_id)
void vsp::DelAllBogies (const std::string &gear_id)

Detailed Description

Function Documentation

◆ CreateAndAddBogie()

std::string vsp::CreateAndAddBogie ( const std::string & gear_id)
extern

Create a new Bogie and add it to the end of the Bogie list of the specified GearGeom. A GearGeom's landing gear is described by its list of Bogies. Each Bogie is a ParmContainer, so once you have the returned Bogie ID you can query and set its Parms with the normal Parm API functions.

string gear_id = AddGeom( "GEAR", "" ); // Add a landing gear Geom
string bogie_id = CreateAndAddBogie( gear_id ); // Create and add a Bogie
// Bogies are ParmContainers -- work with their Parms once you have the ID.
SetParmVal( bogie_id, "NumAcross", "Bogie", 2 ); // Two wheels across
SetParmVal( bogie_id, "NumTandem", "Bogie", 2 ); // Two wheels in tandem
if ( bogie_id.length() == 0 || bogie_id == "NONE" )
{
Print( "ERROR: CreateAndAddBogie returned no id" );
__failure++;
}
std::string CreateAndAddBogie(const std::string &gear_id)
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
double SetParmVal(const std::string &parm_id, double val)
See also
GetAllBogies, GetNumBogies, DelBogie, DelAllBogies
Parameters
[in]gear_idstring GearGeom Geom ID
Returns
string ParmContainer ID for the newly added Bogie

◆ DelAllBogies()

void vsp::DelAllBogies ( const std::string & gear_id)
extern

Delete all Bogies from the specified GearGeom.

string gear_id = AddGeom( "GEAR", "" );
CreateAndAddBogie( gear_id );
CreateAndAddBogie( gear_id );
DelAllBogies( gear_id ); // GetNumBogies( gear_id ) == 0
if ( GetNumBogies( gear_id ) != 0 )
{
Print( "ERROR: DelAllBogies left something behind" );
__failure++;
}
int GetNumBogies(const std::string &gear_id)
void DelAllBogies(const std::string &gear_id)
See also
CreateAndAddBogie, DelBogie
Parameters
[in]gear_idstring GearGeom Geom ID

◆ DelBogie()

void vsp::DelBogie ( const std::string & gear_id,
const std::string & bogie_id )
extern

Delete the specified Bogie from the specified GearGeom.

string gear_id = AddGeom( "GEAR", "" );
string bogie_id = CreateAndAddBogie( gear_id );
int num_before_del = GetNumBogies( gear_id );
DelBogie( gear_id, bogie_id );
if ( GetNumBogies( gear_id ) >= num_before_del )
{
Print( "ERROR: DelBogie removed nothing" );
__failure++;
}
void DelBogie(const std::string &gear_id, const std::string &bogie_id)
See also
CreateAndAddBogie, DelAllBogies
Parameters
[in]gear_idstring GearGeom Geom ID
[in]bogie_idstring Bogie ParmContainer ID

◆ GetAllBogies()

std::vector< std::string > vsp::GetAllBogies ( const std::string & gear_id)
extern

Get the ParmContainer IDs of all the Bogies in the specified GearGeom, in list order.

string gear_id = AddGeom( "GEAR", "" );
CreateAndAddBogie( gear_id );
CreateAndAddBogie( gear_id );
array<string> @bogie_ids = GetAllBogies( gear_id );
if ( bogie_ids.length() == 0 )
{
Print( "ERROR: GetAllBogies returned nothing" );
__failure++;
}
std::vector< std::string > GetAllBogies(const std::string &gear_id)
See also
CreateAndAddBogie, GetNumBogies, DelBogie
Parameters
[in]gear_idstring GearGeom Geom ID
Returns
vector<string> Vector of Bogie ParmContainer IDs

◆ GetNumBogies()

int vsp::GetNumBogies ( const std::string & gear_id)
extern

Get the number of Bogies in the specified GearGeom.

string gear_id = AddGeom( "GEAR", "" );
CreateAndAddBogie( gear_id );
CreateAndAddBogie( gear_id );
int num_bogie = GetNumBogies( gear_id ); // num_bogie == 2
if ( num_bogie != 2 )
{
Print( "ERROR: GetNumBogies, two were added" );
__failure++;
}
See also
CreateAndAddBogie, GetAllBogies
Parameters
[in]gear_idstring GearGeom Geom ID
Returns
int Number of Bogies in the specified GearGeom