When using LineString to draw lines, when Geometry is a lot of points, it changes very slowly and very slowly

classic Classic list List threaded Threaded
3 messages Options
OsgEarth_luo OsgEarth_luo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

When using LineString to draw lines, when Geometry is a lot of points, it changes very slowly and very slowly

When I using osgEarth::Symbology::LineString to draw lines, when Geometry push a lot of points, it changes very  very slowly, why?

// create lineString

osg::ref_ptr<osgEarth::Annotation::FeatureNode> pathNode = 0;
osg::ref_ptr<osgEarth::Symbology::Geometry> path = new LineString();
osg::ref_ptr<osgEarth::Features::Feature> pathFeature = new Feature(path, m_pSrclatLong);
pathFeature->geoInterp() = GEOINTERP_RHUMB_LINE;
pathNode = new FeatureNode(_pMapNode, pathFeature, pathStyle);

//push_back  
osg::ref_ptr<osgEarth::Symbology::Geometry> _trail = featureNode->getFeature()->getGeometry();
_trail->push_back(_longitude, _latitude, _altitude);
featureNode->init();    //A lot of points are added here

help!
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When using LineString to draw lines, when Geometry is a lot of points, it changes very slowly and very slowly

Luo,

The FeatureNode is a general-purpose utility and is not very efficient for dynamic data. Calling init() rebuilds the entire node on every call.

For a dynamic trail, you are probably better off building a specialized implementation.
Glenn Waldron / Pelican Mapping
OsgEarth_luo OsgEarth_luo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When using LineString to draw lines, when Geometry is a lot of points, it changes very slowly and very slowly

thanks a lot  
Loading...