• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kig

  • sources
  • kde-4.14
  • kdeedu
  • kig
  • objects
polygon_type.h
Go to the documentation of this file.
1 // Copyright (C) 2003 Maurizio Paolini <paolini@dmf.unicatt.it>
2 
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.
7 
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.
12 
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., 51 Franklin Street, Fifth Floor, Boston, MA
16 // 02110-1301, USA.
17 
18 #ifndef KIG_OBJECTS_POLYGON_TYPE_H
19 #define KIG_OBJECTS_POLYGON_TYPE_H
20 
21 #include "base_type.h"
22 
26 class TriangleB3PType
27  : public ArgsParserObjectType
28 {
29  TriangleB3PType();
30  ~TriangleB3PType();
31 public:
32  static const TriangleB3PType* instance();
33 
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;
42 };
43 
47 class PolygonBNPType
48  : public ObjectType
49 {
50  PolygonBNPType();
51  ~PolygonBNPType();
52 public:
53  static const PolygonBNPType* instance();
54 
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;
61 
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;
68 };
69 
73 class OpenPolygonType
74  : public ObjectType
75 {
76  OpenPolygonType();
77  ~OpenPolygonType();
78 public:
79  static const OpenPolygonType* instance();
80 
81  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
82  const ObjectImpType* resultId() const;
83  const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const;
84  bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const;
85  std::vector<ObjectCalcer*> sortArgs( const std::vector<ObjectCalcer*>& args ) const;
86  Args sortArgs( const Args& args ) const;
87 
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;
94 };
95 
99 class PolygonBCVType
100  : public ObjectType
101 {
102  PolygonBCVType();
103  ~PolygonBCVType();
104 public:
105  static const PolygonBCVType* instance();
106 
107  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
108  const ObjectImpType* resultId() const;
109 
110  const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const;
111  bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const;
112  std::vector<ObjectCalcer*> sortArgs( const std::vector<ObjectCalcer*>& args ) const;
113  Args sortArgs( const Args& args ) const;
114  bool canMove( const ObjectTypeCalcer& o ) const;
115  bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const;
116  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
117  void move( ObjectTypeCalcer& o, const Coordinate& to,
118  const KigDocument& d ) const;
119  const Coordinate moveReferencePoint( const ObjectTypeCalcer& o ) const;
120 };
121 
122 int polygonlineintersection( const std::vector<Coordinate>& ppoints,
123  const Coordinate a, const Coordinate b,
124  double& t1, double& t2,
125  std::vector<Coordinate>::const_iterator& intersectionside );
126 
127 int polygonlineintersection( const std::vector<Coordinate>& ppoints,
128  const Coordinate a, const Coordinate b,
129  bool boundleft, bool boundright, bool inside,
130  bool openpolygon, double& t1, double& t2,
131  std::vector<Coordinate>::const_iterator& intersectionside );
132 
133 class PolygonLineIntersectionType
134  : public ArgsParserObjectType
135 {
136  PolygonLineIntersectionType();
137 protected:
138  PolygonLineIntersectionType( const char fulltypename[],
139  const struct ArgsParser::spec argsspec[],
140  int n );
141  ~PolygonLineIntersectionType();
142 public:
143  static const PolygonLineIntersectionType* instance();
144  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
145  const ObjectImpType* resultId() const;
146 };
147 
148 class OPolygonalLineIntersectionType
149  : public PolygonLineIntersectionType
150 {
151  OPolygonalLineIntersectionType();
152  ~OPolygonalLineIntersectionType();
153 public:
154  static const OPolygonalLineIntersectionType* instance();
155  const ObjectImpType* resultId() const;
156 };
157 
158 class CPolygonalLineIntersectionType
159  : public PolygonLineIntersectionType
160 {
161  CPolygonalLineIntersectionType();
162  ~CPolygonalLineIntersectionType();
163 public:
164  static const CPolygonalLineIntersectionType* instance();
165  const ObjectImpType* resultId() const;
166 };
167 
168 class PolygonPolygonIntersectionType
169  : public ArgsParserObjectType
170 {
171  PolygonPolygonIntersectionType();
172  ~PolygonPolygonIntersectionType();
173 public:
174  static const PolygonPolygonIntersectionType* instance();
175  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
176  const ObjectImpType* resultId() const;
177 };
178 
179 class PolygonVertexType
180  : public ArgsParserObjectType
181 {
182  PolygonVertexType();
183  ~PolygonVertexType();
184 public:
185  static const PolygonVertexType* instance();
186  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
187  const ObjectImpType* resultId() const;
188 };
189 
190 class PolygonSideType
191  : public ArgsParserObjectType
192 {
193  PolygonSideType();
194  ~PolygonSideType();
195 public:
196  static const PolygonSideType* instance();
197  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
198  const ObjectImpType* resultId() const;
199 };
200 
201 class ConvexHullType
202  : public ArgsParserObjectType
203 {
204  ConvexHullType();
205  ~ConvexHullType();
206 public:
207  static const ConvexHullType* instance();
208  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
209  const ObjectImpType* resultId() const;
210 };
211 
212 #endif
polygonlineintersection
int polygonlineintersection(const std::vector< Coordinate > &ppoints, const Coordinate a, const Coordinate b, double &t1, double &t2, std::vector< Coordinate >::const_iterator &intersectionside)
Definition: polygon_type.cc:816
ConvexHullType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:1100
CPolygonalLineIntersectionType::instance
static const CPolygonalLineIntersectionType * instance()
Definition: polygon_type.cc:677
PolygonBNPType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: polygon_type.cc:157
PolygonLineIntersectionType::~PolygonLineIntersectionType
~PolygonLineIntersectionType()
Definition: polygon_type.cc:528
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
PolygonBNPType::move
void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const
Definition: polygon_type.cc:219
OpenPolygonType::move
void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const
Definition: polygon_type.cc:330
PolygonBCVType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: polygon_type.cc:384
PolygonBCVType::instance
static const PolygonBCVType * instance()
Definition: polygon_type.cc:378
ArgsParserObjectType
This is a convenience subclass of ObjectType that a type should inherit from if its parents can be sp...
Definition: object_type.h:113
PolygonBNPType::isDefinedOnOrThrough
bool isDefinedOnOrThrough(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: polygon_type.cc:189
PolygonVertexType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: polygon_type.cc:999
PolygonSideType
Definition: polygon_type.h:190
PolygonLineIntersectionType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:538
PolygonBCVType::canMove
bool canMove(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:456
TriangleB3PType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: polygon_type.cc:65
TriangleB3PType::canMove
bool canMove(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:86
PolygonBCVType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:482
CPolygonalLineIntersectionType
Definition: polygon_type.h:158
OPolygonalLineIntersectionType
Definition: polygon_type.h:148
OpenPolygonType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:320
PolygonPolygonIntersectionType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: polygon_type.cc:851
ObjectTypeCalcer
This is an ObjectCalcer that uses one of the various ObjectType's to calculate its ObjectImp...
Definition: object_calcer.h:183
PolygonBNPType::sortArgs
std::vector< ObjectCalcer * > sortArgs(const std::vector< ObjectCalcer * > &args) const
Definition: polygon_type.cc:194
PolygonBCVType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:425
OpenPolygonType
Open Polygon (Polyline, Polygonal Line)
Definition: polygon_type.h:73
TriangleB3PType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:91
PolygonPolygonIntersectionType
Definition: polygon_type.h:168
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
ConvexHullType::instance
static const ConvexHullType * instance()
Definition: polygon_type.cc:1081
PolygonPolygonIntersectionType::instance
static const PolygonPolygonIntersectionType * instance()
Definition: polygon_type.cc:845
OpenPolygonType::instance
static const OpenPolygonType * instance()
Definition: polygon_type.cc:267
PolygonSideType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:1057
TriangleB3PType::instance
static const TriangleB3PType * instance()
Definition: polygon_type.cc:59
ConvexHullType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: polygon_type.cc:1087
OpenPolygonType::impRequirement
const ObjectImpType * impRequirement(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: polygon_type.cc:295
TriangleB3PType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: polygon_type.cc:122
PolygonBCVType::move
void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const
Definition: polygon_type.cc:468
Args
std::vector< const ObjectImp * > Args
Definition: objects/common.h:47
PolygonLineIntersectionType::instance
static const PolygonLineIntersectionType * instance()
Definition: polygon_type.cc:532
PolygonBNPType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: polygon_type.cc:238
OpenPolygonType::sortArgs
std::vector< ObjectCalcer * > sortArgs(const std::vector< ObjectCalcer * > &args) const
Definition: polygon_type.cc:305
PolygonPolygonIntersectionType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:968
OPolygonalLineIntersectionType::instance
static const OPolygonalLineIntersectionType * instance()
Definition: polygon_type.cc:645
PolygonBCVType::impRequirement
const ObjectImpType * impRequirement(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: polygon_type.cc:430
PolygonBNPType::impRequirement
const ObjectImpType * impRequirement(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: polygon_type.cc:184
ArgsParser::spec
Definition: argsparser.h:113
PolygonBCVType::isDefinedOnOrThrough
bool isDefinedOnOrThrough(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: polygon_type.cc:441
ObjectType
The ObjectType class is a thing that represents the "behaviour" for a certain type.
Definition: object_type.h:32
PolygonVertexType
Definition: polygon_type.h:179
TriangleB3PType
Triangle by its vertices.
Definition: polygon_type.h:26
PolygonSideType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: polygon_type.cc:1042
PolygonBNPType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:179
OPolygonalLineIntersectionType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:651
TriangleB3PType::move
void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const
Definition: polygon_type.cc:99
CPolygonalLineIntersectionType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:683
PolygonBCVType
Polygon by center and vertex.
Definition: polygon_type.h:99
PolygonBNPType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:231
OpenPolygonType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: polygon_type.cc:349
OpenPolygonType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: polygon_type.cc:273
TriangleB3PType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:81
ConvexHullType
Definition: polygon_type.h:201
PolygonSideType::instance
static const PolygonSideType * instance()
Definition: polygon_type.cc:1036
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
PolygonLineIntersectionType
Definition: polygon_type.h:133
OpenPolygonType::canMove
bool canMove(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:315
PolygonBNPType::instance
static const PolygonBNPType * instance()
Definition: polygon_type.cc:151
PolygonBCVType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: polygon_type.cc:491
PolygonVertexType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:1011
OpenPolygonType::isDefinedOnOrThrough
bool isDefinedOnOrThrough(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: polygon_type.cc:300
OpenPolygonType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: polygon_type.cc:290
PolygonBNPType
Polygon by its vertices.
Definition: polygon_type.h:47
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
OpenPolygonType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:342
TriangleB3PType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:115
PolygonBCVType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:461
base_type.h
PolygonBNPType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:209
PolygonLineIntersectionType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: polygon_type.cc:561
PolygonVertexType::instance
static const PolygonVertexType * instance()
Definition: polygon_type.cc:993
PolygonBCVType::sortArgs
std::vector< ObjectCalcer * > sortArgs(const std::vector< ObjectCalcer * > &args) const
Definition: polygon_type.cc:446
PolygonBNPType::canMove
bool canMove(const ObjectTypeCalcer &o) const
Definition: polygon_type.cc:204
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal