Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] How to know the value of alpha while running 3-D alpha shape demo

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] How to know the value of alpha while running 3-D alpha shape demo


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] How to know the value of alpha while running 3-D alpha shape demo
  • Date: Fri, 26 Aug 2016 09:36:46 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:u7oCNhy2wy5VUdnXCy+O+j09IxM/srCxBDY+r6Qd0eISIJqq85mqBkHD//Il1AaPBtSCrakVwLOM4+igATVGusfZ9ihaMdRlbFwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfTR8Kum9IIPOlcP/j7n0oMyKJV4Zz2PnMfsydEzw9lSJ8JFOwMNLEeUY8lPxuHxGeuBblytDBGm4uFLC3Pq254Np6C9KuvgspIZqWKT+eLkkH/QDVGx1ezN92Mq+vhbKSU6D52AXT34NuhtOGQnMqh/gDbnrtS6v/NFw0iCBIcz7S/gQXi6j6LsjCDDljyIKKyQo3mjclstqneMR6Ea6oxtlwonIJoSRHPV7d6LZO9gdQDwSDY5qSyVdD9bkPMM0BO0bMLMAog==
  • Organization: GeometryFactory

On 08/26/2016 05:32 AM, zys wrote:
<http://cgal-discuss.949826.n4.nabble.com/file/n4662163/snapshot_of_CGAL.jpg>

The 3-D alpha shape demo shows alpha as percentage. What is the exact value
of alpha?

The code used in the demo (demo/Alpha_shape_3/MainWindow.cpp) is the
following:


void
MainWindow::alphaChanged(int i)
{
if (scene.alpha_shape.number_of_alphas() > 0){
if(i < 100){
int n = static_cast<int>((i * scene.alpha_shape.number_of_alphas())/ 100);
if(n == 0) n++;
scene.alpha_shape.set_alpha(scene.alpha_shape.get_nth_alpha(n));
} else {
Alpha_iterator alpha_end_it = scene.alpha_shape.alpha_end();
scene.alpha_shape.set_alpha((*(--alpha_end_it))+1);
}
} else {
scene.alpha_shape.set_alpha(0);
}
viewer->alphaChanged();
Q_EMIT(alphaChanged());
}

It is based on the nth-alpha's.
If you want to see the current alpha, you can for example put a cout
near the calls to set_alpha()


Sebastien.




--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/How-to-know-the-value-of-alpha-while-running-3-D-alpha-shape-demo-tp4662163.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.18.

Top of Page