本文整理匯總了Java中processing.core.PApplet.println方法的典型用法代碼示例。如果您正苦於以下問題:Java PApplet.println方法的具體用法?Java PApplet.println怎麽用?Java PApplet.println使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類processing.core.PApplet
的用法示例。
在下文中一共展示了PApplet.println方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createGraph
import processing.core.PApplet; //導入方法依賴的package包/類
void createGraph(PApplet ap) {
pointsList = new ArrayList<Point>();
edgesList = new ArrayList<Edge>();
facesList = new ArrayList<Face>();
Voronoi voronoi = new Voronoi();
voronoi.setBoundaries(0, 0, width, height);
voronoi.computeVoronoi(voronoiPoints);
if (!voronoi.ok) { // Rare bug I have yet to correct
PApplet.println("Error, stoping creation");
return;
}
HashMap<PVector, Point> pointsLookup = new HashMap<PVector, Point>();
for (Voronoi.Site site : voronoi.sites)
{
if (site.points.size() < 3)
continue;
Face f = new Face();
f.index = facesList.size();
facesList.add(f);
f.color = randomColor(ap);// TODO
for (PVector p : site.points) {
Point pt = pointsLookup.get(p);
if (pt == null) {
pt = new Point(p);
pointsList.add(pt);
pointsLookup.put(p, pt);
}
addToList(f.points, pt);
addToList(pt.faces, f);
}
if (f.getArea() < 0)
f.flipVertexOrder();
f.pos = f.getCentroid();
int nb = f.points.size();
for (int j = 0; j < nb; j++) {
Point pt1 = f.points.get(j);
Point pt2 = f.points.get((j + 1) % nb);
Edge e = getEdge(pt1, pt2);
if (e.f1 == null)
e.f1 = f;
else if (e.f2 == null) {
e.f2 = f;
f.neighbours.add(e.f1);
e.f1.neighbours.add(f);
}
f.edges.add(e);
}
}
// voronoiPoints = null;
}