Hi Jörg,

On Mon, 2004-10-11 at 03:27, Jörg Bornemann wrote:
> Hi *,
> 
> thanks for your fast responses!
> And here is my next question. :-)
> 
> How do I define a SField that contains a pointer to a non-OpenSG class?
> I tried the following.
> 
> osg::SField<CMyClass*>
> 
> but that results in several compiler errors.
> I also tried 
> osg::SField<CMyClass*, 1> and 
> osg::SField<CMyClass*, 2> but that wasn't successful.
> 
> Do I have to mess around with the type traits?

Yup, indeed.

Types that are to be stored in Fields need to have corresponding
TypeTraits, and the implementation of those methods. The main reason is
support for converting from/to binary and strings, for clustering and
file IO. You can take a look at
Examples/NewTypes/OSGNewFieldType.{h,cpp} if you only need that type in
an application, or OSGNewFieldTypeLib.{h,cpp} if you need it in a dll.

If you only need that data in an application running on a single
machine, you could just use a void pointer (VoidP) Field and store your
pointer in there.

Hope it helps

        Dirk




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to