Searched defs:PolygonInterface (Results 1 - 2 of 2) sorted by relevance

/inkscape/src/libavoid/
H A Dgeomtypes.h112 class PolygonInterface class in namespace:Avoid
116 PolygonInterface() { } function in class:Avoid::PolygonInterface
118 virtual ~PolygonInterface() { }
171 class Polygon : public PolygonInterface
192 Polygon(const PolygonInterface& poly);
272 class ReferencingPolygon : public PolygonInterface
H A Dgeomtypes.cpp102 : PolygonInterface(),
127 : PolygonInterface()
168 void PolygonInterface::getBoundingRect(double *minX, double *minY,
204 : PolygonInterface()
211 : PolygonInterface(),
217 Polygon::Polygon(const PolygonInterface& poly)
218 : PolygonInterface(),
159 COLA_ASSERT(index < size()); const Polygon& poly = *(ps[index].first); unsigned short poly_index = ps[index].second; COLA_ASSERT(poly_index < poly.size()); return poly.ps[poly_index]; } void PolygonInterface::getBoundingRect(double *minX, double *minY, double *maxX, double *maxY) const { double progressiveMinX = DBL_MAX; double progressiveMinY = DBL_MAX; double progressiveMaxX = -DBL_MAX; double progressiveMaxY = -DBL_MAX; for (size_t i = 0; i < size(); ++i) { progressiveMinX = std::min(progressiveMinX, at(i).x); progressiveMinY = std::min(progressiveMinY, at(i).y); progressiveMaxX = std::max(progressiveMaxX, at(i).x); progressiveMaxY = std::max(progressiveMaxY, at(i).y); } if (minX) { *minX = progressiveMinX; } if (maxX) { *maxX = progressiveMaxX; } if (minY) { *minY = progressiveMinY; } if (maxY) { *maxY = progressiveMaxY; } } Polygon::Polygon() : PolygonInterface() { clear(); } Polygon::Polygon(const int pn) : PolygonInterface(), ps(pn) { } Polygon::Polygon(const PolygonInterface& poly) : PolygonInterface(), _id(poly.id()), ps(poly.size()) { for (size_t i = 0; i < poly.size(); ++i) { ps[i] = poly.at(i); } } void Polygon::clear(void) { ps.clear(); ts.clear(); } bool Polygon::empty(void) const { return ps.empty(); } size_t Polygon::size(void) const { return ps.size(); } int Polygon::id(void) const { return _id; } const Point& Polygon::at(size_t index) const { COLA_ASSERT(index < size()); return ps[index]; } static const unsigned int SHORTEN_NONE = 0; static const unsigned int SHORTEN_START = 1; static const unsigned int SHORTEN_END = 2; static const unsigned int SHORTEN_BOTH = SHORTEN_START | SHORTEN_END; static void shorten_line(double& x1, double& y1, double& x2, double& y2, const unsigned int mode, const double shorten_length) { if (mode == SHORTEN_NONE) { return; } double rise = y1 - y2; double run = x1 - x2; double disty = fabs(rise); double distx = fabs(run); if ((mode == SHORTEN_BOTH) && (((distx > disty) && ((shorten_length * 2) > distx)) || ((disty >= distx) && ((shorten_length * 2) > disty)))) { x1 = x2 = x1 - (run / 2); y1 = y2 = y1 - (rise / 2); return; } else if ((mode == SHORTEN_START) && (((distx > disty) argument

Completed in 17 milliseconds