]> Shamusworld >> Repos - architektonas/blob - src/base/pen.h
Bugfixes related to removing Snapper class.
[architektonas] / src / base / pen.h
1 #ifndef __PEN_H__
2 #define __PEN_H__
3
4 #include "enums.h"
5 #include "color.h"
6 #include "flags.h"
7
8 /**
9  * A pen stores attributes for painting such as line width,
10  * linetype, color, ...
11  *
12  * @author James Hammons
13  * @author Andrew Mustun
14  */
15 class Pen: public Flags
16 {
17         public:
18                 Pen();
19                 Pen(const Color & c, RS2::LineWidth w, RS2::LineType t);
20                 Pen(unsigned int f);
21                 virtual ~Pen();
22
23                 RS2::LineType getLineType() const;
24                 void setLineType(RS2::LineType t);
25                 RS2::LineWidth getWidth() const;
26                 void setWidth(RS2::LineWidth w);
27                 double getScreenWidth() const;
28                 void setScreenWidth(double w);
29                 const Color & getColor() const;
30                 void setColor(const Color & c);
31                 bool isValid();
32                 bool operator==(const Pen & p) const;
33                 bool operator!=(const Pen & p) const;
34
35                 friend std::ostream & operator<<(std::ostream & os, const Pen & p);
36
37         protected:
38                 RS2::LineType lineType;
39                 RS2::LineWidth width;
40                 double screenWidth;
41                 Color color;
42 };
43
44 #endif