Skip to content

Commit

Permalink
Merge pull request #60 from HarutakaMatsumoto/develop
Browse files Browse the repository at this point in the history
Implemented all parts of ReliefComponent except RectifiedGridCoverage
  • Loading branch information
jklimke authored Oct 26, 2021
2 parents 486fc96 + a716a9d commit d10ec50
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 8 deletions.
5 changes: 5 additions & 0 deletions sources/include/citygml/cityobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ namespace citygml {
COT_SolitaryVegetationObject = 1ll<< 13,
COT_WaterBody = 1ll<< 14,
COT_ReliefFeature = 1ll<< 15,
COT_ReliefComponent = 1ll<< 35,
COT_TINRelief = 1ll<< 36,
COT_MassPointRelief = 1ll<< 37,
COT_BreaklineRelief = 1ll<< 38,
COT_RasterRelief = 1ll<< 39,
COT_LandUse = 1ll<< 16,
COT_Tunnel = 1ll<< 17,
COT_Bridge = 1ll<< 18,
Expand Down
3 changes: 2 additions & 1 deletion sources/include/citygml/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ namespace citygml {
GT_InteriorWall = 1 << 6,
GT_Ceiling = 1 << 7,
GT_OuterCeiling = 1 << 8,
GT_OuterFloor = 1 << 9
GT_OuterFloor = 1 << 9,
GT_Tin = 1 << 10,
};

unsigned int getLOD() const;
Expand Down
4 changes: 3 additions & 1 deletion sources/include/parser/nodetypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ namespace citygml {
NODETYPE( GML, Shell )
NODETYPE( GML, PolyhedralSurface )
NODETYPE( GML, Surface )
NODETYPE( GML, PolygonPatch)
NODETYPE( GML, PolygonPatch )

NODETYPE( GML, LineString )

NODETYPE( GML, RectifiedGridCoverage )

// BLDG
NODETYPE( BLDG, Building )
Expand Down
2 changes: 2 additions & 0 deletions sources/src/citygml/citygmlfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ namespace citygml {
return Geometry::GeometryType::GT_OuterCeiling;
case CityObject::CityObjectsType::COT_OuterFloorSurface:
return Geometry::GeometryType::GT_OuterFloor;
case CityObject::CityObjectsType::COT_TINRelief:
return Geometry::GeometryType::GT_Tin;
default:
return Geometry::GeometryType::GT_Unknown;
}
Expand Down
2 changes: 2 additions & 0 deletions sources/src/citygml/geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ namespace citygml {
return "OuterCeiling";
case GeometryType::GT_OuterFloor:
return "OuterFloor";
case GeometryType::GT_Tin:
return "Tin";
default:
return "Unknown";
}
Expand Down
33 changes: 30 additions & 3 deletions sources/src/parser/cityobjectelementparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ namespace citygml {
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, OuterFloorSurface));
typeIDTypeMap.insert(HANDLE_TYPE(GRP, CityObjectGroup));
typeIDTypeMap.insert(HANDLE_TYPE(DEM, ReliefFeature));
typeIDTypeMap.insert(HANDLE_TYPE(DEM, ReliefComponent));
typeIDTypeMap.insert(HANDLE_TYPE(DEM, TINRelief));
typeIDTypeMap.insert(HANDLE_TYPE(DEM, MassPointRelief));
typeIDTypeMap.insert(HANDLE_TYPE(DEM, BreaklineRelief));
typeIDTypeMap.insert(HANDLE_TYPE(DEM, RasterRelief));
typeIDTypeMap.insert(HANDLE_TYPE(BLDG, IntBuildingInstallation));

typeIDTypeMapInitialized = true;
Expand Down Expand Up @@ -280,14 +285,27 @@ namespace citygml {
|| node == NodeType::GRP_ParentNode
|| node == NodeType::TRANS_TrafficAreaNode
|| node == NodeType::TRANS_AuxiliaryTrafficAreaNode
|| node == NodeType::WTR_BoundedByNode) {
|| node == NodeType::WTR_BoundedByNode
|| node == NodeType::DEM_ReliefComponentNode
|| node == NodeType::DEM_TINReliefNode
|| node == NodeType::DEM_MassPointReliefNode
|| node == NodeType::DEM_BreaklineReliefNode
|| node == NodeType::DEM_RasterReliefNode
|| node == NodeType::DEM_GridNode) {
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::DEM_ExtentNode
|| node == NodeType::DEM_TinNode
|| node == NodeType::DEM_ReliefPointsNode
|| node == NodeType::DEM_RidgeOrValleyLinesNode
|| node == NodeType::DEM_BreaklinesNode) {

parseGeometryForLODLevel(std::stoi(m_model->getAttribute("dem:lod")));
} else if (node == NodeType::BLDG_Lod1MultiCurveNode
|| node == NodeType::BLDG_Lod1MultiSurfaceNode
|| node == NodeType::BLDG_Lod1SolidNode
Expand Down Expand Up @@ -380,13 +398,13 @@ namespace citygml {
|| node == NodeType::CORE_ExternalReferenceNode
|| node == NodeType::GML_MultiPointNode
|| node == NodeType::GRP_GeometryNode
|| node == NodeType::DEM_ReliefComponentNode
|| node == NodeType::GEN_Lod0GeometryNode
|| node == NodeType::GEN_Lod0ImplicitRepresentationNode
|| node == NodeType::GEN_Lod0TerrainIntersectionNode
|| node == NodeType::TRANS_Lod0NetworkNode
|| node == NodeType::WTR_Lod0MultiCurveNode
|| node == NodeType::WTR_Lod0MultiSurfaceNode) {
|| node == NodeType::WTR_Lod0MultiSurfaceNode
|| node == NodeType::GML_RectifiedGridCoverageNode) {
CITYGML_LOG_INFO(m_logger, "Skipping CityObject child element <" << node << "> at " << getDocumentLocation() << " (Currently not supported!)");
setParserForNextElement(new SkipElementParser(m_documentParser, m_logger, node));
return true;
Expand Down Expand Up @@ -504,6 +522,15 @@ namespace citygml {
|| node == NodeType::LUSE_Lod3MultiSurfaceNode
|| node == NodeType::LUSE_Lod4MultiSurfaceNode
|| node == NodeType::DEM_ReliefComponentNode
|| node == NodeType::DEM_TINReliefNode
|| node == NodeType::DEM_MassPointReliefNode
|| node == NodeType::DEM_BreaklineReliefNode
|| node == NodeType::DEM_RasterReliefNode
|| node == NodeType::DEM_TinNode
|| node == NodeType::DEM_ReliefPointsNode
|| node == NodeType::DEM_RidgeOrValleyLinesNode
|| node == NodeType::DEM_BreaklinesNode
|| node == NodeType::DEM_GridNode
|| node == NodeType::GEN_Lod0GeometryNode
|| node == NodeType::GEN_Lod0ImplicitRepresentationNode
|| node == NodeType::GEN_Lod0TerrainIntersectionNode
Expand Down
3 changes: 2 additions & 1 deletion sources/src/parser/geometryelementparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ namespace citygml {
geometryTypeIDSet.insert(NodeType::GML_PolyhedralSurfaceNode.typeID());
geometryTypeIDSet.insert(NodeType::GML_SurfaceNode.typeID());
geometryTypeIDSet.insert(NodeType::GML_MultiCurveNode.typeID());
geometryTypeIDSet.insert(NodeType::GML_MultiPointNode.typeID());
geometryTypeIDSetInitialized = true;

}
Expand Down Expand Up @@ -138,7 +139,7 @@ namespace citygml {
};

setParserForNextElement(new SequenceParser(m_documentParser, m_logger, patchParserFactory, node));

return true;
}

return GMLObjectElementParser::parseChildElementStartTag(node, attributes);
Expand Down
6 changes: 4 additions & 2 deletions sources/src/parser/nodetypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,11 @@ namespace citygml {
DEFINE_NODE( GML, Shell )
DEFINE_NODE( GML, PolyhedralSurface )
DEFINE_NODE( GML, Surface )
DEFINE_NODE( GML, PolygonPatch)
DEFINE_NODE( GML, PolygonPatch )

DEFINE_NODE( GML, LineString)
DEFINE_NODE( GML, LineString )

DEFINE_NODE( GML, RectifiedGridCoverage )

// BLDG
DEFINE_NODE( BLDG, Building )
Expand Down

0 comments on commit d10ec50

Please sign in to comment.