*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
Open an SVG object:
- Parameters:
-
base_name | is the base name of the file name without the .svg. |
width | is the width of the SVG. |
height | is the height of the SVG. |
x_scale | is the amount is scale in X. |
y_scale | is the amount to scale in Y. |
units | is 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.
Close SVG object.
- Parameters:
-
SVG__close*() will close *svg*.
Definition at line 74 of file SVG.cpp.
Member Function Documentation
Turns *svg* into a cartesian graphing canvas bounded by bounding_box*.
- Parameters:
-
svg | is the *SVG* object to modify. |
x_width | is the available width graph on. |
y_height | is the available height graph on. |
bounding_box | specifies 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.
Draw a line from (*x1*, *y1*) to (*x2*, *y2*) using *stroke*.
- Parameters:
-
svg | is the *SVG* object to draw line to. |
x1 | is X coordinate of first point. |
y1 | is Y coordinate of first point. |
x2 | is X coordinate of second point. |
y2 | is Y coordinate of second point. |
stroke | is 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.
Draw a *width* by *height* rectangle at (*x*, *y*).
- Parameters:
-
svg | is the *SVG* object to draw rectangle to. |
x | is the upper left X coordinate. |
y | is the uppper left Y coordinate. |
width | is the rectangle width. |
height | is the rectangle height. |
stroke_color | is the exterior line color. |
fill_color | is 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.
draw *message* at (*x*, *y*).
- Parameters:
-
svg | is the *SVG* object to use. |
message | is the message to draw. |
x | is the X coordinate to draw text at. |
y | is the Y coordinate of draw text at. |
font_family | is the font family to use. |
font_size | is 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
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.
Amount to offset X by.
Definition at line 30 of file SVG.hpp.
Amount to scale X by.
Definition at line 33 of file SVG.hpp.
Amount to offset Y by.
Definition at line 36 of file SVG.hpp.
Amount to scale Y by.
Definition at line 39 of file SVG.hpp.
The documentation for this class was generated from the following files: