本文整理汇总了C++中Attributes::getAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ Attributes::getAttribute方法的具体用法?C++ Attributes::getAttribute怎么用?C++ Attributes::getAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attributes
的用法示例。
在下文中一共展示了Attributes::getAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseChildElementStartTag
bool GMLFeatureCollectionElementParser::parseChildElementStartTag(const NodeType::XMLNode& node, Attributes& attributes)
{
if (getFeatureObject() == nullptr) {
throw std::runtime_error("Invalid call to GMLFeatureCollectionElementParser::parseChildElementStartTag");
}
if (node == NodeType::GML_LowerCornerNode
|| node == NodeType::GML_UpperCornerNode
|| node == NodeType::GML_BoundedByNode) {
return true;
} else if (node == NodeType::GML_EnvelopeNode) {
if (m_sourceSRSOverride) {
return true;
}
if (m_bounds != nullptr) {
CITYGML_LOG_WARN(m_logger, "Duplicate definition of " << NodeType::GML_EnvelopeNode << " at " << getDocumentLocation());
return true;
}
m_bounds = new Envelope(attributes.getAttribute("srsName"));
return true;
}
return GMLObjectElementParser::parseChildElementStartTag(node, attributes);
}
示例2: parseDimension
void LineStringElementParser::parseDimension(Attributes& attributes)
{
std::string dim_str = attributes.getAttribute("srsDimension", "");
if (dim_str.empty()) {
return;
}
int dim = std::stoi(dim_str);
m_model->setDimensions(dim);
}
示例3: parseChildElementStartTag
bool CityObjectElementParser::parseChildElementStartTag(const NodeType::XMLNode& node, Attributes& attributes)
{
initializeAttributesSet();
if (m_model == nullptr) {
throw std::runtime_error("CityObjectElementParser::parseChildElementStartTag called before CityObjectElementParser::parseElementStartTag");
}
if ( node == NodeType::GEN_StringAttributeNode
|| node == NodeType::GEN_DoubleAttributeNode
|| node == NodeType::GEN_IntAttributeNode
|| node == NodeType::GEN_DateAttributeNode
|| node == NodeType::GEN_UriAttributeNode) {
m_lastAttributeName = attributes.getAttribute("name");
} else if (attributesSet.count(node.typeID()) > 0 || node == NodeType::GEN_ValueNode) {
return true;
} else if (node == NodeType::BLDG_BoundedByNode
|| node == NodeType::BLDG_OuterBuildingInstallationNode
|| node == NodeType::BLDG_InteriorBuildingInstallationNode
|| node == NodeType::BLDG_InteriorFurnitureNode
|| node == NodeType::BLDG_RoomInstallationNode
|| node == NodeType::BLDG_InteriorRoomNode
|| node == NodeType::BLDG_OpeningNode
|| node == NodeType::BLDG_ConsistsOfBuildingPartNode
|| node == NodeType::GRP_GroupMemberNode
|| node == NodeType::GRP_ParentNode
|| node == NodeType::TRANS_TrafficAreaNode
|| node == NodeType::TRANS_AuxiliaryTrafficAreaNode
|| node == NodeType::WTR_BoundedByNode) {
setParserForNextElement(new CityObjectElementParser(m_documentParser, m_factory, m_logger, [this](CityObject* obj) {
m_model->addChildCityObject(obj);
}));
} else if (node == NodeType::APP_AppearanceNode // Compatibility with CityGML 1.0 (in CityGML 2 CityObjects can only contain appearanceMember elements)
|| node == NodeType::APP_AppearanceMemberNode) {
setParserForNextElement(new AppearanceElementParser(m_documentParser, m_factory, m_logger));
} else if (node == NodeType::BLDG_Lod1MultiCurveNode
|| node == NodeType::BLDG_Lod1MultiSurfaceNode
|| node == NodeType::BLDG_Lod1SolidNode
|| node == NodeType::BLDG_Lod1TerrainIntersectionNode
|| node == NodeType::GEN_Lod1TerrainIntersectionNode
|| node == NodeType::FRN_Lod1TerrainIntersectionNode
|| node == NodeType::LUSE_Lod1MultiSurfaceNode
|| node == NodeType::TRANS_Lod1MultiSurfaceNode
|| node == NodeType::WTR_Lod1MultiCurveNode
|| node == NodeType::WTR_Lod1MultiSurfaceNode
|| node == NodeType::WTR_Lod1SolidNode) {
parseGeometryForLODLevel(1);
} else if (node == NodeType::BLDG_Lod2MultiCurveNode
|| node == NodeType::BLDG_Lod2MultiSurfaceNode
|| node == NodeType::BLDG_Lod2SolidNode
|| node == NodeType::BLDG_Lod2TerrainIntersectionNode
|| node == NodeType::GEN_Lod2TerrainIntersectionNode
|| node == NodeType::FRN_Lod2TerrainIntersectionNode
|| node == NodeType::LUSE_Lod2MultiSurfaceNode
|| node == NodeType::TRANS_Lod2MultiSurfaceNode
|| node == NodeType::WTR_Lod2SolidNode
|| node == NodeType::WTR_Lod2SurfaceNode) {
parseGeometryForLODLevel(2);
} else if (node == NodeType::BLDG_Lod3MultiCurveNode
|| node == NodeType::BLDG_Lod3MultiSurfaceNode
|| node == NodeType::BLDG_Lod3SolidNode
|| node == NodeType::BLDG_Lod3TerrainIntersectionNode
|| node == NodeType::GEN_Lod3TerrainIntersectionNode
|| node == NodeType::FRN_Lod3TerrainIntersectionNode
|| node == NodeType::LUSE_Lod3MultiSurfaceNode
|| node == NodeType::TRANS_Lod3MultiSurfaceNode
|| node == NodeType::WTR_Lod3SolidNode
|| node == NodeType::WTR_Lod3SurfaceNode) {
parseGeometryForLODLevel(3);
} else if (node == NodeType::BLDG_Lod4MultiCurveNode
|| node == NodeType::BLDG_Lod4MultiSurfaceNode
|| node == NodeType::BLDG_Lod4SolidNode
|| node == NodeType::BLDG_Lod4TerrainIntersectionNode
|| node == NodeType::GEN_Lod4TerrainIntersectionNode
|| node == NodeType::FRN_Lod4TerrainIntersectionNode
|| node == NodeType::LUSE_Lod4MultiSurfaceNode
|| node == NodeType::TRANS_Lod4MultiSurfaceNode
|| node == NodeType::WTR_Lod4SolidNode
|| node == NodeType::WTR_Lod4SurfaceNode) {
parseGeometryForLODLevel(4);
} else if (node == NodeType::GEN_Lod1GeometryNode
|| node == NodeType::FRN_Lod1GeometryNode
|| node == NodeType::VEG_Lod1GeometryNode) {
parseGeometryPropertyElementForLODLevel(1, attributes.getCityGMLIDAttribute());
} else if (node == NodeType::GEN_Lod2GeometryNode
|| node == NodeType::FRN_Lod2GeometryNode
|| node == NodeType::BLDG_Lod2GeometryNode
|| node == NodeType::VEG_Lod2GeometryNode) {
parseGeometryPropertyElementForLODLevel(2, attributes.getCityGMLIDAttribute());
} else if (node == NodeType::GEN_Lod3GeometryNode
|| node == NodeType::FRN_Lod3GeometryNode
|| node == NodeType::BLDG_Lod3GeometryNode
//.........这里部分代码省略.........