SVG.hpp
Go to the documentation of this file.
1 // Copyright (c) 2013 by Wayne C. Gramlich. All rights reserved.
2 
3 #if !defined(SVG_H_INCLUDED)
4 #define SVG_H_INCLUDED 1
5 
6 #include <assert.h>
7 
8 #include "Bounding_Box.hpp"
9 #include "File.hpp"
10 #include "Memory.hpp"
11 
14 
15 class SVG {
16  private:
19 
21  double height;
22 
24  double width;
25 
28 
30  double x_offset;
31 
33  double x_scale;
34 
36  double y_offset;
37 
39  double y_scale;
40 
41  public:
42  SVG(String_Const base_name,
43  double width, double height, double x_scale, double y_scale,
44  String_Const units);
45 
46  ~SVG();
47  void setOffsets(double x_offset, double y_offset);
48 
49  void cartesian_scale(double x_width, double y_height, BoundingBox *bounding_box);
50  void line(double x1, double y1, double x2, double y2, String_Const stroke);
51  void rectangle(double x, double y,
52  double width, double height, String_Const stroke_color,
53  String_Const fill_color);
54  void text(String_Const message, double x, double y, String_Const font_family,
55  unsigned int font_size);
56 };
57 
58 
59 
60 #endif // !defined(SVG_H_INCLUDED)
double width
Width of SVG image.
Definition: SVG.hpp:24
SVG_Struct is the data structure for representing Scalable Vector Graphics.
Definition: SVG.hpp:15
SVG(String_Const base_name, double width, double height, double x_scale, double y_scale, String_Const units)
Open an SVG object:
Definition: SVG.cpp:117
double y_scale
Amount to scale Y by.
Definition: SVG.hpp:39
double y_offset
Amount to offset Y by.
Definition: SVG.hpp:36
~SVG()
Close SVG object.
Definition: SVG.cpp:74
void cartesian_scale(double x_width, double y_height, BoundingBox *bounding_box)
Turns svg into a cartesian graphing canvas bounded by bounding_box.
Definition: SVG.cpp:23
double x_scale
Amount to scale X by.
Definition: SVG.hpp:33
FILE * File
FILE is a file I/O object.
Definition: File.hpp:12
void line(double x1, double y1, double x2, double y2, String_Const stroke)
Draw a line from (x1, y1) to (x2, y2) using stroke.
Definition: SVG.cpp:91
File stream
The output stream.
Definition: SVG.hpp:18
void text(String_Const message, double x, double y, String_Const font_family, unsigned int font_size)
draw message at (x, y).
Definition: SVG.cpp:196
double x_offset
Amount to offset X by.
Definition: SVG.hpp:30
void setOffsets(double x_offset, double y_offset)
Definition: SVG.cpp:207
String_Const units
Units to use for SVG values.
Definition: SVG.hpp:27
double height
Hight of SVG image.
Definition: SVG.hpp:21
const char * String_Const
Definition: String.hpp:9
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).
Definition: SVG.cpp:171


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