Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] savin and loading 3D triangulation is slow !!!

Subject: CGAL users discussion list

List archive

[cgal-discuss] savin and loading 3D triangulation is slow !!!


Chronological Thread 
  • From: <>
  • To:
  • Subject: [cgal-discuss] savin and loading 3D triangulation is slow !!!
  • Date: Thu, 28 Jan 2010 19:12:07 +0100 (CET)

Hi,
I move my project from win XP 32 to win vista 64. It seems that everything
related to CGAL is slower, but saving and loading 3D triangulation is extremly
slow. It was slow in XP 32 but now it is at least 10-20 times slower!

I'm using my own cellInfo and vertexInfo structures with triangluation as
follows :

typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef CGAL::Triangulation_cell_base_with_info_3<cellInfo, K> Cb;
typedef CGAL::Triangulation_vertex_base_with_info_3<vertexInfo, K> Vb;
typedef CGAL::Triangulation_hierarchy_vertex_base_3<Vb> Vbh;

typedef CGAL::Triangulation_data_structure_3<Vbh, Cb> Tds;
typedef CGAL::Delaunay_triangulation_3<K,Tds> Dt;
typedef CGAL::Triangulation_hierarchy_3<Dt> Dh;

Dh &T

void saveDhAndDeallocate(Dh &T, multiviewParams *mp)
{
std::string fileNameInfo = mp->mip->mvDir + "delanuayTrinagluationInfo.bin";
FILE *f = fopen(fileNameInfo.c_str(),"wb");
for (Dh::Finite_vertices_iterator
fit=T.finite_vertices_begin();fit!=T.finite_vertices_end();++fit) {
fit->info().fwriteinfo(f);
};

for (Dh::Finite_cells_iterator fit = T.finite_cells_begin(); fit !=
T.finite_cells_end(); ++fit) {
fit->info().fwriteinfo(f);
};
fclose(f);
deallocateInfo(T);

std::string fileNameDh = mp->mip->mvDir + "delanuayTrinagluation.bin";
std::ofstream oFileT(fileNameDh.c_str(),std::ios::out);
oFileT << T;
}

void loadDh(Dh &T, multiviewParams *mp)
{
std::string fileNameDh = mp->mip->mvDir + "delanuayTrinagluation.bin";
std::ifstream iFileT(fileNameDh.c_str(),std::ios::in);
iFileT >> T;

std::string fileNameInfo = mp->mip->mvDir + "delanuayTrinagluationInfo.bin";
FILE *f = fopen(fileNameInfo.c_str(),"rb");

for (Dh::Finite_vertices_iterator
fit=T.finite_vertices_begin();fit!=T.finite_vertices_end();++fit) {
fit->info().freadinfo(f);
};

for (Dh::Finite_cells_iterator fit = T.finite_cells_begin(); fit !=
T.finite_cells_end(); ++fit) {
fit->info().freadinfo(f);
};
fclose(f);

}

Is there any other possibility how to save and load 3D triangluation, or can
anyone give me an advice how to do it faster, or where can be problem? My
triangluation contanins something about 500 000 points and 4 000 000 cells. I
have to point out that slow parts are oFileT << T; and iFileT >> T; only!!!

Many thanks.

Michal


  • [cgal-discuss] savin and loading 3D triangulation is slow !!!, michal, 01/28/2010

Archive powered by MHonArc 2.6.16.

Top of Page