[IGSTK-Developers] Coordinate System questions

Matt Turek matt.turek at kitware.com
Fri Oct 10 19:55:21 EDT 2008



I would add the lines to generate an event in 
CoordinateSystem::SetTransformAndParentProcessing(). You should be able 
to observe the CoordinateSystem directly.

Think of the CoordinateSystemDelegator as glue logic between standalone 
CoordinateSystems and objects that want to own and behave like a 
CoordinateSystem. More specifically, the CoordinateSystemDelegator has 
the state machine logic to deal with an object that is passed to the 
templated API. Otherwise, we would have had to add at least one new 
state machine input to every object that had a coordinate system. In the 
end, there ended up being a lot of duplication. Perhaps things would 
have been cleaner without the delegator.

I think the delegator is not observing itself, but instead is observing 
the coordinate system that it owns. The delegator does this so that it 
can retransmit the coordinate system events to objects that observe the 
delegator.

As for the macros, CoordinateSystemInterfaceMacros includes and uses a 
CoordinateSystemDelegator.

Matt


Kevin Gary wrote:
> Hi Matt,
>
> My student is working on the scene graph visualization tool. We are 
> trying to introduce a central "manager" singleton that is aware of 
> each time a child-parent relationship is constructed (or destructed) 
> in the graph, and trying to do so without having to change existing 
> IGSTK code. To us, the best way to do that is to observe a 
> CoordinateSystem for events indicating when 
> "RequestSetTransformAndParent" or "RequestDetachFromParent" have been 
> called.
>
> This would seem simple, but we have spent a while tracing through all 
> the various macros and the CoordinateSystemDelegator (why does this 
> exist?) and have a couple of questions -
>
> 1. Should we even try to observe a CoordinateSystem directly or its 
> Delegator?
> 2. Why doesn't the Delegator use 
> igstkCoordinateSystemClassInterfaceConstructorMacro() like the 4 
> object types that have Coordinate Systems?
> 3. It appears the Delegator observes itself? We admit some confusion 
> as to why there is the ObserverCallback with a self reference that 
> moves an event along.
>
> But basically, our main question is to whether to insert a line at the 
> end of CoordinateSystem::SetTransformAndParent to generate an event 
> (it doesn't now), or whether to add it to the delegator somewhere in 
> the midst of all the AddObserver stuff?
>
> Thanks,
> K2
>
>
>
>


-- 
Matt Turek, Ph.D.
R&D Engineer
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x142
email: Matt.Turek at kitware.com




More information about the IGSTK-Developers mailing list