[IGSTK-Developers] IGSTK: STL Containers and Scene Graphs

Patrick Cheng cheng at isis.georgetown.edu
Wed Apr 7 19:00:15 EDT 2010


Hi Jimmy,

Thank you for the test code and detailed explanation. I found the bug 
and a potential design flaw in the igstkSceneGraph class.

In IGSTK, we use observers to listen to all the Attach/Detach events. 
The SceneGraph tree is constructed when those methods are being called.

Bug: The problem is that in current implementation, SceneGraph is not 
aware of object destruction. After we destroy an object, SceneGraphNode 
still keeps pointer references to the object's name and type, which are 
invalid at this time.

Design flaw: in IGSTK SceneGraph, there is no explicit root note, so 
even when you detached an object, it will still be kept in an internal 
list. And it will be displayed as a 'floating' orphan nodes. It will be 
better to monitor the destruction and delete those nodes from scene graph.

Fix: I made some temp modification here to create new pointers to those 
variables. It should fix the crash problem of your test code. Please use 
the attached file replace the one in:
IGSTK/Ultilities/SceneGraphVisualization

Give it a try and let me know how it goes, mean time, I will investigate 
if there is way to remove destroyed objects from scene graph. Let me 
know if you have any comments and suggestions.

Patrick





On 4/5/2010 6:44 PM, Qiu, Jimmy wrote:
> Hi Patrick,
>
> I am working with Mike Daly at Princess Margaret Hospital and we have
> been working on updating our surgical tracking and navigation
> application to the latest IGSTK.
>
> We are running into some issues between stl containers which hold our
> landmark spatial objects/representations and scene graphs. We would like
> to be able to modify the containers to reflect changes to the landmark
> points (adding/removing/clearing).
>
> I have attached a snippet of code which goes through some of the changes
> we would possibly make to the containers during the use of our
> application. It seems like there is a problem in the description in the
> scene graph during some of the changes causing the export of the .dot
> file to crash at run time (specifically
> 'scene->ExportSceneGraphToDot("5.dot");' ).
>
> If 'scene->ExportSceneGraphToDot("5.dot");' is commented out then the
> following 'ellipsoids.back()->RequestSetTransformAndParent( identity,
> worldReference );' results in an access violation error.
>
> Is there a proper way/sequence of adding and removing objects from a stl
> container to the scene graph that we missed here?
>
> I have also attached pngs from the exported dot files that were
> successfully generated (‘1.png’ corresponds to ‘1.dot’).
>
> Thanks!
>
> Jimmy
>
> This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient.
> Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited.
> If you have received this e-mail in error, please contact the sender and delete all copies.
> Opinions, conclusions or other information contained in this e-mail may not be that of the organization.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: igstkSceneGraph.cxx
Type: text/x-c++src
Size: 18487 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/igstk-developers/attachments/20100407/e1fc409b/attachment-0002.cxx>


More information about the IGSTK-Developers mailing list