use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class Scene method setSolarPanelModelForAllRacks.
public void setSolarPanelModelForAllRacks(final PvModuleSpecs specs) {
for (final HousePart p : parts) {
if (p instanceof Rack) {
final Rack r = (Rack) p;
final SolarPanel s = r.getSolarPanel();
s.setPvModuleSpecs(specs);
r.ensureFullSolarPanels(false);
r.draw();
}
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class Scene method setBaseHeightForAllSolarPanels.
public void setBaseHeightForAllSolarPanels(final double baseHeight) {
for (final HousePart p : parts) {
if (p instanceof SolarPanel) {
((SolarPanel) p).setBaseHeight(baseHeight);
p.draw();
}
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class Scene method pasteToPickedLocationOnMesh.
public void pasteToPickedLocationOnMesh(final Mesh mesh) {
EnergyPanel.getInstance().updateRadiationHeatMap();
if (copyBuffer == null) {
return;
}
if (copyBuffer instanceof Foundation) {
return;
}
final HousePart selectedPart = SceneManager.getInstance().getSelectedPart();
if (!(selectedPart instanceof Foundation)) {
return;
}
final HousePart c = copyBuffer.copy(false);
if (c == null) {
return;
}
Vector3 position = SceneManager.getInstance().getPickedLocationOnMesh(mesh);
if (position == null) {
return;
}
position = c.toRelative(position.subtractLocal(c.getContainer().getAbsPoint(0)));
final Vector3 center = c.toRelative(c.getAbsCenter().subtractLocal(c.getContainer().getAbsPoint(0)));
position = position.subtractLocal(center);
final int n = c.getPoints().size();
for (int i = 0; i < n; i++) {
final Vector3 v = c.getPoints().get(i);
v.addLocal(position);
}
if (copyBuffer instanceof Rack) {
final Rack rack = (Rack) c;
rack.moveSolarPanels(position);
setIdOfChildren(c);
final MeshLocator originalMeshLocator = ((Rack) copyBuffer).getMeshLocator();
if (originalMeshLocator != null) {
final UserData ud = (UserData) mesh.getUserData();
rack.setMeshLocator(new MeshLocator((Foundation) ud.getHousePart(), ud.getNodeIndex(), ud.getMeshIndex()));
}
} else if (copyBuffer instanceof SolarPanel) {
final SolarPanel panel = (SolarPanel) c;
final MeshLocator originalMeshLocator = ((SolarPanel) copyBuffer).getMeshLocator();
if (originalMeshLocator != null) {
final UserData ud = (UserData) mesh.getUserData();
panel.setMeshLocator(new MeshLocator((Foundation) ud.getHousePart(), ud.getNodeIndex(), ud.getMeshIndex()));
}
}
add(c, true);
copyBuffer = c;
SceneManager.getInstance().setSelectedPart(c);
SceneManager.getInstance().getUndoManager().addEdit(new PastePartCommand(c));
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class Scene method pasteToPickedLocationOnRack.
public void pasteToPickedLocationOnRack() {
final HousePart selectedPart = SceneManager.getInstance().getSelectedPart();
if (!(selectedPart instanceof Rack)) {
return;
}
if (!(copyBuffer instanceof SolarPanel)) {
return;
}
EnergyPanel.getInstance().updateRadiationHeatMap();
final HousePart c = copyBuffer.copy(false);
if (c == null) {
return;
}
Vector3 position = SceneManager.getInstance().getPickedLocationOnRack();
if (position == null) {
return;
}
if (selectedPart != c.getContainer()) {
((SolarPanel) c).moveTo(selectedPart);
}
position = c.toRelative(position.subtractLocal(c.getContainer().getAbsPoint(0)));
final Vector3 center = c.toRelative(c.getAbsCenter().subtractLocal(c.getContainer().getAbsPoint(0)));
position = position.subtractLocal(center);
final int n = c.getPoints().size();
for (int i = 0; i < n; i++) {
final Vector3 v = c.getPoints().get(i);
v.addLocal(position);
}
add(c, true);
copyBuffer = c;
SceneManager.getInstance().setSelectedPart(c);
SceneManager.getInstance().getUndoManager().addEdit(new PastePartCommand(c));
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class Scene method setCellTypeForAllSolarPanels.
public void setCellTypeForAllSolarPanels(final int cellType) {
for (final HousePart p : parts) {
if (p instanceof SolarPanel) {
((SolarPanel) p).setCellType(cellType);
p.draw();
}
}
SceneManager.getInstance().refresh();
}
Aggregations