53 VecInt& a_firstEndCapEndPts,
54 VecInt& a_lastEndCapEndPts,
58 VecInt& a_blTypes)
override;
61 enum { SA_LEFT = 0, SA_RIGHT };
122 XmSlopedAbutmentUtilImpl::XmSlopedAbutmentUtilImpl()
131 XmSlopedAbutmentUtilImpl::~XmSlopedAbutmentUtilImpl()
242 double x1 = pts[pts.size() - 2].x;
243 double x2 = pts.back().x;
247 double z1 = pts[pts.size() - 2].y;
248 double z2 = pts.back().y;
249 double z3 = ((x3 - x1) / (x2 - x1) * (z2 - z1)) + z1;
316 double angleFactor(-1.0);
325 if (a_side == SA_RIGHT)
347 for (
int i = 1; i < nDiv; ++i)
349 double percent = (
static_cast<double>(i)) / nDiv;
350 interp->InterpCs(saXsect, next, percent, cs);
351 double len = saMaxLen + percent * (maxLen - saMaxLen);
355 vAngles->push_back(angle);
374 if (a_side == SA_RIGHT)
383 for (
size_t i = 0; i < vCs->size(); ++i)
386 double angleRad((*angles)[i] *
XM_PI / 180.0);
391 if (a_side == SA_RIGHT)
417 VecInt& a_firstEndCapEndPts,
418 VecInt& a_lastEndCapEndPts,
425 auto it = vLeft.rbegin();
426 auto end = vLeft.rend();
427 for (; it != end; ++it)
430 a_lastEndCapEndPts.push_back(it->back());
435 auto it = vRight.begin();
436 auto end = vRight.end();
437 for (; it != end; ++it)
440 a_lastEndCapEndPts.push_back(it->back());
448 auto it = vRight.rbegin();
449 auto end = vRight.rend();
450 for (; it != end; ++it)
453 a_firstEndCapEndPts.push_back(it->back());
458 auto it = vLeft.begin();
459 auto end = vLeft.end();
460 for (; it != end; ++it)
463 a_firstEndCapEndPts.push_back(it->back());
482 VecInt firstEndCapEndPts, lastEndCapEndPts;
485 if (firstIsSlopedAbutment)
488 firstEndCapEndPts.insert(firstEndCapEndPts.begin(),
ix);
490 firstEndCapEndPts.push_back(
ix);
491 b.push_back(firstEndCapEndPts);
492 a_blTypes.push_back(XmBreaklines::BL_END);
494 if (lastIsSlopedAbutment)
497 lastEndCapEndPts.insert(lastEndCapEndPts.begin(),
ix);
499 lastEndCapEndPts.push_back(
ix);
500 b.push_back(lastEndCapEndPts);
501 a_blTypes.push_back(XmBreaklines::BL_END);
506 for (
size_t i = 0; i < v2d.size(); ++i)
510 bl.insert(bl.begin(), v.rbegin(), v.rend());
512 type.push_back(XmBreaklines::BL_XSECT);
516 int leftShoulder, rightShoulder;
517 if (firstIsSlopedAbutment)
520 leftShoulder = a_io.
m_cs.front().m_idxLeftShoulder;
524 rightShoulder = a_io.
m_cs.front().m_idxRightShoulder;
529 if (lastIsSlopedAbutment)
532 leftShoulder = a_io.
m_cs.back().m_idxLeftShoulder;
536 rightShoulder = a_io.
m_cs.back().m_idxLeftShoulder;
545 XmSlopedAbutmentUtil::XmSlopedAbutmentUtil()
551 XmSlopedAbutmentUtil::~XmSlopedAbutmentUtil()
virtual void GetEndCapBreakLines(XmStamperIo &a_io, cs3dPtIdx &a_ptIdx, VecInt &a_blTypes) override
breaklines from the end cap
double m_angleRightTransition
Abutment definition for feature stamp end cap.
XmStamperIo * m_io
io class that has the stamping inputs
std::vector< int > VecInt
static BSHP< XmStampInterpCrossSection > New()
Creates a XmStampInterpCrossSection class.
void EnsureCrossSectionAtMaxX(XmStampCrossSection &a_xs)
Makes sure the cross section goes to the maxX value.
double m_angleLeftIncrement
VecPt3d m_left
left side of the cross section
VecPt3d2d m_right
3d locations of cross section points
Pt3d m_leftShoulder3d
location of the left shoulder in 3d
int m_idxRightShoulder
index to the shoulder point in the m_right vector
bool Setup()
Sets up variables to perform the conversion.
XmStamper3dPts * m_3dpts
class that holds the 3d points from the stamp coversion
VecInt2d m_outBreakLines
break lines that are honored in the TIN
std::vector< double > VecDbl
Implementaion of stSlopedAbutment.
double m_angleLeftTransition
stXs3dPts m_last_endcap
3d locations of the last end cap
XmStamperEndCap m_firstEndCap
end cap at beginnig of polyline
csPtIdx m_last_end_cap
helper struct to store point indexes
double m_leftMax
max x value for left side
End cap definition for feature stamp.
static BSHP< XmSlopedAbutmentUtil > New()
Creates a XmSlopedAbutmentUtil class.
void EndCapCrossSectionShouldersTo2dCrossSection()
Makes 2d cross sections from the end cap cross section but only includes the points from the shoulder...
static void EnsureVectorAtMaxX(VecPt3d &a_pts, double a_maxX)
Makes sure the cross section goes to the maxX value.
Pt3d m_rightShoulder3d
location of the right shoulder in 3d
class to hold 3d points for a cross section
double m_maxX
max distance from center line
std::vector< VecInt > VecInt2d
XmStamperEndCap m_lastEndCap
end cap at end of polyline
bool SlopedAbutmentTo2dCrossSection()
Sets up variables to perform the conversion.
virtual void GetEndCapEndPoints(cs3dPtIdx &a_ptIdx, VecInt &a_firstEndCapEndPts, VecInt &a_lastEndCapEndPts, XmStamperIo &a_io) override
creates a breakline representing the outer polygon of the stamp
Pt3d m_pt1
the first of 2 points defining the direction of the center line at this end cap
XmStampCrossSection m_saXsect
a 2d cross section built from the sloped abutment info
helper struct to store point indexes
VecDbl m_interpAnglesRight
angles for the interpolated left cross sections
#define XM_ENSURE_TRUE(...)
XmStampCrossSection m_csLeft
void gmComponentMagnitudes(double *a_x, double *a_y, double *a_mag, double *a_dir, bool a_tomagdir)
XmSlopedAbutment m_sa
copy of the sloped abutment
std::vector< XmStampCrossSection > m_interpRight
interpolated cross sections for the right side transition
XmStampCrossSection m_csRight
stXs3dPts m_first_endcap
3d locations of first end cap
double m_rightMax
max x value for right side
class to hold 3d points generated by the stamping operation
VecPt3d m_right
right side of the cross section
int m_type
type of end cap: 0- guidebank, 1- sloped abutment, 2- wing wall
void ConvertTo3d(int a_side)
Converts interpolated cross sections to 3d.
Stamping inputs/outputs class.
static void ConvertXsPointsTo3d(const Pt3d &a_cl, const VecPt3d &a_pts, double a_maxX, double a_angle, VecPt3d2d &a_3dpts)
Converts the left or right portion of a cross section data to 3d point locations using the angle from...
csPtIdx m_xsPts
helper struct to store point indexes
std::vector< VecPt3d > VecPt3d2d
Pt3d gmCreateVector(const Pt3d &a_p1, const Pt3d &a_p2)
Converts sloped abutment to 3d points.
csPtIdx m_first_end_cap
helper struct to store point indexes
void ComputeTransitionAngles()
Sets up variables to perform the conversion.
Cross section definition for stamping.
VecDbl m_interpAnglesLeft
std::vector< XmStampCrossSection > m_cs
cross sections along the polyLine
bool m_first
flag indicating if this is from the first end of the stamp
VecPt3d2d m_left
3d locations of cross section points
double m_angle
degrees from -45 to 45
stXs3dPts m_xsPts
3d locations of cross section points
VecPt3d m_slope
x,y pairs defining slope from center line
XmStamperEndCap m_cap
copy of the end cap
void InterpolateCrossSections(int a_side)
Interpolates cross sections to define the transition between the sloped abutment and the end cap cros...
Pt3d m_pt2
the second of 2 points defining the direction of the center line at this end cap
double m_angleCenterLine
the direction of the center line at the end cap;
VecInt2d m_right
indexes of cross section points
VecInt2d m_left
indexes of cross section points
virtual void DoConvertTo3d(bool a_first, XmStamperIo &a_io, XmStamper3dPts &a_3dpts) override
Converts an end cap to 3d pts defining the geometry.
double m_angleRightIncrement
XmSlopedAbutment m_slopedAbutment
sloped abutment definition
std::vector< XmStampCrossSection > m_interpLeft
interpolated cross sections for the left side transition
std::vector< Pt3d > VecPt3d
static void ScaleCrossSectionXvals(XmStampCrossSection &a_xs, double a_factor)
Converts interpolated cross sections to 3d.