// // point2d.h // // A point in 2d space // // Copyright (C) J. Belson 1998.11.30 // #ifndef _POINT2D_H_ #define _POINT2D_H_ #include #include "fcolour.h" #include "point3d.h" #include "types.h" #include "vector2d.h" class point3d; /** * Represents a point in 2d space */ class point2d { private: public: point2d(float x, float y, float depth = 0); point2d() { x = y = 0.0; depth = 0.0; }; float x, y; float depth; // Vertex colour fcolour col; void get(float *xx, float *yy, float *d) const; void set(float xx, float yy, float d); void set_colour(uint8 red, uint8 green, uint8 blue); fcolour get_colour(void) const; //point2d operator=(const point3d& p); friend std::ostream& operator<<(std::ostream& str, const point2d& p); // Get vector joining two points vector2d operator-(const point2d& p) const; // Scale point point2d operator*(double f); }; #endif // _POINT2D_H_