overwrite with pgraph version

This commit is contained in:
2019-01-14 23:10:15 +01:00
parent 9006ef10fd
commit 70fe0beca1
17 changed files with 185 additions and 481 deletions

View File

@@ -132,12 +132,12 @@ IGraphSearch makePathFinder(Graph graph, int pathFinder) {
}
void drawNodes(){
pushStyle();
noStroke();
fill(255,0,255,72);
pg_map.pushStyle();
pg_map.noStroke();
pg_map.fill(255,0,255,72);
for(GraphNode node : gNodes)
ellipse(node.xf(), node.yf(), nodeSize, nodeSize);
popStyle();
pg_map.ellipse(node.xf(), node.yf(), nodeSize, nodeSize);
pg_map.popStyle();
}
@@ -166,16 +166,16 @@ void drawArrow(GraphNode fromNode, GraphNode toNode, float nodeRad, float arrowS
awidthx = - (ey - ay);
awidthy = ex - ax;
noFill();
strokeWeight(4.0f);
stroke(160, 128);
line(sx,sy,ax,ay);
pg_map.noFill();
pg_map.strokeWeight(4.0f);
pg_map.stroke(160, 128);
pg_map.line(sx,sy,ax,ay);
noStroke();
fill(48, 128);
beginShape(TRIANGLES);
vertex(ex, ey);
vertex(ax - awidthx, ay - awidthy);
vertex(ax + awidthx, ay + awidthy);
endShape();
pg_map.noStroke();
pg_map.fill(48, 128);
pg_map.beginShape(TRIANGLES);
pg_map.vertex(ex, ey);
pg_map.vertex(ax - awidthx, ay - awidthy);
pg_map.vertex(ax + awidthx, ay + awidthy);
pg_map.endShape();
}