本文整理汇总了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;
}