comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: /ALIAS and drawing in different draw_widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: /ALIAS and drawing in different draw_widgets [message #31683] Mon, 05 August 2002 15:37 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"lyubo" <lzagorch@cs.wright.edu> wrote

> What exactly happens when you add an alias of an object to a
> model? Isn't it just a copy of the same object?

It isn't a copy, but as the keyword would suggest an alias. The aliased
object's reference is added to the model container but its parent property
is unchanged. Aliasing an object allows you to branch your object tree so
that it can be rooted in multiple views (IDL does let you branch using
/alias and then join the parent model and alias model togther in a third
model but the result doesn't compute with me right now.)

Since the parent property of your atom is unchanged, the aliased object
isn't a child of the model in which it is contained. Because of this,
aliased objects are not destroyed when the model object is destroyed. In
your example, destroying M2-M4 will *not* destroy your objects A,B, and C.
Only destroying M1, the parent of the objects A,B, and C, will A,B, and C be
destroyed (unless you destroy them explicitly). David was rambling on about
his reference counting, blah blah blah, tennis and who knows what else but
the point is that IDL isn't as smart as his aliasing system. There are no
foster parents.


> If it isn't which one gets updated first - the alias or the object?

Since the alias is the object, the object (and only the object) is updated.


> I have the following situation:
> Model M1 contains objects A,B, and C
> Model M2 contains an alias of A
> Model M3 contains an alias of B
> Model M4 contains an alias of C
> The models are added to different views and the views are drawn in
> different draw widgets.
>
> The problem comes when I update the objects (A,B, and C) and try
> to redraw the views. It looks like I can't redraw M1,M2,M3,and M4
> correctly in that sequence. Redrawing only M1 works fine, redrawing
> M2,M3, and M4 (without M1) also works, but if I try to redisplay M1,
> M2,M3,and M4, M1 has only Cs.
>
> Furthermore, there is a memory leakage when I redraw M1. I guess
> that it has something to do with the aliases, but I have no idea what
> could be causing that.

Your design seems sound, but I am a little suspicious of your implementation
(which I understand is a little much to post here). I just re-created the
same hierarchy as described above using orb objects and xobjview and
everything worked as expected. No memory leaks. No problems changing
properties and viewing the objects regardless of the order in which they
were drawn.

I see that you found a work around. My guess is that you fixed the bug when
you reworked your code.


-Rick
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: converting Png files to Double
Next Topic: ARROW in 3d?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 15:19:10 PDT 2025

Total time taken to generate the page: 1.28073 seconds