StrokeStyle Class Reference

#include <StrokeStyle.hpp>

Collaboration diagram for StrokeStyle:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class defines how a line, path, or edge appears.

The stroke can have a width, a color, and a dash pattern.

Examples:

example11.cpp, and example13.cpp.

Definition at line 46 of file StrokeStyle.hpp.

Public Types

typedef std::list< double > dashLengthList
 This type lists the dash lengths.

Public Member Functions

 StrokeStyle (void)
 Default constructor.
 StrokeStyle (const Color &icolor, double iwidth=1)
 Creates a solid line StrokeStyle with defined color and width.
 StrokeStyle (const Color &icolor, double iwidth, const dashLengthList &dll)
 Creates a StrokeStyle with a defined color, width, and stroke pattern.
 StrokeStyle (const std::string &strSpec)
 Creates a StrokeStyle with attributes defined by a single string.
bool operator== (const StrokeStyle &rhs) const
 Operator ==.
bool operator!= (const StrokeStyle &rhs) const
 Operator !=.
Color getColor (void) const
 Color accessor.
double getWidth (void) const
 Width accessor.
bool getSolid (void) const
 Stroke solidity accessor.
dashLengthList getDashList (void) const
 Stroke pattern accessors.

Static Public Member Functions

StrokeStyle clear ()
 Get a clear strokestyle.

Protected Attributes

Color color
 Line Color.
double width
 Line width in points.
bool solid
 Is the line solid? If not it is dashed.
dashLengthList dashList
 List of dash lengths in points (if dashed).


Member Typedef Documentation

typedef std::list<double> dashLengthList
 

This type lists the dash lengths.

Each entry is interpreted as a stroke length and distance to the next stroke. If there are an odd number of entries, then the list is repeated.

Definition at line 55 of file StrokeStyle.hpp.


Constructor & Destructor Documentation

StrokeStyle void   ) 
 

Default constructor.

StrokeStyle const Color icolor,
double  iwidth = 1
 

Creates a solid line StrokeStyle with defined color and width.

Parameters:
icolor type vdraw::Color
iwidth Width in points

StrokeStyle const Color icolor,
double  iwidth,
const dashLengthList dll
 

Creates a StrokeStyle with a defined color, width, and stroke pattern.

Parameters:
icolor type vdraw::Color
iwidth Width in points
dll List of stroke and space lengths

StrokeStyle const std::string &  strSpec  )  [inline]
 

Creates a StrokeStyle with attributes defined by a single string.

The idea is to mimic line specifications supported by MATLAB or Octave, but with extensions to add a greater variety of colors and line widths. The format of the string is "[color name][dash descriptor][width]". Each descriptor is optional. The color name is one that can be interpreted as a Color class. Examples are 'r' for red, or the name of a color, such as "burnt orange". The dash symbol is any combination of dashes and dots. A single "-" represents a solid line. A single "." represents a stream of dots. If dots and dashes are combined, the stroke resembles that appearance. The default dashing is a solid line, if unspecified. The width is a number representing the width of the line in points. The default width, if unspecified, is one point. Some examples: "r-" would define a solid red line of default width; "b.2.5" would define a dotted blue line of width 2.5 points; "olive-.0.5" would define an olive line of width one half points, composed of dashes and dots.

Definition at line 101 of file StrokeStyle.hpp.


Member Function Documentation

StrokeStyle clear void   )  [inline, static]
 

Get a clear strokestyle.

Definition at line 104 of file StrokeStyle.hpp.

Referenced by SeriesList::addSeries().

Color getColor void   )  const [inline]
 

Color accessor.

Definition at line 115 of file StrokeStyle.hpp.

Referenced by SeriesList::drawInFrame().

dashLengthList getDashList void   )  const [inline]
 

Stroke pattern accessors.

Definition at line 124 of file StrokeStyle.hpp.

bool getSolid void   )  const [inline]
 

Stroke solidity accessor.

Definition at line 121 of file StrokeStyle.hpp.

double getWidth void   )  const [inline]
 

Width accessor.

Definition at line 118 of file StrokeStyle.hpp.

bool operator!= const StrokeStyle rhs  )  const [inline]
 

Operator !=.

Definition at line 111 of file StrokeStyle.hpp.

bool operator== const StrokeStyle rhs  )  const [inline]
 

Operator ==.

Definition at line 107 of file StrokeStyle.hpp.

References color, dashList, and width.


Member Data Documentation

Color color [protected]
 

Line Color.

Definition at line 129 of file StrokeStyle.hpp.

Referenced by operator==().

dashLengthList dashList [protected]
 

List of dash lengths in points (if dashed).

Definition at line 138 of file StrokeStyle.hpp.

Referenced by operator==().

bool solid [protected]
 

Is the line solid? If not it is dashed.

Definition at line 135 of file StrokeStyle.hpp.

double width [protected]
 

Line width in points.

Definition at line 132 of file StrokeStyle.hpp.

Referenced by operator==().


The documentation for this class was generated from the following file:
Generated on Sun May 19 03:31:37 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1