summaryrefslogtreecommitdiff
path: root/liveengineUnmapped/ofxSVGTiny/src/ofxSVGTiny.h
blob: 5c9a2d3b7d8bcc702382525f8554e42e31f71465 (plain)
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
#pragma once

#include "ofMain.h"

extern "C"
{
#include "svgtiny.h"
};

class ofxSVGTiny
{
public:
	
	~ofxSVGTiny();
	
	void load(string path);
	void draw();
	
	float getWidth() const { return width; }
	float getHeight() const { return height; }
	int getNumPath() { return paths.size(); }
	ofPath& getPathAt(int n) { return *paths[n]; }

private:
	float width, height;

	typedef ofPtr<ofPath> ofPathRef;
	vector<ofPathRef> paths;

	void setupDiagram(struct svgtiny_diagram *diagram);
	void setupShape(struct svgtiny_shape *shape);

};