Search in sources :

Example 41 with FresnelReflector

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

the class ChangeFoundationFresnelReflectorAzimuthCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    final int n = reflectors.size();
    for (int i = 0; i < n; i++) {
        final FresnelReflector r = reflectors.get(i);
        r.setRelativeAzimuth(newValues[i]);
        r.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : FresnelReflector(org.concord.energy3d.model.FresnelReflector)

Example 42 with FresnelReflector

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

the class ChangeAzimuthForAllFresnelReflectorsCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    final int n = reflectors.size();
    for (int i = 0; i < n; i++) {
        final FresnelReflector r = reflectors.get(i);
        r.setRelativeAzimuth(newValues[i]);
        r.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : FresnelReflector(org.concord.energy3d.model.FresnelReflector)

Example 43 with FresnelReflector

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

the class ChangeAzimuthForAllFresnelReflectorsCommand method undo.

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

Example 44 with FresnelReflector

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

the class SetSizeForFresnelReflectorsOnFoundationCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final int n = reflectors.size();
    newLengths = new double[n];
    newWidths = new double[n];
    newModuleLengths = new double[n];
    for (int i = 0; i < n; i++) {
        final FresnelReflector r = reflectors.get(i);
        newLengths[i] = r.getLength();
        newWidths[i] = r.getModuleWidth();
        newModuleLengths[i] = r.getModuleLength();
        r.setLength(oldLengths[i]);
        r.setModuleWidth(oldWidths[i]);
        r.setModuleLength(oldModuleLengths[i]);
        r.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : FresnelReflector(org.concord.energy3d.model.FresnelReflector)

Example 45 with FresnelReflector

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

the class SetPartSizeCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    if (part instanceof Mirror) {
        final Mirror m = (Mirror) part;
        m.setMirrorWidth(newWidth);
        m.setMirrorHeight(newHeight);
    } else if (part instanceof ParabolicTrough) {
        final ParabolicTrough t = (ParabolicTrough) part;
        t.setApertureWidth(newWidth);
        t.setTroughLength(newHeight);
        t.setModuleLength(newModuleLength);
    } else if (part instanceof ParabolicDish) {
        final ParabolicDish d = (ParabolicDish) part;
        d.setRimRadius(newWidth);
    } else if (part instanceof FresnelReflector) {
        final FresnelReflector t = (FresnelReflector) part;
        t.setModuleWidth(newWidth);
        t.setLength(newHeight);
        t.setModuleLength(newModuleLength);
    } else if (part instanceof Rack) {
        final Rack r = (Rack) part;
        r.setRackWidth(newWidth);
        r.setRackHeight(newHeight);
    } else if (part instanceof Window) {
        final Window w = (Window) part;
        w.setWindowWidth(newWidth);
        w.setWindowHeight(newHeight);
        w.getContainer().draw();
    } else if (part instanceof Door) {
        final Door d = (Door) part;
        d.setDoorWidth(newWidth);
        d.setDoorHeight(newHeight);
        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

FresnelReflector (org.concord.energy3d.model.FresnelReflector)48 HousePart (org.concord.energy3d.model.HousePart)32 Foundation (org.concord.energy3d.model.Foundation)25 Mirror (org.concord.energy3d.model.Mirror)21 ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)18 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 Wall (org.concord.energy3d.model.Wall)12 Door (org.concord.energy3d.model.Door)9 Roof (org.concord.energy3d.model.Roof)9 ArrayList (java.util.ArrayList)8 Calendar (java.util.Calendar)5 JDialog (javax.swing.JDialog)5 SolarCollector (org.concord.energy3d.model.SolarCollector)5 List (java.util.List)4 Human (org.concord.energy3d.model.Human)4 Tree (org.concord.energy3d.model.Tree)4 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)3