mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
LP-29 uncrustified
This commit is contained in:
parent
723ab39d59
commit
a7428ed9ad
@ -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<double>(width) / static_cast<double>(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 */
|
||||
|
@ -199,7 +199,6 @@ void OSGFileNode::setOptimizeMode(OptimizeMode mode)
|
||||
emit optimizeModeChanged(optimizeMode());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace osgQtQuick
|
||||
|
||||
#include "OSGFileNode.moc"
|
||||
|
@ -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<osgEarth::Annotation::ModelNode> 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> nodeUpdateCallback;
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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<osgViewer::CompositeViewer> viewer;
|
||||
osg::ref_ptr<osgViewer::View> view;
|
||||
osg::ref_ptr<osgViewer::View> view;
|
||||
|
||||
osg::ref_ptr<osg::NodeCallback> 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<QObject *> i(children());
|
||||
while (i.hasNext()) {
|
||||
QObject *object= i.next();
|
||||
OSGNode *node = qobject_cast<OSGNode *>(object);
|
||||
QObject *object = i.next();
|
||||
OSGNode *node = qobject_cast<OSGNode *>(object);
|
||||
if (node) {
|
||||
qDebug() << "OSGViewport::attach - child" << node;
|
||||
node->attach(view);
|
||||
@ -683,8 +682,8 @@ bool OSGViewport::detach(osgViewer::View *view)
|
||||
|
||||
QListIterator<QObject *> i(children());
|
||||
while (i.hasNext()) {
|
||||
QObject *object= i.next();
|
||||
OSGNode *node = qobject_cast<OSGNode *>(object);
|
||||
QObject *object = i.next();
|
||||
OSGNode *node = qobject_cast<OSGNode *>(object);
|
||||
if (node) {
|
||||
node->detach(view);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -355,8 +355,7 @@ void GraphicsWindowQt::requestWarpPointer(float x, float y)
|
||||
{}
|
||||
|
||||
QtWindowingSystem::QtWindowingSystem()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
QtWindowingSystem::~QtWindowingSystem()
|
||||
{
|
||||
|
@ -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
|
||||
|
||||
|
@ -466,14 +466,15 @@ QString formatSwapBehaviorName(QSurfaceFormat::SwapBehavior swapBehavior)
|
||||
return "<Unknown swap behavior>";
|
||||
}
|
||||
|
||||
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<osg::ApplicationUsage> applicationUsage = new osg::ApplicationUsage();
|
||||
|
||||
viewer->getUsage(*applicationUsage);
|
||||
return getUsageString(applicationUsage);
|
||||
}
|
||||
|
||||
QString getUsageString(osgViewer::CompositeViewer *viewer) {
|
||||
QString getUsageString(osgViewer::CompositeViewer *viewer)
|
||||
{
|
||||
osg::ref_ptr<osg::ApplicationUsage> applicationUsage = new osg::ApplicationUsage();
|
||||
|
||||
viewer->getUsage(*applicationUsage);
|
||||
return getUsageString(applicationUsage);
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user