本文整理汇总了C++中openstudio::model::ModelObject类的典型用法代码示例。如果您正苦于以下问题:C++ ModelObject类的具体用法?C++ ModelObject怎么用?C++ ModelObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModelObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getObjectNames
void TreeModel::getObjectNames(const openstudio::model::ModelObject& object, QList<QVariant>& objectNames)
{
IddObject iddObject = object.iddObject();
QString objectName(iddObject.name().c_str());
// object might have a name
OptionalString optionalString = object.name();
if(optionalString){
QString name = optionalString.get().c_str();
int firstIdx = name.indexOf(guidOpenCurlyBrace);
int secondIdx = name.indexOf(guidCloseCurlyBrace);
if(mMaskGUIDs && (firstIdx != -1) && (secondIdx != -1)){
///! QString::trimmed() won't work due to characters after the last curly brace
unsigned offset = 0;
if(firstIdx>0 && firstIdx<name.size() && name.at(firstIdx-1).isSpace()){
offset++;
}
name.remove(firstIdx-offset,secondIdx-firstIdx+1+offset);
}
objectName += " (";
objectName += name.toStdString().c_str();
objectName += ")";
}
objectNames.push_back(objectName);
}
示例2: onSelectModelObject
void LoadsInspectorView::onSelectModelObject(const openstudio::model::ModelObject& modelObject)
{
switch( modelObject.iddObjectType().value() )
{
case IddObjectType::OS_People_Definition:
this->showPeopleDefinitionsInspector(modelObject);
break;
case IddObjectType::OS_Lights_Definition:
this->showLightsDefinitionsInspector(modelObject);
break;
case IddObjectType::OS_Luminaire_Definition:
this->showLuminaireDefinitionsInspector(modelObject);
break;
case IddObjectType::OS_ElectricEquipment_Definition:
this->showElectricEquipmentDefinitionsInspector(modelObject);
break;
case IddObjectType::OS_GasEquipment_Definition:
this->showGasEquipmentDefinitionsInspector(modelObject);
break;
case IddObjectType::OS_SteamEquipment_Definition:
this->showSteamEquipmentDefinitionsInspector(modelObject);
break;
case IddObjectType::OS_OtherEquipment_Definition:
this->showOtherEquipmentDefinitionsInspector(modelObject);
break;
case IddObjectType::OS_InternalMass_Definition:
this->showInternalMassDefinitionsInspector(modelObject);
break;
case IddObjectType::OS_WaterUse_Equipment_Definition:
this->showWaterUseEquipmentDefinitionsInspector(modelObject);
break;
default:
showDefaultView();
}
}
示例3: onRemoveObject
void DefaultConstructionSetsController::onRemoveObject(openstudio::model::ModelObject modelObject)
{
boost::optional<model::DefaultConstructionSet> dcs = modelObject.optionalCast<model::DefaultConstructionSet>();
if (dcs){
boost::optional<model::DefaultSurfaceConstructions> dsc = dcs->defaultExteriorSurfaceConstructions();
if (dsc && (dsc->directUseCount(true) == 1)){
dsc->remove();
}
dsc = dcs->defaultInteriorSurfaceConstructions();
if (dsc && (dsc->directUseCount(true) == 1)){
dsc->remove();
}
dsc = dcs->defaultGroundContactSurfaceConstructions();
if (dsc && (dsc->directUseCount(true) == 1)){
dsc->remove();
}
boost::optional<model::DefaultSubSurfaceConstructions> dssc = dcs->defaultExteriorSubSurfaceConstructions();
if (dssc && (dssc->directUseCount(true) == 1)){
dssc->remove();
}
dssc = dcs->defaultInteriorSubSurfaceConstructions();
if (dssc && (dssc->directUseCount(true) == 1)){
dssc->remove();
}
}
modelObject.remove();
}
示例4: onAddObject
void SpaceTypesController::onAddObject(const openstudio::model::ModelObject& modelObject)
{
if (IddObjectType::OS_SpaceType == modelObject.iddObjectType().value()) {
openstudio::model::SpaceType(this->model());
return;
}
boost::optional<model::ParentObject> parent = modelObject.parent();
OS_ASSERT(parent);
// Expect a load from the gridview loads tab
switch (modelObject.iddObjectType().value()){
case IddObjectType::OS_People:
openstudio::model::People(openstudio::model::PeopleDefinition(this->model())).setParent(*parent);
break;
case IddObjectType::OS_InternalMass:
openstudio::model::InternalMass(openstudio::model::InternalMassDefinition(this->model())).setParent(*parent);
break;
case IddObjectType::OS_Lights:
openstudio::model::Lights(openstudio::model::LightsDefinition(this->model())).setParent(*parent);
break;
case IddObjectType::OS_Luminaire:
openstudio::model::Luminaire(openstudio::model::LuminaireDefinition(this->model())).setParent(*parent);
break;
case IddObjectType::OS_ElectricEquipment:
openstudio::model::ElectricEquipment(openstudio::model::ElectricEquipmentDefinition(this->model())).setParent(*parent);
break;
case IddObjectType::OS_GasEquipment:
openstudio::model::GasEquipment(openstudio::model::GasEquipmentDefinition(this->model())).setParent(*parent);
break;
case IddObjectType::OS_SteamEquipment:
openstudio::model::SteamEquipment(openstudio::model::SteamEquipmentDefinition(this->model())).setParent(*parent);
break;
case IddObjectType::OS_OtherEquipment:
openstudio::model::OtherEquipment(openstudio::model::OtherEquipmentDefinition(this->model())).setParent(*parent);
break;
case IddObjectType::OS_WaterUse_Equipment:
openstudio::model::WaterUseEquipment(openstudio::model::WaterUseEquipmentDefinition(this->model())).setParent(*parent);
break;
default:
// Should not get here
OS_ASSERT(false);
LOG_FREE(Error, "LoadsController", "Unknown IddObjectType '" << modelObject.iddObjectType().valueName() << "'");
}
}
示例5: onSelectModelObject
void MaterialsInspectorView::onSelectModelObject(const openstudio::model::ModelObject& modelObject)
{
switch( modelObject.iddObjectType().value() )
{
case IddObjectType::OS_Material:
this->showMaterialInspectorView(modelObject);
break;
case IddObjectType::OS_Material_AirGap:
this->showMaterialAirGapInspectorView(modelObject);
break;
case IddObjectType::OS_Material_AirWall:
this->showMaterialAirWallInspectorView(modelObject);
break;
case IddObjectType::OS_Material_InfraredTransparent:
this->showMaterialInfraredTransparentInspectorView(modelObject);
break;
case IddObjectType::OS_Material_NoMass:
this->showMaterialNoMassInspectorView(modelObject);
break;
case IddObjectType::OS_Material_RoofVegetation:
this->showMaterialRoofVegetationInspectorView(modelObject);
break;
case IddObjectType::OS_WindowMaterial_Blind:
this->showWindowMaterialBlindInspectorView(modelObject);
break;
case IddObjectType::OS_WindowMaterial_Gas:
this->showWindowMaterialGasInspectorView(modelObject);
break;
case IddObjectType::OS_WindowMaterial_GasMixture:
this->showWindowMaterialGasMixtureInspectorView(modelObject);
break;
case IddObjectType::OS_WindowMaterial_Glazing:
this->showWindowMaterialGlazingInspectorView(modelObject);
break;
case IddObjectType::OS_WindowMaterial_Glazing_RefractionExtinctionMethod:
this->showWindowMaterialGlazingRefractionExtinctionMethodInspectorView(modelObject);
break;
case IddObjectType::OS_WindowMaterial_GlazingGroup_Thermochromic:
this->showWindowMaterialGlazingGroupThermochromicInspectorView(modelObject);
break;
case IddObjectType::OS_WindowMaterial_Screen:
this->showWindowMaterialScreenInspectorView(modelObject);
break;
case IddObjectType::OS_WindowMaterial_Shade:
this->showWindowMaterialShadeInspectorView(modelObject);
break;
case IddObjectType::OS_WindowMaterial_SimpleGlazingSystem:
this->showWindowMaterialSimpleGlazingSystemInspectorView(modelObject);
break;
default:
showDefaultView();
}
}
示例6: OSItem
ModelObjectItem::ModelObjectItem(const openstudio::model::ModelObject& modelObject,
bool isDefaulted,
OSItemType type,
QWidget * parent )
: OSItem(modelObjectToItemId(modelObject, isDefaulted), type, parent),
m_handle(modelObject.handle()),
m_modelObject(modelObject)
{
this->setText(QString::fromStdString(m_modelObject.name().get()));
connect(m_modelObject.getImpl<model::detail::ModelObject_Impl>().get(), &model::detail::ModelObject_Impl::onChange,
this, &ModelObjectItem::onObjectChanged);
if (!modelObject.getModelObjectSources<model::ComponentData>().empty()){
m_measureBadge->setMeasureBadgeType(MeasureBadgeType::BCLMeasure);
}
}
示例7: onRemoveObject
void LoadsController::onRemoveObject(openstudio::model::ModelObject modelObject)
{
boost::optional<model::SpaceLoadDefinition> spaceLoadDefinition = modelObject.optionalCast<model::SpaceLoadDefinition>();
if (spaceLoadDefinition){
unsigned numInstances = spaceLoadDefinition->instances().size();
if (numInstances > 0){
QMessageBox msgBox(subTabView());
msgBox.setText("There are " + QString::number(numInstances) + " instances that reference this definition.");
msgBox.setInformativeText("Do you want to remove this definition and all of its instances?");
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
int ret = msgBox.exec();
if (ret == QMessageBox::No){
return;
}
}
modelObject.remove();
}
}
示例8: OSItem
ModelObjectItem::ModelObjectItem(const openstudio::model::ModelObject& modelObject,
bool isDefaulted,
OSItem::Type type,
QWidget * parent )
: OSItem(modelObjectToItemId(modelObject, isDefaulted), type, parent),
m_handle(modelObject.handle()),
m_modelObject(modelObject)
{
this->setText(QString::fromStdString(m_modelObject.name().get()));
bool isConnected = false;
isConnected = connect( m_modelObject.getImpl<openstudio::model::detail::ModelObject_Impl>().get(),
SIGNAL(onChange()),
this,
SLOT(onObjectChanged()) );
OS_ASSERT(isConnected);
if (!modelObject.getModelObjectSources<model::ComponentData>().empty()){
m_bclBadge->setVisible(true);
}
}
示例9: onSelectModelObject
void ConstructionsInspectorView::onSelectModelObject(const openstudio::model::ModelObject& modelObject)
{
switch( modelObject.iddObjectType().value() )
{
case IddObjectType::OS_Construction:
this->showConstructionInspector(modelObject);
break;
case IddObjectType::OS_Construction_CfactorUndergroundWall:
this->showCfactorUndergroundWallInspector(modelObject);
break;
case IddObjectType::OS_Construction_FfactorGroundFloor:
this->showFfactorGroundFloorInspector(modelObject);
break;
case IddObjectType::OS_Construction_InternalSource:
this->showInternalSourceInspector(modelObject);
break;
case IddObjectType::OS_Construction_WindowDataFile:
this->showWindowDataFileInspector(modelObject);
break;
default:
showDefaultView();
}
}
示例10: onRemoveObject
void MaterialsController::onRemoveObject(openstudio::model::ModelObject modelObject)
{
modelObject.remove();
}
示例11: onCopyObject
void MaterialsController::onCopyObject(const openstudio::model::ModelObject& modelObject)
{
modelObject.clone(this->model());
}
示例12: onRemoveObject
void SpaceTypesController::onRemoveObject(openstudio::model::ModelObject modelObject)
{
modelObject.remove();
}
示例13: onCopyObject
void SpaceTypesController::onCopyObject(const openstudio::model::ModelObject& modelObject)
{
modelObject.clone(this->model());
}
示例14: onSelectModelObject
void FacilityInspectorView::onSelectModelObject(const openstudio::model::ModelObject& modelObject)
{
int index = 1;
std::map<openstudio::IddObjectType, int>::const_iterator it = m_inspectorIndexMap.find(modelObject.iddObjectType());
if (it != m_inspectorIndexMap.end()){
index = it->second;
}
QWidget* widget = this->stackedWidget()->widget(index);
ModelObjectInspectorView* modelObjectInspectorView = qobject_cast<ModelObjectInspectorView*>(widget);
OS_ASSERT(modelObjectInspectorView);
modelObjectInspectorView->selectModelObject(modelObject);
this->stackedWidget()->setCurrentIndex(index);
}
示例15: modelObjectToItemId
OSItemId modelObjectToItemId(const openstudio::model::ModelObject& modelObject, bool isDefaulted)
{
std::stringstream ss;
ss << modelObject;
return OSItemId(modelObject.handle().toString(), modelToSourceId(modelObject.model()), isDefaulted, toQString(ss.str()));
}