Updraft
1.0
Open source glider flight visualisation tool.
|
00001 #ifndef UPDRAFT_SRC_PLUGINS_TURNPOINTS_TPLAYER_H_ 00002 #define UPDRAFT_SRC_PLUGINS_TURNPOINTS_TPLAYER_H_ 00003 00004 #include <osg/Geometry> 00005 #include <osg/Matrix> 00006 #include "tpfile.h" 00007 #include "tpmapobject.h" 00008 #include "../../pluginbase.h" 00009 00010 namespace osg { 00011 class Geometry; 00012 class Geode; 00013 class AutoTransform; 00014 class Group; 00015 class Node; 00016 } 00017 00018 namespace osgEarth { 00019 namespace Util { 00020 class ObjectPlacer; 00021 } 00022 } 00023 00024 namespace Updraft { 00025 00026 class TurnPoints; 00027 00029 class TPLayer { 00030 public: 00031 TPLayer(bool displayed_, osgEarth::Util::ObjectPlacer* objectPlacer_, 00032 const TPFile *file_, TurnPoints* parent_, 00033 const QVector<SettingInterface*>& settings); 00034 00035 virtual ~TPLayer(); 00036 00038 osg::Node* getNode() const; 00039 osg::Node* getLblNode() const; 00040 00042 bool isDisplayed(); 00043 00046 void display(bool displayed_); 00047 00048 private: 00052 osg::Geometry* createGeometry(qreal scale); 00053 00058 osg::Geode* createGeode(qreal scale, bool isAirfield); 00059 00065 osg::AutoTransform* createAutoTransform( 00066 const osg::Matrix& matrix, 00067 osg::Geode* geode); 00068 00070 osg::Node* createAutoScale( 00071 const osg::Vec3& position, 00072 qreal characterSize, 00073 const QString& message, 00074 qreal minScale = 0.0, 00075 qreal maxScale = FLT_MAX); 00076 00078 osg::Group* group; 00079 00081 osgEarth::Util::ObjectPlacer* objectPlacer; 00082 00083 const TPFile *file; 00084 bool displayed; 00085 00086 TurnPoints* parent; 00087 00088 // TODO(cestmir): Serves for destructor purposes. Remove in future 00089 // when real turnpoint MapObjects are implemented 00090 QList<TPMapObject*> mapObjects; 00091 00093 qreal labelMinScale; 00094 qreal labelMaxScale; 00095 00100 qreal labelDrawDist; 00101 00103 qreal lblSize; 00104 }; 00105 00106 } // End namespace Updraft 00107 00108 #endif // UPDRAFT_SRC_PLUGINS_TURNPOINTS_TPLAYER_H_