HOG2
Namespaces | Enumerations | Functions
SVGUtil.h File Reference
#include <stdio.h>
#include <string>
#include "GLUtil.h"
#include "Graphics.h"
Include dependency graph for SVGUtil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 SVG
 

Enumerations

enum  SVG::svgAlignment { SVG::kLeft, SVG::kRight, SVG::kCenter }
 
enum  SVG::svgBaseline { SVG::kBottom, SVG::kMiddle, SVG::kTop }
 

Functions

std::string SVGFrameRect (float x, float y, float width, float height, float border, rgbColor c)
 
std::string SVGDrawRect (float x, float y, float width, float height, rgbColor c)
 
std::string SVGDrawRect (float x, float y, float width, float height, const char *gradient)
 
std::string SVGFrameCircle (double x, double y, double radius, double border, rgbColor c)
 
std::string SVGDrawCircle (double x, double y, double radius, rgbColor c)
 
std::string SVGFrameNGon (double x, double y, double radius, int segments, float rotation, int border, rgbColor c)
 
std::string SVGDrawNGon (double x, double y, double radius, int segments, float rotation, rgbColor c)
 
std::string SVGDrawLine (int x1, int y1, int x2, int y2, int width, rgbColor c, bool center=true)
 
std::string SVGDrawLine (float x1, float y1, float x2, float y2, float width, rgbColor c)
 
std::string SVGDrawLineSegments (const std::vector< Graphics::point > &lines, float width, rgbColor c)
 
std::string SVGBeginLinePath (float width, rgbColor c)
 
std::string SVGAddLinePath (float x1, float y1)
 
std::string SVGAddLinePath (float x1, float y1, float x2, float y2)
 
std::string SVGEndLinePath ()
 
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)
 
std::string SVGDrawStrokedText (float x1, float y1, const char *txt, rgbColor c, rgbColor strokeColor, double size)
 
std::string SVGDefineGradient (bool horizontal, bool vertical, rgbColor c1, rgbColor c2, const char *name)
 
std::string MakeSVG (const Graphics::Display &disp, int width, int height, int viewport=0, const char *comment=0, bool crisp=true)
 
void MakeSVG (const Graphics::Display &disp, const char *filename, int width, int height, int viewport=0, const char *comment=0, bool crisp=true)
 

Function Documentation

◆ MakeSVG() [1/2]

void MakeSVG ( const Graphics::Display disp,
const char *  filename,
int  width,
int  height,
int  viewport = 0,
const char *  comment = 0,
bool  crisp = true 
)

Definition at line 484 of file SVGUtil.cpp.

References height, MakeSVG(), and width.

Referenced by MakeSVG().

◆ MakeSVG() [2/2]

std::string MakeSVG ( const Graphics::Display disp,
int  width,
int  height,
int  viewport = 0,
const char *  comment = 0,
bool  crisp = true 
)

◆ SVGAddLinePath() [1/2]

std::string SVGAddLinePath ( float  x1,
float  y1 
)

Definition at line 162 of file SVGUtil.cpp.

Referenced by HandleCommand().

◆ SVGAddLinePath() [2/2]

std::string SVGAddLinePath ( float  x1,
float  y1,
float  x2,
float  y2 
)

Definition at line 167 of file SVGUtil.cpp.

◆ SVGBeginLinePath()

std::string SVGBeginLinePath ( float  width,
rgbColor  c 
)

Definition at line 147 of file SVGUtil.cpp.

References SVGGetRGB(), and width.

Referenced by HandleCommand().

◆ SVGDefineGradient()

std::string SVGDefineGradient ( bool  horizontal,
bool  vertical,
rgbColor  c1,
rgbColor  c2,
const char *  name 
)

Definition at line 34 of file SVGUtil.cpp.

References SVGGetRGB().

Referenced by MapOverlay::SVGDraw().

◆ SVGDrawCircle()

std::string SVGDrawCircle ( double  x,
double  y,
double  radius,
rgbColor  c 
)

◆ SVGDrawLine() [1/2]

std::string SVGDrawLine ( float  x1,
float  y1,
float  x2,
float  y2,
float  width,
rgbColor  c 
)

◆ SVGDrawLine() [2/2]

std::string SVGDrawLine ( int  x1,
int  y1,
int  x2,
int  y2,
int  width,
rgbColor  c,
bool  center = true 
)

Definition at line 204 of file SVGUtil.cpp.

References SVGGetRGB(), and width.

◆ SVGDrawLineSegments()

std::string SVGDrawLineSegments ( const std::vector< Graphics::point > &  lines,
float  width,
rgbColor  c 
)

Definition at line 176 of file SVGUtil.cpp.

References SVGGetRGB(), and width.

Referenced by MakeSVG().

◆ SVGDrawNGon()

std::string SVGDrawNGon ( double  x,
double  y,
double  radius,
int  segments,
float  rotation,
rgbColor  c 
)

Definition at line 127 of file SVGUtil.cpp.

References rotation, SVGGetRGB(), to_string_with_precision(), and TWOPI.

Referenced by HandleCommand().

◆ SVGDrawRect() [1/2]

std::string SVGDrawRect ( float  x,
float  y,
float  width,
float  height,
const char *  gradient 
)

◆ SVGDrawRect() [2/2]

std::string SVGDrawRect ( float  x,
float  y,
float  width,
float  height,
rgbColor  c 
)

Definition at line 88 of file SVGUtil.cpp.

References height, SVGGetRGB(), to_string_with_precision(), and width.

◆ SVGDrawStrokedText()

std::string SVGDrawStrokedText ( float  x1,
float  y1,
const char *  txt,
rgbColor  c,
rgbColor  strokeColor,
double  size 
)

Definition at line 266 of file SVGUtil.cpp.

References SVGGetRGB().

◆ 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 
)

◆ SVGEndLinePath()

std::string SVGEndLinePath ( )

Definition at line 172 of file SVGUtil.cpp.

Referenced by HandleCommand().

◆ SVGFrameCircle()

std::string SVGFrameCircle ( double  x,
double  y,
double  radius,
double  border,
rgbColor  c 
)

◆ SVGFrameNGon()

std::string SVGFrameNGon ( double  x,
double  y,
double  radius,
int  segments,
float  rotation,
int  border,
rgbColor  c 
)

Definition at line 110 of file SVGUtil.cpp.

References rotation, to_string_with_precision(), and TWOPI.

Referenced by HandleCommand().

◆ SVGFrameRect()

std::string SVGFrameRect ( float  x,
float  y,
float  width,
float  height,
float  border,
rgbColor  c 
)