本文整理汇总了C++中proportionaltimegeometry::Pointer::IsNotNull方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::IsNotNull方法的具体用法?C++ Pointer::IsNotNull怎么用?C++ Pointer::IsNotNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类proportionaltimegeometry::Pointer
的用法示例。
在下文中一共展示了Pointer::IsNotNull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: localeSwitch
std::vector<itk::SmartPointer<mitk::BaseData>> mitk::GeometryDataReaderService::Read()
{
// Switch the current locale to "C"
LocaleSwitch localeSwitch("C");
std::vector<itk::SmartPointer<BaseData>> result;
InputStream stream(this);
TiXmlDocument doc;
stream >> doc;
if (!doc.Error())
{
TiXmlHandle docHandle(&doc);
for (TiXmlElement *geomDataElement = docHandle.FirstChildElement("GeometryData").ToElement();
geomDataElement != nullptr;
geomDataElement = geomDataElement->NextSiblingElement())
{
for (TiXmlElement *currentElement = geomDataElement->FirstChildElement(); currentElement != nullptr;
currentElement = currentElement->NextSiblingElement())
{
// different geometries could have been serialized from a GeometryData
// object:
std::string tagName = currentElement->Value();
if (tagName == "Geometry3D")
{
Geometry3D::Pointer restoredGeometry = Geometry3DToXML::FromXML(currentElement);
if (restoredGeometry.IsNotNull())
{
GeometryData::Pointer newGeometryData = GeometryData::New();
newGeometryData->SetGeometry(restoredGeometry);
result.push_back(newGeometryData.GetPointer());
}
else
{
MITK_ERROR << "Invalid <Geometry3D> tag encountered. Skipping.";
}
}
else if (tagName == "ProportionalTimeGeometry")
{
ProportionalTimeGeometry::Pointer restoredTimeGeometry =
ProportionalTimeGeometryToXML::FromXML(currentElement);
if (restoredTimeGeometry.IsNotNull())
{
GeometryData::Pointer newGeometryData = GeometryData::New();
newGeometryData->SetTimeGeometry(restoredTimeGeometry);
result.push_back(newGeometryData.GetPointer());
}
else
{
MITK_ERROR << "Invalid <ProportionalTimeGeometry> tag encountered. Skipping.";
}
}
} // for child of <GeometryData>
} // for <GeometryData>
}
else
{
mitkThrow() << "Parsing error at line " << doc.ErrorRow() << ", col " << doc.ErrorCol() << ": " << doc.ErrorDesc();
}
if (result.empty())
{
mitkThrow() << "Did not read a single GeometryData object from input.";
}
return result;
}