HOG2
SVGUtil.h
Go to the documentation of this file.
1 //
2 // SVGUtil.hpp
3 // hog2 glut
4 //
5 // Created by Nathan Sturtevant on 10/29/15.
6 // Copyright © 2015 University of Denver. All rights reserved.
7 //
8 
9 #ifndef SVGUtil_h
10 #define SVGUtil_h
11 
12 #include <stdio.h>
13 #include <string>
14 #include "GLUtil.h"
15 #include "Graphics.h"
16 
17 namespace SVG {
18  enum svgAlignment {
22  };
23 
28 };
29 
30 }
31 
32 std::string SVGFrameRect(float x, float y, float width, float height, float border, rgbColor c);
33 
34 std::string SVGDrawRect(float x, float y, float width, float height, rgbColor c);
35 std::string SVGDrawRect(float x, float y, float width, float height, const char *gradient);
36 std::string SVGFrameCircle(double x, double y, double radius, double border, rgbColor c);
37 std::string SVGDrawCircle(double x, double y, double radius, rgbColor c);
38 
39 std::string SVGFrameNGon(double x, double y, double radius, int segments, float rotation, int border, rgbColor c);
40 std::string SVGDrawNGon(double x, double y, double radius, int segments, float rotation, rgbColor c);
41 
42 std::string SVGDrawLine(int x1, int y1, int x2, int y2, int width, rgbColor c, bool center = true);
43 std::string SVGDrawLine(float x1, float y1, float x2, float y2, float width, rgbColor c);
44 std::string SVGDrawLineSegments(const std::vector<Graphics::point> &lines, float width, rgbColor c);
45 std::string SVGBeginLinePath(float width, rgbColor c);
46 std::string SVGAddLinePath(float x1, float y1);
47 std::string SVGAddLinePath(float x1, float y1, float x2, float y2);
48 std::string SVGEndLinePath();
49 std::string SVGDrawText(float x1, float y1, const char *txt, rgbColor c, double size, const char *typeface = 0,
52 std::string SVGDrawStrokedText(float x1, float y1, const char *txt, rgbColor c, rgbColor strokeColor, double size);
53 
54 std::string SVGDefineGradient(bool horizontal, bool vertical, rgbColor c1, rgbColor c2, const char *name);
55 
56 std::string MakeSVG(const Graphics::Display &disp, int width, int height, int viewport = 0, const char *comment = 0, bool crisp = true);
57 void MakeSVG(const Graphics::Display &disp, const char *filename, int width, int height, int viewport = 0, const char *comment = 0, bool crisp = true);
58 
59 #endif /* SVGUtil_hpp */
SVGDrawLine
std::string SVGDrawLine(int x1, int y1, int x2, int y2, int width, rgbColor c, bool center=true)
Definition: SVGUtil.cpp:204
rgbColor
A color; r/g/b are between 0...1.
Definition: Colors.h:17
SVGDefineGradient
std::string SVGDefineGradient(bool horizontal, bool vertical, rgbColor c1, rgbColor c2, const char *name)
Definition: SVGUtil.cpp:34
SVG::kTop
@ kTop
Definition: SVGUtil.h:27
SVGDrawText
std::string SVGDrawText(float x1, float y1, const char *txt, rgbColor c, double size, const char *typeface=0, SVG::svgAlignment align=SVG::kCenter, SVG::svgBaseline base=SVG::kMiddle)
Definition: SVGUtil.cpp:227
SVG
Definition: SVGUtil.h:17
SVGDrawLineSegments
std::string SVGDrawLineSegments(const std::vector< Graphics::point > &lines, float width, rgbColor c)
Definition: SVGUtil.cpp:176
width
int width
Definition: SFML_HOG.cpp:54
rotation
float rotation[3][3]
Definition: RC.cpp:21
SVG::kBottom
@ kBottom
Definition: SVGUtil.h:25
SVGDrawStrokedText
std::string SVGDrawStrokedText(float x1, float y1, const char *txt, rgbColor c, rgbColor strokeColor, double size)
Definition: SVGUtil.cpp:266
SVGEndLinePath
std::string SVGEndLinePath()
Definition: SVGUtil.cpp:172
viewport
Definition: Common.h:56
SVGDrawCircle
std::string SVGDrawCircle(double x, double y, double radius, rgbColor c)
Definition: SVGUtil.cpp:60
SVGFrameCircle
std::string SVGFrameCircle(double x, double y, double radius, double border, rgbColor c)
Definition: SVGUtil.cpp:51
MakeSVG
std::string MakeSVG(const Graphics::Display &disp, int width, int height, int viewport=0, const char *comment=0, bool crisp=true)
Definition: SVGUtil.cpp:502
SVG::svgBaseline
svgBaseline
Definition: SVGUtil.h:24
SVGBeginLinePath
std::string SVGBeginLinePath(float width, rgbColor c)
Definition: SVGUtil.cpp:147
SVG::kMiddle
@ kMiddle
Definition: SVGUtil.h:26
SVG::kCenter
@ kCenter
Definition: SVGUtil.h:21
Graphics::Display
Definition: Graphics.h:146
SVGFrameRect
std::string SVGFrameRect(float x, float y, float width, float height, float border, rgbColor c)
Definition: SVGUtil.cpp:99
SVGFrameNGon
std::string SVGFrameNGon(double x, double y, double radius, int segments, float rotation, int border, rgbColor c)
Definition: SVGUtil.cpp:110
height
int height
Definition: SFML_HOG.cpp:54
SVGAddLinePath
std::string SVGAddLinePath(float x1, float y1)
Definition: SVGUtil.cpp:162
GLUtil.h
Graphics.h
SVG::kLeft
@ kLeft
Definition: SVGUtil.h:19
SVGDrawNGon
std::string SVGDrawNGon(double x, double y, double radius, int segments, float rotation, rgbColor c)
Definition: SVGUtil.cpp:127
SVG::kRight
@ kRight
Definition: SVGUtil.h:20
SVGDrawRect
std::string SVGDrawRect(float x, float y, float width, float height, rgbColor c)
Definition: SVGUtil.cpp:88
SVG::svgAlignment
svgAlignment
Definition: SVGUtil.h:18