-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvgprinter.hpp
70 lines (59 loc) · 1.9 KB
/
svgprinter.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/******************************************************************************
* GRIDGEN: Grid Generating Compiler
* By: Andy Stone (aistone@gmail.com)
* (C) Copyright 2011 Colorado State University
*****************************************************************************/
/** \addtogroup IO
* @{
*/
#ifndef SVGPRINTER_HPP_
#define SVGPRINTER_HPP_
#include <iostream>
using namespace std;
/**
* Initialization function for the svgprinter module.
*/
void initializeModule_svgprinter();
/**
* This printer is used to output simple shapes and text into an SVG file.
* A list of valid colors for stroke and fill properties is available
* at: <http://www.december.com/html/spec/colorsvg.html>
*/
class SVGPrinter {
public:
// =======================
// - [Construction] -
// =======================
/** @name Construction */
////@{
/** Create a new SVG printer that outputs to the specified stream */
SVGPrinter(ostream &out);
///@}
// =======================
// - [Printing] -
// =======================
/** @name Printing */
////@{
/**
* Print the SVG header to the stream. Note: This must be called
* before executing any other print functions.
**/
void printHeader();
/**
* Print the SVG footer to the stream. Note: This must be called
* after printing the contents of the SVG object.
**/
void printFooter();
/** Print a circle **/
void printCircle(int x, int y, int r, string stroke, string fill);
/** Print a rectangle **/
void printRectangle(int x, int y, int w, int h,
string stroke, string fill);
/** Print text centered around a specified point **/
void printCenteredText(int x, int y, string text, string fontsize="");
///@}
private:
ostream &mOut;
};
#endif
/** @}*/