63 r_Edge(
const r_Point& newStart,
const r_Point& newEnd);
66 const r_Point& getStart()
const;
69 const r_Point& getEnd()
const;
72 double getInvSlope()
const;
75 double getSlope()
const;
78 double getCurrX(r_Range y)
const;
81 double getCurrY(r_Range x)
const;
84 void print_status( std::ostream& s = std::cout )
const;
87 bool isHorizontal()
const;
120 static const r_Dimension polyPointDim;
131 r_Polygon(
const char* init)
throw (r_Error);
134 r_Polygon(r_Range x, r_Range y);
137 r_Polygon(
const r_Polygon&);
143 r_Polygon& operator=(
const r_Polygon&);
146 void addPoint(
const r_Point& newPoint)
throw(r_Error);
149 void addPointXY(r_Range x, r_Range y)
throw(r_Error);
155 const std::vector<r_Edge>& getEdges()
const throw(r_Error);
158 r_Polygon::r_Polygon_Type detectPolygonType() const throw(r_Error);
164 std::vector<r_Point> getPoints() const throw(r_Error);
170 void print_status( std::ostream& s = std::cout ) const;
174 void fillMArray( r_GMarray& myArray,
bool fillInside =
false, const std::
string& bgr = "") const throw(r_Error);
181 r_Minterval getBoundingBox() const throw(r_Error);
185 void clip(const r_Minterval& clipDom) throw(r_Error);
189 void scale(const r_Point& origin, const r_Minterval& mddDom,
191 const r_Minterval& clipDom, const
double& scaleFactor) throw(r_Error);
202 void scale(const r_Point& origin, const
double& scaleFactor) throw(r_Error);
208 void mirror(const r_Minterval& mddDom) throw(r_Error);
213 r_Point getMiddle() const throw(r_Error);
217 void shrinkPoly(
int pixelCount) throw(r_Error);
220 int countEdges() const;
223 int countHorizontalEdges() const;
228 void checkFistPoint();
233 top, bottom, left, right
237 void fromPoints(
const std::vector<r_Point>& newPoints)
throw(r_Error);
240 void eraseLine( r_Range x1, r_Range x2, r_Range y, r_GMarray& myArray,
const std::string& bgr )
const throw(r_Error);
243 std::vector<r_Point> clip1Side(
const r_Minterval& b, r_Polygon::Side s);
246 bool inside(
const r_Minterval& b,
const r_Point& p, r_Polygon::Side s);
249 r_Point intersect(
const r_Minterval& b,
const r_Edge& e, r_Polygon::Side s);
258 std::vector<r_Edge> edges;
267 extern std::ostream&
operator<<( std::ostream& s,
const r_Polygon& d );
276 class EdgeSortCriterion
281 bool operator() (
const r_Edge& e1,
const r_Edge& e2)
const
283 return e1.getStart()[1] < e2.getStart()[1] ||
284 (!(e2.getStart()[1] < e1.getStart()[1]) && e1.getStart()[0] < e2.getStart()[0]);
291 class ActiveEdgeSortCriterion
296 bool operator() (
const r_Edge& e1,
const r_Edge& e2)
const
298 return e1.getStart()[0] < e2.getStart()[0] ||
299 (!(e2.getStart()[0] < e1.getStart()[0]) && e1.getStart()[1] < e2.getStart()[1]);
#define false
Definition: bool.h:23
std::ostream & operator<<(std::ostream &os, const std::vector< T > &list)