Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] const_handle to non_const_handle

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] const_handle to non_const_handle


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] const_handle to non_const_handle
  • Date: Mon, 21 Nov 2016 09:28:07 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:Dw0YNx35vjJK1s4wsmDT+DRfVm0co7zxezQtwd8ZsewULPad9pjvdHbS+e9qxAeQG96KsLQe0aGM7vCoGTRZp83e4DZaKN0EfiRGoPtVtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blItdaymUrPUlNm9guCu54WBJEJDizO5JL9zNx6rth6X55VH0dE8bKBtjB3AqHFMdqJdwmYvOV+WhxL1+sr32pdm9x9doewl+tIGU7niKKExRqZfWTEvOHoy09PquAbOV0WO6i4dVH4KmxxUNAjZ6RWzWJ77uC/3+7FU1SyTPMmwS7kxXXqo5rxmHRnhgi0DOng/+WTTzMp5ia9AuBuqqgc56YfPYYqzPf9zZbvUdt5fQ2NLVMJcETJAD5z6cIYFSfYMOP5cppXw4X0HpxG6CC+lAe700jZDizrw1Kcw1+lnDwDLw0o/EthIrHnRtNH8KKpUd+e5wY/ByDjYd/pd1Hn38oXBfhs7vPSGRud2dtbQx1gYDB7PlV6KqIboJSjc0O0HuWyWorFJWOemimphrQh0pn2uwNwwg4/VsY8Qw1HA7mx/yYw/IdD1E2d2ZNelFN1WviSecpB7RM8VQmdzpC881ooLvJe6eGEMwZ4twxOSMNWKdoGJ5lTlXeOVaX8wzDotMPrsuhCp7EL1yvHgTtLmlxFRvy9dm5/NsGoM3lrd8I+cW/5l9wCg3ziIkAvc4+UBLUEvnrfAMM0dxes7mZMX9EjCBSTrg17ejamMd0xi9PL7xf7gZ+DPoJOGOoZvwi/3OL4v0pi2B+giPwEVGWaS8/69/LLu+kj0XK9bgPQ9jq7DodbRIsFN9f3xOBNczot2s0X3NDyhytlNxXQ=
  • Organization: GeometryFactory


Either use a face iterator, to traverse all faces
Or go to neighbor faces: For a face you can get the
halfedges on its border, for each halfedge you
can get the twin halfedge, and from there the face.
Note that you might get the same neighbor face
several times.

best,

andreas


On 21/11/2016 09:09, sg wrote:
Okk thanks. Its working now.
One more thing I get a face handle from this code. I add some data to
this face by set_data() method. Now i want to access next face from
current handle. How can I do that ?

On Mon, Nov 21, 2016 at 12:49 PM, andreas.fabri [via cgal-discuss]
<[hidden email] </user/SendEmail.jtp?type=node&node=4662377&i=0>> wrote:

Well, it is not a static function.

If your arrangement object is called arr
you have to write

arr.non_const_handle(*f);

best,

andreas

On 20/11/2016 22:11, sg wrote:

> I am implementing some code in CGAL. I made an arrangement. Now I want
to add
> some data to every face in arrangement. So i access a face by below
method.
> It return const handle. So i try to convert this to non_const_handle.
But it
> show error that " cannot call member function without object."
>
> const Face_const_handle* f;
> if(f = boost::get<Face_const_handle>(&(it->second))){
> Arrangement_2::Face_handle fh =
Arrangement_2::non_const_handle(*f);
> // ERROR HERE
> for(int i=1;i<convexPts.size();i++){
> CGAL::Gmpq temp =
> CGAL::squared_distance(convexPts[0],convexPts[i]);
> if(temp>max){
> max = temp;
> fh->set_data(max);
> }
> }
> }
>
>
>
>
>
> --
> View this message in context:
http://cgal-discuss.949826.n4.nabble.com/const-handle-to-non-const-handle-tp4662374.html

<http://cgal-discuss.949826.n4.nabble.com/const-handle-to-non-const-handle-tp4662374.html>
> Sent from the cgal-discuss mailing list archive at Nabble.com.
>
--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912 skype: andreas.fabri

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
<https://sympa.inria.fr/sympa/info/cgal-discuss>




------------------------------------------------------------------------
If you reply to this email, your message will be added to the
discussion below:

http://cgal-discuss.949826.n4.nabble.com/const-handle-to-non-const-handle-tp4662374p4662376.html

<http://cgal-discuss.949826.n4.nabble.com/const-handle-to-non-const-handle-tp4662374p4662376.html>

To unsubscribe from const_handle to non_const_handle, click here.
NAML

<http://cgal-discuss.949826.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




------------------------------------------------------------------------
View this message in context: Re: const_handle to non_const_handle
<http://cgal-discuss.949826.n4.nabble.com/const-handle-to-non-const-handle-tp4662374p4662377.html>
Sent from the cgal-discuss mailing list archive
<http://cgal-discuss.949826.n4.nabble.com/> at Nabble.com.

--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912 skype: andreas.fabri



Archive powered by MHonArc 2.6.18.

Top of Page