MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / initializeModelObjects

Function initializeModelObjects

src/model/FileOperations.cpp:265–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263 }
264
265 void initializeModelObjects(openstudio::model::Model model) {
266 // These objects used to be added to the model as you clicked through the App's tabs,
267 // resulting in a uncertain set of model changes. With these changes, every model will
268 // always have the following objects after opening in the app.
269 openstudio::model::Building building = model.getUniqueModelObject<openstudio::model::Building>();
270 auto facility = model.getUniqueModelObject<openstudio::model::Facility>();
271 auto site = model.getUniqueModelObject<openstudio::model::Site>();
272
273 // from simulation tab
274 //model.getUniqueModelObject<openstudio::model::RadianceParameters>();
275 model.getUniqueModelObject<openstudio::model::SimulationControl>();
276 model.getUniqueModelObject<openstudio::model::SizingParameters>();
277 //model.getUniqueModelObject<openstudio::model::ProgramControl>();
278 model.getUniqueModelObject<openstudio::model::Timestep>();
279 //model.getUniqueModelObject<openstudio::model::ReportingTolerances>();
280 //model.getUniqueModelObject<openstudio::model::ConvergenceLimits>();
281 model.getUniqueModelObject<openstudio::model::ShadowCalculation>();
282 //model.getUniqueModelObject<openstudio::model::SurfaceConvectionAlgorithmInside>();
283 //model.getUniqueModelObject<openstudio::model::SurfaceConvectionAlgorithmOutside>();
284 model.getUniqueModelObject<openstudio::model::HeatBalanceAlgorithm>();
285 //model.getUniqueModelObject<openstudio::model::ZoneAirHeatBalanceAlgorithm>();
286 //model.getUniqueModelObject<openstudio::model::ZoneAirContaminantBalance>();
287 //model.getUniqueModelObject<openstudio::model::ZoneCapacitanceMultiplierResearchSpecial>();
288 model.getUniqueModelObject<openstudio::model::RunPeriod>();
289
290 openstudio::model::LifeCycleCostParameters lifeCycleCostParameters = model.getUniqueModelObject<openstudio::model::LifeCycleCostParameters>();
291
292 for (auto& object : model.objects()) {
293 if (object.optionalCast<model::ConstructionBase>()) {
294 object.cast<model::ConstructionBase>().standardsInformation();
295 object.cast<model::ConstructionBase>().renderingColor();
296 } else if (object.optionalCast<model::Material>()) {
297 object.cast<model::Material>().standardsInformation();
298 } else if (object.optionalCast<model::BuildingStory>()) {
299 object.cast<model::BuildingStory>().renderingColor();
300 } else if (object.optionalCast<model::LightingSimulationZone>()) {
301 object.cast<model::LightingSimulationZone>().renderingColor();
302 } else if (object.optionalCast<model::SpaceType>()) {
303 object.cast<model::SpaceType>().renderingColor();
304 } else if (object.optionalCast<model::ThermalZone>()) {
305 object.cast<model::ThermalZone>().renderingColor();
306 } else if (object.optionalCast<model::BuildingUnit>()) {
307 object.cast<model::BuildingUnit>().renderingColor();
308 }
309 }
310 }
311
312 bool saveModelTempDir(const openstudio::path& modelTempDir, const openstudio::path& osmPath) {
313 bool test = true;

Callers 3

DispatchMethod · 0.85
modelFromThreeJSMethod · 0.85
runInitializationMethod · 0.85

Calls 3

objectsMethod · 0.45
standardsInformationMethod · 0.45
renderingColorMethod · 0.45

Tested by

no test coverage detected