boost::optional<double> InternalMass_Impl::surfaceAreaPerPerson() const { OptionalDouble result = internalMassDefinition().surfaceAreaperPerson(); if (result) { return result.get() * multiplier(); } return result; }
void InternalMassDefinitionInspectorView::ConstructionVectorController::onRemoveItem(OSItem* item) { if(boost::optional<model::InternalMassDefinition> mo = internalMassDefinition() ) { mo->resetConstruction(); } }
void InternalMassDefinitionInspectorView::ConstructionVectorController::onDrop(const OSItemId& itemId) { boost::optional<model::InternalMassDefinition> internalMass = internalMassDefinition(); if (internalMass){ boost::optional<model::ConstructionBase> constructionBase = this->addToModel<model::ConstructionBase>(itemId); if (constructionBase){ internalMass->setConstruction(*constructionBase); } } }
std::vector<OSItemId> InternalMassDefinitionInspectorView::ConstructionVectorController::makeVector() { std::vector<OSItemId> result; if( boost::optional<model::InternalMassDefinition> mo = internalMassDefinition() ) { if( boost::optional<model::ConstructionBase> c = mo->construction() ) { result.push_back(modelObjectToItemId(c.get(), false)); } } return result; }
boost::optional<ModelObject> InternalMass_Impl::internalMassDefinitionAsModelObject() const { OptionalModelObject result = internalMassDefinition(); return result; }
double InternalMass_Impl::getSurfaceAreaPerPerson(double floorArea, double numPeople) const { return internalMassDefinition().getSurfaceAreaPerPerson(floorArea,numPeople) * multiplier(); }