Public Member Functions | |
void | convert (PointType newtype) |
float | distance (Point other) const |
PointType | getPointType () const |
bool | isEnclosedBy (Point *leftTop, Point *rightBottom) |
float | noTypeCheckSquaredDistance (Point *other) const |
Point & | operator= (const Point &other) |
Point (const Point &other) | |
Point (PointType type=TilePoint, float x=0, float y=0, float z=0) | |
void | setType (PointType type) |
Point | to (PointType newtype) const |
~Point () | |
Public Attributes | |
float | x |
float | y |
float | z |
Private Attributes | |
PointType | type |
This class is used for holding Points. You can manipulate the coordinates directly.
import annchienta
point = annchienta.Point( annchienta.TilePoint, 2, 2 )
point.x = point.y = point.z = 0
Their are different types of point, I therefore recommend you read the PointType documentation.
Converting between types is easy, just use the to() and convert() functions.
import annchienta videoManager = annchienta.getVideoManager() point = annchienta.Point( annchienta.TilePoint, 2, 2 ) point.convert( ScreenPoint ) videoManager.drawLine( point.x, point.y, 0, 0 )
Annchienta::Point::Point | ( | PointType | type = TilePoint , |
|
float | x = 0 , |
|||
float | y = 0 , |
|||
float | z = 0 | |||
) |
Annchienta::Point::Point | ( | const Point & | other | ) |
Annchienta::Point::~Point | ( | ) |
void Annchienta::Point::convert | ( | PointType | newtype | ) |
float Annchienta::Point::distance | ( | Point | other | ) | const |
Returns True if this Point lies in the rectangular area defined by leftTop and rightBottom. This does not take the Z coordinate into account.
leftTop | Left top of the rectangle. | |
rightBottom | Right bottom of the rectangle. |
float Annchienta::Point::noTypeCheckSquaredDistance | ( | Point * | other | ) | const |
Returns the squared distance to another Point. This function does not check the other's point type and takes a pointer as argument, making this a very fast (but sometimes unreliable) function.
other | The other Point. |
Assingment operator.
void Annchienta::Point::setType | ( | PointType | type | ) |
PointType Annchienta::Point::type [private] |
float Annchienta::Point::x |
float Annchienta::Point::y |
float Annchienta::Point::z |