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...
|
| void | vsp::ShowAllRulers () |
| void | vsp::HideAllRulers () |
| void | vsp::ShowAllProbes () |
| void | vsp::HideAllProbes () |
| void | vsp::ShowAllProtractors () |
| void | vsp::HideAllProtractors () |
| void | vsp::ShowAllRSTProbes () |
| void | vsp::HideAllRSTProbes () |
| std::string | vsp::AddProtractor (const std::string &startgeomid, int startsurfindx, double startu, double startw, const std::string &midgeomid, int midsurfindx, double midu, double midw, const std::string &endgeomid, int endsurfindx, double endu, double endw, const std::string &name) |
| std::vector< std::string > | vsp::GetAllProtractors () |
| void | vsp::DelProtractor (const std::string &id) |
| void | vsp::DeleteAllProtractors () |
| std::string | vsp::AddRSTProbe (const std::string &geomid, int surfindx, double r, double s, double t, const std::string &name) |
| std::vector< std::string > | vsp::GetAllRSTProbes () |
| void | vsp::DelRSTProbe (const std::string &id) |
| void | vsp::DeleteAllRSTProbes () |
| std::string | vsp::AddRuler (const std::string &startgeomid, int startsurfindx, double startu, double startw, const std::string &endgeomid, int endsurfindx, double endu, double endw, const std::string &name) |
| std::vector< std::string > | vsp::GetAllRulers () |
| void | vsp::DelRuler (const std::string &id) |
| void | vsp::DeleteAllRulers () |
| std::string | vsp::AddProbe (const std::string &geomid, int surfindx, double u, double w, const std::string &name) |
| std::vector< std::string > | vsp::GetAllProbes () |
| void | vsp::DelProbe (const std::string &id) |
| void | vsp::DeleteAllProbes () |
◆ AddProbe()
| std::string vsp::AddProbe |
( |
const std::string & | geomid, |
|
|
int | surfindx, |
|
|
double | u, |
|
|
double | w, |
|
|
const std::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" );
if ( probe_id.length() == 0 || probe_id == "NONE" )
{
Print(
"ERROR: AddProbe returned no id" );
__failure++;
}
void Print(const std::string &data, bool new_line=true)
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
std::string AddProbe(const std::string &geomid, int surfindx, double u, double w, const std::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] | geomid | string Parent Geom ID |
| [in] | surfindx | int Main surface index from the parent Geom |
| [in] | u | double Surface u (0 - 1) coordinate |
| [in] | w | double Surface w (0 - 1) coordinate |
| [in] | name | string Probe name |
- Returns
- string Probe ID
◆ AddProtractor()
| std::string vsp::AddProtractor |
( |
const std::string & | startgeomid, |
|
|
int | startsurfindx, |
|
|
double | startu, |
|
|
double | startw, |
|
|
const std::string & | midgeomid, |
|
|
int | midsurfindx, |
|
|
double | midu, |
|
|
double | midw, |
|
|
const std::string & | endgeomid, |
|
|
int | endsurfindx, |
|
|
double | endu, |
|
|
double | endw, |
|
|
const std::string & | name ) |
|
extern |
Add a protractor measuring the angle at a middle point between two others, each given as a surface coordinate on a Geom.
string prid =
AddProtractor( pid, 0, 0.2, 0.0, pid, 0, 0.5, 0.0, pid, 0, 0.8, 0.0,
"TestProtractor" );
if ( prid.length() == 0 ) {
Print(
"ERROR: AddProtractor" ); __failure++; }
std::string AddProtractor(const std::string &startgeomid, int startsurfindx, double startu, double startw, const std::string &midgeomid, int midsurfindx, double midu, double midw, const std::string &endgeomid, int endsurfindx, double endu, double endw, const std::string &name)
std::vector< std::string > GetAllProtractors()
void Update(bool update_managers=true)
- See also
- GetAllProtractors, DelProtractor
- Parameters
-
| [in] | startgeomid | string Geom ID the first leg starts on |
| [in] | startsurfindx | int Surface index on that Geom |
| [in] | startu | double U coordinate of the start, in [0, 1] |
| [in] | startw | double W coordinate of the start, in [0, 1] |
| [in] | midgeomid | string Geom ID the corner sits on |
| [in] | midsurfindx | int Surface index on that Geom |
| [in] | midu | double U coordinate of the corner, in [0, 1] |
| [in] | midw | double W coordinate of the corner, in [0, 1] |
| [in] | endgeomid | string Geom ID the second leg ends on |
| [in] | endsurfindx | int Surface index on that Geom |
| [in] | endu | double U coordinate of the end, in [0, 1] |
| [in] | endw | double W coordinate of the end, in [0, 1] |
| [in] | name | string Name for the protractor |
- Returns
- string Protractor ID
◆ AddRSTProbe()
| std::string vsp::AddRSTProbe |
( |
const std::string & | geomid, |
|
|
int | surfindx, |
|
|
double | r, |
|
|
double | s, |
|
|
double | t, |
|
|
const std::string & | name ) |
|
extern |
Create and add an RST Probe object to the Measure Tool. An RST Probe marks a point in the volume of a Geom rather than on its surface.
string pod1 =
AddGeom(
"POD",
"" );
string pid =
AddRSTProbe( pod1, 0, 0.5, 0.5, 0.5,
"Example_RSTProbe" );
if ( pid.length() == 0 || pid == "NONE" )
{
Print(
"ERROR: AddRSTProbe returned no id" );
__failure++;
}
if ( probe_array.size() != 1 || probe_array[0] != pid )
{
Print(
"ERROR: AddRSTProbe did not add the probe" );
__failure++;
}
{
Print(
"ERROR: an RST probe was counted as a surface probe" );
__failure++;
}
{
Print(
"ERROR: AddRSTProbe did not name the probe" );
__failure++;
}
std::vector< std::string > GetAllRSTProbes()
std::string AddRSTProbe(const std::string &geomid, int surfindx, double r, double s, double t, const std::string &name)
std::vector< std::string > GetAllProbes()
std::string GetContainerName(const std::string &parm_container_id)
- See also
- GetAllRSTProbes, DelRSTProbe, DeleteAllRSTProbes, AddProbe
- Parameters
-
| [in] | geomid | string Parent Geom ID |
| [in] | surfindx | int Main surface index from the parent Geom |
| [in] | r | double R (0 - 1) volume coordinate |
| [in] | s | double S (0 - 1) volume coordinate |
| [in] | t | double T (0 - 1) volume coordinate |
| [in] | name | string RST Probe name |
- Returns
- string RST Probe ID
◆ AddRuler()
| std::string vsp::AddRuler |
( |
const std::string & | startgeomid, |
|
|
int | startsurfindx, |
|
|
double | startu, |
|
|
double | startw, |
|
|
const std::string & | endgeomid, |
|
|
int | endsurfindx, |
|
|
double | endu, |
|
|
double | endw, |
|
|
const std::string & | name ) |
|
extern |
Add a ruler between two points on the model, each given as a surface coordinate on a Geom.
string rid =
AddRuler( pid, 0, 0.2, 0.0, pid, 0, 0.8, 0.0,
"TestRuler" );
if ( rid.length() == 0 ) {
Print(
"ERROR: AddRuler" ); __failure++; }
std::vector< std::string > GetAllRulers()
std::string AddRuler(const std::string &startgeomid, int startsurfindx, double startu, double startw, const std::string &endgeomid, int endsurfindx, double endu, double endw, const std::string &name)
- See also
- GetAllRulers, DelRuler
- Parameters
-
| [in] | startgeomid | string Geom ID the ruler starts on |
| [in] | startsurfindx | int Surface index on the starting Geom |
| [in] | startu | double U coordinate of the start, in [0, 1] |
| [in] | startw | double W coordinate of the start, in [0, 1] |
| [in] | endgeomid | string Geom ID the ruler ends on |
| [in] | endsurfindx | int Surface index on the ending Geom |
| [in] | endu | double U coordinate of the end, in [0, 1] |
| [in] | endw | double W coordinate of the end, in [0, 1] |
| [in] | name | string Name for the ruler |
- 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" );
if ( probe_array.size() != 0 ) {
Print(
"Error: DeleteAllProbes" ); __failure++; }
◆ DeleteAllProtractors()
| void vsp::DeleteAllProtractors |
( |
| ) |
|
|
extern |
Delete all Protractors from the Measure Tool
string pod1 =
AddGeom(
"POD",
"" );
AddProtractor( pod1, 0, 0.2, 0.0, pod1, 0, 0.5, 0.0, pod1, 0, 0.8, 0.0,
"Protractor_1" );
AddProtractor( pod1, 0, 0.1, 0.0, pod1, 0, 0.4, 0.0, pod1, 0, 0.7, 0.0,
"Protractor_2" );
{
Print(
"ERROR: DeleteAllProtractors left protractors behind" );
__failure++;
}
void DeleteAllProtractors()
- See also
- AddProtractor, GetAllProtractors, DelProtractor
◆ DeleteAllRSTProbes()
| void vsp::DeleteAllRSTProbes |
( |
| ) |
|
|
extern |
Delete all RST Probes from the Measure Tool
string pod1 =
AddGeom(
"POD",
"" );
AddProbe( pod1, 0, 0.5, 0.5,
"Surface_Probe" );
{
Print(
"ERROR: DeleteAllRSTProbes left probes behind" );
__failure++;
}
{
Print(
"ERROR: DeleteAllRSTProbes removed a surface probe" );
__failure++;
}
void DeleteAllRSTProbes()
- See also
- AddRSTProbe, GetAllRSTProbes, DelRSTProbe
◆ 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" );
{
Print(
"ERROR: DeleteAllRulers left something behind" );
__failure++;
}
◆ DelProbe()
| void vsp::DelProbe |
( |
const std::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" );
if ( probe_array.size() != 1 ) {
Print(
"Error: DelProbe" ); __failure++; }
void DelProbe(const std::string &id)
- Parameters
-
◆ DelProtractor()
| void vsp::DelProtractor |
( |
const std::string & | id | ) |
|
|
extern |
Delete a particular Protractor from the Measure Tool
string pod1 =
AddGeom(
"POD",
"" );
string pid1 =
AddProtractor( pod1, 0, 0.2, 0.0, pod1, 0, 0.5, 0.0, pod1, 0, 0.8, 0.0,
"Protractor_1" );
string pid2 =
AddProtractor( pod1, 0, 0.1, 0.0, pod1, 0, 0.4, 0.0, pod1, 0, 0.7, 0.0,
"Protractor_2" );
if ( prot_array.size() != 1 || prot_array[0] != pid2 )
{
Print(
"ERROR: DelProtractor removed the wrong protractor" );
__failure++;
}
void DelProtractor(const std::string &id)
- See also
- AddProtractor, GetAllProtractors, DeleteAllProtractors
- Parameters
-
| [in] | id | string Protractor ID |
◆ DelRSTProbe()
| void vsp::DelRSTProbe |
( |
const std::string & | id | ) |
|
|
extern |
Delete a particular RST Probe from the Measure Tool
string pod1 =
AddGeom(
"POD",
"" );
string pid1 =
AddRSTProbe( pod1, 0, 0.5, 0.5, 0.5,
"RSTProbe_1" );
string pid2 =
AddRSTProbe( pod1, 0, 0.25, 0.5, 0.5,
"RSTProbe_2" );
if ( probe_array.size() != 1 || probe_array[0] != pid2 )
{
Print(
"ERROR: DelRSTProbe removed the wrong probe" );
__failure++;
}
void DelRSTProbe(const std::string &id)
- See also
- AddRSTProbe, GetAllRSTProbes, DeleteAllRSTProbes
- Parameters
-
| [in] | id | string RST Probe ID |
◆ DelRuler()
| void vsp::DelRuler |
( |
const std::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" );
{
Print(
"ERROR: DelRuler removed nothing" );
__failure++;
}
void DelRuler(const std::string &id)
- Parameters
-
◆ GetAllProbes()
| std::vector< std::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" );
if ( probe_array.length() == 0 )
{
Print(
"ERROR: GetAllProbes returned nothing" );
__failure++;
}
Print(
"One Probe: ",
false );
- Returns
- vector<string> Array of Probe IDs
◆ GetAllProtractors()
| std::vector< std::string > vsp::GetAllProtractors |
( |
| ) |
|
|
extern |
Get an array of all Protractor IDs from the Measure Tool
string pod1 =
AddGeom(
"POD",
"" );
AddProtractor( pod1, 0, 0.2, 0.0, pod1, 0, 0.5, 0.0, pod1, 0, 0.8, 0.0,
"Protractor_1" );
AddProtractor( pod1, 0, 0.1, 0.0, pod1, 0, 0.4, 0.0, pod1, 0, 0.7, 0.0,
"Protractor_2" );
if ( prot_array.size() != 2 )
{
Print(
"ERROR: GetAllProtractors did not report both protractors" );
__failure++;
}
if ( prot_array.size() == 2 && prot_array[0] == prot_array[1] )
{
Print(
"ERROR: GetAllProtractors reported the same protractor twice" );
__failure++;
}
- See also
- AddProtractor, DelProtractor, DeleteAllProtractors
- Returns
- vector<string> Array of Protractor IDs
◆ GetAllRSTProbes()
| std::vector< std::string > vsp::GetAllRSTProbes |
( |
| ) |
|
|
extern |
Get an array of all RST Probe IDs from the Measure Tool
string pod1 =
AddGeom(
"POD",
"" );
if ( probe_array.size() != 2 )
{
Print(
"ERROR: GetAllRSTProbes did not report both probes" );
__failure++;
}
if ( probe_array.size() == 2 && probe_array[0] == probe_array[1] )
{
Print(
"ERROR: GetAllRSTProbes reported the same probe twice" );
__failure++;
}
- See also
- AddRSTProbe, DelRSTProbe, DeleteAllRSTProbes
- Returns
- vector<string> Array of RST Probe IDs
◆ GetAllRulers()
| std::vector< std::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" );
if ( ruler_array.length() == 0 )
{
Print(
"ERROR: GetAllRulers returned nothing" );
__failure++;
}
for( int n = 0 ; n < int( ruler_array.length() ) ; n++ )
{
}
- Returns
- vector<string> Vector of Ruler IDs
◆ HideAllProbes()
| void vsp::HideAllProbes |
( |
| ) |
|
|
extern |
◆ HideAllProtractors()
| void vsp::HideAllProtractors |
( |
| ) |
|
|
extern |
Hide every Protractor in the Measure Tool.
AddProtractor( pid, 0, 0.2, 0.0, pid, 0, 0.5, 0.0, pid, 0, 0.8, 0.0,
"P" );
void HideAllProtractors()
- See also
- ShowAllProtractors
◆ HideAllRSTProbes()
| void vsp::HideAllRSTProbes |
( |
| ) |
|
|
extern |
◆ HideAllRulers()
| void vsp::HideAllRulers |
( |
| ) |
|
|
extern |
Hide every Ruler in the Measure Tool.
AddRuler( pid, 0, 0.2, 0.0, pid, 0, 0.8, 0.0,
"R" );
- See also
- ShowAllRulers
◆ ShowAllProbes()
| void vsp::ShowAllProbes |
( |
| ) |
|
|
extern |
◆ ShowAllProtractors()
| void vsp::ShowAllProtractors |
( |
| ) |
|
|
extern |
Show every Protractor in the Measure Tool.
AddProtractor( pid, 0, 0.2, 0.0, pid, 0, 0.5, 0.0, pid, 0, 0.8, 0.0,
"P" );
void ShowAllProtractors()
- See also
- HideAllProtractors
◆ ShowAllRSTProbes()
| void vsp::ShowAllRSTProbes |
( |
| ) |
|
|
extern |
◆ ShowAllRulers()
| void vsp::ShowAllRulers |
( |
| ) |
|
|
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" );
if ( rid.length() == 0 || rid == "NONE" )
{
Print(
"ERROR: AddRuler returned no id" );
__failure++;
}
- Parameters
-
| [in] | startgeomid | string Start parent Geom ID |
| [in] | startsurfindx | int Main surface index from the staring parent Geom |
| [in] | startu | double Surface u (0 - 1) start coordinate |
| [in] | startw | double Surface w (0 - 1) start coordinate |
| [in] | endgeomid | string End parent Geom ID |
| [in] | endsurfindx | int Main surface index on the end parent Geom |
| [in] | endu | double Surface u (0 - 1) end coordinate |
| [in] | endw | double Surface w (0 - 1) end coordinate |
| [in] | name | string Ruler name |
- Returns
- string Ruler ID
Create and add a Protractor object from three points on Geom surfaces. The angle is measured at the middle point, between the legs running out to the start and end points.
string pod1 =
AddGeom(
"POD",
"" );
string pid =
AddProtractor( pod1, 0, 0.2, 0.0, pod1, 0, 0.5, 0.0, pod1, 0, 0.8, 0.0,
"Example_Protractor" );
if ( pid.length() == 0 || pid == "NONE" )
{
Print(
"ERROR: AddProtractor returned no id" );
__failure++;
}
if ( prot_array.size() != 1 || prot_array[0] != pid )
{
Print(
"ERROR: AddProtractor did not add the protractor" );
__failure++;
}
{
Print(
"ERROR: AddProtractor did not name the protractor" );
__failure++;
}
- See also
- GetAllProtractors, DelProtractor, DeleteAllProtractors, AddRuler
- Parameters
-
| [in] | startgeomid | string Start parent Geom ID |
| [in] | startsurfindx | int Start surface index from the start parent Geom |
| [in] | startu | double Start U (0 - 1) surface coordinate |
| [in] | startw | double Start W (0 - 1) surface coordinate |
| [in] | midgeomid | string Middle parent Geom ID |
| [in] | midsurfindx | int Middle surface index from the middle parent Geom |
| [in] | midu | double Middle U (0 - 1) surface coordinate |
| [in] | midw | double Middle W (0 - 1) surface coordinate |
| [in] | endgeomid | string End parent Geom ID |
| [in] | endsurfindx | int End surface index from the end parent Geom |
| [in] | endu | double End U (0 - 1) surface coordinate |
| [in] | endw | double End W (0 - 1) surface coordinate |
| [in] | name | string Protractor name |
- Returns
- string Protractor ID
Show every Ruler in the Measure Tool. This is the Measure screen's Show All button for rulers.
string pod1 =
AddGeom(
"POD",
"" );
string rid =
AddRuler( pod1, 0, 0.2, 0.0, pod1, 0, 0.8, 0.0,
"Example_Ruler" );
{
Print(
"ERROR: HideAllRulers did not hide the ruler" );
__failure++;
}
{
Print(
"ERROR: ShowAllRulers did not show the ruler" );
__failure++;
}
double GetParmVal(const std::string &parm_id)
- See also
- HideAllRulers, AddRuler