OpenVSPAPI  3.20.0
Functions
Specialized Geometry Functions

These API functions are used with Geoms that need specialized treatment. Body of Recolution components are one example, which only have a single XSec to be defined from.

Click here to return to the main page. More...

Functions

void ChangeBORXSecShape (const string &in geom_id, int type)
 
int GetBORXSecShape (const string &in geom_id)
 

Detailed Description

Function Documentation

◆ ChangeBORXSecShape()

void ChangeBORXSecShape ( const string &in  geom_id,
int  type 
)
Convert any XSec type into an EditCurveXSec. This function will work for BOR Geoms, in which case the input XSec index is ignored.
\code{.cpp}
// Add Stack
string sid = AddGeom( "STACK", "" );

// Get First (and Only) XSec Surf
string xsec_surf = GetXSecSurf( sid, 0 );

ChangeXSecShape( xsec_surf, 1, XS_ROUNDED_RECTANGLE );

// Convert Rounded Rectangle to Edit Curve type XSec
ConvertXSecToEdit( sid, 1 );

// Identify XSec 1
string xsec_1 = GetXSec( xsec_surf, 1 );

// Get the control points for the default shape
array < vec3d > xsec1_pts = GetEditXSecCtrlVec( xsec_1, true ); // The returned control points will not be scaled by width and height
\param [in] geom_id Geom ID
\param [in] indx XSec index

*/ void ConvertXSecToEdit(const string&in geom_id, const int&in indx = 0);

/*!

*/

/*! Set the XSec type for a BOR component

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
if ( GetBORXSecShape( bor_id ) != XS_ROUNDED_RECTANGLE ) { Print( "ERROR: ChangeBORXSecShape" ); }
See also
XSEC_CRV_TYPE
Parameters
[in]geom_idGeom ID
[in]typeXSec type enum (i.e. XS_ROUNDED_RECTANGLE)

◆ GetBORXSecShape()

int GetBORXSecShape ( const string &in  geom_id)

Get the XSec type for a BOR component

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
if ( GetBORXSecShape( bor_id ) != XS_ROUNDED_RECTANGLE ) { Print( "ERROR: GetBORXSecShape" ); }
Parameters
[in]geom_idGeom ID
Returns
XSec type enum (i.e. XS_ROUNDED_RECTANGLE)
XS_ROUNDED_RECTANGLE
Definition: openvsp_as.h:2116
GetBORXSecShape
int GetBORXSecShape(const string &in geom_id)
ChangeBORXSecShape
void ChangeBORXSecShape(const string &in geom_id, int type)
AddGeom
string AddGeom(const string &in type, const string &in parent=string())
Print
void Print(const string &in data, bool new_line=true)