diff --git a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGCamera.cpp b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGCamera.cpp index f0c7b7977..b0d566aae 100644 --- a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGCamera.cpp +++ b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGCamera.cpp @@ -106,7 +106,7 @@ public: sceneData = node; if (sceneData) { - //connect(sceneData, &OSGNode::nodeChanged, this, &Hidden::onSceneDataChanged); + // connect(sceneData, &OSGNode::nodeChanged, this, &Hidden::onSceneDataChanged); } return true; @@ -191,7 +191,7 @@ public: if (logDepthBufferEnabled) { qDebug() << "OSGCamera::attach - install logarithmic depth buffer"; logDepthBuffer = new osgEarth::Util::LogarithmicDepthBuffer(); - //logDepthBuffer->setUseFragDepth(true); + // logDepthBuffer->setUseFragDepth(true); logDepthBuffer->install(camera); } @@ -338,7 +338,8 @@ public: { // qDebug() << "OSGCamera::updateCameraFOV"; double fovy, ar, zn, zf; - camera->getProjectionMatrixAsPerspective(fovy, ar, zn ,zf); + + camera->getProjectionMatrixAsPerspective(fovy, ar, zn, zf); fovy = fieldOfView; camera->setProjectionMatrixAsPerspective(fovy, ar, zn, zf); @@ -347,7 +348,8 @@ public: void updateAspectRatio() { double fovy, ar, zn, zf; - camera->getProjectionMatrixAsPerspective(fovy, ar, zn ,zf); + + camera->getProjectionMatrixAsPerspective(fovy, ar, zn, zf); ar = static_cast(width) / static_cast(height); camera->setProjectionMatrixAsPerspective(fovy, ar, zn, zf); @@ -401,9 +403,9 @@ public: camera->setViewMatrix(cameraMatrix); } - qreal fieldOfView; + qreal fieldOfView; - OSGNode *sceneData; + OSGNode *sceneData; ManipulatorMode manipulatorMode; @@ -456,7 +458,7 @@ private slots: void OSGCamera::Hidden::CameraUpdateCallback::operator()(osg::Node *node, osg::NodeVisitor *nv) { h->updateCamera(); - //traverse(node, nv); + // traverse(node, nv); } /* class OSGCamera */ diff --git a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGFileNode.cpp b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGFileNode.cpp index b80eeb354..5e1d5ab5d 100644 --- a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGFileNode.cpp +++ b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGFileNode.cpp @@ -199,7 +199,6 @@ void OSGFileNode::setOptimizeMode(OptimizeMode mode) emit optimizeModeChanged(optimizeMode()); } } - } // namespace osgQtQuick #include "OSGFileNode.moc" diff --git a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGModelNode.cpp b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGModelNode.cpp index 480ba76fa..63907e37c 100644 --- a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGModelNode.cpp +++ b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGModelNode.cpp @@ -60,8 +60,7 @@ public: public: Hidden(OSGModelNode *parent) : QObject(parent), self(parent), modelData(NULL), sceneData(NULL), offset(-1.0), clampToTerrain(false), dirty(false) - { - } + {} ~Hidden() {} @@ -127,7 +126,7 @@ public: // get "size" of model osg::ComputeBoundsVisitor cbv; modelNode->accept(cbv); - const osg::BoundingBox& bbox = cbv.getBoundingBox(); + const osg::BoundingBox & bbox = cbv.getBoundingBox(); offset = bbox.radius(); self->setNode(modelNode); @@ -210,16 +209,16 @@ public: osg::ref_ptr modelNode; - float offset; + float offset; - bool clampToTerrain; - bool intoTerrain; + bool clampToTerrain; + bool intoTerrain; QVector3D attitude; QVector3D position; // handle attitude/position/etc independently - bool dirty; + bool dirty; osg::observer_ptr nodeUpdateCallback; diff --git a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGSkyNode.cpp b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGSkyNode.cpp index 0b48753f7..95b2bc76d 100644 --- a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGSkyNode.cpp +++ b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGSkyNode.cpp @@ -173,7 +173,7 @@ public: // TODO should be done in a node visitor... if (skyNode) { double d = minimumAmbientLight; - //skyNode->getSunLight()->setAmbient(osg::Vec4(d, d, d, 1.0f)); + // skyNode->getSunLight()->setAmbient(osg::Vec4(d, d, d, 1.0f)); skyNode->setMinimumAmbient(osg::Vec4(d, d, d, 1.0f)); } diff --git a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp index 00f664979..7e47cff12 100644 --- a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp +++ b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp @@ -159,7 +159,6 @@ public: bool acceptNode(osg::Node *node) { - return true; } @@ -204,11 +203,11 @@ public: // TODO will the AutoClipPlaneCullCallback be destroyed ? // TODO does it need to be added to the map node or to the view ? cullCallback = new osgEarth::Util::AutoClipPlaneCullCallback(mapNode); - //view->getCamera()->addCullCallback(cullCallback); + // view->getCamera()->addCullCallback(cullCallback); mapNode->addCullCallback(cullCallback); } - //view->getCamera()->setSmallFeatureCullingPixelSize(-1.0f); + // view->getCamera()->setSmallFeatureCullingPixelSize(-1.0f); view->setSceneData(node); @@ -313,7 +312,7 @@ public: int frameTimer; osg::ref_ptr viewer; - osg::ref_ptr view; + osg::ref_ptr view; osg::ref_ptr cullCallback; @@ -400,9 +399,9 @@ public: traits->pbuffer = true; osg::GraphicsContext *graphicsContext = osg::GraphicsContext::createGraphicsContext(traits); // if (!graphicsContext) { - // qWarning() << "Failed to create pbuffer, failing back to normal graphics window."; - // traits->pbuffer = false; - // graphicsContext = osg::GraphicsContext::createGraphicsContext(traits); + // qWarning() << "Failed to create pbuffer, failing back to normal graphics window."; + // traits->pbuffer = false; + // graphicsContext = osg::GraphicsContext::createGraphicsContext(traits); // } return graphicsContext; @@ -431,7 +430,7 @@ public: traits->sampleBuffers = ds->getMultiSamples(); traits->samples = ds->getNumMultiSamples(); - traits->doubleBuffer = false; //ds->getDoubleBuffer(); + traits->doubleBuffer = false; // ds->getDoubleBuffer(); traits->vsync = false; // traits->sharedContext = gc; // traits->inheritedWindowData = new osgQt::GraphicsWindowQt::WindowData(this); @@ -538,7 +537,7 @@ public: requestRedraw = false; } - //h->self->window()->resetOpenGLState(); + // h->self->window()->resetOpenGLState(); if (h->updateMode == OSGViewport::Continuous) { // trigger next update @@ -666,8 +665,8 @@ bool OSGViewport::attach(osgViewer::View *view) QListIterator i(children()); while (i.hasNext()) { - QObject *object= i.next(); - OSGNode *node = qobject_cast(object); + QObject *object = i.next(); + OSGNode *node = qobject_cast(object); if (node) { qDebug() << "OSGViewport::attach - child" << node; node->attach(view); @@ -683,8 +682,8 @@ bool OSGViewport::detach(osgViewer::View *view) QListIterator i(children()); while (i.hasNext()) { - QObject *object= i.next(); - OSGNode *node = qobject_cast(object); + QObject *object = i.next(); + OSGNode *node = qobject_cast(object); if (node) { node->detach(view); } diff --git a/ground/gcs/src/libs/osgearth/osgearth.cpp b/ground/gcs/src/libs/osgearth/osgearth.cpp index a97221b9e..bb6b83fb4 100644 --- a/ground/gcs/src/libs/osgearth/osgearth.cpp +++ b/ground/gcs/src/libs/osgearth/osgearth.cpp @@ -86,9 +86,9 @@ void OsgEarth::initialize() qDebug() << "OsgEarth::initialize - initializing osgearth..."; // increase cache (default is 300); - //setenv("OSG_MAX_PAGEDLOD", "500", 0); + // setenv("OSG_MAX_PAGEDLOD", "500", 0); - //setenv("OSG_ASSIGN_PBO_TO_IMAGES", "on", 0); + // setenv("OSG_ASSIGN_PBO_TO_IMAGES", "on", 0); // Number of threads in the DatbasePager set up, inclusive of the number of http dedicated threads. osg::DisplaySettings::instance()->setNumOfDatabaseThreadsHint(6); diff --git a/ground/gcs/src/libs/osgearth/qtwindowingsystem.cpp b/ground/gcs/src/libs/osgearth/qtwindowingsystem.cpp index df7ff3ad4..6eac26a29 100644 --- a/ground/gcs/src/libs/osgearth/qtwindowingsystem.cpp +++ b/ground/gcs/src/libs/osgearth/qtwindowingsystem.cpp @@ -355,8 +355,7 @@ void GraphicsWindowQt::requestWarpPointer(float x, float y) {} QtWindowingSystem::QtWindowingSystem() -{ -} +{} QtWindowingSystem::~QtWindowingSystem() { diff --git a/ground/gcs/src/libs/osgearth/qtwindowingsystem.h b/ground/gcs/src/libs/osgearth/qtwindowingsystem.h index ce53edec5..958c04fb1 100644 --- a/ground/gcs/src/libs/osgearth/qtwindowingsystem.h +++ b/ground/gcs/src/libs/osgearth/qtwindowingsystem.h @@ -24,7 +24,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - + #ifndef QTWINDOWINGSYSTEM_H #define QTWINDOWINGSYSTEM_H diff --git a/ground/gcs/src/libs/osgearth/utility.cpp b/ground/gcs/src/libs/osgearth/utility.cpp index 16518c675..becac109b 100644 --- a/ground/gcs/src/libs/osgearth/utility.cpp +++ b/ground/gcs/src/libs/osgearth/utility.cpp @@ -466,14 +466,15 @@ QString formatSwapBehaviorName(QSurfaceFormat::SwapBehavior swapBehavior) return ""; } -QString getUsageString(osg::ApplicationUsage *applicationUsage) { - const osg::ApplicationUsage::UsageMap& keyboardBinding = applicationUsage->getKeyboardMouseBindings(); +QString getUsageString(osg::ApplicationUsage *applicationUsage) +{ + const osg::ApplicationUsage::UsageMap & keyboardBinding = applicationUsage->getKeyboardMouseBindings(); QString desc; - for(osg::ApplicationUsage::UsageMap::const_iterator itr = keyboardBinding.begin(); - itr != keyboardBinding.end(); - ++itr) - { + + for (osg::ApplicationUsage::UsageMap::const_iterator itr = keyboardBinding.begin(); + itr != keyboardBinding.end(); + ++itr) { desc += QString::fromStdString(itr->first); desc += " : "; desc += QString::fromStdString(itr->second); @@ -482,14 +483,18 @@ QString getUsageString(osg::ApplicationUsage *applicationUsage) { return desc; } -QString getUsageString(osgViewer::Viewer *viewer) { +QString getUsageString(osgViewer::Viewer *viewer) +{ osg::ref_ptr applicationUsage = new osg::ApplicationUsage(); + viewer->getUsage(*applicationUsage); return getUsageString(applicationUsage); } -QString getUsageString(osgViewer::CompositeViewer *viewer) { +QString getUsageString(osgViewer::CompositeViewer *viewer) +{ osg::ref_ptr applicationUsage = new osg::ApplicationUsage(); + viewer->getUsage(*applicationUsage); return getUsageString(applicationUsage); } diff --git a/ground/gcs/src/libs/osgearth/utility.h b/ground/gcs/src/libs/osgearth/utility.h index 48310592f..8a84f70b4 100644 --- a/ground/gcs/src/libs/osgearth/utility.h +++ b/ground/gcs/src/libs/osgearth/utility.h @@ -125,9 +125,9 @@ osgText::Font *createFont(const std::string &name); osgText::Font *createFont(const QFont &font); osgText::Text *createText(const osg::Vec3 &pos, - const std::string &content, - float size, - osgText::Font *font = 0); + const std::string &content, + float size, + osgText::Font *font = 0); osgEarth::GeoPoint toGeoPoint(const QVector3D &position); bool clampGeoPoint(osgEarth::GeoPoint &geoPoint, float offset, osgEarth::MapNode *mapNode);