// baseobjact.hpp -- base object actions // // Written by Frederic Bouvier, started June 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: baseobjact.hpp,v 1.5 2005/06/09 22:33:58 fredb2 Exp $ #ifndef _baseobjact_hpp_ #define _baseobjact_hpp_ #include #include "action.hpp" class FGSD_MoveVertexBaseObjectAction : public FGSD_Action { public: typedef std::vector NameList; FGSD_MoveVertexBaseObjectAction(); FGSD_MoveVertexBaseObjectAction( const char *__name, double __lon, double __lat, double __xdepl, double __ydepl ); bool undo(); bool redo( bool __step = false ); std::string name() const; std::string description() const; bool combine( FGSD_Action *__action ); FGSD_ActionID type() const; void *convertTo( FGSD_ActionID __id ); FGSD_Action *clone() const; bool getPosition( bool undo, double &lon, double &lat ) const; bool save( const char *__project, SGPropertyNode *__node ); bool load( const char *__project, SGPropertyNode *__node ); static FGSD_ActionID _id; private: std::string _name; double _lon; double _lat; double _xdepl; double _ydepl; }; class FGSD_ChangeHeightBaseObjectAction : public FGSD_Action { public: typedef std::vector NameList; FGSD_ChangeHeightBaseObjectAction(); FGSD_ChangeHeightBaseObjectAction( const char *__name, double __lon, double __lat, double __zdepl ); bool undo(); bool redo( bool __step = false ); std::string name() const; std::string description() const; bool combine( FGSD_Action *__action ); FGSD_ActionID type() const; void *convertTo( FGSD_ActionID __id ); FGSD_Action *clone() const; bool getPosition( bool undo, double &lon, double &lat ) const; bool save( const char *__project, SGPropertyNode *__node ); bool load( const char *__project, SGPropertyNode *__node ); static FGSD_ActionID _id; private: std::string _name; double _lon; double _lat; double _zdepl; }; class FGSD_ChangeMaterialBaseObjectAction : public FGSD_Action { public: typedef std::vector NameList; FGSD_ChangeMaterialBaseObjectAction(); FGSD_ChangeMaterialBaseObjectAction( const char *__name, double __lon, double __lat, const std::string &__oldmat, const std::string &__newmat ); bool undo(); bool redo( bool __step = false ); std::string name() const; std::string description() const; bool combine( FGSD_Action *__action ); FGSD_ActionID type() const; void *convertTo( FGSD_ActionID __id ); FGSD_Action *clone() const; bool getPosition( bool undo, double &lon, double &lat ) const; bool save( const char *__project, SGPropertyNode *__node ); bool load( const char *__project, SGPropertyNode *__node ); static FGSD_ActionID _id; private: std::string _name; double _lon; double _lat; std::string _oldmat; std::string _newmat; }; #endif