moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / objects / polygon_type.h
blob61fc2389f4b9081a3076c32f328f693c97c8f205
1 // Copyright (C) 2003 Maurizio Paolini <paolini@dmf.unicatt.it>
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
16 // 02111-1307, USA.
18 #ifndef KIG_OBJECTS_POLIGON_TYPE_H
19 #define KIG_OBJECTS_POLIGON_TYPE_H
21 #include "base_type.h"
23 /**
24 * Triangle by its vertices
26 class TriangleB3PType
27 : public ArgsParserObjectType
29 TriangleB3PType();
30 ~TriangleB3PType();
31 public:
32 static const TriangleB3PType* instance();
34 ObjectImp* calc( const Args& parents, const KigDocument& ) const;
35 const ObjectImpType* resultId() const;
36 bool canMove( const ObjectTypeCalcer& o ) const;
37 bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const;
38 std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
39 void move( ObjectTypeCalcer& o, const Coordinate& to,
40 const KigDocument& d ) const;
41 const Coordinate moveReferencePoint( const ObjectTypeCalcer& o ) const;
44 /**
45 * Polygon by its vertices
47 class PolygonBNPType
48 : public ObjectType
50 PolygonBNPType();
51 ~PolygonBNPType();
52 public:
53 static const PolygonBNPType* instance();
55 ObjectImp* calc( const Args& parents, const KigDocument& ) const;
56 const ObjectImpType* resultId() const;
57 const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const;
58 bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const;
59 std::vector<ObjectCalcer*> sortArgs( const std::vector<ObjectCalcer*>& args ) const;
60 Args sortArgs( const Args& args ) const;
62 bool canMove( const ObjectTypeCalcer& o ) const;
63 bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const;
64 std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
65 void move( ObjectTypeCalcer& o, const Coordinate& to,
66 const KigDocument& d ) const;
67 const Coordinate moveReferencePoint( const ObjectTypeCalcer& o ) const;
70 /**
71 * Polygon by center and vertex
73 class PolygonBCVType
74 : public ObjectType
76 PolygonBCVType();
77 ~PolygonBCVType();
78 public:
79 static const PolygonBCVType* instance();
81 ObjectImp* calc( const Args& parents, const KigDocument& ) const;
82 const ObjectImpType* resultId() const;
84 const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const;
85 bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const;
86 std::vector<ObjectCalcer*> sortArgs( const std::vector<ObjectCalcer*>& args ) const;
87 Args sortArgs( const Args& args ) const;
88 bool canMove( const ObjectTypeCalcer& o ) const;
89 bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const;
90 std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
91 void move( ObjectTypeCalcer& o, const Coordinate& to,
92 const KigDocument& d ) const;
93 const Coordinate moveReferencePoint( const ObjectTypeCalcer& o ) const;
96 class PolygonLineIntersectionType
97 : public ArgsParserObjectType
99 PolygonLineIntersectionType();
100 ~PolygonLineIntersectionType();
101 public:
102 static const PolygonLineIntersectionType* instance();
103 ObjectImp* calc( const Args& parents, const KigDocument& ) const;
104 const ObjectImpType* resultId() const;
107 class PolygonVertexType
108 : public ArgsParserObjectType
110 PolygonVertexType();
111 ~PolygonVertexType();
112 public:
113 static const PolygonVertexType* instance();
114 ObjectImp* calc( const Args& parents, const KigDocument& ) const;
115 const ObjectImpType* resultId() const;
118 class PolygonSideType
119 : public ArgsParserObjectType
121 PolygonSideType();
122 ~PolygonSideType();
123 public:
124 static const PolygonSideType* instance();
125 ObjectImp* calc( const Args& parents, const KigDocument& ) const;
126 const ObjectImpType* resultId() const;
129 class ConvexHullType
130 : public ArgsParserObjectType
132 ConvexHullType();
133 ~ConvexHullType();
134 public:
135 static const ConvexHullType* instance();
136 ObjectImp* calc( const Args& parents, const KigDocument& ) const;
137 const ObjectImpType* resultId() const;
139 #endif