Example #1
0
 public ArrayList<Vertex> getVertecesInArea(Rectangle2D.Double area, byte dim1, byte dim2) {
   ArrayList<Vertex> temp = new ArrayList<Vertex>();
   for (Vertex ver : vertex) {
     //             Point2D.Double p = new Point(ver.getCoords(dim1),ver.getCoords(dim2))
     if (area.contains(ver.getCoord(dim1), ver.getCoord(dim2))) {
       temp.add(ver);
     }
   }
   return temp;
 }
Example #2
0
 public ArrayList<TVertex> getTVertecesInArea(Rectangle2D.Double area, int layerId) {
   ArrayList<TVertex> temp = new ArrayList<TVertex>();
   for (int i = 0; i < vertex.size(); i++) {
     TVertex ver = vertex.get(i).getTVertex(layerId);
     //             Point2D.Double p = new Point(ver.getCoords(dim1),ver.getCoords(dim2))
     if (area.contains(ver.getX(), ver.getY())) {
       temp.add(ver);
     }
   }
   return temp;
 }
 public java.util.List<Figure> findFiguresWithin(Rectangle2D.Double bounds) {
   LinkedList<Figure> contained = new LinkedList<Figure>();
   for (Figure f : children) {
     Rectangle2D r = f.getBounds();
     if (AttributeKeys.TRANSFORM.get(f) != null) {
       r = AttributeKeys.TRANSFORM.get(f).createTransformedShape(r).getBounds2D();
     }
     if (f.isVisible() && bounds.contains(r)) {
       contained.add(f);
     }
   }
   return contained;
 }
 /** Ensures that the robot does not make contact with the wall */
 public static double wallSmoothing(Point2D.Double location, double angle, int orientation) {
   while (!worldApproximation.contains(project(location, angle, WALL_STICK))) {
     angle += orientation * 0.05;
   }
   return angle;
 }