use of org.concord.energy3d.model.ParabolicDish in project energy3d by concord-consortium.
the class SetRimRadiusForParabolicDishesOnFoundationCommand method redo.
@Override
public void redo() throws CannotRedoException {
super.redo();
final int n = dishes.size();
for (int i = 0; i < n; i++) {
final ParabolicDish d = dishes.get(i);
d.setRimRadius(newRadii[i]);
d.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.ParabolicDish in project energy3d by concord-consortium.
the class MovePartCommand method move.
private void move(final Vector3 v) {
SceneManager.getInstance().setSelectedPart(part);
SceneManager.getTaskManager().update(new Callable<Object>() {
@Override
public Object call() throws Exception {
if (part == null) {
for (final HousePart p : Scene.getInstance().getParts()) {
if (p instanceof Foundation) {
((Foundation) p).move(v, p.getGridSize());
}
}
} else if (part instanceof Foundation) {
final Foundation f = (Foundation) part;
if (f.isGroupMaster()) {
final List<Foundation> g = Scene.getInstance().getFoundationGroup(f);
for (final Foundation x : g) {
x.move(v, part.getGridSize());
}
} else {
f.move(v, part.getGridSize());
}
} else if (part instanceof Window) {
final Window w = (Window) part;
w.move(v);
w.draw();
} else if (part instanceof SolarPanel) {
final SolarPanel s = (SolarPanel) part;
s.move(v, part.getGridSize());
s.draw();
} else if (part instanceof Rack) {
final Rack r = (Rack) part;
r.move(v, part.getGridSize());
r.draw();
} else if (part instanceof Mirror) {
final Mirror m = (Mirror) part;
m.move(v, part.getGridSize());
m.draw();
} else if (part instanceof ParabolicTrough) {
final ParabolicTrough t = (ParabolicTrough) part;
t.move(v, part.getGridSize());
t.draw();
} else if (part instanceof ParabolicDish) {
final ParabolicDish d = (ParabolicDish) part;
d.move(v, part.getGridSize());
d.draw();
} else if (part instanceof FresnelReflector) {
final FresnelReflector f = (FresnelReflector) part;
f.move(v, part.getGridSize());
f.draw();
}
return null;
}
});
}
use of org.concord.energy3d.model.ParabolicDish in project energy3d by concord-consortium.
the class SetFocalLengthForAllParabolicDishesCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = dishes.size();
newValues = new double[n];
for (int i = 0; i < n; i++) {
final ParabolicDish d = dishes.get(i);
newValues[i] = d.getFocalLength();
d.setFocalLength(oldValues[i]);
}
}
use of org.concord.energy3d.model.ParabolicDish in project energy3d by concord-consortium.
the class SetFocalLengthForParabolicDishesOnFoundationCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = dishes.size();
newCurvatureParameters = new double[n];
for (int i = 0; i < n; i++) {
final ParabolicDish d = dishes.get(i);
newCurvatureParameters[i] = d.getFocalLength();
d.setFocalLength(oldCurvatureParameters[i]);
d.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.ParabolicDish in project energy3d by concord-consortium.
the class SetFocalLengthForParabolicDishesOnFoundationCommand method redo.
@Override
public void redo() throws CannotRedoException {
super.redo();
final int n = dishes.size();
for (int i = 0; i < n; i++) {
final ParabolicDish d = dishes.get(i);
d.setFocalLength(newCurvatureParameters[i]);
d.draw();
}
SceneManager.getInstance().refresh();
}
Aggregations