|
@@ -150,7 +150,18 @@ public class Controller {
|
|
|
model.setHeight(height);
|
|
|
model.setDepth(depth);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Validate all device positions, move all devices into the bounds, if they are outside the visualization
|
|
|
+ */
|
|
|
+ public void validateDevicePosition() {
|
|
|
+ // Update all device positions
|
|
|
+ for (SmartDevice d : model.getDevices()) {
|
|
|
+ d.setX(scalePos(d.getX(), 1.0, getWidth()));
|
|
|
+ d.setY(scalePos(d.getY(), 1.0, getHeight()));
|
|
|
+ d.setZ(scalePos(d.getZ(), 1.0, getDepth()));
|
|
|
+ }
|
|
|
+ }
|
|
|
/**
|
|
|
* Calculates the new scaled position, which should be in Bounds:
|
|
|
* {@code radius < newPosition <
|