Dillo
Public Member Functions | Private Member Functions | Private Attributes | List of all members
dw::core::Polygon Class Reference

dw::core::Shape implemtation for polygons. More...

#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)
 
- Public Member Functions inherited from lout::object::Object
virtual ~Object ()
 The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More...
 
virtual bool equals (Object *other)
 Returns, whether two objects are equal. More...
 
virtual int hashValue ()
 Return a hash value for the object. More...
 
virtual Objectclone ()
 Return an exact copy of the object. More...
 
virtual void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer. More...
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object. More...
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses. More...
 

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). More...
 
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). More...
 
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). More...
 

Private Attributes

lout::misc::SimpleVector< Point > * points
 
int minx
 
int miny
 
int maxx
 
int maxy
 

Detailed Description

dw::core::Shape implemtation for polygons.

Constructor & Destructor Documentation

dw::core::Polygon::Polygon ( )
dw::core::Polygon::~Polygon ( )

Member Function Documentation

void dw::core::Polygon::addPoint ( int  x,
int  y 
)

References lout::misc::max(), and lout::misc::min().

Referenced by main().

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.

Referenced by main().

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).

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

int dw::core::Polygon::zOfVectorProduct ( int  x1,
int  y1,
int  x2,
int  y2 
)
inlineprivate

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).

Member Data Documentation

int dw::core::Polygon::maxx
private
int dw::core::Polygon::maxy
private
int dw::core::Polygon::minx
private
int dw::core::Polygon::miny
private
lout::misc::SimpleVector<Point>* dw::core::Polygon::points
private

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