• 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
point_type.h
Go to the documentation of this file.
1 // Copyright (C) 2002 Dominique Devriese <devriese@kde.org>
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_POINT_TYPE_H
19 #define KIG_OBJECTS_POINT_TYPE_H
20 
21 #include "base_type.h"
22 #include "common.h"
23 #include "circle_imp.h"
24 
25 class FixedPointType
26  : public ArgsParserObjectType
27 {
28  FixedPointType();
29  ~FixedPointType();
30 
31  static const ArgsParser::spec argsspec[1];
32 public:
33  static const FixedPointType* instance();
34 
35  bool inherits( int type ) const;
36 
37  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
38  bool canMove( const ObjectTypeCalcer& ourobj ) const;
39  bool isFreelyTranslatable( const ObjectTypeCalcer& ourobj ) const;
40  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
41  const Coordinate moveReferencePoint( const ObjectTypeCalcer& ourobj ) const;
42  void move( ObjectTypeCalcer& ourobj, const Coordinate& to,
43  const KigDocument& ) const;
44  const ObjectImpType* resultId() const;
45 
46  QStringList specialActions() const;
47  void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& t,
48  KigPart& d, KigWidget& w, NormalMode& m ) const;
49 };
50 
51 class RelativePointType
52  : public ArgsParserObjectType
53 {
54  RelativePointType();
55  ~RelativePointType();
56 
57  static const ArgsParser::spec argsspec[1];
58 public:
59  static const RelativePointType* instance();
60 
61  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
62  bool canMove( const ObjectTypeCalcer& ourobj ) const;
63  bool isFreelyTranslatable( const ObjectTypeCalcer& ourobj ) const;
64  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
65  const Coordinate moveReferencePoint( const ObjectTypeCalcer& ourobj ) const;
66  void move( ObjectTypeCalcer& ourobj, const Coordinate& to,
67  const KigDocument& ) const;
68  const ObjectImpType* resultId() const;
69 
70 // QStringList specialActions() const;
71 // void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& t,
72 // KigPart& d, KigWidget& w, NormalMode& m ) const;
73 };
74 
75 class ConstrainedRelativePointType
76  : public ArgsParserObjectType
77 {
78  ConstrainedRelativePointType();
79  ~ConstrainedRelativePointType();
80 
81  static const ArgsParser::spec argsspec[1];
82 public:
83  static const ConstrainedRelativePointType* instance();
84 
85  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
86  bool canMove( const ObjectTypeCalcer& ourobj ) const;
87  bool isFreelyTranslatable( const ObjectTypeCalcer& ourobj ) const;
88  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
89  const Coordinate moveReferencePoint( const ObjectTypeCalcer& ourobj ) const;
90  void move( ObjectTypeCalcer& ourobj, const Coordinate& to,
91  const KigDocument& ) const;
92  const ObjectImpType* resultId() const;
93 };
94 
95 class CursorPointType
96  : public ObjectType
97 {
98  CursorPointType();
99  ~CursorPointType();
100 
101 public:
102  static const CursorPointType* instance();
103  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
104 
105  const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const;
106  bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const;
107  std::vector<ObjectCalcer*> sortArgs( const std::vector<ObjectCalcer*>& args ) const;
108  Args sortArgs( const Args& args ) const;
109  bool canMove( const ObjectTypeCalcer& ourobj ) const;
110  void move( ObjectTypeCalcer& ourobj, const Coordinate& to,
111  const KigDocument& ) const;
112  const ObjectImpType* resultId() const;
113 };
114 
115 class ConstrainedPointType
116  : public ArgsParserObjectType
117 {
118  ConstrainedPointType();
119  ~ConstrainedPointType();
120 public:
121  static const ConstrainedPointType* instance();
122 
123  bool inherits( int type ) const;
124 
125  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
126 
127  bool canMove( const ObjectTypeCalcer& ourobj ) const;
128  bool isFreelyTranslatable( const ObjectTypeCalcer& ourobj ) const;
129  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
130  const Coordinate moveReferencePoint( const ObjectTypeCalcer& ourobj ) const;
131  void move( ObjectTypeCalcer& ourobj, const Coordinate& to,
132  const KigDocument& ) const;
133  const ObjectImpType* resultId() const;
134 
135  QStringList specialActions() const;
136  void executeAction( int i, ObjectHolder&, ObjectTypeCalcer& o, KigPart& d, KigWidget& w,
137  NormalMode& m ) const;
138 };
139 
140 class MidPointType
141  : public ObjectABType
142 {
143  MidPointType();
144  ~MidPointType();
145 public:
146  static const MidPointType* instance();
147  // calcx was an overloaded calc, which produced a compilation warning
148  ObjectImp* calcx( const Coordinate& a, const Coordinate& b ) const;
149  const ObjectImpType* resultId() const;
150 };
151 
152 class MeasureTransportType
153  : public ObjectType
154 {
155  MeasureTransportType();
156  ~MeasureTransportType();
157 public:
158  static const MeasureTransportType* instance();
159 
160  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
161  const ObjectImpType* resultId() const;
162  const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const;
163  bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const;
164  std::vector<ObjectCalcer*> sortArgs( const std::vector<ObjectCalcer*>& args )const;
165  Args sortArgs( const Args& args ) const;
166 };
167 
168 class MeasureTransportTypeOld
169  : public ArgsParserObjectType
170 {
171  MeasureTransportTypeOld();
172  ~MeasureTransportTypeOld();
173 public:
174  static const MeasureTransportTypeOld* instance();
175 
176  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
177  const ObjectImpType* resultId() const;
178 };
179 
180 class PointByCoordsType
181  : public ArgsParserObjectType
182 {
183  PointByCoordsType();
184  ~PointByCoordsType();
185 public:
186  static const PointByCoordsType* instance();
187 
188  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
189  const ObjectImpType* resultId() const;
190 };
191 
192 class ProjectedPointType
193  : public ArgsParserObjectType
194 {
195  ProjectedPointType();
196  ~ProjectedPointType();
197 public:
198  static const ProjectedPointType* instance();
199 
200  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
201  const ObjectImpType * resultId() const;
202 };
203 
204 #endif
MeasureTransportType::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: point_type.cc:665
ProjectedPointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:848
MidPointType::calcx
ObjectImp * calcx(const Coordinate &a, const Coordinate &b) const
Definition: point_type.cc:288
MeasureTransportType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:660
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
RelativePointType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:483
RelativePointType::canMove
bool canMove(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:248
ConstrainedRelativePointType::move
void move(ObjectTypeCalcer &ourobj, const Coordinate &to, const KigDocument &) const
Definition: point_type.cc:531
MeasureTransportType::sortArgs
std::vector< ObjectCalcer * > sortArgs(const std::vector< ObjectCalcer * > &args) const
Definition: point_type.cc:692
ObjectABType
Definition: base_type.h:27
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
FixedPointType::executeAction
void executeAction(int i, ObjectHolder &o, ObjectTypeCalcer &t, KigPart &d, KigWidget &w, NormalMode &m) const
execute the i 'th action from the specialActions above.
Definition: point_type.cc:389
RelativePointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:326
CursorPointType::canMove
bool canMove(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:258
ConstrainedRelativePointType::canMove
bool canMove(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:556
ConstrainedPointType::move
void move(ObjectTypeCalcer &ourobj, const Coordinate &to, const KigDocument &) const
Definition: point_type.cc:211
ConstrainedPointType::executeAction
void executeAction(int i, ObjectHolder &, ObjectTypeCalcer &o, KigPart &d, KigWidget &w, NormalMode &m) const
execute the i 'th action from the specialActions above.
Definition: point_type.cc:423
circle_imp.h
ObjectTypeCalcer
This is an ObjectCalcer that uses one of the various ObjectType's to calculate its ObjectImp...
Definition: object_calcer.h:183
ConstrainedRelativePointType
Definition: point_type.h:75
FixedPointType::instance
static const FixedPointType * instance()
Definition: point_type.cc:309
FixedPointType
Definition: point_type.h:25
RelativePointType::instance
static const RelativePointType * instance()
Definition: point_type.cc:320
ConstrainedRelativePointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:518
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
ConstrainedPointType::canMove
bool canMove(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:228
ConstrainedRelativePointType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:561
FixedPointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:58
ConstrainedRelativePointType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:577
common.h
ConstrainedRelativePointType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:584
ObjectHolder
An ObjectHolder represents an object as it is known to the document.
Definition: object_holder.h:40
ConstrainedRelativePointType::instance
static const ConstrainedRelativePointType * instance()
Definition: point_type.cc:566
Args
std::vector< const ObjectImp * > Args
Definition: objects/common.h:47
CursorPointType::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: point_type.cc:347
ConstrainedPointType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:491
MeasureTransportType::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: point_type.cc:685
ConstrainedPointType
Definition: point_type.h:115
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
FixedPointType::move
void move(ObjectTypeCalcer &ourobj, const Coordinate &to, const KigDocument &) const
Definition: point_type.cc:158
QStringList
FixedPointType::canMove
bool canMove(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:238
ArgsParser::spec
Definition: argsparser.h:113
MidPointType
Definition: point_type.h:140
MeasureTransportTypeOld::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:756
CursorPointType::move
void move(ObjectTypeCalcer &ourobj, const Coordinate &to, const KigDocument &) const
Definition: point_type.cc:194
RelativePointType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:253
ObjectType
The ObjectType class is a thing that represents the "behaviour" for a certain type.
Definition: object_type.h:32
PointByCoordsType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:805
CursorPointType::sortArgs
std::vector< ObjectCalcer * > sortArgs(const std::vector< ObjectCalcer * > &args) const
Definition: point_type.cc:352
ConstrainedPointType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:233
CursorPointType
Definition: point_type.h:95
MidPointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:362
FixedPointType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:478
ConstrainedPointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:331
ConstrainedPointType::specialActions
QStringList specialActions() const
return i18n'd names for the special actions.
Definition: point_type.cc:375
MeasureTransportTypeOld
Definition: point_type.h:168
ConstrainedPointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:130
RelativePointType::move
void move(ObjectTypeCalcer &ourobj, const Coordinate &to, const KigDocument &) const
Definition: point_type.cc:174
PointByCoordsType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:765
RelativePointType
Definition: point_type.h:51
FixedPointType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:243
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
CursorPointType::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: point_type.cc:336
MeasureTransportTypeOld::instance
static const MeasureTransportTypeOld * instance()
Definition: point_type.cc:750
ConstrainedPointType::inherits
bool inherits(int type) const
Definition: point_type.cc:293
MidPointType::instance
static const MidPointType * instance()
Definition: point_type.cc:282
FixedPointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:315
MeasureTransportType::instance
static const MeasureTransportType * instance()
Definition: point_type.cc:654
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
KigPart
This is a "Part".
Definition: kig_part.h:68
ProjectedPointType
Definition: point_type.h:192
ProjectedPointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:835
CursorPointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:125
MeasureTransportType
Definition: point_type.h:152
PointByCoordsType
Definition: point_type.h:180
FixedPointType::specialActions
QStringList specialActions() const
return i18n'd names for the special actions.
Definition: point_type.cc:367
ConstrainedPointType::instance
static const ConstrainedPointType * instance()
Definition: point_type.cc:298
base_type.h
RelativePointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:86
ConstrainedPointType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:472
PointByCoordsType::instance
static const PointByCoordsType * instance()
Definition: point_type.cc:799
ConstrainedRelativePointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:572
RelativePointType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:465
NormalMode
Definition: normal.h:26
MeasureTransportTypeOld::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:707
ProjectedPointType::instance
static const ProjectedPointType * instance()
Definition: point_type.cc:829
FixedPointType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:459
CursorPointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:115
CursorPointType::instance
static const CursorPointType * instance()
Definition: point_type.cc:109
MeasureTransportType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:596
FixedPointType::inherits
bool inherits(int type) const
Definition: point_type.cc:304
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