// objectstatic.hpp -- an object static from a flightgear scenery tile // // Written by Frederic Bouvier, started February 2002. // // Copyright (C) 2002 Frederic Bouvier - fredb@users.sourceforge.net // // 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. // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // $Id: objectstatic.hpp,v 1.22 2005/05/09 07:02:10 fredb Exp $ #ifndef _objectstatic_hpp_ #define _objectstatic_hpp_ #include "bobject.hpp" #include class FGSD_ObjectStatic : public FGSD_BaseObject { public: enum { NB_POINTS = 6 }; FGSD_ObjectStatic( FGSD_Tile *__tile, const std::string &name, double lon, double lat, double elev, double hdg, bool shared, double ground_elev ); FGSD_ObjectStatic( const std::string &name, const std::vector &textures ); void draw( double alpha, bool lines, DrawType drawType, double minx, double maxx, double miny, double maxy, double zLevel ); bool propertiesUnderMouse( double lon, double lat, double &height, std::string &material, std::string &airportID ) const; bool objectUnderMouse( double lon, double lat, double zLevel ); bool visible( double minx, double maxx, double miny, double maxy ) const; bool visible( double lon, double lat ) const; std::string getName() const; void saveTo( std::ostream &out, const std::string &path, bool objectStatic, bool objectShared ); void *convertTo( FGSD_BaseObject::ObjectType __type ); void transformSymbol(); void changeHeading( double __hdg ); double getHeading() const; void changePosition( double __lon, double __lat ); void changePosition( double __lon, double __lat, double __height ); double getLon() const; double getLat() const; double getElev() const; std::vector getTextures() const; std::string path() const; std::string name() const; private: std::string _name; std::string _path; std::vector _textures; double _lon; double _lat; double _elev; double _hdg; double _offset; bool _agl; bool _shared; double _points[ NB_POINTS ][ 2 ]; static double _symbol[ NB_POINTS ][ 2 ]; }; inline double FGSD_ObjectStatic::getHeading() const { return _hdg; } inline double FGSD_ObjectStatic::getLon() const { return _lon; } inline double FGSD_ObjectStatic::getLat() const { return _lat; } inline double FGSD_ObjectStatic::getElev() const { return _elev; } inline std::vector FGSD_ObjectStatic::getTextures() const { return _textures; } inline std::string FGSD_ObjectStatic::path() const { return _path; } inline std::string FGSD_ObjectStatic::name() const { return _name; } #endif