}
public void evaluateGate() {
//checks the intersection with the first view in the list
//others views are ignored!!!
Representation representation = getPojo().getRepresentations().get(0);
FreedomPolygon pojoShape = (FreedomPolygon) representation.getShape();
int xoffset = representation.getOffset().getX();
int yoffset = representation.getOffset().getY();
// double rotation = Math.toRadians(representation.getRotation());
from = null;
to = null;
//now apply offset and rotation to gate the shape
// AffineTransform transform = new AffineTransform();
// transform.translate(xoffset, yoffset);
// transform.rotate(rotation);
// Shape gateShape = transform.createTransformedShape(TopologyUtils.convertToAWT(pojoShape));
//
// for (Room room : Freedomotic.environment.getRooms()) {
// Shape roomPolygon = TopologyUtils.convertToAWT(room.getPojo().getShape());
// if (roomPolygon.intersects(gateShape.getBounds2D())) {
// if (from == null) {
// from = (Room) room;
// to = (Room) room;
// } else {
// to = (Room) room;
// }
// }
// }
FreedomPolygon objShape =
TopologyUtils.rotate(TopologyUtils.translate(pojoShape, xoffset, yoffset),
(int) representation.getRotation());
EnvironmentLogic env = EnvironmentPersistence.getEnvByUUID(getPojo().getEnvironmentID());
if (env != null) {
for (Room room : env.getRooms()) {
if (TopologyUtils.intersects(objShape,