Marker Class Reference

#include <Marker.hpp>

Collaboration diagram for Marker:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class defines a marker which will be drawn at every point on a line.

The user-creatable BasicShape entry was removed as it presents more difficulties than it is worth in each language. In postscript a duplicate of every draw method for a basicshape class would have to be made using only relative drawing and spacing and such might have to be addressed. In svg, markers seem to need to be in the first quadrant (i.e. not centered on 0 0) and their middle has to be defined there as well (think of it as a translation from (0,0) to somewhere where the mark fits in the first quadrant) as my tests seemed to show tha svg (at the time at least) would cut off everything out of its bounds (quadrants II, III, IV). Also there are issues with the bounds of the marker and such.

Examples:

example11.cpp.

Definition at line 58 of file Marker.hpp.

Public Types

enum  Mark { PLUS, X, DOT }
 This enumeration contains sime simple marker choices. More...

Public Member Functions

 Marker (void)
 Default constructor.
 Marker (Mark imark, double irange=1.0, Color icolor=Color::BLACK)
 Constructor.
Mark getMark (void) const
 Accessor.
Color getColor (void) const
 Accessor.
double getRange (void) const
 Accessor.
void setColor (const Color &newColor)
 Mutator.
bool hasDefaultMark (void) const
 Returns whether this marker uses a default marker.
std::string uniqueName (void) const
 Returns a unique name for this marker.
bool shapeEquals (const Marker &other) const
 Compares this marker to another marker to see if they each have the same Mark and Range.
bool equals (const Marker &other) const
 Compares this marker to another marker.
bool operator== (const Marker &rhs) const
 Operator ==.
bool operator!= (const Marker &rhs) const
 Operator !=.

Static Public Member Functions

Marker clear ()


Member Enumeration Documentation

enum Mark
 

This enumeration contains sime simple marker choices.

Enumeration values:
PLUS 
X 
DOT 

Definition at line 63 of file Marker.hpp.


Constructor & Destructor Documentation

Marker void   )  [inline]
 

Default constructor.

Definition at line 68 of file Marker.hpp.

Marker Mark  imark,
double  irange = 1.0,
Color  icolor = Color::BLACK
[inline]
 

Constructor.

See also:
getRange For a description of how range is defined.
Parameters:
imark The predefined mark to use.
irange The range is the radius of the symmetrical predefined mark.
icolor The desired color of the mark.

Definition at line 78 of file Marker.hpp.


Member Function Documentation

Marker clear void   )  [inline, static]
 

Returns:
A clear marker.

Definition at line 101 of file Marker.hpp.

Referenced by SeriesList::addSeries().

bool equals const Marker other  )  const
 

Compares this marker to another marker.

Returns:
Whether or not the two markers are equal.

Definition at line 70 of file Marker.cpp.

References getColor(), and shapeEquals().

Color getColor void   )  const [inline]
 

Accessor.

Returns:
The color of the marker.

Definition at line 119 of file Marker.hpp.

Referenced by SeriesList::drawInFrame(), equals(), and PSImageBase::line().

Mark getMark void   )  const [inline]
 

Accessor.

Returns:
The mark that the marker is set as.

Definition at line 113 of file Marker.hpp.

Referenced by shapeEquals().

double getRange void   )  const [inline]
 

Accessor.

A range defines the radius of the mark from the point on which the point is drawn. A DOT mark with a range 0.5 will place a point with a diameter of 1.0 at each point on the Line.

Returns:
The range of the mark from its origin.

Definition at line 127 of file Marker.hpp.

Referenced by shapeEquals().

bool hasDefaultMark void   )  const [inline]
 

Returns whether this marker uses a default marker.

Definition at line 136 of file Marker.hpp.

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

Operator !=.

Definition at line 163 of file Marker.hpp.

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

Operator ==.

Definition at line 160 of file Marker.hpp.

void setColor const Color newColor  )  [inline]
 

Mutator.

Parameters:
newColor The new color of the marker.

Definition at line 133 of file Marker.hpp.

bool shapeEquals const Marker other  )  const
 

Compares this marker to another marker to see if they each have the same Mark and Range.

This is for postscript as a marker definition does not contain any references to color.

Returns:
Whether or not the two markers have the same shape & size.

Definition at line 65 of file Marker.cpp.

References getMark(), and getRange().

Referenced by equals().

std::string uniqueName void   )  const
 

Returns a unique name for this marker.

Definition at line 38 of file Marker.cpp.

References DOT, Color::getRGB(), PLUS, and X.

Referenced by SVGImage::line().


The documentation for this class was generated from the following files:
Generated on Tue Feb 7 03:31:25 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1