This group of API functions is used to create and manipulate RoutingGeom objects, which define wire routing paths between points in the model. Click here to return to the main page.
More...
|
| int | vsp::GetNumRoutingPts (const std::string &routing_id) |
| std::string | vsp::AddRoutingPt (const std::string &routing_id, const std::string &geom_id, int surf_index) |
| std::string | vsp::InsertRoutingPt (const std::string &routing_id, int index, const std::string &geom_id, int surf_index) |
| void | vsp::DelRoutingPt (const std::string &routing_id, int index) |
| void | vsp::DelAllRoutingPt (const std::string &routing_id) |
| int | vsp::MoveRoutingPt (const std::string &routing_id, int index, int reorder_type) |
| std::string | vsp::GetRoutingPtID (const std::string &routing_id, int index) |
| std::vector< std::string > | vsp::GetAllRoutingPtIds (const std::string &routing_id) |
| std::string | vsp::GetRoutingPtParentID (const std::string &pt_id) |
| void | vsp::SetRoutingPtParentID (const std::string &pt_id, const std::string &parent_id) |
| vec3d | vsp::GetMainRoutingPtCoord (const std::string &pt_id) |
| vec3d | vsp::GetRoutingPtCoord (const std::string &routing_id, int index, int symm_index) |
| std::vector< vec3d > | vsp::GetAllRoutingPtCoords (const std::string &routing_id, int symm_index) |
| std::vector< vec3d > | vsp::GetRoutingCurve (const std::string &routing_id, int symm_index) |
◆ AddRoutingPt()
| std::string vsp::AddRoutingPt |
( |
const std::string & | routing_id, |
|
|
const std::string & | geom_id, |
|
|
int | surf_index ) |
|
extern |
Add a routing point to a RoutingGeom. The new point will be the last point in the route. The new point will be anchored to the specified geom and surface.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
if ( rpt0.length() == 0 || rpt0 == "NONE" )
{
Print(
"ERROR: AddRoutingPt 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())
double SetParmVal(const std::string &parm_id, double val)
std::string GetParm(const std::string &geom_id, const std::string &name, const std::string &group)
std::string AddRoutingPt(const std::string &routing_id, const std::string &geom_id, int surf_index)
- See also
- AddRoutingPt, DelRoutingPt, InsertRoutingPt
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
| [in] | geom_id | string Geom ID of geom to anchor new routing point to |
| [in] | surf_index | int Index of surf to anchor new routing point to |
- Returns
- string ParmContainer ID for the newly added routing point
◆ DelAllRoutingPt()
| void vsp::DelAllRoutingPt |
( |
const std::string & | routing_id | ) |
|
|
extern |
Delete all routing points from a RoutingGeom.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
{
Print(
"ERROR: DelAllRoutingPt left something behind" );
__failure++;
}
int GetNumRoutingPts(const std::string &routing_id)
void DelAllRoutingPt(const std::string &routing_id)
- See also
- AddRoutingPt, DelRoutingPt
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
◆ DelRoutingPt()
| void vsp::DelRoutingPt |
( |
const std::string & | routing_id, |
|
|
int | index ) |
|
extern |
Delete a specified routing point from a RoutingGeom.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
{
Print(
"ERROR: DelRoutingPt removed nothing" );
__failure++;
}
void DelRoutingPt(const std::string &routing_id, int index)
- See also
- AddRoutingPt, DelAllRoutingPt
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
| [in] | index | int Index of routing point to delete |
◆ GetAllRoutingPtCoords()
| std::vector< vec3d > vsp::GetAllRoutingPtCoords |
( |
const std::string & | routing_id, |
|
|
int | symm_index ) |
|
extern |
Get the coordinate locations along a RoutingGeom. The main copy is symm_index = 0.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
if ( pvec.length() != 3 )
{
Print(
"ERROR: GetAllRoutingPtCoords returned the wrong number of points" );
__failure++;
}
else
{
if ( !closeTo( pvec[0].y(), 0.0, 1e-6 ) ||
!closeTo( pvec[1].y(), 2.0, 1e-6 ) ||
!closeTo( pvec[2].y(), 0.0, 1e-6 ) )
{
Print(
"ERROR: GetAllRoutingPtCoords did not follow the parent Geoms" );
__failure++;
}
if ( pvec[2].x() <= pvec[0].x() )
{
Print(
"ERROR: GetAllRoutingPtCoords did not order the points by U" );
__failure++;
}
{
Print(
"ERROR: GetAllRoutingPtCoords disagrees with GetMainRoutingPtCoord" );
__failure++;
}
}
std::vector< vec3d > GetAllRoutingPtCoords(const std::string &routing_id, int symm_index)
vec3d GetMainRoutingPtCoord(const std::string &pt_id)
void Update(bool update_managers=true)
double dist(const vec3d &a, const vec3d &b)
- See also
- AddRoutingPt, DelRoutingPt, GetMainRoutingPtCoord, GetRoutingPtCoord, GetRoutingCurve
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
| [in] | symm_index | int Symmetry index to get coordinate of |
- Returns
- vector < vec3d > coordinate of routing points along RoutingGeom
◆ GetAllRoutingPtIds()
| std::vector< std::string > vsp::GetAllRoutingPtIds |
( |
const std::string & | routing_id | ) |
|
|
extern |
Get the ParmContainer IDs of all the routing points within a RoutingGeom. The vector will contain the IDs in order.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
if ( rpts.length() == 0 )
{
Print(
"ERROR: GetAllRoutingPtIds returned nothing" );
__failure++;
}
std::vector< std::string > GetAllRoutingPtIds(const std::string &routing_id)
- See also
- AddRoutingPt, DelAllRoutingPt, GetRoutingPtId
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
- Returns
- vector<string> Vector of routing point ParmConatiner IDs
◆ GetMainRoutingPtCoord()
| vec3d vsp::GetMainRoutingPtCoord |
( |
const std::string & | pt_id | ) |
|
|
extern |
Get the main coordinate location a routing point. The main location is the location of the base copy before symmetry has been applied.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
if ( !closeTo( p1.
y(), 2.0, 1e-6 ) )
{
Print(
"ERROR: GetMainRoutingPtCoord did not follow the parent Geom" );
__failure++;
}
{
Print(
"ERROR: GetMainRoutingPtCoord disagrees with GetRoutingPtCoord" );
__failure++;
}
vec3d GetRoutingPtCoord(const std::string &routing_id, int index, int symm_index)
- See also
- AddRoutingPt, DelRoutingPt, GetRoutingPtCoord, GetAllRoutingPtCoords, GetRoutingCurve
- Parameters
-
| [in] | pt_id | string ParmContainer ID of desired routing point |
- Returns
- vec3d coordinate of main routing point
◆ GetNumRoutingPts()
| int vsp::GetNumRoutingPts |
( |
const std::string & | routing_id | ) |
|
|
extern |
Get the number of routing points in a RoutingGeom
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
{
Print(
"ERROR: GetNumRoutingPts did not count the points that were added" );
__failure++;
}
{
Print(
"ERROR: GetNumRoutingPts did not follow DelRoutingPt" );
__failure++;
}
- See also
- AddRoutingPt, DelRoutingPt
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
- Returns
- int Number of routing points in specified RoutingGeom
◆ GetRoutingCurve()
| std::vector< vec3d > vsp::GetRoutingCurve |
( |
const std::string & | routing_id, |
|
|
int | symm_index ) |
|
extern |
Get points along a RoutingGeom. These points will follow the curve of a RoutingGeom with radiused routing points. The main copy is symm_index = 0.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
if ( pvec.length() < rpts.length() )
{
Print(
"ERROR: GetRoutingCurve returned too few points" );
__failure++;
}
else
{
if (
dist( pvec[0], rpts[0] ) > 1e-6 ||
dist( pvec[pvec.length() - 1], rpts[rpts.length() - 1] ) > 1e-6 )
{
Print(
"ERROR: GetRoutingCurve does not end on the routing points" );
__failure++;
}
}
std::vector< vec3d > GetRoutingCurve(const std::string &routing_id, int symm_index)
- See also
- AddRoutingPt, DelRoutingPt, GetMainRoutingPtCoord, GetRoutingPtCoord, GetAllRoutingPtCoords
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
| [in] | symm_index | int Symmetry index to get coordinate of |
- Returns
- vector < vec3d > coordinate of points along RoutingGeom curve
◆ GetRoutingPtCoord()
| vec3d vsp::GetRoutingPtCoord |
( |
const std::string & | routing_id, |
|
|
int | index, |
|
|
int | symm_index ) |
|
extern |
Get the coordinate location a routing point in a RoutingGeom. The main location is symm_index = 0.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
if ( !closeTo( p1.
y(), 2.0, 1e-6 ) )
{
Print(
"ERROR: GetRoutingPtCoord did not follow the parent Geom" );
__failure++;
}
if ( pvec.length() != 3 ||
dist( p1, pvec[1] ) > 1e-6 )
{
Print(
"ERROR: GetRoutingPtCoord disagrees with GetAllRoutingPtCoords" );
__failure++;
}
- See also
- AddRoutingPt, DelRoutingPt, GetMainRoutingPtCoord, GetAllRoutingPtCoords, GetRoutingCurve
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
| [in] | index | int Index of routing point to get cordinate of |
| [in] | symm_index | int Symmetry index to get coordinate of |
- Returns
- vec3d coordinate of routing point
◆ GetRoutingPtID()
| std::string vsp::GetRoutingPtID |
( |
const std::string & | routing_id, |
|
|
int | index ) |
|
extern |
Get the ParmContainer ID of a routing point within a RoutingGeom.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
if ( rid.length() == 0 )
{
Print(
"ERROR: GetRoutingPtID returned nothing" );
__failure++;
}
std::string GetRoutingPtID(const std::string &routing_id, int index)
- See also
- AddRoutingPt, DelAllRoutingPt, GetAllRoutingPtIds
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
| [in] | index | int Index of routing point to ID to retreive |
- Returns
- string ParmContainer ID for the specified routing point
◆ GetRoutingPtParentID()
| std::string vsp::GetRoutingPtParentID |
( |
const std::string & | pt_id | ) |
|
|
extern |
Get the Geom ID of the geom a routing point is anchored to.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
if ( gid.length() == 0 )
{
Print(
"ERROR: GetRoutingPtParentID returned nothing" );
__failure++;
}
std::string GetRoutingPtParentID(const std::string &pt_id)
- See also
- AddRoutingPt, DelAllRoutingPt, GetAllRoutingPtIds
- Parameters
-
| [in] | pt_id | string ParmContainer ID of desired routing point |
- Returns
- string Geom ID for the geom the routing point is anchored to
◆ InsertRoutingPt()
| std::string vsp::InsertRoutingPt |
( |
const std::string & | routing_id, |
|
|
int | index, |
|
|
const std::string & | geom_id, |
|
|
int | surf_index ) |
|
extern |
Add a routing point to a RoutingGeom. The new point will be inserted before the specified index. The new point will be anchored to the specified geom and surface.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
string uPre2 =
GetParm( rptPre2,
"U",
"RoutePt");
if ( rptPre2.length() == 0 || rptPre2 == "NONE" )
{
Print(
"ERROR: InsertRoutingPt returned no id" );
__failure++;
}
std::string InsertRoutingPt(const std::string &routing_id, int index, const std::string &geom_id, int surf_index)
- See also
- AddRoutingPt, DelRoutingPt
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
| [in] | index | int Index of routing point to insert new point before |
| [in] | geom_id | string Geom ID of geom to anchor new routing point to |
| [in] | surf_index | int Index of surf to anchor new routing point to |
- Returns
- string ParmContainer ID for the newly added routing point
◆ MoveRoutingPt()
| int vsp::MoveRoutingPt |
( |
const std::string & | routing_id, |
|
|
int | index, |
|
|
int | reorder_type ) |
|
extern |
Move a specified routing point within the route of a RoutingGeom.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
if ( newindx != 2 || after_ids.size() != before_ids.size() )
{
Print(
"ERROR: MoveRoutingPt did not move the point down" );
__failure++;
}
else
{
if ( after_ids[2] != before_ids[1] || after_ids[1] != before_ids[2] )
{
Print(
"ERROR: MoveRoutingPt did not swap the two points" );
__failure++;
}
}
int MoveRoutingPt(const std::string &routing_id, int index, int reorder_type)
- See also
- AddRoutingPt, DelRoutingPt, REORDER_TYPE
- Parameters
-
| [in] | routing_id | string RoutingGeom Geom ID |
| [in] | index | int Index of routing point to move |
| [in] | reorder_type | int Enum specifying reordering type (i.e. REORDER_MOVE_UP, REORDER_MOVE_DOWN, REORDER_MOVE_TOP, REORDER_MOVE_BOTTOM) |
◆ SetRoutingPtParentID()
| void vsp::SetRoutingPtParentID |
( |
const std::string & | pt_id, |
|
|
const std::string & | parent_id ) |
|
extern |
Set the Geom ID of the geom a routing point is anchored to.
string ypod2 =
GetParm(pod2,
"Y_Rel_Location",
"XForm");
string routing_geom =
AddGeom(
"ROUTING",
"");
string u0 =
GetParm( rpt0,
"U",
"RoutePt");
string u2 =
GetParm( rpt2,
"U",
"RoutePt");
{
Print(
"ERROR: SetRoutingPtParentID did not take" );
__failure++;
}
void SetRoutingPtParentID(const std::string &pt_id, const std::string &parent_id)
- See also
- AddRoutingPt, DelAllRoutingPt, GetAllRoutingPtIds
- Parameters
-
| [in] | pt_id | string ParmContainer ID of desired routing point |
| [in] | parent_id | string Geom ID for the geom to anchor the routing point to |