summaryrefslogtreecommitdiff
path: root/nextus/src
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2023-04-17 19:44:00 +0100
committerTim Redfern <tim@getdrop.com>2023-04-17 19:44:00 +0100
commit19be92e0aff674b95bdae72fe7a2e409fd1bf77a (patch)
tree079acfc11ffbff8f11b120649f5cb3a623e354d6 /nextus/src
parent5309ef89393aa56083d1c2238c517c3d576907ec (diff)
add to archive
Diffstat (limited to 'nextus/src')
-rw-r--r--nextus/src/ofApp.cpp14
-rw-r--r--nextus/src/ofApp.h40
2 files changed, 50 insertions, 4 deletions
diff --git a/nextus/src/ofApp.cpp b/nextus/src/ofApp.cpp
index 71ece45..0db8149 100644
--- a/nextus/src/ofApp.cpp
+++ b/nextus/src/ofApp.cpp
@@ -58,8 +58,9 @@ void ofApp::update(){
void ofApp::draw(){
ofBackground(0);
- ofSetColor(255);
- ofNoFill();
+ networkinput.draw();
+ svginput.draw();
+ textinput.draw();
}
@@ -147,8 +148,13 @@ void ofApp::windowResized(int w, int h){
//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){
-
-
+ string filename= *dragInfo.files.begin();
+ string extension= filename.substr(filename.find_last_of(".") + 1);
+ if (extension == "svg") {
+ ofLog()<<"loading SVG "<<filename;
+ } else {
+ ofLog()<<"cannot load "<<filename;
+ }
}
diff --git a/nextus/src/ofApp.h b/nextus/src/ofApp.h
index b62b06b..839ad36 100644
--- a/nextus/src/ofApp.h
+++ b/nextus/src/ofApp.h
@@ -13,11 +13,45 @@
#include "lineTransformer.h"
#include "lineSegmenter.h"
+static ofVec2f DISPLAYSIZE(200,200);
+static int panelnum=1;
+class vectorPanel {
+ public:
+ vectorPanel(
+ string _title="",
+ ofVec2f _size=DISPLAYSIZE,
+ ofVec2f _pos=ofPoint(5,5))
+ {
+ size=_size;
+ position=_pos;
+ panel.setup(_title,"",0,size.y+5);
+ }
+ void draw(){
+ ofPushMatrix();
+ ofTranslate(position);
+ ofSetColor(255);
+ ofNoFill();
+ ofDrawRectangle(0,0,size.x,size.y);
+ panel.draw();
+ ofPopMatrix();
+ }
+
+ private:
+ ofVec2f size;
+ ofPoint position;
+ ofxPanel panel;
+};
class ofApp: public ofBaseApp, public ofxMidiListener {
public:
+
+ ofApp() :
+ networkinput("network",DISPLAYSIZE,ofPoint(5,5)),
+ svginput("svg",DISPLAYSIZE,ofPoint(210,5)),
+ textinput("text",DISPLAYSIZE,ofPoint(415,5)) {}
+
void setup();
void update();
void draw();
@@ -45,4 +79,10 @@ class ofApp: public ofBaseApp, public ofxMidiListener {
void save_settings();
void load_settings();
+ //======================================= //inputs
+
+ vectorPanel networkinput;
+ vectorPanel svginput;
+ vectorPanel textinput;
+
};