// curveactfact.cpp -- the action factory for curve 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: curveactfact.cpp,v 1.9 2005/05/09 07:01:50 fredb Exp $ #ifdef _MSC_VER #pragma warning( disable : 4786 4503 ) #endif #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "curveactfact.hpp" #include #include "curveact.hpp" FGSD_CurveActionFactory::~FGSD_CurveActionFactory() { } FGSD_Action *FGSD_CurveActionFactory::createAction( const char *__project, SGPropertyNode *__node ) { FGSD_Action *ret = 0; SGPropertyNode *nm = __node->getChild( "name" ); if ( nm ) { std::string name = nm->getStringValue(); if ( name == "add" ) ret = new FGSD_AddCurveAction; else if ( name == "remove" ) ret = new FGSD_RemoveCurveAction; else if ( name == "insert-point" ) ret = new FGSD_AddCurvePointAction; else if ( name == "remove-point" ) ret = new FGSD_RemoveCurvePointAction; else if ( name == "move-point" ) ret = new FGSD_MoveCurvePointAction; else if ( name == "properties" ) ret = new FGSD_CurvePropertiesAction; else if ( name == "embed" ) ret = new FGSD_EmbedCurveAction; if ( ret ) ret->load( __project, __node ); } return ret; } std::string FGSD_CurveActionFactory::getName() const { return "scenery-curve"; } FGSD_CurveActionFactory curveActionFactory;