//This file is part of Photon (http://photon.sourceforge.net) //Copyright (C) 2004-2005 James Turk // // Author: // James Turk (jpt2433@rit.edu) // // Version: // $Id: Pen.hpp,v 1.2 2005/03/03 09:25:47 cozman Exp $ #ifndef PHOTON_VIDEO_PEN_HPP #define PHOTON_VIDEO_PEN_HPP #include "types.hpp" #include "video/Color.hpp" #include "math/Rect.hpp" #include "math/Vector2.hpp" #include "math/Circle.hpp" namespace photon { namespace video { // Class: Pen // Class which is used for drawing primitives. // // Each instance of pen has a color, and the various members simply draw // primitives in that color. class Pen { // Group: (Con/De)structors public: // Function: Pen // Default constructor, sets color to white. Pen(); // Function: Pen // Initializing constructor, takes components of color to use for drawing. // // Parameters: // r - Value for red component. // g - Value for green component. // b - Value for blue component. // a - Value for alpha component. [default: 255] // // See Also: // Pen(ubyte r, ubyte g, ubyte b, ubyte a=255); // Function: Pen // Initializing constructor, takes to use for drawing.. // // Parameters: // color - to use for drawing. // // See Also: // Pen(const Color& color); // Group: Color public: // Function: setColor // Sets color to use for drawing. // // Parameters: // r - Value for red component. // g - Value for green component. // b - Value for blue component. // a - Value for alpha component. [default: 255] void setColor(ubyte r, ubyte g, ubyte b, ubyte a=255); // Function: setColor // Sets color to use for drawing. // // Parameters: // color - to use for drawing. void setColor(const Color& color); // Group: Drawing public: // Function: drawPoint // Draws a single point. // // Parameters: // point - Point to draw. void drawPoint(const math::Point2& point) const; // Function: drawLine // Draw a line from one point to another. // // Parameters: // p1 - First endpoint of line. // p2 - Second endpoint of line. void drawLine(const math::Point2& p1, const math::Point2& p2) const; // Function: drawVector // Draw a vector, including small arrow, with base at a given point. // // Parameters: // point - Base point for vector. // vector - Vector to draw. void drawVector(const math::Point2& point, const math::Vector2& vector) const; // Function: drawRectangle // Draw an empty rectangle. // // Parameters: // rect - to draw. void drawRectangle(const math::Rect &rect) const; // Function: fillRectangle // Draw a filled rectangle. // // Parameters: // rect - to draw. void fillRectangle(const math::Rect &rect) const; // Function: drawCircle // Draw an empty circle. // // Parameters: // circle - to draw. void drawCircle(const math::Circle &circle) const; // Function: fillCircle // Draw a filled circle. // // Parameters: // circle - to draw. void fillCircle(const math::Circle &circle) const; // data members private: Color color_; }; } } #endif //PHOTON_VIDEO_PEN_HPP