Subject: CGAL users discussion list
List archive
- From: titan99 <>
- To:
- Subject: [cgal-discuss] Re: Slow Polyhedron Clear Time and Problems with Kernels
- Date: Wed, 2 Feb 2011 01:43:13 -0800 (PST)
Sebastien Loriot (GeometryFactory) wrote:
>
> Can you post the code used to measure these times?
>
>
> S.
>
>
Yes, here's the code
void TerrainGrid::BuildPolyhedron()
{
BuildTerrainPolyhedron<HalfedgeDS> builder;
builder.vertices = &vertices;
builder.triangleIndexs = &triangleIndexs;
builder.progBuildPolyh = &progBuildPolyh;
polyhedron.delegate(builder);
progDestrPolyh.Initiate(1); //Measuring begins (the Object
progDestrPolyh
uses QueryPerformanceCounter from Windows-API)
polyhedron.clear();
progDestrPolyh.StepProgress(); //Measuring stops}
template <class HDS> void BuildTerrainPolyhedron<HDS>::operator()(HDS& hds)
{
size_t facetsSize = triangleIndexs->size() / 3;
progBuildPolyh->Initiate(vertices->size() + facetsSize + 1);
//Measuring
begins (the Object progBuildPolyh uses QueryPerformanceCounter from
Windows-API)
CGAL::Polyhedron_incremental_builder_3<HDS> builder(hds, false);
builder.begin_surface(vertices->size(), facetsSize, facetsSize * 3);
for(size_t i = 0; i < vertices->size(); ++i)
{
builder.add_vertex(Point3(vertices->at(i).x,
vertices->at(i).y,
vertices->at(i).z));
progBuildPolyh->StepProgress();
}
size_t vertexIndex = 0;
for(size_t i = 0; i < facetsSize; ++i)
{
builder.begin_facet();
builder.add_vertex_to_facet(triangleIndexs->at(vertexIndex));
++vertexIndex;
builder.add_vertex_to_facet(triangleIndexs->at(vertexIndex));
++vertexIndex;
builder.add_vertex_to_facet(triangleIndexs->at(vertexIndex));
++vertexIndex;
builder.end_facet();
progBuildPolyh->StepProgress();
}
builder.end_surface();
progBuildPolyh->StepProgress(); //Measuring stops
}
}
http://cgal-discuss.949826.n4.nabble.com/file/n3253686/screen_terrain_gen_0.jpg
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Slow-Polyhedron-Clear-Time-and-Problems-with-Kernels-tp3246996p3253686.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Re: Slow Polyhedron Clear Time and Problems with Kernels, titan99, 02/02/2011
- [cgal-discuss] Re: Slow Polyhedron Clear Time and Problems with Kernels, titan99, 02/02/2011
- Re: [cgal-discuss] Re: Slow Polyhedron Clear Time and Problems with Kernels, Sebastien Loriot (GeometryFactory), 02/02/2011
- [cgal-discuss] Re: Slow Polyhedron Clear Time and Problems with Kernels, titan99, 02/03/2011
Archive powered by MHonArc 2.6.16.