Custom ConfigOption

classic Classic list List threaded Threaded
3 messages Options
JD JD
Reply | Threaded
Open this post in threaded view
|

Custom ConfigOption

I am doing my own ConfigOption this way

    class CircleOptions : public ConfigOptions // NO EXPORT; header only
    {
    public:
        META_ConfigOptions(osgearth_feature_ogr, CircleOptions, ConfigOptions);

        // I do the accessors and getConfig and mergeConfig
     }

It builds.
But when i use it inside another ConfigOptions in the methods ConfigOptions::getConfig or ConfigOptions::fromConfig i have this error:

C:\Projects\git\osgearth-mpdev\src\osgEarth\StringUtils:155: error: C2679: binary '>>': no operator found which takes a right-hand operand of type 'T' (or there is no acceptable conversion)
        with
        [
            T=osgEarth::Drivers::CircleOptions
        ]

What am i missing ? thank you

I provide the full code attached to this post.
The inner class CircleOptions is the new class i am trying to define/use.

OGRFeatureOptions.OGRFeatureOptions

The line:
    conf.get( "geometry_circle", _geometryCircle );
is doing the compilation error.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Custom ConfigOption

Just a guess but you probably need to uncomment this

OSGEARTH_SPECIALIZE_CONFIG(osgEarth::Drivers::CircleOptions);

Glenn Waldron / Pelican Mapping
JD JD
Reply | Threaded
Open this post in threaded view
|

Re: Custom ConfigOption

I tried without success.
However i finally made it work by using :

            if ( conf.hasChild("circle") )
                geometryCircle() = CircleOptions(conf.child("circle"));

instead of simply:

            conf.get( "circle", _geometryCircle );

I don't know why but that does the job.
Thank you.