SVGImage Class Reference

#include <SVGImage.hpp>

Collaboration diagram for SVGImage:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class generates graphics in Scalable Vector Graphics format.

Much of the code is based on examples and explanations from the text "SVG Essentials" by J. David Eisenberg, published by O'Reilly.

Definition at line 48 of file SVGImage.hpp.

Public Member Functions

 SVGImage (std::ostream &stream, double width=US_LETTER_WIDTH_PTS, double height=US_LETTER_HEIGHT_PTS, ORIGIN_LOCATION iloc=LOWER_LEFT)
 Create an SVG output stream attached to an existing stream.
 SVGImage (const char *fname, double width=US_LETTER_WIDTH_PTS, double height=US_LETTER_HEIGHT_PTS, ORIGIN_LOCATION iloc=LOWER_LEFT)
 Create an SVG output file given the file name.
 ~SVGImage (void)
 Destructor.
void setMarker (const Marker &newMarker)
 Operations.
void comment (const Comment &comment)
void line (const Line &line)
void rectangle (const Rectangle &rect)
void circle (const Circle &circle)
void text (const Text &text)
void polygon (const Polygon &polygon)
void bitmap (const Bitmap &bitmap)
void view (void) throw (VDrawException)

Public Attributes

ViewerManager viewerManager
 Used to define default programs to open this type of file for a preview.

Protected Attributes

std::string filename
 Remember the output file name.
std::ofstream myfstream
 When writing to a file, this is used to set ostr.
std::ostream & ostr
 The stream to write to.


Constructor & Destructor Documentation

SVGImage std::ostream &  stream,
double  width = US_LETTER_WIDTH_PTS,
double  height = US_LETTER_HEIGHT_PTS,
ORIGIN_LOCATION  iloc = LOWER_LEFT
 

Create an SVG output stream attached to an existing stream.

Parameters:
stream Stream to insert SVG graphic elements
width Width of the SVG canvas in points
height Height of the SVG canvas in points
iloc Location of the origin the drawer will use

Definition at line 41 of file SVGImage.cpp.

SVGImage const char *  fname,
double  width = US_LETTER_WIDTH_PTS,
double  height = US_LETTER_HEIGHT_PTS,
ORIGIN_LOCATION  iloc = LOWER_LEFT
 

Create an SVG output file given the file name.

Parameters:
fname Name of the output file to be created
width Width of the SVG canvas in points
height Height of the SVG canvas in points
iloc Location of the origin the drawer will use

Definition at line 49 of file SVGImage.cpp.

~SVGImage void   ) 
 

Destructor.

Definition at line 57 of file SVGImage.cpp.


Member Function Documentation

void bitmap const Bitmap bitmap  ) 
 

Definition at line 421 of file SVGImage.cpp.

References Bitmap::boxes, comment(), ostr, Bitmap::x1, Bitmap::x2, Bitmap::y1, and Bitmap::y2.

void circle const Circle circle  ) 
 

Definition at line 362 of file SVGImage.cpp.

References comment(), ostr, Circle::radius, Circle::xc, and Circle::yc.

void comment const Comment comment  ) 
 

Definition at line 122 of file SVGImage.cpp.

References ostr, and Comment::str.

Referenced by bitmap(), circle(), line(), polygon(), rectangle(), and text().

void line const Line line  ) 
 

Definition at line 150 of file SVGImage.cpp.

References Path::asAbsolute(), comment(), Markable::getMarker(), ostr, and Marker::uniqueName().

void polygon const Polygon polygon  ) 
 

Definition at line 391 of file SVGImage.cpp.

References comment(), and ostr.

void rectangle const Rectangle rect  ) 
 

Definition at line 331 of file SVGImage.cpp.

References comment(), ostr, Rectangle::x1, Rectangle::x2, Rectangle::y1, and Rectangle::y2.

void setMarker const Marker newMarker  )  [inline]
 

Operations.

Definition at line 90 of file SVGImage.hpp.

void text const Text text  ) 
 

Definition at line 453 of file SVGImage.cpp.

References comment(), Text::getAngle(), TextStyle::getColor(), TextStyle::getPointSize(), Color::getRGB(), Text::getString(), TextStyle::isBold(), Text::isCenter(), TextStyle::isItalic(), Text::isLeft(), TextStyle::isMonospace(), TextStyle::isSansSerif(), TextStyle::isSerif(), TextStyle::isStrike(), TextStyle::isUnderline(), ostr, Text::x, and Text::y.

void view void   )  throw (VDrawException)
 

Definition at line 544 of file SVGImage.cpp.

References filename, ostr, ViewerManager::registerViewer(), ViewerManager::view(), and viewerManager.


Member Data Documentation

std::string filename [protected]
 

Remember the output file name.

Definition at line 126 of file SVGImage.hpp.

Referenced by view().

std::ofstream myfstream [protected]
 

When writing to a file, this is used to set ostr.

Definition at line 129 of file SVGImage.hpp.

std::ostream& ostr [protected]
 

The stream to write to.

Definition at line 132 of file SVGImage.hpp.

Referenced by bitmap(), circle(), comment(), line(), polygon(), rectangle(), text(), and view().

ViewerManager viewerManager
 

Used to define default programs to open this type of file for a preview.

Definition at line 118 of file SVGImage.hpp.

Referenced by view().


The documentation for this class was generated from the following files:
Generated on Tue May 21 03:31:38 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1