summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vodaviz.pde52
1 files changed, 41 insertions, 11 deletions
diff --git a/vodaviz.pde b/vodaviz.pde
index 8f85392..8764aec 100644
--- a/vodaviz.pde
+++ b/vodaviz.pde
@@ -18,24 +18,54 @@
//must be able to find a random point within the shape
//
+//250112 so far so good, can iterate children.
+//safest thing is to establish that I can place a point as being inside or outside of a shape
+//(are they closed properly!)
-PShape s;
-PShape[] country;
+//If we can find points in them then we can start the main task:
+//connecting parts of the SVG with rows in the spreadsheet
+
+//maybe next first I should look at projections (to keep them happy)
+//I have a map with rectangular coords,
+//is easy to enough to play with the projection
+
+// public boolean contains(RGeomElem shp)
+// public geomerative.RRectangle getBounds()
+// --> this is kind of hidden. why? anyway, it should be possible to use it
+//another option is to use the OUTLINE of the country (as a purely geometric thing).
+
+
+import geomerative.*;
+
+RShape shp;
+ RRectangle cb;
+int whichChild,numChildren;
void setup(){
- println("vodaviz v0.1");
+ println("vodaviz v0.11");
+ RG.init(this);
size(800,600); //832,220);
- background(0,0,0);
+ smooth();
float m = millis();
- s = loadShape("world_countries_outlines.svg");
+
+ shp = RG.loadShape("world_countries_outlines_split.svg");
+ RG.ignoreStyles();
println("loaded svg in "+((millis()-m)*.001)+" seconds");
- country = new PShape[10];
- country[0]=s.getChild("c001");
- country[0].disableStyle();
- //country[0].scale(0.5);
+ numChildren=shp.children.length;
+ whichChild=0;
}
void draw() {
- fill(102, 0, 0);
- shape(country[0], 0 , 0);
+ background(0,0,0);
+ noFill();
+ stroke(255);
+ RG.shape(shp);
+ whichChild=(whichChild+1)%numChildren;
+ println("child "+whichChild+" of "+numChildren);
+
+ cb=shp.children[whichChild].getBounds();
+}
+
+void mousePressed() {
+
}