#include <types.hh>
Public Member Functions | |
| Polygon () | |
| ~Polygon () | |
| void | draw (core::View *view, core::style::Style *style, int x, int y) |
| void | addPoint (int x, int y) |
| bool | isPointWithin (int x, int y) |
Private Member Functions | |
| int | zOfVectorProduct (int x1, int y1, int x2, int y2) |
| Return the z-coordinate of the vector product of two vectors, whose z-coordinate is 0 (so that x and y of the vector product is 0, too). | |
| bool | linesCross0 (int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2) |
| Return, whether the line, limited by (ax1, ay1) and (ax2, ay2), crosses the unlimited line, determined by two points (bx1, by1) and (bx2, by2). | |
| bool | linesCross (int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2) |
| Return, whether the line, limited by (ax1, ay1) and (ax2, ay2), crosses the line, limited by (bx1, by1) and (bx2, by2). | |
Private Attributes | |
| lout::misc::SimpleVector< Point > * | points |
| int | minx |
| int | miny |
| int | maxx |
| int | maxy |
| dw::core::Polygon::~Polygon | ( | ) |
References points.
| void dw::core::Polygon::addPoint | ( | int | x, | |
| int | y | |||
| ) |
| void dw::core::Polygon::draw | ( | core::View * | view, | |
| core::style::Style * | style, | |||
| int | x, | |||
| int | y | |||
| ) | [virtual] |
| bool dw::core::Polygon::isPointWithin | ( | int | x, | |
| int | y | |||
| ) | [virtual] |
Implements dw::core::Shape.
References lout::misc::SimpleVector< T >::getRef(), linesCross(), maxx, maxy, minx, miny, points, lout::misc::SimpleVector< T >::size(), dw::core::Point::x, and dw::core::Point::y.
| bool dw::core::Polygon::linesCross | ( | int | ax1, | |
| int | ay1, | |||
| int | ax2, | |||
| int | ay2, | |||
| int | bx1, | |||
| int | by1, | |||
| int | bx2, | |||
| int | by2 | |||
| ) | [private] |
Return, whether the line, limited by (ax1, ay1) and (ax2, ay2), crosses the line, limited by (bx1, by1) and (bx2, by2).
References linesCross0().
Referenced by isPointWithin().
| bool dw::core::Polygon::linesCross0 | ( | int | ax1, | |
| int | ay1, | |||
| int | ax2, | |||
| int | ay2, | |||
| int | bx1, | |||
| int | by1, | |||
| int | bx2, | |||
| int | by2 | |||
| ) | [private] |
Return, whether the line, limited by (ax1, ay1) and (ax2, ay2), crosses the unlimited line, determined by two points (bx1, by1) and (bx2, by2).
TODO Some more description
References zOfVectorProduct().
Referenced by linesCross().
| int dw::core::Polygon::zOfVectorProduct | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2 | |||
| ) | [inline, private] |
Return the z-coordinate of the vector product of two vectors, whose z-coordinate is 0 (so that x and y of the vector product is 0, too).
Referenced by linesCross0().
int dw::core::Polygon::maxx [private] |
Referenced by addPoint(), isPointWithin(), and Polygon().
int dw::core::Polygon::maxy [private] |
Referenced by addPoint(), isPointWithin(), and Polygon().
int dw::core::Polygon::minx [private] |
Referenced by addPoint(), isPointWithin(), and Polygon().
int dw::core::Polygon::miny [private] |
Referenced by addPoint(), isPointWithin(), and Polygon().
lout::misc::SimpleVector<Point>* dw::core::Polygon::points [private] |
Referenced by addPoint(), draw(), isPointWithin(), Polygon(), and ~Polygon().
1.5.9