Hello Rainer,
Rainer Schuetze wrote:
> thanks for the advice.
> I've implemented my test class(e)s as you desribed below.
> But I've got two problems / questions.
> I honestly don't know what I have to do in part 3) (Isn't the code I
> created in step 1 & 2 just used by the classes in 3. and I don't have to
> manipulate the class of step 3?)
well, step 3 boils down to doing a
typedef GeoProperty<GeoPositionsMyPoint3iPropertyDesc>
GeoPositionsMyPoint3i;
> My classes for the GeoPositionsMyPoint3i wouldn't link with VS 2005.
> He couldn't find the function
> osg::GeoProperty::getClassType(void)
Do you define the static _desc member of
GeoPositionsMyPoint3iPropertyDesc somewhere ? Look at
OSGGeoPropPositions.cpp for how it is done for the built in types.
> Do I miss to use a special macro? When I implement this funtion in the
> cpp (with dummy values), it compiles & links, but crashes on ::create()
> (of course, he couldn't find the initMethod?!)
yes, the initMethod without defining the _desc member the initMethod
does not get registered with the FieldContainerFactory.
> In my code in comment the following macros out (otherwise it wouldn't
> compile):
> // In the .h
> #if !defined(OSG_COMPILEGEOPROPPOSITIONINST) && !defined(OSG_DO_DOC)
> OSG_FC_DLLEXPORT_DECL(GeoProperty,
> GeoPositionsMyPoint3iPropertyDesc,
> OSG_SYSTEMLIB_DLLTMPLMAPPING )
> #endif
>
> // in the cpp
> OSG_GEO_PROP_TYPE_TMPL_DEF(GeoProperty, GeoPropertyDesc, PtrType)
> OSG_BEGIN_NAMESPACE
> OSG_GEOPROP_DLLEXPORT_DEF (GeoProperty ,
> GeoPositionsMyPoint3iPropertyDesc,
> OSG_SYSTEMLIB_DLLTMPLMAPPING);
> OSG_END_NAMESPACE
hm, since you are not compiling this into the SystemLib it might be a
problem with the dllimport/dllexport declarations. What are the compile
errors ?
> I also can't direcly add my Class to the container:
> template<>
> inline
> void GeoProperty::addValue(const MyPoint3i &val)
> {
> _field.push_back(val);
> }
>
> The compiler just could find the function within the file
> osggeopropertybase.h :
> void osg::GeoProperty::addValue(const osg::PointInterface &)'
> with
> [
> GeoPropertyDesc=osg::GeoPositionsMyPoint3iPropertyDesc,
> ValueTypeT=osg::Real32,
> StorageInterfaceT=osg::VecStorage3
>
addValue uses StoredGenericType as argument, which in your case is
Pnt3f. To make this work, you need to have conversion operators between
your type and Pnt3f. That interface is not recommended for performance
critical stuff, for that you need the full type information of your
property (as opposed to using a base class and call the virtual methods
like addValue) and then use operator->() to get the internally stored
field on which you can do push_back directly.
Hope it helps,
Carsten
PS: It might be easier to put your new properties into the SystemLib to
start with, that might help with the dllexport macros.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users