how to check if a halfedge handle is valid?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to check if a halfedge handle is valid?

Shi Yan
hello guys,

i have a halfedge handle which i need to check its validity after a
set of operations, but i don't know how.

can i do something like if( h == NULL ) , where h is the halfedge handle?

thank you.
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Reply | Threaded
Open this post in threaded view
|

Re: how to check if a halfedge handle is valid?

Eric Berberich
Shi Yan wrote:
> hello guys,
>
> i have a halfedge handle which i need to check its validity after a
> set of operations, but i don't know how.
>
> can i do something like if( h == NULL ) , where h is the halfedge handle?
>
> thank you.

In Arrangements we have:

        Halfedge_handle invalid_he;

        if (h == invalid_he) {
          // ... my code
        }

eriC

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Reply | Threaded
Open this post in threaded view
|

Re: how to check if a halfedge handle is valid?

Shi Yan
no, this doesn't work.

say i have a halfedge handle h which points to a valid half-edge.

and then i want to do some operations on the geometry object, for
example join_vertex. these operations will eliminate some halfedges
and may be h is one of them.

so after these operations, can i check if h is still valid?

the way you suggested will not work, because initially the invalid_he
equals to 0x00000000,

however h is not 0x00000000, but some value that i assigned at the beginning.

even the halfedge pointed by h is not valid, h is not 0x00000000.

is there any way to solve this problem?

thank you.

On Wed, Aug 13, 2008 at 3:25 PM, Eric Berberich <[hidden email]> wrote:

> Shi Yan wrote:
>>
>> hello guys,
>>
>> i have a halfedge handle which i need to check its validity after a
>> set of operations, but i don't know how.
>>
>> can i do something like if( h == NULL ) , where h is the halfedge handle?
>>
>> thank you.
>
> In Arrangements we have:
>
>        Halfedge_handle invalid_he;
>
>        if (h == invalid_he) {
>          // ... my code
>        }
>
> eriC
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss