2007-09-09 23:22:14 +00:00
|
|
|
// groundradar.hxx - Background layer for the ATC radar.
|
|
|
|
//
|
2007-09-10 05:08:57 +00:00
|
|
|
// Copyright (C) 2007 Csaba Halasz.
|
2007-09-09 23:22:14 +00:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
2008-06-01 18:08:01 +00:00
|
|
|
//
|
2007-09-09 23:22:14 +00:00
|
|
|
// 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
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __INST_GROUNDRADAR_HXX
|
|
|
|
#define __INST_GROUNDRADAR_HXX
|
|
|
|
|
|
|
|
#include <osg/ref_ptr>
|
|
|
|
#include <osg/Geometry>
|
2012-09-26 19:30:24 +00:00
|
|
|
|
2007-09-09 23:22:14 +00:00
|
|
|
#include <simgear/props/props.hxx>
|
2012-04-15 11:03:21 +00:00
|
|
|
#include <simgear/structure/subsystem_mgr.hxx>
|
2007-09-09 23:22:14 +00:00
|
|
|
|
2012-09-26 19:30:24 +00:00
|
|
|
#include "od_gauge.hxx"
|
|
|
|
|
2008-08-14 18:13:39 +00:00
|
|
|
// forward decls
|
2008-12-29 22:23:22 +00:00
|
|
|
class FGRunwayBase;
|
2012-09-26 19:30:24 +00:00
|
|
|
class FGPavement;
|
2008-08-14 18:13:39 +00:00
|
|
|
|
2007-09-09 23:22:14 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Built-in layer for the atc radar.
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-04-15 11:03:21 +00:00
|
|
|
class GroundRadar : public SGSubsystem, public SGPropertyChangeListener, private FGODGauge
|
2007-09-09 23:22:14 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-06-14 11:08:21 +00:00
|
|
|
static const int TextureHalfSize = 256;
|
2007-09-09 23:22:14 +00:00
|
|
|
GroundRadar(SGPropertyNode* node);
|
|
|
|
virtual ~GroundRadar();
|
|
|
|
void updateTexture();
|
|
|
|
virtual void valueChanged(SGPropertyNode*);
|
2012-04-15 11:03:21 +00:00
|
|
|
virtual void update (double dt);
|
2007-09-09 23:22:14 +00:00
|
|
|
protected:
|
2008-06-01 18:08:01 +00:00
|
|
|
void createTexture(const char* texture_name);
|
2008-08-14 18:13:39 +00:00
|
|
|
|
2008-12-29 22:23:22 +00:00
|
|
|
void addRunwayVertices(const FGRunwayBase* aRunway, double aTowerLat, double aTowerLon, double aScale, osg::Vec3Array* aVertices);
|
2009-06-14 11:08:21 +00:00
|
|
|
osg::Geometry *addPavementGeometry(const FGPavement* aPavement, double aTowerLat, double aTowerLon, double aScale);
|
2008-08-14 18:13:39 +00:00
|
|
|
|
2009-06-14 11:08:21 +00:00
|
|
|
osg::ref_ptr<osg::Geode> _geode;
|
2007-09-09 23:22:14 +00:00
|
|
|
SGPropertyNode_ptr _airport_node;
|
2008-06-01 18:08:01 +00:00
|
|
|
SGPropertyNode_ptr _range_node;
|
2007-09-09 23:22:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __INST_GROUNDRADAR_HXX
|