VGImage Class Reference
[Basic Vector Graphics]

#include <VGImage.hpp>

Inheritance diagram for VGImage:

Inheritance graph
[legend]
Collaboration diagram for VGImage:

Collaboration graph
[legend]
List of all members.

Detailed Description

This is a generic, format- and device-independent interface to vector plotting.

Any subclass can be "swapped out" with another. The default unit of length is points (1/72 of an inch, about 1/28 of a centimeter).

Definition at line 52 of file VGImage.hpp.

Public Types

enum  ORIGIN_LOCATION { LOWER_LEFT, UPPER_LEFT }
 Enumeration to set origin from which everything in the stream will be drawn. More...

Public Member Functions

 VGImage (double width=US_LETTER_WIDTH_PTS, double height=US_LETTER_HEIGHT_PTS, ORIGIN_LOCATION iloc=LOWER_LEFT)
 Defines a new canvas in which to draw.
virtual ~VGImage ()
 Destructor.
double getWidth (void) const
 Access width.
double getHeight (void) const
 Access height.
bool isLL ()
virtual void view (void) throw (VDrawException)
 Write the footer, flush the stream, and view the output.

Static Public Attributes

const double PTS_PER_INCH
 Units conversion from points to inches.
const double PTS_PER_CM
 Units conversion from points to centimeters.
const double US_LETTER_WIDTH_PTS
 U.S. Customary page size width given in points.
const double US_LETTER_HEIGHT_PTS
 U.S. Customary page size height given in points.
const double A3_WIDTH_PTS
 A3 page size width given in points.
const double A3_HEIGHT_PTS
 A3 page size height given in points.
const double A4_WIDTH_PTS
 A4 page size width given in points.
const double A4_HEIGHT_PTS
 A4 page size height given in points.
const double A5_WIDTH_PTS
 A5 page size width given in points.
const double A5_HEIGHT_PTS
 A5 page size height given in points.

Protected Types

enum  StyleType { NONE, CLEAR, DEFAULT, SHAPE }
 This is an enumeration for the getCorrect*(...) helper methods. More...

Protected Member Functions

void rectangles (const Bitmap &bitmap)
 Take a bitmap and draw rectangles for each box.
StyleType getCorrectMarker (Marker *m, const Markable &mark)
 Helper function.
StyleType getCorrectStrokeStyle (StrokeStyle *s, const BasicShape &shape)
 Helper function.
StyleType getCorrectFillColor (Color *c, const Fillable &shape)
 Helper function.
StyleType getCorrectTextStyle (TextStyle *s, const Text &text)
 Helper function.
virtual void outputFooter (void)
 Close up the file -- must be done before this object is destroyed.

Protected Attributes

double canvasWidth
 Width of the drawable area in points.
double canvasHeight
 Height of the drawable area in points.
bool footerHasBeenWritten
 Make sure to only write the footer once.
bool ll
 Is the origin lower left? If not it is upper left.


Member Enumeration Documentation

enum ORIGIN_LOCATION
 

Enumeration to set origin from which everything in the stream will be drawn.

Enumeration values:
LOWER_LEFT  Origin in the lower-left corner.
UPPER_LEFT  Origin in the upper-left corner.

Definition at line 85 of file VGImage.hpp.

enum StyleType [protected]
 

This is an enumeration for the getCorrect*(...) helper methods.

Enumeration values:
NONE  There is no potential style.
CLEAR  The selected style is clear.
DEFAULT  The shape has no style but a default one is set.
SHAPE  The shape has its own style.

Definition at line 147 of file VGImage.hpp.


Constructor & Destructor Documentation

VGImage double  width = US_LETTER_WIDTH_PTS,
double  height = US_LETTER_HEIGHT_PTS,
ORIGIN_LOCATION  iloc = LOWER_LEFT
[inline]
 

Defines a new canvas in which to draw.

Parameters:
width Width of the canvas in points
height Height of the canvas in points
iloc Location on the page of the overall origin

Definition at line 102 of file VGImage.hpp.

virtual ~VGImage  )  [inline, virtual]
 

Destructor.

Definition at line 115 of file VGImage.hpp.


Member Function Documentation

StyleType getCorrectFillColor Color c,
const Fillable shape
[protected]
 

Helper function.

See also:
StyleType For return values
Parameters:
[out] c Pointer to Color to be set.
[in] shape Fillable to obtain the fill Color for.
Returns:
What type of Color was selected

StyleType getCorrectMarker Marker m,
const Markable mark
[protected]
 

Helper function.

See also:
StyleType For return values
Parameters:
[out] m Pointer to Marker to be set.
[in] mark Line to obtain Marker for.
Returns:
What type of marker was selected

StyleType getCorrectStrokeStyle StrokeStyle s,
const BasicShape shape
[protected]
 

Helper function.

See also:
StyleType For return values
Parameters:
[out] s Pointer to StrokeStyle to be set.
[in] shape BasicShape to obtain the StrokeStyle for.
Returns:
What type of StrokeStyle was selected

StyleType getCorrectTextStyle TextStyle s,
const Text text
[protected]
 

Helper function.

See also:
StyleType For return values
Parameters:
[out] s Pointer to TextStyle to be set.
[in] text Text to obtain the TextStyle for.
Returns:
What type of TextStyle was selected

double getHeight void   )  const [inline]
 

Access height.

Definition at line 124 of file VGImage.hpp.

double getWidth void   )  const [inline]
 

Access width.

Definition at line 118 of file VGImage.hpp.

bool isLL  )  [inline, virtual]
 

Returns:
true if the origin is lower left, false otherwise

Implements Canvas.

Definition at line 129 of file VGImage.hpp.

virtual void outputFooter void   )  [inline, protected, virtual]
 

Close up the file -- must be done before this object is destroyed.

Definition at line 198 of file VGImage.hpp.

void rectangles const Bitmap bitmap  )  [protected]
 

Take a bitmap and draw rectangles for each box.

virtual void view void   )  throw (VDrawException) [inline, virtual]
 

Write the footer, flush the stream, and view the output.

Definition at line 134 of file VGImage.hpp.


Member Data Documentation

const double A3_HEIGHT_PTS [static]
 

A3 page size height given in points.

Definition at line 71 of file VGImage.hpp.

const double A3_WIDTH_PTS [static]
 

A3 page size width given in points.

Definition at line 69 of file VGImage.hpp.

const double A4_HEIGHT_PTS [static]
 

A4 page size height given in points.

Definition at line 77 of file VGImage.hpp.

const double A4_WIDTH_PTS [static]
 

A4 page size width given in points.

Definition at line 75 of file VGImage.hpp.

const double A5_HEIGHT_PTS [static]
 

A5 page size height given in points.

Definition at line 82 of file VGImage.hpp.

const double A5_WIDTH_PTS [static]
 

A5 page size width given in points.

Definition at line 80 of file VGImage.hpp.

double canvasHeight [protected]
 

Height of the drawable area in points.

Definition at line 204 of file VGImage.hpp.

double canvasWidth [protected]
 

Width of the drawable area in points.

Definition at line 201 of file VGImage.hpp.

bool footerHasBeenWritten [protected]
 

Make sure to only write the footer once.

Definition at line 207 of file VGImage.hpp.

bool ll [protected]
 

Is the origin lower left? If not it is upper left.

This boolean is used to shorten expressions when placing a y-coordinate in a file.

Definition at line 214 of file VGImage.hpp.

const double PTS_PER_CM [static]
 

Units conversion from points to centimeters.

Definition at line 60 of file VGImage.hpp.

const double PTS_PER_INCH [static]
 

Units conversion from points to inches.

Definition at line 57 of file VGImage.hpp.

const double US_LETTER_HEIGHT_PTS [static]
 

U.S. Customary page size height given in points.

Definition at line 65 of file VGImage.hpp.

const double US_LETTER_WIDTH_PTS [static]
 

U.S. Customary page size width given in points.

Definition at line 63 of file VGImage.hpp.


The documentation for this class was generated from the following file:
Generated on Wed Feb 8 03:31:44 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1