Functions for modifying XSecs of type XS_EDIT_CURVE are defined here. Click here to return to the main page.
More...
|
| void | vsp::EditXSecInitShape (const std::string &xsec_id) |
| void | vsp::EditXSecConvertTo (const std::string &xsec_id, const int &newtype) |
| std::vector< double > | vsp::GetEditXSecUVec (const std::string &xsec_id) |
| std::vector< vec3d > | vsp::GetEditXSecCtrlVec (const std::string &xsec_id, bool non_dimensional=true) |
| void | vsp::SetEditXSecPnts (const std::string &xsec_id, const std::vector< double > &u_vec, const std::vector< vec3d > &control_pts, const std::vector< double > &r_vec) |
| void | vsp::EditXSecDelPnt (const std::string &xsec_id, const int &indx) |
| int | vsp::EditXSecSplit01 (const std::string &xsec_id, const double &u) |
| void | vsp::MoveEditXSecPnt (const std::string &xsec_id, const int &indx, const vec3d &new_pnt) |
| void | vsp::ConvertXSecToEdit (const std::string &geom_id, const int &indx=0) |
| std::vector< bool > | vsp::GetEditXSecFixedUVec (const std::string &xsec_id) |
| void | vsp::SetEditXSecFixedUVec (const std::string &xsec_id, std::vector< bool > fixed_u_vec) |
| void | vsp::ReparameterizeEditXSec (const std::string &xsec_id) |
◆ ConvertXSecToEdit()
| void vsp::ConvertXSecToEdit |
( |
const std::string & | geom_id, |
|
|
const int & | indx = 0 ) |
|
extern |
Convert any XSec type into an EditCurveXSec. This function will work for BOR Geoms, in which case the input XSec index is ignored.
string sid =
AddGeom(
"STACK",
"" );
string xsec_1 =
GetXSec( xsec_surf, 1 );
void ConvertXSecToEdit(const std::string &geom_id, const int &indx=0)
std::vector< vec3d > GetEditXSecCtrlVec(const std::string &xsec_id, bool non_dimensional=true)
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
std::string GetXSecSurf(const std::string &geom_id, int index)
std::string GetXSec(const std::string &xsec_surf_id, int xsec_index)
void ChangeXSecShape(const std::string &xsec_surf_id, int xsec_index, int type)
- Parameters
-
| [in] | geom_id | string Geom ID |
| [in] | indx | int XSec index |
◆ EditXSecConvertTo()
| void vsp::EditXSecConvertTo |
( |
const std::string & | xsec_id, |
|
|
const int & | newtype ) |
|
extern |
Convert the EditCurveXSec curve type to the specified new type. Note, EditCurveXSec uses the same enumerations for PCurve to identify curve type, but APPROX_CEDIT is not supported at this time.
string sid =
AddGeom(
"STACK",
"" );
string xsec_1 =
GetXSec( xsec_surf, 1 );
void EditXSecConvertTo(const std::string &xsec_id, const int &newtype)
- See also
- PCURV_TYPE
- Parameters
-
| [in] | xsec_id | string XSec ID |
| [in] | newtype | int New curve type enum (i.e. CEDIT) |
◆ EditXSecDelPnt()
| void vsp::EditXSecDelPnt |
( |
const std::string & | xsec_id, |
|
|
const int & | indx ) |
|
extern |
Delete an EditCurveXSec control point. Note, cubic Bezier intermediate control points (those not on the curve) cannot be deleted. The previous and next Bezier control point will be deleted along with the point on the curve. Regardless of curve type, the first and last points may not be deleted.
string sid =
AddGeom(
"STACK",
"" );
string xsec_2 =
GetXSec( xsec_surf, 2 );
if ( old_pnts.size() - new_pnts.size() != 3 )
{
Print( "Error: EditXSecDelPnt");
}
void EditXSecDelPnt(const std::string &xsec_id, const int &indx)
double SetParmVal(const std::string &parm_id, double val)
std::string GetXSecParm(const std::string &xsec_id, const std::string &name)
- Parameters
-
| [in] | xsec_id | string XSec ID |
| [in] | indx | int Control point index |
◆ EditXSecInitShape()
| void vsp::EditXSecInitShape |
( |
const std::string & | xsec_id | ) |
|
|
extern |
Initialize the EditCurveXSec to the current value of m_ShapeType (i.e. EDIT_XSEC_ELLIPSE)
string sid =
AddGeom(
"STACK",
"" );
string xsec_2 =
GetXSec( xsec_surf, 2 );
void EditXSecInitShape(const std::string &xsec_id)
- See also
- INIT_EDIT_XSEC_TYPE
- Parameters
-
| [in] | xsec_id | string XSec ID |
◆ EditXSecSplit01()
| int vsp::EditXSecSplit01 |
( |
const std::string & | xsec_id, |
|
|
const double & | u ) |
|
extern |
Split the EditCurveXSec at the specified U value
string sid =
AddGeom(
"STACK",
"" );
string xsec_2 =
GetXSec( xsec_surf, 2 );
if ( new_pnts.size() - old_pnts.size() != 3 )
{
Print( "Error: EditXSecSplit01");
}
int EditXSecSplit01(const std::string &xsec_id, const double &u)
- Parameters
-
| [in] | xsec_id | string XSec ID |
| [in] | u | double U value to split the curve at (0 - 1) |
- Returns
- int Index of the point added from the split
◆ GetEditXSecCtrlVec()
| std::vector< vec3d > vsp::GetEditXSecCtrlVec |
( |
const std::string & | xsec_id, |
|
|
bool | non_dimensional = true ) |
|
extern |
Get the control point vector for an EditCurveXSec. Note, the returned array of vec3d values will be represented in 2D with Z set to 0.
string sid =
AddGeom(
"STACK",
"" );
string xsec_1 =
GetXSec( xsec_surf, 1 );
Print( "Normalized Bottom Point of XSecCurve: " + xsec1_pts[3].x() + ", " + xsec1_pts[3].y() + ", " + xsec1_pts[3].z() );
- Parameters
-
| [in] | xsec_id | string XSec ID |
| [in] | non_dimensional | bool True to get the points non-dimensionalized, False to get them scaled by m_Width and m_Height |
- Returns
- vector <vec3d> Array of control points
◆ GetEditXSecFixedUVec()
| std::vector< bool > vsp::GetEditXSecFixedUVec |
( |
const std::string & | xsec_id | ) |
|
|
extern |
Get the vector of fixed U flags for each control point in an EditCurveXSec. The fixed U flag is used to hold the U parameter of the control point constant when performing an equal arc length reparameterization of the curve.
string xsec_1 =
GetXSec( xsec_surf, 1 );
fixed_u_vec[3] = true;
std::vector< bool > GetEditXSecFixedUVec(const std::string &xsec_id)
void SetEditXSecFixedUVec(const std::string &xsec_id, std::vector< bool > fixed_u_vec)
void ReparameterizeEditXSec(const std::string &xsec_id)
- See also
- SetEditXSecFixedUVec, ReparameterizeEditXSec
- Parameters
-
| [in] | xsec_id | string XSec ID |
- Returns
- vector <bool> Array of bool values for each control point
◆ GetEditXSecUVec()
| std::vector< double > vsp::GetEditXSecUVec |
( |
const std::string & | xsec_id | ) |
|
|
extern |
Get the U parameter vector for an EditCurveXSec. The vector will be in increasing order with a range of 0 - 1.
string sid =
AddGeom(
"STACK",
"" );
string xsec_2 =
GetXSec( xsec_surf, 2 );
if ( u_vec[1] - 0.25 > 1e-6 )
{
Print( "Error: GetEditXSecUVec" );
}
std::vector< double > GetEditXSecUVec(const std::string &xsec_id)
- Parameters
-
| [in] | xsec_id | string XSec ID |
- Returns
- vector <double> Array of U parameter values
◆ MoveEditXSecPnt()
| void vsp::MoveEditXSecPnt |
( |
const std::string & | xsec_id, |
|
|
const int & | indx, |
|
|
const vec3d & | new_pnt ) |
|
extern |
Move an EditCurveXSec control point. The XSec points are nondimensionalized by m_Width and m_Height and defined in 2D, so the Z value of the new coordinate point will be ignored.
string sid =
AddGeom(
"STACK",
"" );
string xsec_1 =
GetXSec( xsec_surf, 1 );
int move_pnt_ind = 3;
vec3d new_pnt =
vec3d( xsec1_pts[move_pnt_ind].x(), 2 * xsec1_pts[move_pnt_ind].y(), 0.0 );
if (
dist( new_pnt, new_pnts[move_pnt_ind] ) > 1e-6 )
{
Print( "Error: MoveEditXSecPnt" );
}
void MoveEditXSecPnt(const std::string &xsec_id, const int &indx, const vec3d &new_pnt)
double dist(const vec3d &a, const vec3d &b)
- Parameters
-
| [in] | xsec_id | string XSec ID |
| [in] | indx | int Control point index |
| [in] | new_pnt | vec3d Coordinate of the new point |
◆ ReparameterizeEditXSec()
| void vsp::ReparameterizeEditXSec |
( |
const std::string & | xsec_id | ) |
|
|
extern |
Perform an equal arc length repareterization on an EditCurveXSec. The reparameterization is performed between specific U values if the Fixed U flag is true. This allows corners, such as at 0.25, 0.5, and 0.75 U, to be held constant while everything between them is reparameterized.
string xsec_1 =
GetXSec( xsec_surf, 1 );
fixed_u_vec[3] = true;
- See also
- SetEditXSecFixedUVec, GetEditXSecFixedUVec
- Parameters
-
| [in] | xsec_id | string XSec ID |
◆ SetEditXSecFixedUVec()
| void vsp::SetEditXSecFixedUVec |
( |
const std::string & | xsec_id, |
|
|
std::vector< bool > | fixed_u_vec ) |
|
extern |
Set the vector of fixed U flags for each control point in an EditCurveXSec. The fixed U flag is used to hold the U parameter of the control point constant when performing an equal arc length reparameterization of the curve.
string xsec_1 =
GetXSec( xsec_surf, 1 );
fixed_u_vec[3] = true;
- See also
- GetEditXSecFixedUVec, ReparameterizeEditXSec
- Parameters
-
| [in] | xsec_id | string XSec ID |
| [in] | fixed_u_vec | vector <bool> Array of fixed U flags |
◆ SetEditXSecPnts()
| void vsp::SetEditXSecPnts |
( |
const std::string & | xsec_id, |
|
|
const std::vector< double > & | u_vec, |
|
|
const std::vector< vec3d > & | control_pts, |
|
|
const std::vector< double > & | r_vec ) |
|
extern |
Set the U parameter vector and the control point vector for an EditCurveXSec. The arrays must be of equal length, with the values for U defined in increasing order and range 0 - 1. The input control points to SetEditXSecPnts must be nondimensionalized in the approximate range of [-0.5, 0.5].
string sid =
AddGeom(
"STACK",
"" );
string xsec_2 =
GetXSec( xsec_surf, 2 );
array < vec3d > xsec2_pts(5);
xsec2_pts[0] =
vec3d( 0.5, 0.5, 0.0 );
xsec2_pts[1] =
vec3d( 0.5, -0.5, 0.0 );
xsec2_pts[2] =
vec3d( -0.5, -0.5, 0.0 );
xsec2_pts[3] =
vec3d( -0.5, 0.5, 0.0 );
xsec2_pts[4] =
vec3d( 0.5, 0.5, 0.0 );
array < double > u_vec(5);
u_vec[0] = 0.0;
u_vec[1] = 0.25;
u_vec[2] = 0.5;
u_vec[3] = 0.75;
u_vec[4] = 1.0;
array < double > r_vec(5);
r_vec[0] = 0.0;
r_vec[1] = 0.0;
r_vec[2] = 0.0;
r_vec[3] = 0.0;
r_vec[4] = 0.0;
if (
dist( new_pnts[3], xsec2_pts[3] ) > 1e-6 )
{
Print( "Error: SetEditXSecPnts");
}
void SetEditXSecPnts(const std::string &xsec_id, const std::vector< double > &u_vec, const std::vector< vec3d > &control_pts, const std::vector< double > &r_vec)
- Parameters
-
| [in] | xsec_id | string XSec ID |
| [in] | u_vec | vector <double> Array of U parameter values |
| [in] | r_vec | vector <double> Array of R parameter values |
| [in] | control_pts | vector <vec3d> Nondimensionalized array of control points |