Search in sources :

Example 16 with ParabolicTrough

use of org.concord.energy3d.model.ParabolicTrough in project energy3d by concord-consortium.

the class ChangeAzimuthForAllParabolicTroughsCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final int n = troughs.size();
    newValues = new double[n];
    for (int i = 0; i < n; i++) {
        final ParabolicTrough t = troughs.get(i);
        newValues[i] = t.getRelativeAzimuth();
        t.setRelativeAzimuth(oldValues[i]);
        t.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicTrough(org.concord.energy3d.model.ParabolicTrough)

Example 17 with ParabolicTrough

use of org.concord.energy3d.model.ParabolicTrough in project energy3d by concord-consortium.

the class ChangeFoundationParabolicTroughAzimuthCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final int n = troughs.size();
    newValues = new double[n];
    for (int i = 0; i < n; i++) {
        final ParabolicTrough t = troughs.get(i);
        newValues[i] = t.getRelativeAzimuth();
        t.setRelativeAzimuth(oldValues[i]);
        t.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicTrough(org.concord.energy3d.model.ParabolicTrough)

Example 18 with ParabolicTrough

use of org.concord.energy3d.model.ParabolicTrough in project energy3d by concord-consortium.

the class SetShapeForAllParabolicTroughsCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final int n = troughs.size();
    newLengths = new double[n];
    newApertureWidths = new double[n];
    newSemilatusRecta = new double[n];
    newModuleLengths = new double[n];
    for (int i = 0; i < n; i++) {
        final ParabolicTrough t = troughs.get(i);
        newLengths[i] = t.getTroughLength();
        newApertureWidths[i] = t.getApertureWidth();
        newSemilatusRecta[i] = t.getSemilatusRectum();
        newModuleLengths[i] = t.getModuleLength();
        t.setTroughLength(oldLengths[i]);
        t.setApertureWidth(oldApertureWidths[i]);
        t.setSemilatusRectum(oldSemilatusRecta[i]);
        t.setModuleLength(oldModuleLengths[i]);
        t.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicTrough(org.concord.energy3d.model.ParabolicTrough)

Example 19 with ParabolicTrough

use of org.concord.energy3d.model.ParabolicTrough in project energy3d by concord-consortium.

the class SetShapeForParabolicTroughsOnFoundationCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    final int n = troughs.size();
    for (int i = 0; i < n; i++) {
        final ParabolicTrough t = troughs.get(i);
        t.setTroughLength(newLengths[i]);
        t.setApertureWidth(newApertureWidths[i]);
        t.setSemilatusRectum(newSemilatusRecta[i]);
        t.setModuleLength(newModuleLengths[i]);
        t.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicTrough(org.concord.energy3d.model.ParabolicTrough)

Example 20 with ParabolicTrough

use of org.concord.energy3d.model.ParabolicTrough in project energy3d by concord-consortium.

the class SetPartSizeCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    if (part instanceof Mirror) {
        final Mirror m = (Mirror) part;
        newWidth = m.getMirrorWidth();
        newHeight = m.getMirrorHeight();
        m.setMirrorWidth(oldWidth);
        m.setMirrorHeight(oldHeight);
    } else if (part instanceof ParabolicTrough) {
        final ParabolicTrough t = (ParabolicTrough) part;
        newWidth = t.getApertureWidth();
        newHeight = t.getTroughLength();
        newModuleLength = t.getModuleLength();
        t.setApertureWidth(oldWidth);
        t.setTroughLength(oldHeight);
        t.setModuleLength(oldModuleLength);
    } else if (part instanceof ParabolicDish) {
        final ParabolicDish d = (ParabolicDish) part;
        newWidth = d.getRimRadius();
        d.setRimRadius(oldWidth);
    } else if (part instanceof FresnelReflector) {
        final FresnelReflector r = (FresnelReflector) part;
        newWidth = r.getModuleWidth();
        newHeight = r.getLength();
        newModuleLength = r.getModuleLength();
        r.setModuleWidth(oldWidth);
        r.setLength(oldHeight);
        r.setModuleLength(oldModuleLength);
    } else if (part instanceof Rack) {
        final Rack r = (Rack) part;
        newWidth = r.getRackWidth();
        newHeight = r.getRackHeight();
        r.setRackWidth(oldWidth);
        r.setRackHeight(oldHeight);
    } else if (part instanceof Window) {
        final Window w = (Window) part;
        newWidth = w.getWindowWidth();
        newHeight = w.getWindowHeight();
        w.setWindowWidth(oldWidth);
        w.setWindowHeight(oldHeight);
        w.getContainer().draw();
    } else if (part instanceof Door) {
        final Door d = (Door) part;
        newWidth = d.getDoorWidth();
        newHeight = d.getDoorHeight();
        d.setDoorWidth(oldWidth);
        d.setDoorHeight(oldHeight);
        d.getContainer().draw();
    }
    part.draw();
    SceneManager.getInstance().refresh();
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish) Window(org.concord.energy3d.model.Window) Rack(org.concord.energy3d.model.Rack) ParabolicTrough(org.concord.energy3d.model.ParabolicTrough) FresnelReflector(org.concord.energy3d.model.FresnelReflector) Mirror(org.concord.energy3d.model.Mirror) Door(org.concord.energy3d.model.Door)

Aggregations

ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)44 HousePart (org.concord.energy3d.model.HousePart)30 Foundation (org.concord.energy3d.model.Foundation)22 FresnelReflector (org.concord.energy3d.model.FresnelReflector)18 Mirror (org.concord.energy3d.model.Mirror)17 ParabolicDish (org.concord.energy3d.model.ParabolicDish)17 Rack (org.concord.energy3d.model.Rack)16 SolarPanel (org.concord.energy3d.model.SolarPanel)14 Window (org.concord.energy3d.model.Window)14 Roof (org.concord.energy3d.model.Roof)10 Wall (org.concord.energy3d.model.Wall)10 Door (org.concord.energy3d.model.Door)9 ArrayList (java.util.ArrayList)6 Calendar (java.util.Calendar)5 List (java.util.List)5 JDialog (javax.swing.JDialog)4 Tree (org.concord.energy3d.model.Tree)4 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)3 Human (org.concord.energy3d.model.Human)3 UserData (org.concord.energy3d.model.UserData)3