Thanks. Seems obvious now. I think a C++ 101 course would do me the world of 
good :  )
It shows the only C++ I have ever done is OSG hacking.

ps- I am not used to such quick resposes. Geat having someone in the same time 
zone for a change!

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Wang Rui
Sent: Thursday, 16 December 2010 2:12 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Limitation in current ImageLayer serializer

Hi Brad,

In your compile error reports:

cannot convert parameter 3 from 'bool (__cdecl *)(osgDB::InputStream
&,const osgTerrain::ImageLayer &)

Shouldn't it be:

bool readFunction(osgDB::InputStream&, osgTerrain::ImageLayer&)

'const' may not be used here. :-)

Wang Rui


2010/12/16 Christiansen, Brad <[email protected]>:
> Hi Rui,
>
> I have finally found some time to have a look at this issue, and would love 
> to get a fix implemented before 3.0, but I am not having much luck.
> I have previously managed to add a user serializer to VirtualPlanetBuilder 
> without issue to add support for some extra options, but am getting nowhere 
> with the ImageLyer serializer.
>
> I changed the code exactly as you suggested and have added the required check 
> / read and write functions. I am pretty sure I can implement these ok but I 
> cant get things compiling with simple stub implementations that simply return 
> true.
>
> The compile error I am getting is:
>
> 2>  ImageLayer.cpp
> 2>..\..\..\..\..\..\..\Source\src-osg\src\osgWrappers\serializers\osgTerrain\ImageLayer.cpp(52):
>  error C2664: 'osgDB::UserSerializer<C>::UserSerializer(const char *,bool 
> (__cdecl *)(const C &),bool (__cdecl *)(osgDB::InputStream &,C &),bool 
> (__cdecl *)(osgDB::OutputStream &,const C &))' : cannot convert parameter 3 
> from 'bool (__cdecl *)(osgDB::InputStream &,const osgTerrain::ImageLayer &)' 
> to 'bool (__cdecl *)(osgDB::InputStream &,C &)'
> 2>          with
> 2>          [
> 2>              C=MyClass
> 2>          ]
> 2>          This conversion requires a reinterpret_cast, a C-style cast or 
> function-style cast
>
> After examing the the VirtualPlanetBuilder code I modified for an earlier 
> submission, I think I need to register a lookup (or something like that) to 
> solve the issue but my C++ skills just arnt up to the job of figuring out 
> exactly what it is I need to do. Any suggestions or simple examples I could 
> look at would be greatly appreciated.
>
> Cheers,
> Brad
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



DISCLAIMER:---------------------------------------------------------------------------
This e-mail transmission and any documents, files and previous e-mail messages
attached to it are private and confidential. They may contain proprietary or 
copyright
material or information that is subject to legal professional privilege. They 
are for
the use of the intended recipient only.  Any unauthorised viewing, use, 
disclosure,
copying, alteration, storage or distribution of, or reliance on, this message is
strictly prohibited. No part may be reproduced, adapted or transmitted without 
the
written permission of the owner. If you have received this transmission in 
error, or
are not an authorised recipient, please immediately notify the sender by return 
email,
delete this message and all copies from your e-mail system, and destroy any 
printed
copies. Receipt by anyone other than the intended recipient should not be 
deemed a
waiver of any privilege or protection. Thales Australia does not warrant or 
represent
that this e-mail or any documents, files and previous e-mail messages attached 
are
error or virus free.
--------------------------------------------------------------------------------------

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to