The following group of API functions deals with set manipulation. Click here to return to the main page.
More...
|
int | vsp::GetNumSets () |
void | vsp::SetSetName (int index, const std::string &name) |
std::string | vsp::GetSetName (int index) |
std::vector< std::string > | vsp::GetGeomSetAtIndex (int index) |
std::vector< std::string > | vsp::GetGeomSet (const std::string &name) |
int | vsp::GetSetIndex (const std::string &name) |
bool | vsp::GetSetFlag (const std::string &geom_id, int set_index) |
void | vsp::SetSetFlag (const std::string &geom_id, int set_index, bool flag) |
void | vsp::CopyPasteSet (int copyIndex, int pasteIndex) |
bool | vsp::GetBBoxSet (int set, double &xmin_out, double &ymin_out, double &zmin_out, double &xlen_out, double &ylen_out, double &zlen_out) |
bool | vsp::GetScaleIndependentBBoxSet (int set, double &xmin_out, double &ymin_out, double &zmin_out, double &xlen_out, double &ylen_out, double &zlen_out) |
◆ CopyPasteSet()
void vsp::CopyPasteSet |
( |
int | copyIndex, |
|
|
int | pasteIndex ) |
|
extern |
Copies all the states of a geom set and pastes them into a specific set based on passed in indexs
string fuseid =
AddGeom(
"FUSELAGE",
"" );
if ( flag_value != true) { Print( "---> Error: API CopyPasteSet " ); }
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
void CopyPasteSet(int copyIndex, int pasteIndex)
bool GetSetFlag(const std::string &geom_id, int set_index)
void SetSetFlag(const std::string &geom_id, int set_index, bool flag)
- Parameters
-
[in] | copyIndex | Copy Index |
[in] | pasteIndex | Paste Index |
◆ GetBBoxSet()
bool vsp::GetBBoxSet |
( |
int | set, |
|
|
double & | xmin_out, |
|
|
double & | ymin_out, |
|
|
double & | zmin_out, |
|
|
double & | xlen_out, |
|
|
double & | ylen_out, |
|
|
double & | zlen_out ) |
|
extern |
Get the corners of the bounding box of the specified Set.
double xmin, ymin, zmin, xlen, ylen, zlen;
bool GetBBoxSet(int set, double &xmin_out, double &ymin_out, double &zmin_out, double &xlen_out, double &ylen_out, double &zlen_out)
void Update(bool update_managers=true)
- Parameters
-
[in] | set | int Desired Set |
[out] | xmin_out | double Minimum bounding box X coordinate |
[out] | ymin_out | double Minimum bounding box Y coordinate |
[out] | zmin_out | double Minimum bounding box Z coordinate |
[out] | xlen_out | double Maximum bounding box X length |
[out] | ylen_out | double Maximum bounding box Y length |
[out] | zlen_out | double Maximum bounding box Z length |
- Returns
- bool Flag indicating whether the set has members (is non-empty)
◆ GetGeomSet()
std::vector< std::string > vsp::GetGeomSet |
( |
const std::string & | name | ) |
|
|
extern |
Get an array of Geom IDs for the specified set name
array<string> @geom_arr2 =
GetGeomSet(
"SetFromScript" );
if ( geom_arr1.size() != geom_arr2.size() ) { Print( "---> Error: API GetGeomSet " ); }
void SetSetName(int index, const std::string &name)
std::vector< std::string > GetGeomSet(const std::string &name)
std::vector< std::string > GetGeomSetAtIndex(int index)
- Parameters
-
[in] | name | const string set name |
- Returns
- array<string> array of Geom IDs
◆ GetGeomSetAtIndex()
std::vector< std::string > vsp::GetGeomSetAtIndex |
( |
int | index | ) |
|
|
extern |
Get an array of Geom IDs for the specified set index
array<string> @geom_arr2 =
GetGeomSet(
"SetFromScript" );
if ( geom_arr1.size() != geom_arr2.size() ) { Print( "---> Error: API GetGeomSet " ); }
- See also
- SET_TYPE
- Parameters
-
- Returns
- Array of Geom IDs
◆ GetNumSets()
Get the total number of defined sets. Named sets are used to group components and read/write on them. The number of named sets will be 10 for OpenVSP versions up to 3.17.1 and 20 for later versions.
if (
GetNumSets() <= 0 ) { Print(
"---> Error: API GetNumSets " ); }
- Returns
- Number of sets
◆ GetScaleIndependentBBoxSet()
bool vsp::GetScaleIndependentBBoxSet |
( |
int | set, |
|
|
double & | xmin_out, |
|
|
double & | ymin_out, |
|
|
double & | zmin_out, |
|
|
double & | xlen_out, |
|
|
double & | ylen_out, |
|
|
double & | zlen_out ) |
|
extern |
Get the corners of the scale independent bounding box of the specified Set.
double xmin, ymin, zmin, xlen, ylen, zlen;
bool GetScaleIndependentBBoxSet(int set, double &xmin_out, double &ymin_out, double &zmin_out, double &xlen_out, double &ylen_out, double &zlen_out)
- Parameters
-
[in] | set | int Desired Set |
[out] | xmin_out | double Minimum bounding box X coordinate |
[out] | ymin_out | double Minimum bounding box Y coordinate |
[out] | zmin_out | double Minimum bounding box Z coordinate |
[out] | xlen_out | double Maximum bounding box X length |
[out] | ylen_out | double Maximum bounding box Y length |
[out] | zlen_out | double Maximum bounding box Z length |
- Returns
- bool Flag indicating whether the set has members (is non-empty)
◆ GetSetFlag()
bool vsp::GetSetFlag |
( |
const std::string & | geom_id, |
|
|
int | set_index ) |
|
extern |
Check if a Geom is in the set at the specified set index
string fuseid =
AddGeom(
"FUSELAGE",
"" );
if ( !
GetSetFlag( fuseid, 3 ) ) { Print(
"---> Error: API Set/Get Set Flag " ); }
- Parameters
-
[in] | geom_id | string Geom ID |
[in] | set_index | Set index |
- Returns
- True if geom is in the set, false otherwise
◆ GetSetIndex()
int vsp::GetSetIndex |
( |
const std::string & | name | ) |
|
|
extern |
Get the set index for the specified set name
if (
GetSetIndex(
"SetFromScript" ) != 3 ) { Print(
"ERROR: GetSetIndex" ); }
int GetSetIndex(const std::string &name)
- Parameters
-
- Returns
- Set index
◆ GetSetName()
std::string vsp::GetSetName |
( |
int | index | ) |
|
|
extern |
Get the name of a set at specified index
Print("---> Error: API Get/Set Set Name");
std::string GetSetName(int index)
- See also
- SET_TYPE
- Parameters
-
- Returns
- Set name
◆ SetSetFlag()
void vsp::SetSetFlag |
( |
const std::string & | geom_id, |
|
|
int | set_index, |
|
|
bool | flag ) |
|
extern |
Set whether or not a Geom is a member of the set at specified set index
string fuseid =
AddGeom(
"FUSELAGE",
"" );
if ( !
GetSetFlag( fuseid, 3 ) ) { Print(
"---> Error: API Set/Get Set Flag " ); }
- Parameters
-
[in] | geom_id | string Geom ID |
[in] | set_index | Set index |
[in] | flag | Flag that indicates set membership |
◆ SetSetName()
void vsp::SetSetName |
( |
int | index, |
|
|
const std::string & | name ) |
|
extern |
Set the name of a set at specified index
if (
GetSetName( 3 ) !=
"SetFromScript" ) { Print(
"---> Error: API Get/Set Set Name " ); }
- See also
- SET_TYPE
- Parameters
-
[in] | index | Set index |
[in] | name | Set name |