Search in sources :

Example 41 with HousePart

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

the class Scene method deleteAllConnectedWalls.

public void deleteAllConnectedWalls(final Wall w) {
    final List<HousePart> copy = new ArrayList<HousePart>();
    w.visitNeighbors(new WallVisitor() {

        @Override
        public void visit(final Wall currentWall, final Snap prev, final Snap next) {
            copy.add(currentWall);
        }
    });
    final RemoveMultiplePartsCommand c = new RemoveMultiplePartsCommand(copy);
    for (final HousePart p : copy) {
        remove(p, false);
    }
    SceneManager.getInstance().getUndoManager().addEdit(c);
    edited = true;
    SceneManager.getInstance().refresh();
}
Also used : WallVisitor(org.concord.energy3d.util.WallVisitor) Wall(org.concord.energy3d.model.Wall) ArrayList(java.util.ArrayList) Snap(org.concord.energy3d.model.Snap) HousePart(org.concord.energy3d.model.HousePart) RemoveMultiplePartsCommand(org.concord.energy3d.undo.RemoveMultiplePartsCommand)

Example 42 with HousePart

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

the class Scene method setThicknessForAllWalls.

public void setThicknessForAllWalls(final double thickness) {
    for (final HousePart p : parts) {
        if (p instanceof Wall) {
            ((Wall) p).setThickness(thickness);
            p.draw();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : Wall(org.concord.energy3d.model.Wall) HousePart(org.concord.energy3d.model.HousePart)

Example 43 with HousePart

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

the class Scene method setRimRadiusForAllParabolicDishes.

public void setRimRadiusForAllParabolicDishes(final double apertureRadius) {
    for (final HousePart p : parts) {
        if (p instanceof ParabolicDish) {
            ((ParabolicDish) p).setRimRadius(apertureRadius);
            p.draw();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish) HousePart(org.concord.energy3d.model.HousePart)

Example 44 with HousePart

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

the class Scene method setLengthForAllFresnelReflectors.

public void setLengthForAllFresnelReflectors(final double length) {
    for (final HousePart p : parts) {
        if (p instanceof FresnelReflector) {
            final FresnelReflector r = (FresnelReflector) p;
            r.setLength(length);
            r.ensureFullModules(false);
            r.draw();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : FresnelReflector(org.concord.energy3d.model.FresnelReflector) HousePart(org.concord.energy3d.model.HousePart)

Example 45 with HousePart

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

the class Scene method setShutterColorOfBuilding.

public void setShutterColorOfBuilding(final HousePart part, final ReadOnlyColorRGBA color) {
    if (part instanceof Foundation) {
        return;
    }
    for (final HousePart p : parts) {
        if (p instanceof Window && p.getTopContainer() == part.getTopContainer()) {
            final Window w = (Window) p;
            w.setShutterColor(color);
            w.draw();
        }
    }
}
Also used : Window(org.concord.energy3d.model.Window) Foundation(org.concord.energy3d.model.Foundation) HousePart(org.concord.energy3d.model.HousePart)

Aggregations

HousePart (org.concord.energy3d.model.HousePart)277 Foundation (org.concord.energy3d.model.Foundation)153 Rack (org.concord.energy3d.model.Rack)69 SolarPanel (org.concord.energy3d.model.SolarPanel)60 Roof (org.concord.energy3d.model.Roof)47 Wall (org.concord.energy3d.model.Wall)45 Window (org.concord.energy3d.model.Window)43 ActionEvent (java.awt.event.ActionEvent)42 ActionListener (java.awt.event.ActionListener)42 ArrayList (java.util.ArrayList)41 Mirror (org.concord.energy3d.model.Mirror)38 JMenuItem (javax.swing.JMenuItem)36 JDialog (javax.swing.JDialog)35 FresnelReflector (org.concord.energy3d.model.FresnelReflector)34 ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)32 ParabolicDish (org.concord.energy3d.model.ParabolicDish)28 Tree (org.concord.energy3d.model.Tree)26 Door (org.concord.energy3d.model.Door)25 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)21 JPanel (javax.swing.JPanel)21