Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Accessing information from Point set shape dectection

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Accessing information from Point set shape dectection


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Accessing information from Point set shape dectection
  • Date: Mon, 05 Sep 2016 15:33:19 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:/qtxDBCykSQBOiciVIoHUyQJP3N1i/DPJgcQr6AfoPdwSP3yrsbcNUDSrc9gkEXOFd2CrakV0qyL4+u9CCRAuc/H6y9SNsQUFlcssoY/oU8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUt2as8Pi3O+7/9jfYh5DmSGmSbJ0NhS/6wvL5ecMho43YJ08wBLSvnpFfaxywnlpIk7b3znx4cK94IRy3S1bp/U75o8KGfHhe6MiTLtESjEiG28w7czv8xLESF3ctTMnTmwKn08QUED+5xbgU8Kpvw==
  • Organization: GeometryFactory

Try something like:

typedef CGAL::Shape_detection_3::Sphere<Traits> Sphere_shape;
Sphere_shape sphere_shape = dynamic_cast<Sphere_shape*>(shape.get());

if(sphere_shape)
{
Traits::Point_3 center = sphere_shape->center();
Traits::FT radius = sphere_shape->radius();
}

Sebastien.

On 09/05/2016 02:45 PM, Kelvin_Piroddi wrote:
Thank you.

How can I create a dynamic_cast to check the ransac_factory for every
iteration of the iterator:

Efficient_ransac::Shape_range::iterator it = shapes.begin();
while (it != shapes.end()) {
boost::shared_ptr<Efficient_ransac::Shape> shape = *it;

I have only used a sphere in my factory:

typedef CGAL::Shape_detection_3::Sphere<Traits> Sphere;

and would like to access the radius for every detected sphere:

Sphere->radius()


Thank you






--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Accessing-information-from-Point-set-shape-dectection-tp4662202p4662209.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.18.

Top of Page