diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-01-17 00:15:21 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-01-17 00:15:21 +0000 |
| commit | 84b99181e804430acedb94ba848a801ffc33e15a (patch) | |
| tree | 71492826404c3aa8a5841d3bb2614b9912e9e85f /drawing/src/ofApp.cpp | |
initial commit
Diffstat (limited to 'drawing/src/ofApp.cpp')
| -rw-r--r-- | drawing/src/ofApp.cpp | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/drawing/src/ofApp.cpp b/drawing/src/ofApp.cpp new file mode 100644 index 0000000..f4a00b5 --- /dev/null +++ b/drawing/src/ofApp.cpp @@ -0,0 +1,128 @@ +#include "ofApp.h" +#include "glew.h" + + +//-------------------------------------------------------------- +void ofApp::setup(){ + ofxSVG svg; + svg.load("shapes.svg"); + vector <ofPath> paths= svg.getPaths(); + + for (int i=0;i<paths.size();i++){ + + paths[i].setMode(ofPath::COMMANDS); + + vector <ofPolyline> outlines= paths[i].getOutline(); + + for (int j=0;j<outlines.size();j++){ + segments.push_back(lineSegmenter(outlines[j])); + } + + } + + cout << "Found " << segments.size() << " segments"; + + ofSetFrameRate(30); +} + +//-------------------------------------------------------------- +void ofApp::update(){ + + + +} + + + +//-------------------------------------------------------------- +void ofApp::draw(){ + ofBackground(0,0,0); + ofSetColor(255,255,255); + + glTranslatef(128,128,0); + + + + + + + + //svg.draw(); + + std::stringstream strm; + strm << "segments: "<<segments.size(); + ofSetWindowTitle(strm.str()); + +} + + +//-------------------------------------------------------------- +void ofApp::exit() { + +} + + + +//-------------------------------------------------------------- +void ofApp::keyPressed(ofKeyEventArgs &args){ + + + +} + + + +//-------------------------------------------------------------- +void ofApp::keyReleased(int key){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseMoved(int x, int y ){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseDragged(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void ofApp::mousePressed(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseReleased(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseEntered(int x, int y){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseExited(int x, int y){ + +} + +//-------------------------------------------------------------- +void ofApp::windowResized(int w, int h){ + +} + +void ofApp::outputWindowResized(ofResizeEventArgs &resizeargs){ + +} + +//-------------------------------------------------------------- +void ofApp::gotMessage(ofMessage msg){ + +} + +//-------------------------------------------------------------- +void ofApp::dragEvent(ofDragInfo dragInfo){ + + +} |
