Changeset 4305 for trunk/packages
- Timestamp:
- Mar 31, 2014 5:30:04 PM (10 years ago)
- Location:
- trunk/packages/vizservers/geovis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/geovis/Renderer.cpp
r4293 r4305 10 10 #include <cassert> 11 11 #include <cmath> 12 #include <cstdlib> 12 13 13 14 #include <GL/gl.h> … … 18 19 19 20 #include <osgGA/StateSetManipulator> 21 #include <osgGA/GUIEventAdapter> 20 22 21 23 #include <osgEarth/Version> … … 62 64 _minFrameTime = 1.0/30.0; 63 65 _lastFrameTime = _minFrameTime; 66 67 char *base = getenv("MAP_BASE_URI"); 68 if (base != NULL) { 69 _baseURI = base; 70 TRACE("Setting base URI: %s", _baseURI.c_str()); 71 } 64 72 65 73 #if 0 … … 85 93 _viewer->setSceneData(_sceneRoot.get()); 86 94 87 _manipulator = new osgEarth::Util::EarthManipulator; 88 _viewer->setCameraManipulator(_manipulator.get()); 95 initEarthManipulator(); 89 96 90 97 _coordsCallback = new MouseCoordsCallback(); … … 251 258 } 252 259 260 void Renderer::initEarthManipulator() 261 { 262 _manipulator = new osgEarth::Util::EarthManipulator; 263 osgEarth::Util::EarthManipulator::Settings *settings = _manipulator->getSettings(); 264 settings->bindMouse(osgEarth::Util::EarthManipulator::ACTION_ROTATE, 265 osgGA::GUIEventAdapter::MIDDLE_MOUSE_BUTTON, 266 osgGA::GUIEventAdapter::MODKEY_ALT); 267 osgEarth::Util::EarthManipulator::ActionOptions options; 268 options.clear(); 269 options.add(osgEarth::Util::EarthManipulator::OPTION_CONTINUOUS, true); 270 settings->bindMouse(osgEarth::Util::EarthManipulator::ACTION_ZOOM, 271 osgGA::GUIEventAdapter::RIGHT_MOUSE_BUTTON, 272 osgGA::GUIEventAdapter::MODKEY_ALT, options); 273 _manipulator->applySettings(settings); 274 _viewer->setCameraManipulator(_manipulator.get()); 275 _manipulator->setNode(NULL); 276 _manipulator->setNode(_sceneRoot.get()); 277 _manipulator->computeHomePosition(); 278 } 279 253 280 void Renderer::loadEarthFile(const char *path) 254 281 { … … 287 314 } 288 315 _viewer->setSceneData(_sceneRoot.get()); 289 _manipulator = new osgEarth::Util::EarthManipulator; 290 _viewer->setCameraManipulator(_manipulator.get()); 291 _manipulator->setNode(NULL); 292 _manipulator->setNode(_sceneRoot.get()); 293 _manipulator->computeHomePosition(); 316 initEarthManipulator(); 294 317 _viewer->home(); 295 318 finalizeViewer(); … … 332 355 initViewer(); 333 356 357 //mapOpts.referenceURI() = _baseURI; 334 358 osgEarth::Map *map = new osgEarth::Map(mapOpts); 335 359 _map = map; … … 384 408 } 385 409 _viewer->setSceneData(_sceneRoot.get()); 386 _manipulator = new osgEarth::Util::EarthManipulator; 387 _viewer->setCameraManipulator(_manipulator.get()); 388 _manipulator->setNode(NULL); 389 _manipulator->setNode(_sceneRoot.get()); 390 _manipulator->computeHomePosition(); 410 initEarthManipulator(); 391 411 _viewer->home(); 392 412 … … 454 474 } 455 475 } else { 456 ERROR("Can't get terrain lighting uniform");476 ERROR("Can't find terrain engine container"); 457 477 } 458 478 #else -
trunk/packages/vizservers/geovis/Renderer.h
r4297 r4305 336 336 void finalizeViewer(); 337 337 338 void initEarthManipulator(); 339 338 340 void initColorMaps(); 339 341 … … 354 356 355 357 ColorMapHashmap _colorMaps; 358 359 std::string _baseURI; 356 360 357 361 osg::ref_ptr<osg::Node> _sceneRoot; -
trunk/packages/vizservers/geovis/RendererCmd.cpp
r4299 r4305 634 634 ls->stroke()->color() = osgEarth::Symbology::Color::Black; 635 635 ls->stroke()->width() = 2.0f; 636 636 #if 0 637 osgEarth::Symbology::AltitudeSymbol *alt = style.getOrCreateSymbol<osgEarth::Symbology::AltitudeSymbol>(); 638 alt->clamping() = osgEarth::Symbology::AltitudeSymbol::CLAMP_TO_TERRAIN; 639 //alt->technique() = osgEarth::Symbology::AltitudeSymbol::TECHNIQUE_DRAPE; 640 alt->technique() = osgEarth::Symbology::AltitudeSymbol::TECHNIQUE_GPU; 641 #endif 642 #if 1 637 643 osgEarth::Symbology::RenderSymbol* rs = style.getOrCreateSymbol<osgEarth::Symbology::RenderSymbol>(); 638 644 rs->depthOffset()->enabled() = true; 639 645 rs->depthOffset()->minBias() = 1000; 640 646 #endif 641 647 osgEarth::Drivers::FeatureGeomModelOptions geomOpts; 642 648 geomOpts.featureOptions() = opts;
Note: See TracChangeset
for help on using the changeset viewer.