- Timestamp:
- Apr 19, 2016 9:05:15 AM (8 years ago)
- Location:
- geovis/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/Placard.cpp
r6254 r6273 14 14 #include <osgEarth/Registry> 15 15 #include <osgEarth/ShaderGenerator> 16 #ifdef NEW_ANNOTATION_API 17 #include <osgEarth/ScreenSpaceLayout> 18 #else 16 19 #include <osgEarth/Decluttering> 20 #endif 17 21 #include <osgEarthSymbology/PolygonSymbol> 18 22 #include <osgEarthSymbology/TextSymbol> … … 151 155 { 152 156 #ifdef NEW_ANNOTATION_API 153 osgEarth:: Decluttering::setEnabled(this->getOrCreateStateSet(), false);157 osgEarth::ScreenSpaceLayout::activate(this->getOrCreateStateSet()); 154 158 #endif 155 159 _backdropGeode = new osg::Geode(); … … 263 267 osgEarth::Registry::stateSetCache() ); 264 268 #ifdef NEW_ANNOTATION_API 265 updateLayoutData(); 269 // Set to max priority to draw on top in decluttering sort 270 setPriority(FLT_MAX); 271 // setPriority calls updateLayoutData 272 //updateLayoutData(); 266 273 #endif 267 274 } … … 281 288 return; 282 289 283 osg::ref_ptr<osgEarth::LayoutData> data = new osgEarth::LayoutData(); 284 data->_priority = getPriority(); 290 if (!_dataLayout.valid()) 291 { 292 _dataLayout = new osgEarth::ScreenSpaceLayoutData(); 293 } 294 295 // re-apply annotation drawable-level stuff as neccesary. 296 for (unsigned i = 0; i < _backdropGeode->getNumDrawables(); ++i) 297 { 298 _backdropGeode->getDrawable(i)->setUserData(_dataLayout.get()); 299 } 300 // re-apply annotation drawable-level stuff as neccesary. 301 for (unsigned i = 0; i < _geode->getNumDrawables(); ++i) 302 { 303 _geode->getDrawable(i)->setUserData(_dataLayout.get()); 304 } 305 306 _dataLayout->setPriority(getPriority()); 285 307 const osgEarth::Symbology::TextSymbol *ts = getStyle().get<osgEarth::Symbology::TextSymbol>(); 286 if (ts) data->_pixelOffset = ts->pixelOffset().get(); 287 288 // re-apply annotation drawable-level stuff as neccesary. 289 for (unsigned i = 0; i<_backdropGeode->getNumDrawables(); ++i) 290 { 291 _backdropGeode->getDrawable(i)->setUserData(data.get()); 292 } 293 // re-apply annotation drawable-level stuff as neccesary. 294 for (unsigned i = 0; i<_geode->getNumDrawables(); ++i) 295 { 296 _geode->getDrawable(i)->setUserData(data.get()); 308 if (ts) 309 { 310 _dataLayout->setPixelOffset(ts->pixelOffset().get()); 297 311 } 298 312 } -
geovis/trunk/Placard.h
r6254 r6273 195 195 osg::ref_ptr<osg::Geode> _geode; 196 196 osg::ref_ptr<osg::Geode> _backdropGeode; 197 #ifdef NEW_ANNOTATION_API 198 osg::ref_ptr<osgEarth::ScreenSpaceLayoutData> _dataLayout; 199 #endif 197 200 198 201 Placard _placardConf; -
geovis/trunk/Renderer.cpp
r6254 r6273 1732 1732 PlacardNode *label = 1733 1733 new PlacardNode(_mapNode.get(), location, placard, attrs); 1734 #ifndef NEW_ANNOTATION_API 1734 1735 label->getOrCreateStateSet()->setRenderBinDetails(INT_MAX, "RenderBin"); 1736 #endif 1735 1737 getAnnotations()->addChild(label); 1736 1738 }
Note: See TracChangeset
for help on using the changeset viewer.