Hi Daniele,
have you looked at the Examples/NewTypes stuff for comparison?
On Thu, 2005-10-13 at 17:39 +0200, Daniele Pagliani wrote:
> Hi Dirk,
> I have derived ShadowMapViewport in order to add a public method to access
> _shadowImages vector. It is the first time I try to derive an opensg class,
> so I made some error maybe [ops: sure]. I used following procedure that I
> show you step by step in hope you can diagnose my errors! :(
>
> 1. I loaded with fcdedit OSGShadowMapViewport.fcd (the parent class) and I
> saved fcd file in a new dir (dShadowMapViewport). I didn't understand how
> "Load parent" works :'(
That doesn't really do anything. The important question here is whether
you expect your type to be part of the OpenSG library or just in your
application. Depending on that you need to set the "System Component?"
field. I assume you want to try it in your app first, so disable that
field. Unless you need it to go into a separate dll in your system and
not straight into the app, I recommend setting "Library" to empty, that
will trigger a simpler code that needs less build system support.
> 2. I have written "field container" and "field container base" codes (via
> fcdedit);
OK.
> 3. I copied all files into my project tree, made some correction to errors
> produced by fcdedit (strange iclusions);
What were those? Having problems here hints at some serious problems.
> 4. introduced the public method into dShadowMapViewport.h file:
> std::vector<ImagePtr> getShadowImages(void) { return
> (dShadowMapViewport::_shadowImages); }
OK.
> 5. after that I tryed to compile and I received errors like
> "_desc : definition of dllimport static not available". I preface I don't
> know how dllimport/export works under Windows, but I supposed that
> OSG_SYSTEMLIB_DLLMAPPING definition wasn't right for my case (I compile new
> class inside my project and I don't want a library, I looked in netypes
> example also) and so I decided to remove that label from my class
> definition;
OK, that's what an empty Library does autoamtically.
> 6 after that I can compile but my application crashed;
>
> first of all i have the following error lauching the application:
> WARNING: ERROR: Double field description in dShadowMapViewport from offBias
> (id: 83)
If you derive from ShadowViewport you should remove all the variables
that are already in ShadowViewport, just like in C++.
> ...
>
> And when I call getShadowImages the application crashes:
>
> dShadowMapViewportPtr dsvp =
> dShadowMapViewportPtr::dcast(svp);
> dsvp->getShadowImages();
>
>
> Can you give me any suggestion ?
Did the dcast work? You should compare the result of a dcast to NullFC,
to make sure that it actually worked, before using it.
Hope it helps
Dirk
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users