本文整理汇总了C++中model::ModelObject类的典型用法代码示例。如果您正苦于以下问题:C++ ModelObject类的具体用法?C++ ModelObject怎么用?C++ ModelObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModelObject类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attach
void ModelObjectVectorController::attach(const model::ModelObject& modelObject)
{
detach();
m_modelObject = modelObject;
attachModel(modelObject.model());
connect(m_model->getImpl<model::detail::Model_Impl>().get(),
static_cast<void (model::detail::Model_Impl::*)(std::shared_ptr<detail::WorkspaceObject_Impl>, const IddObjectType &, const UUID &) const>(&model::detail::Model_Impl::addWorkspaceObject),
this,
&ModelObjectVectorController::objectAdded,
Qt::QueuedConnection);
connect(m_model->getImpl<model::detail::Model_Impl>().get(),
static_cast<void (model::detail::Model_Impl::*)(std::shared_ptr<detail::WorkspaceObject_Impl>, const IddObjectType &, const UUID &) const>(&model::detail::Model_Impl::removeWorkspaceObject),
this,
&ModelObjectVectorController::objectRemoved,
Qt::QueuedConnection);
connect(m_modelObject->getImpl<model::detail::ModelObject_Impl>().get(), &model::detail::ModelObject_Impl::onRelationshipChange,
this, &ModelObjectVectorController::changeRelationship);
connect(m_modelObject->getImpl<model::detail::ModelObject_Impl>().get(), &model::detail::ModelObject_Impl::onDataChange,
this, &ModelObjectVectorController::dataChange);
connect(m_modelObject->getImpl<model::detail::ModelObject_Impl>().get(), &model::detail::ModelObject_Impl::onChange,
this, &ModelObjectVectorController::change);
}
示例2: attach
void BuildingStorySpacesVectorController::attach(const model::ModelObject& modelObject)
{
ModelObjectVectorController::attach(modelObject);
BOOST_FOREACH(const model::Space& space, modelObject.model().getModelObjects<model::Space>()){
attachOtherModelObject(space);
}
}
示例3: attach
void SpaceSpaceTypeVectorController::attach(const model::ModelObject& modelObject)
{
ModelObjectVectorController::attach(modelObject);
model::Building building = modelObject.model().getUniqueModelObject<model::Building>();
attachOtherModelObject(building);
}
示例4: attachOtherModelObject
void ModelObjectVectorController::attachOtherModelObject(const model::ModelObject& modelObject)
{
// check not already connected
for (const model::ModelObject& currentModelObject : m_otherModelObjects){
if (modelObject.handle() == currentModelObject.handle()){
return;
}
}
m_otherModelObjects.push_back(modelObject);
connect(modelObject.getImpl<model::detail::ModelObject_Impl>().get(), &model::detail::ModelObject_Impl::onRelationshipChange,
this, &ModelObjectVectorController::changeRelationship);
}
示例5: detachOtherModelObject
void ModelObjectVectorController::detachOtherModelObject(const model::ModelObject& modelObject)
{
std::vector<model::ModelObject>::const_iterator it = m_otherModelObjects.begin();
std::vector<model::ModelObject>::const_iterator itend = m_otherModelObjects.end();
std::vector<model::ModelObject> newVector;
for (; it != itend; ++it){
if (it->handle() == modelObject.handle()){
disconnect(modelObject.getImpl<model::detail::ModelObject_Impl>().get());
}else{
newVector.push_back(*it);
}
}
m_otherModelObjects.swap(newVector);
}
示例6: bind
void OSDoubleEdit::bind(model::ModelObject& modelObject,
const char* property,
const boost::optional<std::string>& isDefaultedProperty,
const boost::optional<std::string>& isAutosizedProperty,
const boost::optional<std::string>& isAutocalculatedProperty)
{
m_modelObject = modelObject;
m_property = property;
m_isDefaultedProperty = isDefaultedProperty;
m_isAutosizedProperty = isAutosizedProperty;
m_isAutocalculatedProperty = isAutocalculatedProperty;
// only let one of autosize/autocalculate
if (isAutosizedProperty && isAutocalculatedProperty) {
LOG_AND_THROW("A field can only be autosized or autocalculated, it cannot be both.");
}
// check for attribute existence
StringVector attributeNames = modelObject.attributeNames();
StringVector::const_iterator anb(attributeNames.begin()),ane(attributeNames.end());
BOOST_ASSERT(std::find(anb,ane,m_property) != ane);
if (m_isDefaultedProperty) {
BOOST_ASSERT(std::find(anb,ane,*m_isDefaultedProperty) != ane);
}
if (m_isAutosizedProperty) {
BOOST_ASSERT(std::find(anb,ane,*m_isAutosizedProperty) != ane);
}
if (m_isAutocalculatedProperty) {
BOOST_ASSERT(std::find(anb,ane,*m_isAutocalculatedProperty) != ane);
}
setEnabled(true);
bool isConnected = false;
isConnected = connect( this, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()) );
BOOST_ASSERT(isConnected);
isConnected = connect( m_modelObject->getImpl<openstudio::model::detail::ModelObject_Impl>().get(),SIGNAL(onChange()),
this,SLOT(onModelObjectChange()) );
BOOST_ASSERT(isConnected);
isConnected = connect( m_modelObject->getImpl<openstudio::model::detail::ModelObject_Impl>().get(),SIGNAL(onRemoveFromWorkspace(Handle)),
this,SLOT(onModelObjectRemove(Handle)) );
BOOST_ASSERT(isConnected);
refreshTextAndLabel();
}
示例7: BOOST_FOREACH
void ModelObjectVectorController::attachOtherModelObject(const model::ModelObject& modelObject)
{
// check not already connected
BOOST_FOREACH(const model::ModelObject& currentModelObject, m_otherModelObjects){
if (modelObject.handle() == currentModelObject.handle()){
return;
}
}
m_otherModelObjects.push_back(modelObject);
bool isConnected = false;
isConnected = connect(modelObject.getImpl<model::detail::ModelObject_Impl>().get(),
SIGNAL(onRelationshipChange(int, Handle, Handle)),
this,
SLOT(changeRelationship(int, Handle, Handle)));
OS_ASSERT(isConnected);
}
示例8: operator
// sort by name
bool operator()(const model::ModelObject & lhs, const model::ModelObject & rhs){
return (lhs.name() < rhs.name());
}
示例9: onDataChange
void SubSurfaceConstructionVectorController::onDataChange(const model::ModelObject& modelObject)
{
if (m_modelObject && (modelObject.handle() == m_modelObject->handle())){
emit itemIds(makeVector());
}
}