File indexing completed on 2024-09-15 03:57:31
0001 /*************************************************************************** 0002 areacreator.cpp - description 0003 ------------------- 0004 begin : Wed Apr 3 2002 0005 copyright : (C) 2002 by Jan Schäfer 0006 email : janschaefer@users.sourceforge.net 0007 ***************************************************************************/ 0008 0009 /*************************************************************************** 0010 * * 0011 * This program is free software; you can redistribute it and/or modify * 0012 * it under the terms of the GNU General Public License as published by * 0013 * the Free Software Foundation; either version 2 of the License, or * 0014 * (at your option) any later version. * 0015 * * 0016 ***************************************************************************/ 0017 0018 #include "areacreator.h" 0019 0020 0021 0022 Area* AreaCreator::create( Area::ShapeType type) 0023 { 0024 switch ( type ) { 0025 case Area::Rectangle : return new RectArea(); 0026 case Area::Circle : return new CircleArea(); 0027 case Area::Polygon : return new PolyArea(); 0028 case Area::Default : return new DefaultArea(); 0029 case Area::Selection : return new AreaSelection(); 0030 default : return new Area(); 0031 } 0032 } 0033 0034 0035 Area* AreaCreator::create( KImageMapEditor::ToolType type) 0036 { 0037 switch ( type ) { 0038 case KImageMapEditor::Rectangle : return new RectArea(); 0039 case KImageMapEditor::Circle : return new CircleArea(); 0040 case KImageMapEditor::Polygon : return new PolyArea(); 0041 case KImageMapEditor::Freehand : return new PolyArea(); 0042 default : return new Area(); 0043 } 0044 }