// baseobjactfact.cpp -- the action factory for object base 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: baseobjactfact.cpp,v 1.9 2005/06/09 22:33:58 fredb2 Exp $ #ifdef _MSC_VER #pragma warning( disable : 4786 ) #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "baseobjactfact.hpp" #include #include "baseobjact.hpp" FGSD_BaseObjectActionFactory::~FGSD_BaseObjectActionFactory() { } FGSD_Action *FGSD_BaseObjectActionFactory::createAction( const char *__project, SGPropertyNode *__node ) { FGSD_Action *ret = 0; SGPropertyNode *nm = __node->getChild( "name" ); if ( nm ) { std::string name = nm->getStringValue(); if ( name == "move-vertex" ) ret = new FGSD_MoveVertexBaseObjectAction; else if ( name == "change-height" ) ret = new FGSD_ChangeHeightBaseObjectAction; else if ( name == "change-material" ) ret = new FGSD_ChangeMaterialBaseObjectAction; if ( ret ) ret->load( __project, __node ); } return ret; } std::string FGSD_BaseObjectActionFactory::getName() const { return "base-object"; } FGSD_BaseObjectActionFactory baseObjectActionFactory;