本文整理汇总了C++中DataPtr::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ DataPtr::getType方法的具体用法?C++ DataPtr::getType怎么用?C++ DataPtr::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataPtr
的用法示例。
在下文中一共展示了DataPtr::getType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertChild
void Data::insertChild(size_t _index, DataPtr _child)
{
MYGUI_ASSERT(_child != nullptr, "Child is nullptr");
MYGUI_ASSERT(_child->getParent() == nullptr, "Child already attached");
MYGUI_ASSERT(_child->getType() != nullptr, "Type not found");
MYGUI_ASSERT(getType() != nullptr, "Type not found");
MYGUI_ASSERT(getType()->isChild(_child->getType()->getName()), "Type is not child");
MYGUI_ASSERT_RANGE_INSERT(_index, mChilds.size(), "Data::insertChild");
if (_index == MyGUI::ITEM_NONE)
_index = mChilds.size();
mChilds.insert(mChilds.begin() + _index, _child);
_child->mParent = mWeakThis.lock();
}
示例2: notifyChangeDataSelector
void PropertyPanelController::notifyChangeDataSelector(DataPtr _data, bool _changeOnlySelection)
{
if (mControl != nullptr)
{
DataPtr selected = _data != nullptr ? _data->getChildSelected() : nullptr;
// выделяем только данные с типом скопа
if (selected != nullptr)
{
if (selected->getType()->getName() != ScopeManager::getInstance().getCurrentScope() &&
selected->getType()->getFriend() != ScopeManager::getInstance().getCurrentScope())
selected = nullptr;
}
mControl->setCurrentData(selected);
}
}
示例3: cloneData
void DataUtility::cloneData(DataPtr _target, DataPtr _prototype)
{
MYGUI_ASSERT(_target != _prototype, "Error clone self");
MYGUI_ASSERT(_target->getType() == _prototype->getType(), "Error clone different types");
MYGUI_ASSERT(_target->getChilds().size() == 0, "Target not empty");
copyProperty(_target, _prototype);
for (Data::VectorData::const_iterator child = _prototype->getChilds().begin(); child != _prototype->getChilds().end(); child ++)
{
DataPtr data = Data::CreateInstance();
data->setType((*child)->getType());
_target->addChild(data);
cloneData(data, *child);
}
}
示例4: getSelectedDataByType
DataPtr DataUtility::getSelectedDataByType(DataPtr _data, DataTypePtr _info)
{
if (_data == nullptr)
return NULL;
if (_data->getType() == _info)
return _data;
return getSelectedDataByType(_data->getChildSelected(), _info);
}
示例5: getSelectedParentDataByType
DataPtr DataUtility::getSelectedParentDataByType(DataPtr _data, DataTypePtr _info)
{
if (_data == nullptr)
return NULL;
for (DataType::VectorString::const_iterator child = _data->getType()->getChilds().begin(); child != _data->getType()->getChilds().end(); child ++)
{
if ((*child) == _info->getName())
return _data;
}
return getSelectedParentDataByType(_data->getChildSelected(), _info);
}
示例6: getFirstFramePoint
MyGUI::IntPoint ImageExportSerializer::getFirstFramePoint(DataPtr _data)
{
if (_data->getType()->getName() != "Group")
return MyGUI::IntPoint();
if (_data->getChilds().size() != 0)
{
DataPtr child = _data->getChildByIndex(0);
if (child->getChilds().size() != 0)
{
return child->getChildByIndex(0)->getPropertyValue<MyGUI::IntPoint>("Point");
}
}
return MyGUI::IntPoint();
}
示例7: getPriority
int getPriority(DataPtr data)
{
if (data->getType()=="mesh")
return 6;
DataMetricPtr metric = boost::dynamic_pointer_cast<DataMetric>(data);
if (metric)
return 7;
ImagePtr image = boost::dynamic_pointer_cast<Image>(data);
if (image)
{
if (image->getModality().toUpper().contains("US"))
{
if (image->getImageType().toUpper().contains("B-MODE"))
return 4;
else // angio types
return 5;
}
else if (image->getModality().toUpper().contains("MR"))
{
// MR, CT, SC, others
return 2;
}
else if (image->getModality().toUpper().contains("CT"))
{
// MR, CT, SC, others
return 1;
}
else
{
return 0;
}
}
return 3;
}
示例8: validArgument
bool MetricReferenceArgumentList::validArgument(DataPtr p) const
{
if (!p)
return false;
return mValidTypes.contains(p->getType());
}
示例9: modelIsImage
bool CustomMetric::modelIsImage() const
{
DataPtr model = this->getModel();
return (model && model->getType() == "image");
}