Hi Jaideep,

Jaideep Khadilkar wrote:
> HI....
> 
> Stuck in a problem...
> 
> Suppose I have a transform node 'Xform'. I can get its transformations 
> using----
> m = Xform->getMatrix();
> m.getTransform(tR, rR, sR, rsR);
> then I can get tx,ty,tz,rx,ry,rz,sx,sy,sz
> But I want these values to put into an attribute editor in my GUI.
> Also, I have to put callbacks so that when values in my GUI change,
> it will be reflected in my Xform node.
> 
> Now in my Callback function I want to avoid------
> 
> if(label == tx )
> {
>     set tR using new value.
> }
> if(label == rx )
> {
>     set rR using new value.
> }
> .
> .
> .
> .
> .
> set M using new tR,rR,sR
> and Xform->setMatrix(M);
> and so on........
> 
> Instead what I want to do is when setting the callbacks, I want to
> connect my value in the field directly to the Xform node attribute
> value it is referring to.
> 
> Can I get the direct pointers to these Xform attribute values?????

Sorry, but no. You can't get direct access to the internal OpenSG 
variables, as OpenSG needs to know when you change them (for many 
reasons), so manipulation via pointer is not an option.

If you want to keep things simple and avoid the if(...) mess I would use 
shadow variables in your own classes for the parameters you want to set 
that are manipulated by the GUI. Then you nly need to call an update 
method that takes all of them and puts them into the camera transform 
and you're set.

Hope it helps

        Dirk

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to