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
18 #ifndef KIG_OBJECTS_POLIGON_TYPE_H
19 #define KIG_OBJECTS_POLIGON_TYPE_H
21 #include "base_type.h"
24 * Triangle by its vertices
27 : public ArgsParserObjectType
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;
45 * Polygon by its vertices
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;
71 * Polygon by center and vertex
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();
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
111 ~PolygonVertexType();
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
124 static const PolygonSideType
* instance();
125 ObjectImp
* calc( const Args
& parents
, const KigDocument
& ) const;
126 const ObjectImpType
* resultId() const;
130 : public ArgsParserObjectType
135 static const ConvexHullType
* instance();
136 ObjectImp
* calc( const Args
& parents
, const KigDocument
& ) const;
137 const ObjectImpType
* resultId() const;