]> Shamusworld >> Repos - architektonas/blob - src/base/pen.h
Fixed thumbnail rendering in LibraryWidget and DXF detection.
[architektonas] / src / base / pen.h
1 #ifndef __PEN_H__
2 #define __PEN_H__
3
4 #include "rs.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 RS_Pen: public RS_Flags
16 {
17         public:
18                 RS_Pen();
19                 RS_Pen(const RS_Color & c, RS2::LineWidth w, RS2::LineType t);
20                 RS_Pen(unsigned int f);
21                 virtual ~RS_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 RS_Color & getColor() const;
30                 void setColor(const RS_Color & c);
31                 bool isValid();
32                 bool operator==(const RS_Pen & p) const;
33                 bool operator!=(const RS_Pen & p) const;
34
35                 friend std::ostream & operator<<(std::ostream & os, const RS_Pen & p);
36
37         protected:
38                 RS2::LineType lineType;
39                 RS2::LineWidth width;
40                 double screenWidth;
41                 RS_Color color;
42 };
43
44 #endif