Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] bbox_3 initialization in linear_cell_complex_3_demo

Subject: CGAL users discussion list

List archive

[cgal-discuss] bbox_3 initialization in linear_cell_complex_3_demo


Chronological Thread 
  • From: changwon lee <>
  • To:
  • Subject: [cgal-discuss] bbox_3 initialization in linear_cell_complex_3_demo
  • Date: Tue, 11 Jun 2013 12:57:19 +0900

Hello

when I run linear cell complex demo (CGAL 4.2 and visual studio 2010), I couldn't see anything.
if CGAL_Bbox_3 uses std::array,
Bbox_3 bb;
is not initialized zero sized. (I don't know if I use boost::array or other compiler result is different)
we have to initialize explicitly.

CGAL::Bbox_3 Viewer::bbox()
{
  CGAL::Bbox_3 bb(0,0,0,0,0,0);

  bool empty = true;
  for (LCC::Attribute_range<3>::type::iterator
       it=scene->lcc->attributes<3>().begin(),
       itend=scene->lcc->attributes<3>().end(); it!=itend; ++it )
  {
    if ( it->info().is_visible() )
    {
      empty = false;
      for( LCC::Dart_of_cell_range<3>::iterator
           it2=scene->lcc->darts_of_cell<3>(it->dart()).begin();
           it2.cont(); ++it2)
        bb = bb + LCC::point(it2).bbox();
    }
  }

  if ( empty )
  {
    bb = LCC::Point(CGAL::ORIGIN).bbox();
    bb = bb + LCC::Point(1,1,1).bbox(); // To avoid a warning from Qglviewer
  }
 
  return bb;
}

I hope this is helpful to some.

regards



Archive powered by MHonArc 2.6.18.

Top of Page