Functions related to Sub-Surfaces are defined in this group. Click here to return to the main page.
More...
|
| std::string | vsp::AddSubSurf (const std::string &geom_id, int type, int surfindex=0) |
| std::string | vsp::GetSubSurf (const std::string &geom_id, int index) |
| std::vector< std::string > | vsp::GetSubSurf (const std::string &geom_id, const std::string &name) |
| void | vsp::DeleteSubSurf (const std::string &geom_id, const std::string &sub_id) |
| void | vsp::ReorderSubSurf (const std::string &geom_id, const std::string &sub_id, int reorder_type) |
| void | vsp::DeleteSubSurf (const std::string &sub_id) |
| void | vsp::SetSubSurfName (const std::string &geom_id, const std::string &sub_id, const std::string &name) |
| void | vsp::SetSubSurfName (const std::string &sub_id, const std::string &name) |
| std::string | vsp::GetSubSurfName (const std::string &geom_id, const std::string &sub_id) |
| std::string | vsp::GetSubSurfName (const std::string &sub_id) |
| int | vsp::GetSubSurfIndex (const std::string &sub_id) |
| std::vector< std::string > | vsp::GetSubSurfIDVec (const std::string &geom_id) |
| std::vector< std::string > | vsp::GetAllSubSurfIDs () |
| int | vsp::GetNumSubSurf (const std::string &geom_id) |
| int | vsp::GetSubSurfType (const std::string &sub_id) |
| std::vector< std::string > | vsp::GetSubSurfParmIDs (const std::string &sub_id) |
| void | vsp::IntersectSubSurf (const std::string &sub_id) |
| std::string | vsp::GetIntersectSubSurfGeomID (const std::string &sub_id) |
◆ AddSubSurf()
| std::string vsp::AddSubSurf |
( |
const std::string & | geom_id, |
|
|
int | type, |
|
|
int | surfindex = 0 ) |
|
extern |
Add a sub-surface to the specified Geom
string wid =
AddGeom(
"WING",
"" );
SetParmVal( wid,
"Const_Line_Value",
"SubSurface_1", 0.4 );
if ( ss_line_id.length() == 0 || ss_line_id == "NONE" )
{
Print( "ERROR: AddSubSurf returned no id" );
__failure++;
}
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
double SetParmVal(const std::string &parm_id, double val)
std::string AddSubSurf(const std::string &geom_id, int type, int surfindex=0)
- See also
- SUBSURF_TYPE
- Parameters
-
| [in] | geom_id | string Geom ID |
| [in] | type | int Sub-surface type enum (i.e. SS_RECTANGLE) |
| [in] | surfindex | int Main surface index (default: 0) |
- Returns
- string Sub-surface ID
◆ DeleteSubSurf() [1/2]
| void vsp::DeleteSubSurf |
( |
const std::string & | geom_id, |
|
|
const std::string & | sub_id ) |
|
extern |
Delete the specified sub-surface
string wid =
AddGeom(
"WING",
"" );
Print("Delete SS_Line\n");
{
Print( "ERROR: DeleteSubSurf removed nothing" );
__failure++;
}
string num_str = string("Number of SubSurfaces: ") + formatInt( num_ss, '' ) + string("\n");
Print( num_str );
int GetNumSubSurf(const std::string &geom_id)
void DeleteSubSurf(const std::string &geom_id, const std::string &sub_id)
- Parameters
-
| [in] | geom_id | string Geom ID |
| [in] | sub_id | string Sub-surface ID |
◆ DeleteSubSurf() [2/2]
| void vsp::DeleteSubSurf |
( |
const std::string & | sub_id | ) |
|
|
extern |
Delete the specified sub-surface
string wid =
AddGeom(
"WING",
"" );
Print("Delete SS_Line\n");
{
Print( "ERROR: DeleteSubSurf removed nothing" );
__failure++;
}
string num_str = string("Number of SubSurfaces: ") + formatInt( num_ss, '' ) + string("\n");
Print( num_str );
- Parameters
-
| [in] | sub_id | string Sub-surface ID |
◆ GetAllSubSurfIDs()
| std::vector< std::string > vsp::GetAllSubSurfIDs |
( |
| ) |
|
|
extern |
Get a vector of all sub-surface IDs for the entire model
- Returns
- vector<string> Array of sub-surface IDs
◆ GetIntersectSubSurfGeomID()
| std::string vsp::GetIntersectSubSurfGeomID |
( |
const std::string & | sub_id | ) |
|
|
extern |
Set Geom ID to intersect parent with to create intersection SS_INTERSECT type subsurfaces
string p2id =
AddGeom(
"POD",
"" );
string xpod2 =
GetParm( p2id,
"X_Rel_Location",
"XForm" );
string zrotpod2 =
GetParm( p2id,
"Z_Rel_Rotation",
"XForm" );
SetIntersectSubSurfGeomID( sub_id, p2id );
{
Print( "ERROR: the sub-surface is not an intersection" );
__failure++;
}
if ( sub_ids.size() != 1 || sub_ids[0] != sub_id )
{
Print( "ERROR: the intersection sub-surface is not on the Geom it was added to" );
__failure++;
}
SetIntersectSubSurfGeomID( sub_id, "NOSUCHGEOM" );
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: a bad Geom ID was accepted for the intersection" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
}
std::string GetParm(const std::string &geom_id, const std::string &name, const std::string &group)
std::vector< std::string > GetSubSurfIDVec(const std::string &geom_id)
void IntersectSubSurf(const std::string &sub_id)
int GetSubSurfType(const std::string &sub_id)
void Update(bool update_managers=true)
- Parameters
-
| [in] | sub_id | string Sub-surface ID |
| [in] | geom_id | string Geom ID to intersect with parent to create subsurface |
Get the Geom ID that an SS_INTERSECT type sub-surface intersects its parent with
string p2id =
AddGeom(
"POD",
"" );
SetIntersectSubSurfGeomID( sub_id, p2id );
{
Print( "ERROR: GetIntersectSubSurfGeomID did not report the Geom that was set" );
__failure++;
}
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: GetIntersectSubSurfGeomID accepted a sub-surface of the wrong type" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
}
std::string GetIntersectSubSurfGeomID(const std::string &sub_id)
- See also
- SetIntersectSubSurfGeomID, IntersectSubSurf
- Parameters
-
| [in] | sub_id | string Sub-surface ID |
- Returns
- string Geom ID the sub-surface intersects with
◆ GetNumSubSurf()
| int vsp::GetNumSubSurf |
( |
const std::string & | geom_id | ) |
|
|
extern |
Get the number of sub-surfaces for the specified Geom
string wid =
AddGeom(
"WING",
"" );
if ( num_ss != 2 )
{
Print( "ERROR: GetNumSubSurf, two were added" );
__failure++;
}
string num_str = string("Number of SubSurfaces: ") + num_ss + string("\n");
Print( num_str );
- Parameters
-
| [in] | geom_id | string Geom ID |
- Returns
- int Number of Sub-surfaces
◆ GetSubSurf() [1/2]
| std::vector< std::string > vsp::GetSubSurf |
( |
const std::string & | geom_id, |
|
|
const std::string & | name ) |
|
extern |
Get the ID of the specified sub-surface
string wid =
AddGeom(
"WING",
"" );
Print( ss_rec_2, false );
Print( " = ", false );
{
Print( "ERROR: GetSubSurf did not report the sub-surfaces in order" );
__failure++;
}
if ( id_vec.size() != 2 || id_vec[1] !=
GetSubSurf( wid, 1 ) )
{
Print( "ERROR: GetSubSurf disagrees with GetSubSurfIDVec" );
__failure++;
}
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: GetSubSurf accepted an index past the end" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
}
std::string GetSubSurf(const std::string &geom_id, int index)
- Parameters
-
| [in] | geom_id | string Geom ID |
| [in] | name | string Sub surface name |
- Returns
- vector<string> Vector of sub-surface ID
◆ GetSubSurf() [2/2]
| std::string vsp::GetSubSurf |
( |
const std::string & | geom_id, |
|
|
int | index ) |
|
extern |
Get the ID of the specified sub-surface
string wid =
AddGeom(
"WING",
"" );
Print( ss_rec_2, false );
Print( " = ", false );
{
Print( "ERROR: GetSubSurf did not report the sub-surfaces in order" );
__failure++;
}
if ( id_vec.size() != 2 || id_vec[1] !=
GetSubSurf( wid, 1 ) )
{
Print( "ERROR: GetSubSurf disagrees with GetSubSurfIDVec" );
__failure++;
}
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: GetSubSurf accepted an index past the end" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
}
- Parameters
-
| [in] | geom_id | string Geom ID |
| [in] | index | int Sub-surface index |
- Returns
- string Sub-surface ID
◆ GetSubSurfIDVec()
| std::vector< std::string > vsp::GetSubSurfIDVec |
( |
const std::string & | geom_id | ) |
|
|
extern |
Get a vector of all sub-surface IDs for the specified geometry
string wid =
AddGeom(
"WING",
"" );
if ( id_vec.length() == 0 )
{
Print( "ERROR: GetSubSurfIDVec returned nothing" );
__failure++;
}
string id_type_str = string( "SubSurface IDs and Type Indexes -> ");
for ( uint i = 0; i < uint(id_vec.length()); i++ )
{
id_type_str += id_vec[i];
id_type_str += string(": ");
id_type_str += string("\t");
}
id_type_str += string("\n");
Print( id_type_str );
- Parameters
-
| [in] | geom_id | string Geom ID |
- Returns
- vector<int> Array of sub-surface IDs
◆ GetSubSurfIndex()
| int vsp::GetSubSurfIndex |
( |
const std::string & | sub_id | ) |
|
|
extern |
Get the index of the specified sub-surface in its parent Geom's sub-surface vector
string wid =
AddGeom(
"WING",
"" );
string ind_str = string("Index of SS_Rectangle: ") + ind + string("\n");
Print( ind_str );
{
Print( "ERROR: GetSubSurfIndex did not report the order they were added" );
__failure++;
}
{
Print( "ERROR: GetSubSurfIndex disagrees with GetSubSurf" );
__failure++;
}
int GetSubSurfIndex(const std::string &sub_id)
- Parameters
-
| [in] | sub_id | string Sub-surface ID |
- Returns
- int Sub-surface index
◆ GetSubSurfName() [1/2]
| std::string vsp::GetSubSurfName |
( |
const std::string & | geom_id, |
|
|
const std::string & | sub_id ) |
|
extern |
Get the name of the specified sub-surface
string wid =
AddGeom(
"WING",
"" );
if ( rec_name.length() == 0 )
{
Print( "ERROR: GetSubSurfName returned nothing" );
__failure++;
}
string name_str = string("Current Name of SS_Rectangle: ") + rec_name + string("\n");
Print( name_str );
std::string GetSubSurfName(const std::string &geom_id, const std::string &sub_id)
- Parameters
-
| [in] | geom_id | string Geom ID |
| [in] | sub_id | string Sub-surface ID |
- Returns
- string Sub-surface name
◆ GetSubSurfName() [2/2]
| std::string vsp::GetSubSurfName |
( |
const std::string & | sub_id | ) |
|
|
extern |
Get the name of the specified sub-surface
string wid =
AddGeom(
"WING",
"" );
if ( rec_name.length() == 0 )
{
Print( "ERROR: GetSubSurfName returned nothing" );
__failure++;
}
string name_str = string("Current Name of SS_Rectangle: ") + rec_name + string("\n");
Print( name_str );
- Parameters
-
| [in] | sub_id | string Sub-surface ID |
- Returns
- string Sub-surface name
◆ GetSubSurfParmIDs()
| std::vector< std::string > vsp::GetSubSurfParmIDs |
( |
const std::string & | sub_id | ) |
|
|
extern |
Get the vector of Parm IDs for specified sub-surface
string wid =
AddGeom(
"WING",
"" );
if ( parm_id_vec.length() == 0 )
{
Print( "ERROR: GetSubSurfParmIDs returned nothing" );
__failure++;
}
for ( uint i = 0; i < uint(parm_id_vec.length()); i++ )
{
string(", ID: ") + parm_id_vec[i] + string("\n");
Print( id_name_str );
}
std::string GetParmName(const std::string &parm_id)
std::string GetParmDisplayGroupName(const std::string &parm_id)
std::vector< std::string > GetSubSurfParmIDs(const std::string &sub_id)
- Parameters
-
| [in] | sub_id | string Sub-surface ID |
- Returns
- vector<string> Vector of Parm IDs
◆ GetSubSurfType()
| int vsp::GetSubSurfType |
( |
const std::string & | sub_id | ) |
|
|
extern |
Get the type for the specified sub-surface (i.e. SS_RECTANGLE)
string wid =
AddGeom(
"WING",
"" );
{
Print( "ERROR: GetSubSurfType did not report the type that was added" );
__failure++;
}
string id_type_str = string( "SubSurface IDs and Type Indexes -> ");
for ( uint i = 0; i < uint(id_vec.length()); i++ )
{
id_type_str += id_vec[i];
id_type_str += string(": ");
id_type_str += string("\t");
}
id_type_str += string("\n");
Print( id_type_str );
- See also
- SUBSURF_TYPE
- Parameters
-
| [in] | sub_id | string Sub-surface ID |
- Returns
- int Sub-surface type enum (i.e. SS_RECTANGLE)
◆ IntersectSubSurf()
| void vsp::IntersectSubSurf |
( |
const std::string & | sub_id | ) |
|
|
extern |
Trigger intersection for SS_INTERSECT type subsurfaces
string p2id =
AddGeom(
"POD",
"" );
string xpod2 =
GetParm( p2id,
"X_Rel_Location",
"XForm" );
string zrotpod2 =
GetParm( p2id,
"Z_Rel_Rotation",
"XForm" );
SetIntersectSubSurfGeomID( sub_id, p2id );
{
Print( "ERROR: the sub-surface is not an intersection" );
__failure++;
}
if ( sub_ids.size() != 1 || sub_ids[0] != sub_id )
{
Print( "ERROR: the intersection sub-surface is not on the Geom it was added to" );
__failure++;
}
SetIntersectSubSurfGeomID( sub_id, "NOSUCHGEOM" );
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: a bad Geom ID was accepted for the intersection" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
}
- Parameters
-
| [in] | sub_id | string Sub-surface ID |
◆ ReorderSubSurf()
| void vsp::ReorderSubSurf |
( |
const std::string & | geom_id, |
|
|
const std::string & | sub_id, |
|
|
int | reorder_type ) |
|
extern |
Move a sub-surface within its parent Geom's sub-surface list, the way the move buttons on the Sub-Surface tab do. Sub-surfaces are applied in list order, so where one sits decides which of two overlapping sub-surfaces tags a given piece of the surface.
string wing_id =
AddGeom(
"WING",
"" );
{
Print( "ERROR: the sub-surfaces did not start in creation order" );
__failure++;
}
{
Print( "ERROR: ReorderSubSurf did not move the sub-surface" );
__failure++;
}
void ReorderSubSurf(const std::string &geom_id, const std::string &sub_id, int reorder_type)
- See also
- AddSubSurf, DeleteSubSurf
- Parameters
-
| [in] | geom_id | string Geom ID |
| [in] | sub_id | string Sub-surface ID |
| [in] | reorder_type | int Reorder type enum (see REORDER_TYPE) |
◆ SetSubSurfName() [1/2]
| void vsp::SetSubSurfName |
( |
const std::string & | geom_id, |
|
|
const std::string & | sub_id, |
|
|
const std::string & | name ) |
|
extern |
Set the name of the specified sub-surface
string wid =
AddGeom(
"WING",
"" );
string new_name = string("New_SS_Rec_Name");
{
Print( "ERROR: SetSubSurfName did not take" );
__failure++;
}
void SetSubSurfName(const std::string &geom_id, const std::string &sub_id, const std::string &name)
- Parameters
-
| [in] | geom_id | string Geom ID |
| [in] | sub_id | string Sub-surface ID |
| [in] | name | string Sub-surface name |
◆ SetSubSurfName() [2/2]
| void vsp::SetSubSurfName |
( |
const std::string & | sub_id, |
|
|
const std::string & | name ) |
|
extern |
Set the name of the specified sub-surface
string wid =
AddGeom(
"WING",
"" );
string new_name = string("New_SS_Rec_Name");
{
Print( "ERROR: SetSubSurfName did not take" );
__failure++;
}
- Parameters
-
| [in] | sub_id | string Sub-surface ID |
| [in] | name | string Sub-surface name |