OpenVSP API Documentation 3.41.0
 
Loading...
Searching...
No Matches
Measure Tool Functions

This group of API functions can be used to control the Ruler Tool through the API. Click here to return to the main page. More...

Functions

string vsp::AddRuler (const string &startgeomid, int startsurfindx, double startu, double startw, const string &endgeomid, int endsurfindx, double endu, double endw, const string &name)
 
std::vector< string > vsp::GetAllRulers ()
 
void vsp::DelRuler (const string &id)
 
void vsp::DeleteAllRulers ()
 
string vsp::AddProbe (const string &geomid, int surfindx, double u, double w, const string &name)
 
std::vector< string > vsp::GetAllProbes ()
 
void vsp::DelProbe (const string &id)
 
void vsp::DeleteAllProbes ()
 

Detailed Description

Function Documentation

◆ AddProbe()

string vsp::AddProbe ( const string & geomid,
int surfindx,
double u,
double w,
const string & name )
extern

Create a new Probe and add it to the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string probe_id = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" );
SetParmVal( FindParm( probe_id, "Len", "Measure" ), 3.0 );
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
string AddProbe(const string &geomid, int surfindx, double u, double w, const string &name)
std::string FindParm(const std::string &parm_container_id, const std::string &parm_name, const std::string &group_name)
double SetParmVal(const std::string &parm_id, double val)
Parameters
[in]geomidstring Parent Geom ID
[in]surfindxint Main surface index from the parent Geom
[in]udouble Surface u (0 - 1) coordinate
[in]wdouble Surface w (0 - 1) coordinate
[in]namestring Probe name
Returns
string Probe ID

◆ AddRuler()

string vsp::AddRuler ( const string & startgeomid,
int startsurfindx,
double startu,
double startw,
const string & endgeomid,
int endsurfindx,
double endu,
double endw,
const string & name )
extern

Create a new Ruler and add it to the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string pid2 = AddGeom( "POD", "" );
SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 );
string rid = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" );
SetParmVal( FindParm( rid, "X_Offset", "Measure" ), 6.0 );
string AddRuler(const string &startgeomid, int startsurfindx, double startu, double startw, const string &endgeomid, int endsurfindx, double endu, double endw, const string &name)
Parameters
[in]startgeomidstring Start parent Geom ID
[in]startsurfindxint Main surface index from the staring parent Geom
[in]startudouble Surface u (0 - 1) start coordinate
[in]startwdouble Surface w (0 - 1) start coordinate
[in]endgeomidstring End parent Geom ID
[in]endsurfindxint Main surface index on the end parent Geom
[in]endudouble Surface u (0 - 1) end coordinate
[in]endwdouble Surface w (0 - 1) end coordinate
[in]namestring Ruler name
Returns
string Ruler ID

◆ DeleteAllProbes()

void vsp::DeleteAllProbes ( )
extern

Delete all Probes from the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string probe_id_1 = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" );
string probe_id_2 = AddProbe( pid1, 0, 0.2, 0.3, "Probe 2" );
array< string > @probe_array = GetAllProbes();
if ( probe_array.size() != 0 ) { Print( "Error: DeleteAllProbes" ); }
void DeleteAllProbes()
std::vector< string > GetAllProbes()

◆ DeleteAllRulers()

void vsp::DeleteAllRulers ( )
extern

Delete all Rulers from the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string pid2 = AddGeom( "POD", "" );
SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 );
string rid1 = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" );
string rid2 = AddRuler( pid1, 0, 0.4, 0.6, pid1, 1, 0.8, 0.9, "Ruler 2" );
void DeleteAllRulers()

◆ DelProbe()

void vsp::DelProbe ( const string & id)
extern

Delete a specific Probe from the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string probe_id_1 = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" );
string probe_id_2 = AddProbe( pid1, 0, 0.2, 0.3, "Probe 2" );
DelProbe( probe_id_1 );
array< string > @probe_array = GetAllProbes();
if ( probe_array.size() != 1 ) { Print( "Error: DelProbe" ); }
void DelProbe(const string &id)
Parameters
[in]idProbe ID

◆ DelRuler()

void vsp::DelRuler ( const string & id)
extern

Delete a particular Ruler from the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string pid2 = AddGeom( "POD", "" );
SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 );
string rid1 = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" );
string rid2 = AddRuler( pid1, 0, 0.4, 0.6, pid1, 1, 0.8, 0.9, "Ruler 2" );
array< string > @ruler_array = GetAllRulers();
DelRuler( ruler_array[0] );
std::vector< string > GetAllRulers()
void DelRuler(const string &id)
Parameters
[in]idstring Ruler ID

◆ GetAllProbes()

std::vector< string > vsp::GetAllProbes ( )
extern

Get an array of all Probe IDs from the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string probe_id = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" );
array< string > @probe_array = GetAllProbes();
Print( "One Probe: ", false );
Print( probe_array[0] );
Returns
[in] Array of Probe IDs

◆ GetAllRulers()

std::vector< string > vsp::GetAllRulers ( )
extern

Get an array of all Ruler IDs from the Measure Tool

string pid1 = AddGeom( "POD", "" );
SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 );
string pid2 = AddGeom( "POD", "" );
SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 );
string rid1 = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" );
string rid2 = AddRuler( pid1, 0, 0.4, 0.6, pid1, 1, 0.8, 0.9, "Ruler 2" );
array< string > @ruler_array = GetAllRulers();
Print("Two Rulers");
for( int n = 0 ; n < int( ruler_array.length() ) ; n++ )
{
Print( ruler_array[n] );
}
Returns
vector<string> Vector of Ruler IDs