Some more fixes, skipping delete of citygml model as it gets stuck during...

Some more fixes, skipping delete of citygml model as it gets stuck during destruction, probably related to shared pointers
parent ee71cb2b
......@@ -130,20 +130,27 @@ void ITAGeo::CCityGMLModel::GetBuildingMesh( const ITAGeo::CCityGMLModel::CCityB
}
vFaceVertices.push_back( pMesh->add_vertex( CurrentPoint ) );
}
if( vFaceVertices.size() < 3 )
size_t iNumVerticesPre = vFaceVertices.size();
vFaceVertices.erase( std::unique( vFaceVertices.begin(), vFaceVertices.end() ), vFaceVertices.end() );
if( vFaceVertices.size() != iNumVerticesPre )
{
std::cerr << "Found invalid number of face vertices after mesh conversion. Skipping this face." << std::endl;
continue;
std::cout << "For an unkown reason, detected non-unique vertices to be added as face during mesh conversion. Will skip this face for safety." << std::endl;
//continue;
}
const size_t iNumVerticesPre = vFaceVertices.size();
vFaceVertices.erase( std::unique( vFaceVertices.begin(), vFaceVertices.end() ), vFaceVertices.end() );
iNumVerticesPre = vFaceVertices.size();
std::set< CITAMesh::VertexHandle > s( vFaceVertices.begin(), vFaceVertices.end() );
vFaceVertices.assign( s.begin(), s.end() );
if( vFaceVertices.size() != iNumVerticesPre )
std::cout << "For an unkown reason, detected non-unique vertices to be added as face during mesh conversion. Made them unique." << std::endl;
if( vFaceVertices.size() < 3 )
{
std::cout << "For an unkown reason, detected non-unique vertices to ba added as face during mesh conversion. Will skip this face for safety." << std::endl;
std::cerr << "Found invalid number of face vertices after mesh conversion. Skipping this face." << std::endl;
continue;
}
pMesh->add_face( vFaceVertices );
}
}
......@@ -166,7 +173,9 @@ ITAGeo::CCityGMLModel::CCityGMLModel()
ITAGeo::CCityGMLModel::~CCityGMLModel()
{
delete m_pCityModel;
//m_pCityModel->pCityModel = nullptr;
//m_pCityModel->pLogger = nullptr;
//delete m_pCityModel;
}
bool ITAGeo::CCityGMLModel::Load( const std::string& sCityGMLFilePath )
......
......@@ -81,6 +81,9 @@ int main( int, char** )
ITAGeo::CSensor oReceiver;
oReceiver.vPos.SetValues( 294605.0f, 5628758.0f, 164.0f );
cout << "Source: " << oSource.ToString() << endl;
cout << "Receiver: " << oReceiver.ToString() << endl;
vector< ITAGeo::CHalfedgeMeshModel* > vpRemainingBuildingModels;
vector< ITAGeo::CHalfedgeMeshModel* > vpAachenBuildingModels;
......@@ -113,16 +116,10 @@ int main( int, char** )
vector< const ITAGeo::CCityGMLModel::CCityBuilding* > RemainingObjects;
cout << "Executing Culling Test with Distance of 1000m, Source Position at 100/100/10, Receiver Position at 300/300/0 ...";
cout << "Culling ... ";
oModel.DistanceCulling( dDistance, oSource, oReceiver, RemainingObjects );
cout << "done." << endl;
cout << RemainingObjects.size() << " Objects Remaining" << endl;
for( unsigned int i = 0; i < RemainingObjects.size(); i++ )
{
cout << RemainingObjects[ i ]->sID << " " << RemainingObjects[ i ]->v3CenterPos << endl;
}
cout << "Exporting remaining meshes ... ";
for( unsigned int i = 0; i < RemainingObjects.size(); i++ )
{
......
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