Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions addons/ofxSvg/src/ofxSvg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ using namespace std;
extern "C"{
#include "svgtiny.h"
}
ofxSVG::~ofxSVG(){
ofxSvg::~ofxSvg(){
paths.clear();
}

float ofxSVG::getWidth() const {
float ofxSvg::getWidth() const {
return width;
}

float ofxSVG::getHeight() const {
float ofxSvg::getHeight() const {
return height;
}

int ofxSVG::getNumPath(){
int ofxSvg::getNumPath(){
return paths.size();
}
ofPath & ofxSVG::getPathAt(int n){
ofPath & ofxSvg::getPathAt(int n){
return paths[n];
}

void ofxSVG::load(std::string path){
void ofxSvg::load(std::string path){
path = ofToDataPath(path);

if(path.compare("") == 0){
Expand All @@ -40,7 +40,7 @@ void ofxSVG::load(std::string path){

}

void ofxSVG::loadFromString(std::string stringdata, std::string urlstring){
void ofxSvg::loadFromString(std::string stringdata, std::string urlstring){

// goes some way to improving SVG compatibility
fixSvgString(stringdata);
Expand Down Expand Up @@ -87,7 +87,7 @@ void ofxSVG::loadFromString(std::string stringdata, std::string urlstring){
svgtiny_free(diagram);
}

void ofxSVG::fixSvgString(std::string& xmlstring) {
void ofxSvg::fixSvgString(std::string& xmlstring) {

ofXml xml;

Expand Down Expand Up @@ -157,13 +157,13 @@ void ofxSVG::fixSvgString(std::string& xmlstring) {

}

void ofxSVG::draw(){
void ofxSvg::draw(){
for(int i = 0; i < (int)paths.size(); i++){
paths[i].draw();
}
}

void ofxSVG::setupDiagram(struct svgtiny_diagram * diagram){
void ofxSvg::setupDiagram(struct svgtiny_diagram * diagram){

width = diagram->width;
height = diagram->height;
Expand All @@ -180,7 +180,7 @@ void ofxSVG::setupDiagram(struct svgtiny_diagram * diagram){
}
}

void ofxSVG::setupShape(struct svgtiny_shape * shape, ofPath & path){
void ofxSvg::setupShape(struct svgtiny_shape * shape, ofPath & path){
float * p = shape->path;

path.setFilled(false);
Expand Down Expand Up @@ -223,6 +223,6 @@ void ofxSVG::setupShape(struct svgtiny_shape * shape, ofPath & path){
}
}

const vector <ofPath> & ofxSVG::getPaths() const{
const vector <ofPath> & ofxSvg::getPaths() const{
return paths;
}
6 changes: 4 additions & 2 deletions addons/ofxSvg/src/ofxSvg.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
/// but we have gone some way to improving this by manually implementing some extra features (such as the
/// SVG "use" element).

class ofxSVG {
public: ~ofxSVG();
class ofxSvg {
public: ~ofxSvg();

float getWidth() const ;
float getHeight() const;
Expand Down Expand Up @@ -55,3 +55,5 @@ class ofxSVG {
void setupShape(struct svgtiny_shape * shape, ofPath & path);

};

typedef ofxSvg ofxSVG;
2 changes: 1 addition & 1 deletion examples/input_output/svgExample/src/ofApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ofApp : public ofBaseApp{
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);

ofxSVG svg;
ofxSvg svg;
float step;
vector<ofPolyline> outlines;

Expand Down
2 changes: 1 addition & 1 deletion examples/templates/allAddonsExample/src/ofApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ class ofApp : public ofBaseApp{
ofxThreadedImageLoader threadedLoader;
ofxKinect kinect;
ofxPanel gui;
ofxSVG svg;
ofxSvg svg;
ofxXmlPoco xml;
};