Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] bbox_3 initialization in linear_cell_complex_3_demo


Chronological Thread 
  • From: Guillaume Damiand <>
  • To:
  • Subject: Re: [cgal-discuss] bbox_3 initialization in linear_cell_complex_3_demo
  • Date: Tue, 11 Jun 2013 07:54:49 +0200

Hi,

Thank you for the report. This will be corrected in future release.
Guillaume


On 11/06/2013 05:57, changwon lee wrote:
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


-- 
===================================================================
Guillaume DAMIAND

CNRS, LIRIS  UMR 5205
Université Claude Bernard
Bâtiment Nautibus (710)
43 Boulevard du 11 Novembre 1918
69622 Villeurbanne Cedex (France)
-------------------------------------------------------------------
Phone: +33 (0)4.72.43.26.62               Fax: +33 (0)4.72.43.15.36
Mail: 
===================================================================




Archive powered by MHonArc 2.6.18.

Top of Page