Commit 00bdb9ed authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen

Merge branch 'develop' of https://git.rwth-aachen.de/ita/ITAGeo into develop

parents ae0e5b32 e8a929a6
......@@ -41,10 +41,7 @@ if( ITA_GEO_WITH_SKETCHUP_SUPPORT )
endif( )
if( ITA_GEO_WITH_CITYGML_SUPPORT )
vista_use_package( xerces REQUIRED FIND_DEPENDENCIES )
vista_use_package( gdal REQUIRED FIND_DEPENDENCIES )
vista_use_package( libcitygml REQUIRED FIND_DEPENDENCIES )
#add_definitions( -DLIBCITYGML_STATIC )
endif( )
if( ITA_GEO_WITH_IFC_SUPPORT )
......@@ -53,7 +50,6 @@ endif( )
if( ITA_GEO_WITH_XERCES_SUPPORT )
add_definitions( -DWITH_XERCES_SUPPORT )
#add_definitions( -DXERCES_STATIC_LIBRARY )
endif( )
......
......@@ -76,7 +76,7 @@ namespace ITAGeo
*/
bool Store( const std::string& sGMLFilePath, bool bOverwrite = true ) const;
void GetBuildingMesh( const CCityBuilding* pBuilding, ITAGeo::CHalfedgeMeshModel* pBuildingMesh, const VistaVector3D v3Shift = VistaVector3D( 0.0f, 0.0f, 0.0f ) );
void GetBuildingMesh( const CCityBuilding* pBuilding, ITAGeo::CHalfedgeMeshModel* pBuildingMesh, const VistaVector3D v3Shift = VistaVector3D( 0.0f, 0.0f, 0.0f ), const bool bCreateConnectedMesh = true );
std::vector< const ITAGeo::CCityGMLModel::CCityBuilding* > GetBuildings() const;
void DistanceCulling( const double dDetourDistance, const ITAGeo::CPropagationAnchor& v3Source, const ITAGeo::CPropagationAnchor& v3Target, std::vector< const ITAGeo::CCityGMLModel::CCityBuilding* >& vpResidualBuildings );
......
......@@ -58,7 +58,7 @@ public:
//! Resolved for Polygons without Holes // throws Polygon Connectivity error at seemingly random points.
void ITAGeo::CCityGMLModel::GetBuildingMesh( const ITAGeo::CCityGMLModel::CCityBuilding* pBuilding, ITAGeo::CHalfedgeMeshModel* pMeshModel, const VistaVector3D v3Shift )
void ITAGeo::CCityGMLModel::GetBuildingMesh( const ITAGeo::CCityGMLModel::CCityBuilding* pBuilding, ITAGeo::CHalfedgeMeshModel* pMeshModel, const VistaVector3D v3Shift, const bool bCreateConnectedMesh )
{
const citygml::CityObject& oBuilding = m_pCityModel->pCityModel->getRootCityObject( pBuilding->iNum - 1 );
CITAMesh* pMesh = pMeshModel->GetMesh()->pTopLevelMesh;
......@@ -104,7 +104,8 @@ void ITAGeo::CCityGMLModel::GetBuildingMesh( const ITAGeo::CCityGMLModel::CCityB
{
CITAMesh::VertexHandle vh = pMesh->add_vertex( CityGMLPoint3DToITAMeshPoint( v ) + vpGlobalShift );
voPointCloud.push_back( v );
if( bCreateConnectedMesh )
voPointCloud.push_back( v );
vvhVertices.push_back( vh );
vFaceVertices.push_back( vh );
......@@ -118,7 +119,9 @@ void ITAGeo::CCityGMLModel::GetBuildingMesh( const ITAGeo::CCityGMLModel::CCityB
if( vPrunedFaceVertices.size() != vFaceVertices.size() )
{
std::cerr << "Found non-unique entries in linear ring at " << oBuildingPart.getId() << ", skipping building part." << std::endl;
std::cerr << "Found non-unique entries in linear ring at " << oBuildingPart.getId() << ", trying to add pruned building part." << std::endl;
if( vPrunedFaceVertices.size() > 2 )
pMesh->add_face( vPrunedFaceVertices );
continue;
}
......
......@@ -18,6 +18,8 @@ double GetSIScaleFromSUUnits( const SUModelUnits& iUnits )
dScale = g_dInchesToMeterScale;
if( iUnits == SUModelUnits_Millimeters )
dScale = 0.001f;
if( iUnits == SUModelUnits_Meters )
dScale = g_dInchesToMeterScale;
return dScale;
}
......
......@@ -4,9 +4,8 @@ project( ITAGeoCityGMLNativeTests )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
vista_use_package( xerces REQUIRED FIND_DEPENDENCIES )
vista_use_package( gdal REQUIRED FIND_DEPENDENCIES )
vista_use_package( libcitygml REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITAGeo REQUIRED FIND_DEPENDENCIES )
add_executable( ITAGeoCityGMLTest ITAGeoCityGMLTest.cpp )
target_link_libraries( ITAGeoCityGMLTest ${VISTA_USE_PACKAGE_LIBRARIES} )
......
......@@ -57,12 +57,13 @@ typedef OpenMesh::PolyMesh_ArrayKernelT<> CITAMesh;
static vector< string > vsAachenCityFilePaths =
{
//"corrupt_building_2"
"corrupt_building_2"
/*
"LoD2_293_5628_1_NW",
"LoD2_293_5629_1_NW",
"LoD2_294_5628_1_NW",
"LoD2_294_5629_1_NW",
*/
};
const VistaVector3D v3GlobalExportShift( -293000.0f, -5628000.0f, 0.0f );
......@@ -115,7 +116,7 @@ int main( int, char** )
for( size_t n = 0; n < vpCityBuildings.size(); n++ )
{
auto pBuildingModel = new ITAGeo::CHalfedgeMeshModel();
oModel.GetBuildingMesh( vpCityBuildings[ n ], pBuildingModel, v3GlobalExportShift );
oModel.GetBuildingMesh( vpCityBuildings[ n ], pBuildingModel, v3GlobalExportShift, false );
voSketchUpCity.AddVisualizationMesh( pBuildingModel, "CityBuildings_" + sCityGMLFileName );
vpRemainingBuildingModels.push_back( pBuildingModel );
}
......@@ -131,7 +132,7 @@ int main( int, char** )
for( unsigned int i = 0; i < RemainingObjects.size(); i++ )
{
auto pBuildingModel = new ITAGeo::CHalfedgeMeshModel();
oModel.GetBuildingMesh( RemainingObjects[ i ], pBuildingModel, v3GlobalExportShift );
oModel.GetBuildingMesh( RemainingObjects[ i ], pBuildingModel, v3GlobalExportShift, false );
voSketchUpCity.AddVisualizationMesh( pBuildingModel, "CullingAlgo_" + sCityGMLFileName );
vpAachenBuildingModels.push_back( pBuildingModel );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment