1 | /*************************************************************************** |
---|---|
2 | areacreator.cpp - description |
3 | ------------------- |
4 | begin : Wed Apr 3 2002 |
5 | copyright : (C) 2002 by Jan Schäfer |
6 | email : janschaefer@users.sourceforge.net |
7 | ***************************************************************************/ |
8 | |
9 | /*************************************************************************** |
10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * |
15 | * * |
16 | ***************************************************************************/ |
17 | |
18 | #include "areacreator.h" |
19 | |
20 | |
21 | |
22 | Area* AreaCreator::create( Area::ShapeType type) |
23 | { |
24 | switch ( type ) { |
25 | case Area::Rectangle : return new RectArea(); |
26 | case Area::Circle : return new CircleArea(); |
27 | case Area::Polygon : return new PolyArea(); |
28 | case Area::Default : return new DefaultArea(); |
29 | case Area::Selection : return new AreaSelection(); |
30 | default : return new Area(); |
31 | } |
32 | } |
33 | |
34 | |
35 | Area* AreaCreator::create( KImageMapEditor::ToolType type) |
36 | { |
37 | switch ( type ) { |
38 | case KImageMapEditor::Rectangle : return new RectArea(); |
39 | case KImageMapEditor::Circle : return new CircleArea(); |
40 | case KImageMapEditor::Polygon : return new PolyArea(); |
41 | case KImageMapEditor::Freehand : return new PolyArea(); |
42 | default : return new Area(); |
43 | } |
44 | } |
45 |