KiCad PCB EDA Suite
SutherlandHodgman::BoundaryHor< Comp > Class Template Reference
Inheritance diagram for SutherlandHodgman::BoundaryHor< Comp >:
SutherlandHodgman::ClipStage< BoundaryBottom, OutputStage > SutherlandHodgman::ClipStage< BoundaryTop, ClipLeft >

Public Member Functions

 BoundaryHor (REAL y)
 
bool IsInside (const PointF &pnt) const
 
PointF Intersect (const PointF &p0, const PointF &p1) const
 

Private Attributes

REAL m_Y
 

Detailed Description

template<class Comp>
class SutherlandHodgman::BoundaryHor< Comp >

Definition at line 126 of file SutherlandHodgmanClipPoly.h.

Constructor & Destructor Documentation

template<class Comp >
SutherlandHodgman::BoundaryHor< Comp >::BoundaryHor ( REAL  y)
inline

Definition at line 129 of file SutherlandHodgmanClipPoly.h.

Member Function Documentation

template<class Comp >
PointF SutherlandHodgman::BoundaryHor< Comp >::Intersect ( const PointF p0,
const PointF p1 
) const
inline

Definition at line 134 of file SutherlandHodgmanClipPoly.h.

References SutherlandHodgman::BoundaryHor< Comp >::m_Y, PointF::X, and PointF::Y.

135  { // assumes p0...p1 is not strictly horizontal
136  PointF d = p1 - p0;
137  REAL xslope = d.X / d.Y;
138 
139  PointF r;
140 
141  r.Y = m_Y;
142  r.X = p0.X + xslope * (m_Y - p0.Y);
143  return r;
144  }
double REAL
template<class Comp >
bool SutherlandHodgman::BoundaryHor< Comp >::IsInside ( const PointF pnt) const
inline

Definition at line 130 of file SutherlandHodgmanClipPoly.h.

References SutherlandHodgman::BoundaryHor< Comp >::m_Y, and PointF::Y.

131  {
132  return Comp ()( pnt.Y, m_Y );
133  } // return true if pnt.Y is at the inside of the boundary

Member Data Documentation


The documentation for this class was generated from the following file: