34 #include <Pt/Gfx/Api.h>
35 #include <Pt/Gfx/Color.h>
36 #include <Pt/SmartPtr.h>
106 const std::vector<Pt::uint8_t>& dashPattern,
140 {
return style() == Solid; }
170 return _penData.get();
178 class PT_GFX_API PenData
181 PenData(
const Color& color, std::size_t size,
190 PenData(
const Color& color, std::size_t size,
195 , _dashPattern(dashPattern)
200 PenData(
const Color& color, std::size_t size,
205 , _dashPattern(dashPatternBeg, dashPatternEnd)
210 void setColor(
const Color& color)
213 const Color& color()
const
216 void setSize(std::size_t size)
219 std::size_t size()
const
225 _dashPattern.clear();
231 void setDashPattern(
const std::vector<Pt::uint8_t>& dashPattern)
233 _style = Pen::DashPattern;
234 _dashPattern = dashPattern;
237 const std::vector<Pt::uint8_t>& dashPattern()
const
238 {
return _dashPattern; }
247 { _joinStyle = join; }
250 {
return _joinStyle; }
256 std::vector<Pt::uint8_t> _dashPattern;
Core module.
Definition: pt-gfx-images.dox:14
Pen(const Color &color, std::size_t width, Style style=Solid, CapStyle cap=FlatCap, JoinStyle join=BevelJoin)
Constructs a pen with the specified size, color and styles.
void setSize(std::size_t size)
Sets the size of the pen.
Attributes for the drawing of outlines.
Definition: Pen.h:54
Pen()
Constructs a null pen.
void setJoinStyle(JoinStyle join=BevelJoin)
Sets the join style.
void setCapStyle(CapStyle cap=FlatCap)
Sets the cap style.
Style style() const
Returns the pen style.
const Color & color() const
Returns the color of the pen.
Style
Identifies how outlines are stroked.
Definition: Pen.h:59
JoinStyle joinStyle() const
Returns the join style.
void setColor(const Color &color)
Sets the color of the pen.
const std::vector< Pt::uint8_t > & dashPattern() const
Returns the pen user dash pattern.
std::size_t size() const
Returns the size of the pen.
Pen(const Color &color, std::size_t width, const std::vector< Pt::uint8_t > &dashPattern, CapStyle cap=FlatCap, JoinStyle join=BevelJoin)
Constructs a pen with a custom dash pattern.
uint_type uint8_t
Unsigned 8-bit integer type.
Definition: Types.h:18
JoinStyle
Identifies how connected line segments are joined.
Definition: Pen.h:78
Standard color type.
Definition: Color.h:47
void setStyle(Style style=Solid)
Sets the pen style.
Pen(const Color &color)
Constructs a pen with the specified color.
CapStyle capStyle() const
Returns the cap style.
bool isSolid() const
Returns true if the pen is solid.
Definition: Pen.h:139
const void * instance() const
Returns an implementation-specific pen instance.
Definition: Pen.h:168
void setDashPattern(const std::vector< Pt::uint8_t > &dashPattern)
Sets the pen user dash pattern.
CapStyle
Identifies how open line ends are rendered.
Definition: Pen.h:69
bool isNull() const
Returns true if the pen is null.