OpenVSPAPI  3.19.0
Functions
Custom Geometry Functions

This functions grouped here are used to create and manipulate Custom Components. Custom components are defined in *.vspscript files included in the /"Custom Scripts/" directory. Examples of Custom Components are available in the directory for reference.

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

Functions

string AddParm (int type, const string &in name, const string &in group)
 
string GetCurrCustomGeom ()
 
string GetCustomParm (int index)
 
int AddGui (int type, const string &in label=string(), const string &in parm_name=string(), const string &in group_name=string(), double range=10.0)
 
void UpdateGui (int gui_id, const string &in parm_id)
 
string AddXSecSurf ()
 
void RemoveXSecSurf (const string &in xsec_id)
 
void ClearXSecSurfs ()
 
void SkinXSecSurf (bool closed_flag=false)
 
void CloneSurf (int index, Matrix4d &in mat)
 
void TransformSurf (int index, Matrix4d &in mat)
 
void SetVspSurfType (int type, int surf_index=- 1)
 
void SetVspSurfCfdType (int type, int surf_index=- 1)
 
void SetCustomXSecLoc (const string &in xsec_id, const vec3d &in loc)
 
vec3d GetCustomXSecLoc (const string &in xsec_id)
 
void SetCustomXSecRot (const string &in xsec_id, const vec3d &in rot)
 
vec3d GetCustomXSecRot (const string &in xsec_id)
 
bool CheckClearTriggerEvent (int gui_id)
 
void SetupCustomDefaultSource (int type, int surf_index, double l1, double r1, double u1, double w1, double l2=0, double r2=0, double u2=0, double w2=0)
 
void ClearAllCustomDefaultSources ()
 
void SetCustomCenter (double x, double y, double z)
 
string AppendXSec (const string &in xsec_surf_id, int type)
 
string AppendCustomXSec (const string &in xsec_surf_id, int type)
 
void CutCustomXSec (const string &in xsec_surf_id, int index)
 
void CopyCustomXSec (const string &in xsec_surf_id, int index)
 
void PasteCustomXSec (const string &in xsec_surf_id, int index)
 
string InsertCustomXSec (const string &in xsec_surf_id, int type, int index)
 

Detailed Description

Function Documentation

◆ AddGui()

int AddGui ( int  type,
const string &in  label = string(),
const string &in  parm_name = string(),
const string &in  group_name = string(),
double  range = 10.0 
)

Add a GUI element for the current custom Geom. Some inputs may not be used depending on the input type. The Parm name and group name are used to identify the Parm ID associated with the GUI element.

See also
GDEV
Parameters
[in]typeGUI element type enum (i.e. GDEV_SLIDER_ADJ_RANGE)
[in]labelOptional GUI device label
[in]parm_nameOptional Parm name
[in]group_nameOptional Parm group name
[in]rangeOptional GUI element range
Returns
GUI element index

◆ AddParm()

string AddParm ( int  type,
const string &in  name,
const string &in  group 
)

Function to add a new Parm of input type, name, and group for a custom Geom component

See also
PARM_TYPE
Parameters
[in]typeParm type enum (i.e. PARM_DOUBLE_TYPE)
[in]nameParm name
[in]groupParm group
Returns
Parm ID

◆ AddXSecSurf()

string AddXSecSurf ( )

Add an XSecSurf to the current custom Geom

Returns
XSecSurf ID

◆ AppendCustomXSec()

string AppendCustomXSec ( const string &in  xsec_surf_id,
int  type 
)

Append an XSec to the current custom Geom. This function is identical to AppendXSec.

See also
XSEC_CRV_TYPE, AppendXSec
Parameters
[in]xsec_surf_idXSecSurf ID
[in]typeXSec type enum (i.e. XSEC_WEDGE)
Returns
XSec ID

◆ AppendXSec()

string AppendXSec ( const string &in  xsec_surf_id,
int  type 
)

Append an XSec to the current custom Geom. This function is identical to AppendCustomXSec.

See also
XSEC_CRV_TYPE, AppendCustomXSec
Parameters
[in]xsec_surf_idXSecSurf ID
[in]typeXSec type enum (i.e. XSEC_WEDGE)
Returns
XSec ID

◆ CheckClearTriggerEvent()

bool CheckClearTriggerEvent ( int  gui_id)

Check and clear a trigger event for a custom Geom GUI element

Parameters
[in]gui_idGUI element index
Returns
True if successful, false otherwise

◆ ClearAllCustomDefaultSources()

void ClearAllCustomDefaultSources ( )

Clear all default sources for the current custom Geom

◆ ClearXSecSurfs()

void ClearXSecSurfs ( )

Clear all XSecSurf from the current custom Geom

◆ CloneSurf()

void CloneSurf ( int  index,
Matrix4d &in  mat 
)

Make a copy of the current custom Geom's main surface at given index and apply a transformation

Parameters
[in]indexMain surface index
[in]matTransformation matrix

◆ CopyCustomXSec()

void CopyCustomXSec ( const string &in  xsec_surf_id,
int  index 
)

Copy an XSec from the current custom Geom and keep it in memory

See also
PasteCustomXSec
Parameters
[in]xsec_surf_idXSecSurf ID
[in]indexXSec index

◆ CutCustomXSec()

void CutCustomXSec ( const string &in  xsec_surf_id,
int  index 
)

Remove an XSec from the current custom Geom and keep it in memory

See also
PasteCustomXSec
Parameters
[in]xsec_surf_idXSecSurf ID
[in]indexXSec index

◆ GetCurrCustomGeom()

string GetCurrCustomGeom ( )

Get the Geom ID of the current custom Geom

Returns
Geom ID

◆ GetCustomParm()

string GetCustomParm ( int  index)

Get the Parm ID for the input Parm index of the current custom Geom

Parameters
[in]indexParm index
Returns
Parm ID

◆ GetCustomXSecLoc()

vec3d GetCustomXSecLoc ( const string &in  xsec_id)

Get the location of an XSec for the current custom Geom

Parameters
[in]xsec_idXSec ID
Returns
3D location

◆ GetCustomXSecRot()

vec3d GetCustomXSecRot ( const string &in  xsec_id)

Get the rotation of an XSec for the current custom Geom

Parameters
[in]xsec_idXSec ID
Returns
3D rotation (degrees)

◆ InsertCustomXSec()

string InsertCustomXSec ( const string &in  xsec_surf_id,
int  type,
int  index 
)

Insert a new XSec at the given index for the currently selected custom Geom

See also
XSEC_CRV_TYPE
Parameters
[in]xsec_surf_idXSecSurf ID
[in]typeXSec type enum (i.e. XSEC_WEDGE)
[in]indexXSec index

◆ PasteCustomXSec()

void PasteCustomXSec ( const string &in  xsec_surf_id,
int  index 
)

Paste the XSec currently held in memory for the current custom Geom at given index

See also
CutCustomXSec, CopyCustomXSec
Parameters
[in]xsec_surf_idXSecSurf ID
[in]indexXSec index

◆ RemoveXSecSurf()

void RemoveXSecSurf ( const string &in  xsec_id)

Remove an XSecSurf from the current custom Geom

Parameters
[in]xsec_idXSecSurf ID

◆ SetCustomCenter()

void SetCustomCenter ( double  x,
double  y,
double  z 
)

Set the center point of the current custom Geom

Parameters
[in]xX coordinate
[in]yY coordinate
[in]zZ coordinate

◆ SetCustomXSecLoc()

void SetCustomXSecLoc ( const string &in  xsec_id,
const vec3d &in  loc 
)

Set the location of an XSec for the current custom Geom

Parameters
[in]xsec_idXSec ID
[in]loc3D location

◆ SetCustomXSecRot()

void SetCustomXSecRot ( const string &in  xsec_id,
const vec3d &in  rot 
)

Set the rotation of an XSec for the current custom Geom

Parameters
[in]xsec_idXSec ID
[in]rotAngle of rotation about the X, Y and Z axes (degrees)

◆ SetupCustomDefaultSource()

void SetupCustomDefaultSource ( int  type,
int  surf_index,
double  l1,
double  r1,
double  u1,
double  w1,
double  l2 = 0,
double  r2 = 0,
double  u2 = 0,
double  w2 = 0 
)

Add a CFD Mesh default source for the current custom Geom. Note, certain input params may not be used depending on the source type.

See also
CFD_MESH_SOURCE_TYPE
Parameters
[in]typeCFD Mesh source type enum (i.e. BOX_SOURCE)
[in]surf_indexMain surface index
[in]l1Source first edge length
[in]r1Source first radius
[in]u1Source first U location
[in]w1Source first W location
[in]l2Source second edge length
[in]r2Source second radius
[in]u2Source second U location
[in]w2Source second W location

◆ SetVspSurfCfdType()

void SetVspSurfCfdType ( int  type,
int  surf_index = - 1 
)

Set the surface CFD type for the current custom Geom at given surface index

See also
VSP_SURF_CFD_TYPE
Parameters
[in]typeCFD surface type enum (i.e. CFD_TRANSPARENT)
[in]surf_indexMain surface index. The default value of -1 is used to indicate all main surfaces are the same type.

◆ SetVspSurfType()

void SetVspSurfType ( int  type,
int  surf_index = - 1 
)

Set the surface type for the current custom Geom at given surface index

See also
VSP_SURF_TYPE
Parameters
[in]typeSurface type enum (i.e DISK_SURF)
[in]surf_indexMain surface index. The default value of -1 is used to indicate all main surfaces are the same type.

◆ SkinXSecSurf()

void SkinXSecSurf ( bool  closed_flag = false)

Perform a skinning update for the current custom Geom. This is typically the last call in the UpdateSurf function that gets called every time the Geom is updated.

Parameters
[in]closed_flagFlag to set the last XSec equal to the first

◆ TransformSurf()

void TransformSurf ( int  index,
Matrix4d &in  mat 
)

Perform a transformation for the main surface at input index for the current custom Geom

Parameters
[in]indexMain surface index
[in]matTransformation matrix

◆ UpdateGui()

void UpdateGui ( int  gui_id,
const string &in  parm_id 
)

Update the GUI element with an associated Parm

Parameters
[in]gui_idIndex of the GUI element
[in]parm_idParm ID