Public Member Functions | Private Attributes | List of all members
SVG Class Reference

SVG_Struct is the data structure for representing Scalable Vector Graphics. More...

#include <SVG.hpp>

Public Member Functions

void cartesian_scale (double x_width, double y_height, BoundingBox *bounding_box)
 Turns svg into a cartesian graphing canvas bounded by bounding_box. More...
 
void line (double x1, double y1, double x2, double y2, String_Const stroke)
 Draw a line from (x1, y1) to (x2, y2) using stroke. More...
 
void rectangle (double x, double y, double width, double height, String_Const stroke_color, String_Const fill_color)
 Draw a width by height rectangle at (x, y). More...
 
void setOffsets (double x_offset, double y_offset)
 
 SVG (String_Const base_name, double width, double height, double x_scale, double y_scale, String_Const units)
 Open an SVG object: More...
 
void text (String_Const message, double x, double y, String_Const font_family, unsigned int font_size)
 draw message at (x, y). More...
 
 ~SVG ()
 Close SVG object. More...
 

Private Attributes

double height
 Hight of SVG image. More...
 
File stream
 The output stream. More...
 
String_Const units
 Units to use for SVG values. More...
 
double width
 Width of SVG image. More...
 
double x_offset
 Amount to offset X by. More...
 
double x_scale
 Amount to scale X by. More...
 
double y_offset
 Amount to offset Y by. More...
 
double y_scale
 Amount to scale Y by. More...
 

Detailed Description

SVG_Struct is the data structure for representing Scalable Vector Graphics.

Definition at line 15 of file SVG.hpp.

Constructor & Destructor Documentation

SVG::SVG ( String_Const  base_name,
double  width,
double  height,
double  x_scale,
double  y_scale,
String_Const  units 
)

Open an SVG object:

Parameters
base_nameis the base name of the file name without the .svg.
widthis the width of the SVG.
heightis the height of the SVG.
x_scaleis the amount is scale in X.
y_scaleis the amount to scale in Y.
unitsis the units to use.
Returns
a new SVG object.

SVG__open() will create and return a new SVG for writing out scable vector graphics.

Definition at line 117 of file SVG.cpp.

SVG::~SVG ( )

Close SVG object.

Parameters
svgobject to close

SVG__close() will close svg.

Definition at line 74 of file SVG.cpp.

Member Function Documentation

void SVG::cartesian_scale ( double  x_width,
double  y_height,
BoundingBox bounding_box 
)

Turns svg into a cartesian graphing canvas bounded by bounding_box.

Parameters
svgis the SVG object to modify.
x_widthis the available width graph on.
y_heightis the available height graph on.
bounding_boxspecifies the BoundingBox of the values to be graphed.

SVG__cartesian_scale() will modifiy svg so that it can graph lines, rectangles, etc, in an area bounded by bounding_box. The available graphing area is x_width by y_height.

Definition at line 23 of file SVG.cpp.

void SVG::line ( double  x1,
double  y1,
double  x2,
double  y2,
String_Const  stroke 
)

Draw a line from (x1, y1) to (x2, y2) using stroke.

Parameters
svgis the SVG object to draw line to.
x1is X coordinate of first point.
y1is Y coordinate of first point.
x2is X coordinate of second point.
y2is Y coordinate of second point.
strokeis stroke string.

SVG__line() will draw a line to svg from (x1, y1) to (x2, y2) using stroke.

Definition at line 91 of file SVG.cpp.

void SVG::rectangle ( double  x,
double  y,
double  width,
double  height,
String_Const  stroke_color,
String_Const  fill_color 
)

Draw a width by height rectangle at (x, y).

Parameters
svgis the SVG object to draw rectangle to.
xis the upper left X coordinate.
yis the uppper left Y coordinate.
widthis the rectangle width.
heightis the rectangle height.
stroke_coloris the exterior line color.
fill_coloris the interior fill color.

SVG__rectangle will draw a width by height rectangle at (x, y) with stroke_color and fill_color specifying the external line color and internal fill color respectivily.

Definition at line 171 of file SVG.cpp.

void SVG::setOffsets ( double  x_offset,
double  y_offset 
)

Definition at line 207 of file SVG.cpp.

void SVG::text ( String_Const  message,
double  x,
double  y,
String_Const  font_family,
unsigned int  font_size 
)

draw message at (x, y).

Parameters
svgis the SVG object to use.
messageis the message to draw.
xis the X coordinate to draw text at.
yis the Y coordinate of draw text at.
font_familyis the font family to use.
font_sizeis the font size.

SVG__text() will draw message at (x, y) with font_size font of type font_family.

Definition at line 196 of file SVG.cpp.

Member Data Documentation

double SVG::height
private

Hight of SVG image.

Definition at line 21 of file SVG.hpp.

File SVG::stream
private

The output stream.

Definition at line 18 of file SVG.hpp.

String_Const SVG::units
private

Units to use for SVG values.

Definition at line 27 of file SVG.hpp.

double SVG::width
private

Width of SVG image.

Definition at line 24 of file SVG.hpp.

double SVG::x_offset
private

Amount to offset X by.

Definition at line 30 of file SVG.hpp.

double SVG::x_scale
private

Amount to scale X by.

Definition at line 33 of file SVG.hpp.

double SVG::y_offset
private

Amount to offset Y by.

Definition at line 36 of file SVG.hpp.

double SVG::y_scale
private

Amount to scale Y by.

Definition at line 39 of file SVG.hpp.


The documentation for this class was generated from the following files:


fiducial_lib
Author(s): Wayne Gramlich
autogenerated on Thu Dec 28 2017 04:06:53