Exemplo n.º 1
0
 private void restoreFigureCoords() {
   Collection<Vertex> vertices = getVertices();
   for (MovablePoint vertex : vertices) {
     vertex.setCoords(initialCoords.get(vertex).clone());
   }
   centrum.setCoords(initialCoords.get(centrum).clone());
 }
Exemplo n.º 2
0
  @Override
  public synchronized void rotate(RotationPlane4DEnum rotationPlane, double radians) {
    double[][] rotationMatrix = rotationPlane.getRotationMatrix(radians);

    for (MovablePoint vertex : getVertices()) {
      vertex.rotate(rotationMatrix, centrum);
    }
  }
Exemplo n.º 3
0
 @Override
 public synchronized void move(Vector vector) {
   double[] vectorCoords = vector.getCoords();
   for (MovablePoint vertex : getVertices()) {
     vertex.move(vectorCoords);
   }
   centrum.move(vectorCoords);
 }
Exemplo n.º 4
0
 private void storeFigureCoords() {
   Collection<Vertex> vertices = getVertices();
   initialCoords = new HashMap<MovablePoint, double[]>(vertices.size());
   for (Vertex vertex : vertices) {
     initialCoords.put(vertex, vertex.getCoords().clone());
   }
   initialCoords.put(centrum, centrum.getCoords().clone());
 }