On Thu, Mar 12, 2009 at 9:40 AM, Carsten Neumann
<[email protected]> wrote:
>        Hello Allen,
>
> Allen Bierbaum wrote:
>> I am just starting to use the new trunk code for OpenSG.  It looks
>> like a lot has changed and there are now a *lot* more pointer types
>> (5??).  I am trying to figure out what I should be using and running
>> into some issues.
>>
>>> >From the documentation here:
>> http://opensg.vrsource.org/trac/wiki/Tutorial/OpenSG2/Basics
>>
>> It sounds like RecPtr holds a referenced counted pointer, but that it
>> only works in a single aspect and that to use a pointer that can be
>> used in multiple aspects you would have to use MTRecPtr.  Is that
>> correct?
>
> yes, except for MTRecPtr none of the pointer types work across multiple
> aspects.

This may be a dumb question, but how does RecPtr work at all then?
How does it detect the correct aspect to allocate the object in and
the correct aspect to look up the data (FC fields) from if it doesn't
know about the aspect?

More specifically, let's assume that I did use a RecPtr in DB below to
create an object:

- How does OpenSG know to create it in the DB aspect (ie. add to that
change list and put copy in that aspect)?

- When Main sync's the changes from the DB changelist, how would I get
access to the node from main? (do I have to traverse the scene graph
to find it somehow and if so, how does RecPtr know to look only in
that aspect)


>> For example if I had code with the following threads:
>>
>> - Main: Traversal, rendering
>> - DB: Load items in the background, sync into main thread periodically
>> - Work: Background thread to do work on nodes that came from the main thread
>>
>> Then would I need to use MTRecPtr?
>
> only if you pass around pointers across aspects. I can see that is quite
> likely the case between Main and Work, e.g. if Work has a queue in which
> you put (from Main) pointers to nodes that need to be processed, that
> should be a queue of NodeMTRecPtr.
> And for Main and DB: if you pass a pointer from Main to DB to indicate
> where to add loaded stuff that should be a MTRecPtr. For most (all?)
> other pointers I don't see where they cross an aspect boundary so you do
> not need the MTRecPtr, just RecPtr is fine.

So, if I take a node in Main and subChild a subtree, all of the nodes
under that node will be removed correctly even though the RecPtrs
creating them were created in another aspect, correct?  (I think it
should, just very confused about these pointer types and their
interaction with threads and aspects)

>> By the same token, what ptr corresponds to the old RefPtr?  (it looks
>> like it would be MTRecPtr)
>
> yes.

Why the need for the RecPtr type at all then?  Seems like raw pointers
get all the performance improvements needed for the core.  Maybe I am
missing something big here.

>> Also, are the old XxxxNodePtr's still around and which type of ptr
>> (MTRecPtr/RecPtr) do they use to hold their data? (ie. are they thread
>> safe).
>
> there are XxxxNodeRefPtr and XxxxNodeMTRefPtr.
> Hm, maybe these should be called Rec instead?

Or atleast aliased maybe.

Thanks.  Sorry for all the questions, just very confused.


-Allen
>
>
>        Cheers,
>                Carsten
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to