1 // Copyright (C) 2003 Dominique Devriese <devriese@kde.org>
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 #include "object_type_factory.h"
22 #include "object_type.h"
23 #include "circle_type.h"
24 #include "conic_types.h"
25 #include "cubic_type.h"
26 #include "intersection_types.h"
27 #include "line_type.h"
28 #include "text_type.h"
29 #include "other_type.h"
30 #include "transform_types.h"
31 #include "point_type.h"
32 #include "tests_type.h"
34 #ifdef KIG_ENABLE_PYTHON_SCRIPTING
35 #include "../scripting/python_type.h"
41 ObjectTypeFactory::ObjectTypeFactory()
42 : malreadysetup( false )
47 ObjectTypeFactory::~ObjectTypeFactory()
51 ObjectTypeFactory
* ObjectTypeFactory::instance()
53 static ObjectTypeFactory fact
;
57 void ObjectTypeFactory::add( const ObjectType
* type
)
59 assert( mmap
.find( std::string( type
->fullName() ) ) == mmap
.end() );
60 mmap
[std::string( type
->fullName() )] = type
;
63 const ObjectType
* ObjectTypeFactory::find( const char* name
) const
65 maptype::const_iterator i
= mmap
.find( std::string( name
) );
66 if ( i
== mmap
.end() ) return 0;
67 else return i
->second
;
70 void ObjectTypeFactory::setupBuiltinTypes()
72 // assert( ! malreadysetup );
73 // malreadysetup = true;
76 // add( CircleBCPType::instance() );
77 // add( CircleBPRType::instance() );
78 // add( CircleBTPType::instance() );
81 // add( ConicB5PType::instance() );
82 // add( ConicBAAPType::instance() );
83 // add( EllipseBFFPType::instance() );
84 // add( HyperbolaBFFPType::instance() );
85 // add( ConicBDFPType::instance() );
86 // add( ParabolaBTPType::instance() );
87 // add( EquilateralHyperbolaB4PType::instance() );
88 // add( ConicPolarPointType::instance() );
89 // add( ConicPolarLineType::instance() );
90 // add( ConicDirectrixType::instance() );
91 // add( ParabolaBDPType::instance() );
92 // add( ConicAsymptoteType::instance() );
93 // add( ConicRadicalType::instance() );
96 // add( CubicB9PType::instance() );
97 // add( CubicNodeB6PType::instance() );
98 // add( CubicCuspB4PType::instance() );
100 // // intersection_types.h
101 // add( ConicLineIntersectionType::instance() );
102 // add( ConicLineOtherIntersectionType::instance() );
103 // add( LineLineIntersectionType::instance() );
104 // add( LineCubicIntersectionType::instance() );
105 // add( CircleCircleIntersectionType::instance() );
108 // add( SegmentABType::instance() );
109 // add( LineABType::instance() );
110 // add( RayABType::instance() );
111 // add( LinePerpendLPType::instance() );
112 // add( LineParallelLPType::instance() );
115 // add( AngleType::instance() );
116 // add( VectorType::instance() );
117 // add( LocusType::instance() );
118 // add( ArcBTPType::instance() );
119 // add( CopyObjectType::instance() );
122 // add( FixedPointType::instance() );
123 // add( ConstrainedPointType::instance() );
124 // add( MidPointType::instance() );
125 // add( MeasureTransportType::instance() );
128 // add( TextType::instance() );
131 // add( AreParallelType::instance() );
133 // // transform_types.h
134 // add( TranslatedType::instance() );
135 // add( PointReflectionType::instance() );
136 // add( LineReflectionType::instance() );
137 // add( RotationType::instance() );
138 // add( ScalingOverCenterType::instance() );
139 // add( ScalingOverLineType::instance() );
140 // add( ProjectiveRotationType::instance() );
141 // add( CastShadowType::instance() );
143 // #ifdef KIG_ENABLE_PYTHON_SCRIPTING
145 // add( PythonCompileType::instance() );
146 // add( PythonExecuteType::instance() );