コード例 #1
0
 @Override
 protected void postProcess(Sector.Triangle[] triangles) {
   if (show.contains("triangles")) {
     int i = 0;
     for (Sector.Triangle t : triangles) {
       GeoPoint[] trianglePoints = t.getPoints('A');
       double x = 0, y = 0;
       int l = trianglePoints.length;
       double[] points = new double[l * 2 + 2];
       for (int j = 0; j <= l; j++) {
         Point p = trianglePoints[j % l].toPoint(1000.0);
         points[j * 2] = p.x;
         points[j * 2 + 1] = p.z;
         if (j < l) {
           x += p.x;
           y += p.z;
         }
       }
       x /= l;
       y /= l;
       for (int j = 0; j <= l; j++) {
         points[j * 2] = points[j * 2] * 0.95 + x * 0.05;
         points[j * 2 + 1] = points[j * 2 + 1] * 0.95 + y * 0.05;
       }
       Color color = t.inverted ? triangleInverted : triangleNormal;
       out.addLine(color, points);
       if (show.contains("labels")) {
         out.addLabel(color, "" + i, x, y);
       }
       i++;
     }
   }
   super.postProcess(triangles);
 }
コード例 #2
0
 @Override
 protected void usingPoints(Point[] points) {
   if (show.contains("points")) {
     int i = 0;
     for (Point p : points) {
       out.addPoint(Color.white, String.valueOf(i++), p.x, p.z);
     }
   }
   super.usingPoints(points);
 }