From ef6ea2258969c8a1ceacf10e08085cc55ccae448 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 18 Apr 2023 00:04:22 +0100 Subject: WIP --- nextus/src/main.cpp | 2 +- nextus/src/ofApp.h | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 76 insertions(+), 5 deletions(-) (limited to 'nextus') diff --git a/nextus/src/main.cpp b/nextus/src/main.cpp index df57f72..3eb78b7 100644 --- a/nextus/src/main.cpp +++ b/nextus/src/main.cpp @@ -10,7 +10,7 @@ int main(int argc, char *argv[]){ settings.decorated = true; - settings.setSize(1200,900); + settings.setSize(1200,700); settings.setPosition(ofVec2f(0,0)); settings.resizable = false; diff --git a/nextus/src/ofApp.h b/nextus/src/ofApp.h index dd7b57d..352c6ca 100644 --- a/nextus/src/ofApp.h +++ b/nextus/src/ofApp.h @@ -40,7 +40,7 @@ class vectorPanel { ofPopMatrix(); ofPopMatrix(); } - virtual void drawcontent(); + virtual void drawcontent() {};; private: ofVec2f size; @@ -57,16 +57,87 @@ class svgPanel: public vectorPanel{ ) : vectorPanel(_title,_size,_pos){} void load(string filename){ ofLog()<<"loading SVG "< imagepaths= svg.getPaths(); + + std::stringstream strm; + + if (imagepaths.size()){ + segmenters.clear(); + //shape_selection_durations.clear(); + for (auto& path:imagepaths){ + path.setPolyWindingMode(OF_POLY_WINDING_ODD); + + vector outlines= path.getOutline(); + for (auto& outline:outlines){ + //strm << outline.size() << "->"; + //outline.simplify(contour_simplify); + //strm << outline.size() << " "; + segmenters.push_back(colourLineSegmenter(outline,path.getStrokeColor())); + //shape_selection_durations.push_back(0.0f); + } + + //strm << " , "; + } + + //std::stringstream strom; + + //shape_selection.clear(); + //while (shape_selection.size()<(segmenters.size()*shapes_amount)){ + // int selection=(int)ofRandom(0,segmenters.size()); + // shape_selection.insert(selection); + //} + //for (auto s:shape_selection){ + // float spawn=(ofRandom(0,(float)shapes_duration)); + // shape_selection_durations[s]=spawn; + // strom << s << ":"<getPoly().draw(); + } } private: - ofxSVG svg; + //ofxFloatSlider contour_simplify; + + //svg gui + //ofxToggle shapes_randomise; + //ofxFloatSlider shapes_amount; + //ofxFloatSlider shapes_duration; + //ofxToggle use_mask; + //ofxToggle invert_mask; + + //segmenter + //ofxToggle use_segmenter; + //ofxToggle colour_segmenter; + //ofxFloatSlider segmenter_speed; + //ofxFloatSlider segmenter_length; + //ofxIntSlider segmenter_number; + + + vector segmenters; + //vector shape_selection_durations; + //set shape_selection; + //int framecounter; + //float phase,prev_time; //to calculate phase + //float rotate_amt; + //float scale_phase,scale_amt; }; class ofApp: public ofBaseApp, public ofxMidiListener { -- cgit v1.2.3