Public Member Functions | Private Attributes
SVG Class Reference

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

#include <SVG.hpp>

List of all members.

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*.
void line (double x1, double y1, double x2, double y2, String_Const stroke)
 Draw a line from (*x1*, *y1*) to (*x2*, *y2*) using *stroke*.
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*).
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:
void text (String_Const message, double x, double y, String_Const font_family, unsigned int font_size)
 draw *message* at (*x*, *y*).
 ~SVG ()
 Close SVG object.

Private Attributes

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

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.

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 Jun 6 2019 18:08:04