|
| void | vsp::SetGeomMaterialName (const std::string &geom_id, const std::string &name) |
| std::vector< std::string > | vsp::GetGeomTypes () |
| std::string | vsp::AddGeom (const std::string &type, const std::string &parent=std::string()) |
| void | vsp::UpdateGeom (const std::string &geom_id) |
| void | vsp::DeleteGeom (const std::string &geom_id) |
| void | vsp::DeleteGeomVec (const std::vector< std::string > &del_vec) |
| void | vsp::CutGeomToClipboard (const std::string &geom_id) |
| void | vsp::CopyGeomToClipboard (const std::string &geom_id) |
| std::vector< std::string > | vsp::PasteGeomClipboard (const std::string &parent=std::string()) |
| std::string | vsp::ConvertFuselageToStack (const std::string &geom_id) |
| std::vector< std::string > | vsp::FindGeoms () |
| std::vector< std::string > | vsp::FindGeomsWithName (const std::string &name) |
| std::string | vsp::FindGeom (const std::string &name, int index) |
| void | vsp::SetGeomName (const std::string &geom_id, const std::string &name) |
| std::string | vsp::GetGeomName (const std::string &geom_id) |
| std::vector< std::string > | vsp::GetGeomParmIDs (const std::string &geom_id) |
| std::string | vsp::GetGeomTypeName (const std::string &geom_id) |
| void | vsp::SetGeomParent (const std::string &geom_id, const std::string &parent_id) |
| void | vsp::ReorderGeom (const std::string &geom_id, int reorder_type) |
| std::string | vsp::AttachGeomTexture (const std::string &geom_id, const std::string &file_name) |
| void | vsp::RemoveGeomTexture (const std::string &geom_id, const std::string &texture_id) |
| std::vector< std::string > | vsp::GetGeomTextureIDVec (const std::string &geom_id) |
| std::string | vsp::GetGeomTextureFileName (const std::string &geom_id, const std::string &texture_id) |
| std::string | vsp::GetGeomParent (const std::string &geom_id) |
| std::vector< std::string > | vsp::GetGeomChildren (const std::string &geom_id) |
| int | vsp::GetNumMainSurfs (const std::string &geom_id) |
| int | vsp::GetTotalNumSurfs (const std::string &geom_id) |
| int | vsp::GetGeomVSPSurfType (const std::string &geom_id, int main_surf_ind=0) |
| int | vsp::GetGeomVSPSurfCfdType (const std::string &geom_id, int main_surf_ind=0) |
| vec3d | vsp::GetGeomBBoxMax (const std::string &geom_id, int main_surf_ind=0, bool ref_frame_is_absolute=true) |
| vec3d | vsp::GetGeomBBoxMin (const std::string &geom_id, int main_surf_ind=0, bool ref_frame_is_absolute=true) |
| void | vsp::SplitWingXSec (const std::string &wing_id, int section_index) |
| std::vector< int > | vsp::GetDriverGroup (const std::string &geom_id, int section_index) |
| void | vsp::ResetPropellerThickness (const std::string &geom_id) |
| void | vsp::CopyAirfoil (const std::string &geom_id, int index) |
| void | vsp::PasteAirfoil (const std::string &geom_id, int index) |
| void | vsp::ClearSkinning (const std::string &geom_id, int index=-1) |
| void | vsp::ResetGeomScale (const std::string &geom_id) |
| void | vsp::AcceptGeomScale (const std::string &geom_id) |
| std::vector< vec3d > | vsp::GetPtCloudPnts (const std::string &geom_id) |
| std::string | vsp::CreateNGonMeshGeom (const std::string &geom_id) |
| std::string | vsp::CreateConvexHull (const std::string &geom_id) |
| void | vsp::ProjectPtCloudPts (const std::string &geom_id, const std::string &target_geom_id, int surf_index, int dir_index) |
| std::string vsp::ConvertFuselageToStack |
( |
const std::string & | geom_id | ) |
|
|
extern |
Replace a Fuselage with a Stack of the same shape. Each cross section is placed where the Fuselage put it, and its skinning is carried across, so the surface is unchanged. The Stack goes in the Fuselage's place in the model, under its name, with its children, subsurfaces, structures, mesh sources, textures and attributes.
The Stack takes over the Fuselage's identity: its Geom ID, the IDs of the Parms the two have in common, and the IDs of each cross section and its Parms. A link, a design variable or an advanced link on one of those Parms goes on naming the same thing, and the ID this returns is the ID that was passed in. Some Parms are paired with a counterpart that means something different: a cross section's rotation, which in a Stack is relative to the section before it, and its location fractions, which become the Stack's X, Y and Z deltas – lengths, and relative ones. Only the Fuselage's length has no counterpart at all; attributes on it, or on a cross section's copy of it, move to the Stack itself. Attributes elsewhere – on the Geom, a cross section, a subsurface, a Parm – stay with the ID they were on.
CompareGeomSurfaces measures how closely the Stack's surfaces match a copy of the Fuselage kept for the purpose.
string fid =
AddGeom(
"FUSELAGE" );
string pid =
AddGeom(
"POD", fid );
if ( GetErrorLastCallFlag() ) {
Print(
"---> Error: API ConvertFuselageToStack reported an error " ); __failure++; }
if ( sid != fid ) {
Print(
"---> Error: API ConvertFuselageToStack did not keep the ID " ); __failure++; }
if (
GetGeomTypeName( sid ) !=
"Stack" ) {
Print(
"---> Error: API ConvertFuselageToStack did not make a Stack " ); __failure++; }
if (
dist( before,
CompPnt01( sid, 0, 0.3, 0.2 ) ) > 1e-9 ) {
Print(
"---> Error: API ConvertFuselageToStack moved the surface " ); __failure++; }
if (
dist( pod_before,
CompPnt01( pid, 0, 0.5, 0.5 ) ) > 1e-9 ) {
Print(
"---> Error: API ConvertFuselageToStack moved a child " ); __failure++; }
std::string ConvertFuselageToStack(const std::string &geom_id)
std::string FindParm(const std::string &parm_container_id, const std::string &parm_name, const std::string &group_name)
vec3d CompPnt01(const std::string &geom_id, const int &surf_indx, const double &u, const double &w)
double dist(const vec3d &a, const vec3d &b)
- Parameters
-
| [in] | geom_id | string Fuselage Geom ID |
- Returns
- string ID of the Stack, which is the Fuselage's own ID
| vec3d vsp::GetGeomBBoxMax |
( |
const std::string & | geom_id, |
|
|
int | main_surf_ind = 0, |
|
|
bool | ref_frame_is_absolute = true ) |
|
extern |
Get the the maximum coordinate of the bounding box of a Geom with given main surface index. The Geom bounding box may be specified in absolute or body reference frame.
A Geom with no surfaces – a mesh, a point cloud, a wireframe – answers out of its own bounding box, and main_surf_ind does not apply. That box is built in absolute coordinates, so the body reference frame answer is the absolute box turned back through the model matrix, which contains the geometry but is not as tight as the box a surface gives.
if ( max_pnt.
x() <= min_pnt.
x() || max_pnt.
y() <= min_pnt.
y() || max_pnt.
z() <= min_pnt.
z() )
{
Print(
"ERROR: GetGeomBBoxMax is not above the minimum corner" );
__failure++;
}
vec3d GetGeomBBoxMin(const std::string &geom_id, int main_surf_ind=0, bool ref_frame_is_absolute=true)
- See also
- GetGeomBBoxMin
- Parameters
-
| [in] | geom_id | string Geom ID |
| [in] | main_surf_ind | int Main surface index |
| [in] | ref_frame_is_absolute | bool Flag to specify absolute or body reference frame |
- Returns
- vec3d Maximum coordinate of the bounding box
| vec3d vsp::GetGeomBBoxMin |
( |
const std::string & | geom_id, |
|
|
int | main_surf_ind = 0, |
|
|
bool | ref_frame_is_absolute = true ) |
|
extern |
Get the the minimum coordinate of the bounding box of a Geom with given main surface index. The Geom bounding box may be specified in absolute or body reference frame.
A Geom with no surfaces – a mesh, a point cloud, a wireframe – answers out of its own bounding box, and main_surf_ind does not apply. That box is built in absolute coordinates, so the body reference frame answer is the absolute box turned back through the model matrix, which contains the geometry but is not as tight as the box a surface gives.
if ( min_pnt.
x() >= max_pnt.
x() || min_pnt.
y() >= max_pnt.
y() || min_pnt.
z() >= max_pnt.
z() )
{
Print(
"ERROR: GetGeomBBoxMin is not below the maximum corner" );
__failure++;
}
- See also
- GetGeomBBoxMax
- Parameters
-
| [in] | geom_id | string Geom ID |
| [in] | main_surf_ind | int Main surface index |
| [in] | ref_frame_is_absolute | bool Flag to specify absolute or body reference frame |
- Returns
- vec3d Minimum coordinate of the bounding box