/usr/include/osgEarthQt/TerrainProfileGraph is in libosgearth-dev 2.5.0+dfsg-2+b2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | /* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2008-2013 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef OSGEARTHQT_TERRAINPROFILEGRAPH_H
#define OSGEARTHQT_TERRAINPROFILEGRAPH_H 1
#include <osgEarthQt/Actions>
#include <osgEarthQt/Common>
#include <osgEarthQt/DataManager>
#include <osgEarth/Map>
#include <osgEarthUtil/TerrainProfile>
#include <QGraphicsLineItem>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QLineF>
#include <QList>
#include <QMouseEvent>
#include <QRect>
#include <QResizeEvent>
namespace osgEarth { namespace QtGui
{
using namespace osgEarth::Util;
struct TerrainProfilePositionCallback : public osg::Referenced
{
virtual void updatePosition(double lat, double lon, const std::string& text) { }
virtual ~TerrainProfilePositionCallback() { }
};
/**
* Graphics widget that displays the results of an osgEarth::Util::TerrainProfile
* calculation.
*/
class OSGEARTHQT_EXPORT TerrainProfileGraph : public QGraphicsView
{
Q_OBJECT
public:
TerrainProfileGraph(osgEarth::Util::TerrainProfileCalculator* calculator, TerrainProfilePositionCallback* callback=0L);
virtual ~TerrainProfileGraph();
void setBackgroundColor(const QColor& color);
const QColor& getBackgroundColor() { return _backgroundColor; }
void setFieldColor(const QColor& color);
const QColor& getFieldColor() { return _fieldColor; }
void setAxesColor(const QColor& color);
const QColor& getAxesColor() { return _axesColor; }
void setGraphColor(const QColor& color);
const QColor& getGraphColor() { return _graphColor; }
void setGraphFillColor(const QColor& color);
const QColor& getGraphFillColor() { return _graphFillColor; }
void notifyTerrainGraphChanged() { emit onNotifyTerrainGraphChanged(); }
signals:
void onNotifyTerrainGraphChanged();
protected:
static const int FIELD_Z;
static const int AXES_Z;
static const int GRAPH_Z;
static const int OVERLAY_Z;
void resizeEvent(QResizeEvent* e);
void mouseMoveEvent(QMouseEvent* e);
void mousePressEvent(QMouseEvent* e);
void mouseReleaseEvent(QMouseEvent* e);
void redrawGraph();
void drawAxes(double yMin, double yMax, double yScale, double xMax, QRect &out_field);
void drawHoverCursor(const QPointF& position);
void drawSelectionBox(double position);
private slots:
void onTerrainGraphChanged();
private:
osg::ref_ptr<osgEarth::Util::TerrainProfileCalculator> _calculator;
osg::ref_ptr<TerrainProfilePositionCallback> _positionCallback;
osg::ref_ptr<TerrainProfileCalculator::ChangedCallback> _graphChangedCallback;
QGraphicsScene* _scene;
QList<QLineF> _graphLines;
QGraphicsLineItem* _hoverLine;
QPen _linePen;
QPen _hoverPen;
QPen _axesPen;
QFont _graphFont;
QColor _backgroundColor;
QColor _fieldColor;
QColor _axesColor;
QColor _graphColor;
QColor _graphFillColor;
QRect _graphField;
double _totalDistance;
int _graphMinY;
int _graphMaxY;
int _graphWidth;
int _graphHeight;
bool _selecting;
double _selectStart;
double _selectEnd;
};
} }
#endif // OSGEARTHQT_TERRAINPROFILEGRAPH_H
|