Arrangement observer and notification order

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Arrangement observer and notification order

chgans
When inserting a (isolated) segment:
- Before create vertex
- After create vertex
- Before create vertex
- After create vertex
- Before create Edge
- After create edge

When removing a (isolated) segment:
- Before remove edge
- Before remove vertex
- After remove vertex
- Before remove vertex
- After remove vertex
- After remove edge


As you can see inserting and removing edges lead to a non symetrical
notification ordering, which I think is a bug.

I think that the notification ordering when inserting the edge is
correct, you start by inserting the first vertex, then the second, and
finally you *can* insert the edge since the 2 vertices are "fully"
inserted.
And so, the notification ordering when removing an edge is bogus, the
notifications should be: remove the edge, then remove a vertex (since
it is not used by any edge), then remove the other vertex.

I'm using the observer to maintain a (Qt) tree model of edges,
vertices and faces.
With Qt model/view, you *cannot* say:
- i'm about to remove something somewhere
- i'm about to remove something else somewhere else
- i'm have removed something somewhere
- i'm have removed something else somewhere else

Actually the above could work if 'something else' was a child of
'something', which is not my case, since my root items have 2
children:
- an Edge list node, whith Edge children
- a Vertex list node, with vertex children

Now, you might say that it is not because the CGAL ArrangementObserver
doesn't behave in a friendly way for my use-case (QAbstractItemModel),
that it is broken.
True. Nonetheless, I tend to consider non-symetrical behaviour as
design errors. In SW design, it usually doesn't make sense to
construct something following an order and dis-construct it using a
completely different order.

What do you guys think?

Chris

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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Arrangement observer and notification order

Efi Fogel
I think that you are correct on both counts.
It should be symmetric and I'd pick the first order.
We will fix it.

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/



On 2 March 2017 at 06:56, Ch'Gans <[hidden email]> wrote:
When inserting a (isolated) segment:
- Before create vertex
- After create vertex
- Before create vertex
- After create vertex
- Before create Edge
- After create edge

When removing a (isolated) segment:
- Before remove edge
- Before remove vertex
- After remove vertex
- Before remove vertex
- After remove vertex
- After remove edge


As you can see inserting and removing edges lead to a non symetrical
notification ordering, which I think is a bug.

I think that the notification ordering when inserting the edge is
correct, you start by inserting the first vertex, then the second, and
finally you *can* insert the edge since the 2 vertices are "fully"
inserted.
And so, the notification ordering when removing an edge is bogus, the
notifications should be: remove the edge, then remove a vertex (since
it is not used by any edge), then remove the other vertex.

I'm using the observer to maintain a (Qt) tree model of edges,
vertices and faces.
With Qt model/view, you *cannot* say:
- i'm about to remove something somewhere
- i'm about to remove something else somewhere else
- i'm have removed something somewhere
- i'm have removed something else somewhere else

Actually the above could work if 'something else' was a child of
'something', which is not my case, since my root items have 2
children:
- an Edge list node, whith Edge children
- a Vertex list node, with vertex children

Now, you might say that it is not because the CGAL ArrangementObserver
doesn't behave in a friendly way for my use-case (QAbstractItemModel),
that it is broken.
True. Nonetheless, I tend to consider non-symetrical behaviour as
design errors. In SW design, it usually doesn't make sense to
construct something following an order and dis-construct it using a
completely different order.

What do you guys think?

Chris

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



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Arrangement observer and notification order

chgans
On 5 March 2017 at 00:02, Efi Fogel <[hidden email]> wrote:
> I think that you are correct on both counts.
> It should be symmetric and I'd pick the first order.
> We will fix it.

Should I create a bug report for this?

>
>    ____  _        ____             _
>   /_____/_) o    /__________  __  //
>  (____ (   (    (    (_/ (_/-(-'_(/
>                          _/
>
>
>
> On 2 March 2017 at 06:56, Ch'Gans <[hidden email]> wrote:
>>
>> When inserting a (isolated) segment:
>> - Before create vertex
>> - After create vertex
>> - Before create vertex
>> - After create vertex
>> - Before create Edge
>> - After create edge
>>
>> When removing a (isolated) segment:
>> - Before remove edge
>> - Before remove vertex
>> - After remove vertex
>> - Before remove vertex
>> - After remove vertex
>> - After remove edge
>>
>>
>> As you can see inserting and removing edges lead to a non symetrical
>> notification ordering, which I think is a bug.
>>
>> I think that the notification ordering when inserting the edge is
>> correct, you start by inserting the first vertex, then the second, and
>> finally you *can* insert the edge since the 2 vertices are "fully"
>> inserted.
>> And so, the notification ordering when removing an edge is bogus, the
>> notifications should be: remove the edge, then remove a vertex (since
>> it is not used by any edge), then remove the other vertex.
>>
>> I'm using the observer to maintain a (Qt) tree model of edges,
>> vertices and faces.
>> With Qt model/view, you *cannot* say:
>> - i'm about to remove something somewhere
>> - i'm about to remove something else somewhere else
>> - i'm have removed something somewhere
>> - i'm have removed something else somewhere else
>>
>> Actually the above could work if 'something else' was a child of
>> 'something', which is not my case, since my root items have 2
>> children:
>> - an Edge list node, whith Edge children
>> - a Vertex list node, with vertex children
>>
>> Now, you might say that it is not because the CGAL ArrangementObserver
>> doesn't behave in a friendly way for my use-case (QAbstractItemModel),
>> that it is broken.
>> True. Nonetheless, I tend to consider non-symetrical behaviour as
>> design errors. In SW design, it usually doesn't make sense to
>> construct something following an order and dis-construct it using a
>> completely different order.
>>
>> What do you guys think?
>>
>> Chris
>>
>> --
>> You are currently subscribed to cgal-discuss.
>> To unsubscribe or access the archives, go to
>> https://sympa.inria.fr/sympa/info/cgal-discuss
>>
>>
>

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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Arrangement observer and notification order

Efi Fogel
Sure, go ahead.

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/



On 6 March 2017 at 00:37, Ch'Gans <[hidden email]> wrote:
On 5 March 2017 at 00:02, Efi Fogel <[hidden email]> wrote:
> I think that you are correct on both counts.
> It should be symmetric and I'd pick the first order.
> We will fix it.

Should I create a bug report for this?

>
>    ____  _        ____             _
>   /_____/_) o    /__________  __  //
>  (____ (   (    (    (_/ (_/-(-'_(/
>                          _/
>
>
>
> On 2 March 2017 at 06:56, Ch'Gans <[hidden email]> wrote:
>>
>> When inserting a (isolated) segment:
>> - Before create vertex
>> - After create vertex
>> - Before create vertex
>> - After create vertex
>> - Before create Edge
>> - After create edge
>>
>> When removing a (isolated) segment:
>> - Before remove edge
>> - Before remove vertex
>> - After remove vertex
>> - Before remove vertex
>> - After remove vertex
>> - After remove edge
>>
>>
>> As you can see inserting and removing edges lead to a non symetrical
>> notification ordering, which I think is a bug.
>>
>> I think that the notification ordering when inserting the edge is
>> correct, you start by inserting the first vertex, then the second, and
>> finally you *can* insert the edge since the 2 vertices are "fully"
>> inserted.
>> And so, the notification ordering when removing an edge is bogus, the
>> notifications should be: remove the edge, then remove a vertex (since
>> it is not used by any edge), then remove the other vertex.
>>
>> I'm using the observer to maintain a (Qt) tree model of edges,
>> vertices and faces.
>> With Qt model/view, you *cannot* say:
>> - i'm about to remove something somewhere
>> - i'm about to remove something else somewhere else
>> - i'm have removed something somewhere
>> - i'm have removed something else somewhere else
>>
>> Actually the above could work if 'something else' was a child of
>> 'something', which is not my case, since my root items have 2
>> children:
>> - an Edge list node, whith Edge children
>> - a Vertex list node, with vertex children
>>
>> Now, you might say that it is not because the CGAL ArrangementObserver
>> doesn't behave in a friendly way for my use-case (QAbstractItemModel),
>> that it is broken.
>> True. Nonetheless, I tend to consider non-symetrical behaviour as
>> design errors. In SW design, it usually doesn't make sense to
>> construct something following an order and dis-construct it using a
>> completely different order.
>>
>> What do you guys think?
>>
>> Chris
>>
>> --
>> You are currently subscribed to cgal-discuss.
>> To unsubscribe or access the archives, go to
>> https://sympa.inria.fr/sympa/info/cgal-discuss
>>
>>
>

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



Loading...