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

kig

  • sources
  • kde-4.12
  • kdeedu
  • kig
  • objects
other_imp.h
Go to the documentation of this file.
1 // Copyright (C) 2003 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_OTHER_IMP_H
19 #define KIG_OBJECTS_OTHER_IMP_H
20 
21 #include "curve_imp.h"
22 #include "../misc/common.h"
23 #include "../misc/coordinate.h"
24 
28 class AngleImp
29  : public ObjectImp
30 {
31  static const int radius;
32  const Coordinate mpoint;
33  const double mstartangle;
34  const double mangle;
35  bool mmarkRightAngle: 1;
36 public:
37  typedef ObjectImp Parent;
41  static const ObjectImpType* stype();
42 
47  AngleImp( const Coordinate& pt, double start_angle_in_radials,
48  double angle_in_radials, bool markRightAngle );
49  ~AngleImp();
50 
51  ObjectImp* transform( const Transformation& ) const;
52 
53  void draw( KigPainter& p ) const;
54  bool contains( const Coordinate& p, int width, const KigWidget& ) const;
55  bool inRect( const Rect& r, int width, const KigWidget& ) const;
56  Rect surroundingRect() const;
57 
58  Coordinate attachPoint() const;
59  int numberOfProperties() const;
60  const QByteArrayList properties() const;
61  const QByteArrayList propertiesInternalNames() const;
62  ObjectImp* property( int which, const KigDocument& w ) const;
63  const char* iconForProperty( int which ) const;
64  const ObjectImpType* impRequirementForProperty( int which ) const;
65  bool isPropertyDefinedOnOrThroughThisImp( int which ) const;
66 
67  ObjectImp* copy() const;
68 
72  double size() const;
73  const ObjectImpType* type() const;
74  void visit( ObjectImpVisitor* vtor ) const;
75 
79  const Coordinate point() const { return mpoint; }
83  double startAngle() const { return mstartangle; }
87  double angle() const { return mangle; }
88 
89  bool markRightAngle() const { return mmarkRightAngle; }
90 
91  void setMarkRightAngle( bool markRightAngle ) { mmarkRightAngle = markRightAngle; }
92 
93  bool equals( const ObjectImp& rhs ) const;
94 };
95 
99 class VectorImp
100  : public CurveImp
101 {
102  LineData mdata;
103 public:
104  typedef CurveImp Parent;
108  static const ObjectImpType* stype();
109 
113  VectorImp( const Coordinate& a, const Coordinate& b );
114  ~VectorImp();
115 
116  ObjectImp* transform( const Transformation& ) const;
117 
118  const Coordinate getPoint( double param, const KigDocument& ) const;
119  double getParam( const Coordinate&, const KigDocument& ) const;
120 
121  void draw( KigPainter& p ) const;
122  bool contains( const Coordinate& p, int width, const KigWidget& ) const;
123  bool inRect( const Rect& r, int width, const KigWidget& ) const;
124  Rect surroundingRect() const;
125 
126  int numberOfProperties() const;
127  const QByteArrayList properties() const;
128  const QByteArrayList propertiesInternalNames() const;
129  ObjectImp* property( int which, const KigDocument& w ) const;
130  const char* iconForProperty( int which ) const;
131  const ObjectImpType* impRequirementForProperty( int which ) const;
132  bool isPropertyDefinedOnOrThroughThisImp( int which ) const;
133 
134  VectorImp* copy() const;
135 
139  const Coordinate dir() const;
143  const Coordinate a() const;
147  const Coordinate b() const;
151  double length() const;
155  LineData data() const;
156 
157  const ObjectImpType* type() const;
158  void visit( ObjectImpVisitor* vtor ) const;
159 
160  bool equals( const ObjectImp& rhs ) const;
161 
162  bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
163  bool internalContainsPoint( const Coordinate& p, double threshold ) const;
164 };
165 
169 class ArcImp
170  : public CurveImp
171 {
172  Coordinate mcenter;
173  double mradius;
174  double msa;
175  double ma;
176 public:
177  typedef CurveImp Parent;
181  static const ObjectImpType* stype();
182 
187  ArcImp( const Coordinate& center, const double radius,
188  const double startangle, const double angle );
189  ~ArcImp();
190  ArcImp* copy() const;
191 
192  ObjectImp* transform( const Transformation& t ) const;
193 
194  void draw( KigPainter& p ) const;
195  bool contains( const Coordinate& p, int width, const KigWidget& w ) const;
196  bool inRect( const Rect& r, int width, const KigWidget& si ) const;
197  Rect surroundingRect() const;
198  bool valid() const;
199 
200  int numberOfProperties() const;
201  const QByteArrayList properties() const;
202  const QByteArrayList propertiesInternalNames() const;
203  ObjectImp* property( int which, const KigDocument& d ) const;
204  const char* iconForProperty( int which ) const;
205  const ObjectImpType* impRequirementForProperty( int which ) const;
206  bool isPropertyDefinedOnOrThroughThisImp( int which ) const;
207 
208  const ObjectImpType* type() const;
209  void visit( ObjectImpVisitor* vtor ) const;
210 
211  double getParam( const Coordinate& c, const KigDocument& d ) const;
212  const Coordinate getPoint( double p, const KigDocument& d ) const;
213 
217  const Coordinate center() const;
221  double radius() const;
225  double startAngle() const;
229  double angle() const;
233  Coordinate firstEndPoint() const;
237  Coordinate secondEndPoint() const;
241  double sectorSurface() const;
242 
243  bool equals( const ObjectImp& rhs ) const;
244 
245  bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
246  bool internalContainsPoint( const Coordinate& p, double threshold ) const;
247 };
248 
249 #endif
ArcImp::~ArcImp
~ArcImp()
Definition: other_imp.cc:333
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
AngleImp::AngleImp
AngleImp(const Coordinate &pt, double start_angle_in_radials, double angle_in_radials, bool markRightAngle)
Construct an Angle with a given center, start angle and dimension (both in radians).
Definition: other_imp.cc:64
VectorImp::data
LineData data() const
Get the LineData for this vector.
Definition: other_imp.cc:771
AngleImp::~AngleImp
~AngleImp()
Definition: other_imp.cc:42
LineData
Simple class representing a line.
Definition: misc/common.h:49
ArcImp::sectorSurface
double sectorSurface() const
Return the size of the sector surface of this arc.
Definition: other_imp.cc:493
VectorImp::Parent
CurveImp Parent
Definition: other_imp.h:104
ArcImp::numberOfProperties
int numberOfProperties() const
Definition: other_imp.cc:397
AngleImp::point
const Coordinate point() const
Return the center of this angle.
Definition: other_imp.h:79
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
VectorImp::internalContainsPoint
bool internalContainsPoint(const Coordinate &p, double threshold) const
Definition: other_imp.cc:766
VectorImp::impRequirementForProperty
const ObjectImpType * impRequirementForProperty(int which) const
Definition: other_imp.cc:252
ArcImp::firstEndPoint
Coordinate firstEndPoint() const
Return the start point of this arc.
Definition: other_imp.cc:552
VectorImp::VectorImp
VectorImp(const Coordinate &a, const Coordinate &b)
Construct a Vector with a given start point and end point.
Definition: other_imp.cc:191
VectorImp::getParam
double getParam(const Coordinate &, const KigDocument &) const
Definition: other_imp.cc:747
VectorImp::dir
const Coordinate dir() const
Return the direction of this vector.
Definition: other_imp.cc:300
AngleImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: other_imp.cc:582
VectorImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the VectorImp type.
Definition: other_imp.cc:613
AngleImp::transform
ObjectImp * transform(const Transformation &) const
Return this ObjectImp, transformed by the transformation t.
Definition: other_imp.cc:46
VectorImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: other_imp.cc:651
VectorImp::length
double length() const
Return the length of this vector.
Definition: other_imp.cc:315
ArcImp::valid
bool valid() const
Definition: other_imp.cc:392
VectorImp::draw
void draw(KigPainter &p) const
Definition: other_imp.cc:208
ArcImp::radius
double radius() const
Return the radius of this arc.
Definition: other_imp.cc:537
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
AngleImp::inRect
bool inRect(const Rect &r, int width, const KigWidget &) const
Definition: other_imp.cc:104
VectorImp::surroundingRect
Rect surroundingRect() const
Definition: other_imp.cc:718
VectorImp
An ObjectImp representing a vector.
Definition: other_imp.h:99
AngleImp::propertiesInternalNames
const QByteArrayList propertiesInternalNames() const
Definition: other_imp.cc:120
VectorImp::iconForProperty
const char * iconForProperty(int which) const
Definition: other_imp.cc:259
ArcImp::contains
bool contains(const Coordinate &p, int width, const KigWidget &w) const
Definition: other_imp.cc:381
ArcImp::Parent
CurveImp Parent
Definition: other_imp.h:177
VectorImp::getPoint
const Coordinate getPoint(double param, const KigDocument &) const
Definition: other_imp.cc:742
ArcImp::iconForProperty
const char * iconForProperty(int which) const
Definition: other_imp.cc:435
KigPainter
KigPainter is an extended QPainter.
Definition: kigpainter.h:51
ArcImp::propertiesInternalNames
const QByteArrayList propertiesInternalNames() const
Definition: other_imp.cc:419
ArcImp::angle
double angle() const
Return the dimension in radians of this arc.
Definition: other_imp.cc:547
VectorImp::property
ObjectImp * property(int which, const KigDocument &w) const
Definition: other_imp.cc:277
Transformation
Class representing a transformation.
Definition: kigtransform.h:37
ArcImp::inRect
bool inRect(const Rect &r, int width, const KigWidget &si) const
Definition: other_imp.cc:386
ArcImp::transform
ObjectImp * transform(const Transformation &t) const
Return this ObjectImp, transformed by the transformation t.
Definition: other_imp.cc:342
ArcImp::secondEndPoint
Coordinate secondEndPoint() const
Return the end point of this arc.
Definition: other_imp.cc:558
AngleImp::markRightAngle
bool markRightAngle() const
Definition: other_imp.h:89
AngleImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: other_imp.cc:646
AngleImp::angle
double angle() const
Return the dimension in radians of this angle.
Definition: other_imp.h:87
VectorImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: other_imp.cc:310
ArcImp::getPoint
const Coordinate getPoint(double p, const KigDocument &d) const
Definition: other_imp.cc:525
AngleImp::surroundingRect
Rect surroundingRect() const
Definition: other_imp.cc:713
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
ArcImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: other_imp.cc:574
AngleImp::property
ObjectImp * property(int which, const KigDocument &w) const
Definition: other_imp.cc:162
ArcImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the ArcImp type.
Definition: other_imp.cc:629
ArcImp::center
const Coordinate center() const
Return the center of this arc.
Definition: other_imp.cc:532
ArcImp::startAngle
double startAngle() const
Return the start angle in radians of this arc.
Definition: other_imp.cc:542
AngleImp::numberOfProperties
int numberOfProperties() const
Definition: other_imp.cc:115
AngleImp::Parent
ObjectImp Parent
Definition: other_imp.h:37
AngleImp::properties
const QByteArrayList properties() const
Definition: other_imp.cc:130
VectorImp::a
const Coordinate a() const
Return the start point of this vector.
Definition: other_imp.cc:564
ArcImp::isPropertyDefinedOnOrThroughThisImp
bool isPropertyDefinedOnOrThroughThisImp(int which) const
Definition: other_imp.cc:683
AngleImp::startAngle
double startAngle() const
Return the start angle in radians of this angle.
Definition: other_imp.h:83
ArcImp::getParam
double getParam(const Coordinate &c, const KigDocument &d) const
Definition: other_imp.cc:511
VectorImp::numberOfProperties
int numberOfProperties() const
Definition: other_imp.cc:223
ArcImp::internalContainsPoint
bool internalContainsPoint(const Coordinate &p, double threshold) const
Definition: other_imp.cc:666
AngleImp::attachPoint
Coordinate attachPoint() const
Returns a reference point where to attach labels; when this returns an invalidCoord then the attachme...
Definition: other_imp.cc:110
AngleImp::setMarkRightAngle
void setMarkRightAngle(bool markRightAngle)
Definition: other_imp.h:91
VectorImp::inRect
bool inRect(const Rect &r, int width, const KigWidget &) const
Definition: other_imp.cc:218
VectorImp::propertiesInternalNames
const QByteArrayList propertiesInternalNames() const
Definition: other_imp.cc:228
AngleImp::iconForProperty
const char * iconForProperty(int which) const
Definition: other_imp.cc:147
VectorImp::isPropertyDefinedOnOrThroughThisImp
bool isPropertyDefinedOnOrThroughThisImp(int which) const
Definition: other_imp.cc:678
ArcImp::copy
ArcImp * copy() const
Returns a copy of this ObjectImp.
Definition: other_imp.cc:337
AngleImp::copy
ObjectImp * copy() const
Returns a copy of this ObjectImp.
Definition: other_imp.cc:186
VectorImp::contains
bool contains(const Coordinate &p, int width, const KigWidget &) const
Definition: other_imp.cc:213
AngleImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the AngleImp type.
Definition: other_imp.cc:597
ArcImp::draw
void draw(KigPainter &p) const
Definition: other_imp.cc:376
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
ArcImp::property
ObjectImp * property(int which, const KigDocument &d) const
Definition: other_imp.cc:464
ArcImp::impRequirementForProperty
const ObjectImpType * impRequirementForProperty(int which) const
Definition: other_imp.cc:498
ArcImp
An ObjectImp representing an arc.
Definition: other_imp.h:169
ArcImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: other_imp.cc:656
ArcImp::containsPoint
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
Definition: other_imp.cc:661
ArcImp::surroundingRect
Rect surroundingRect() const
Definition: other_imp.cc:723
AngleImp::draw
void draw(KigPainter &p) const
Definition: other_imp.cc:52
QByteArrayList
QList< QByteArray > QByteArrayList
Definition: objects/common.h:50
AngleImp::contains
bool contains(const Coordinate &p, int width, const KigWidget &) const
Definition: other_imp.cc:71
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
VectorImp::transform
ObjectImp * transform(const Transformation &) const
Return this ObjectImp, transformed by the transformation t.
Definition: other_imp.cc:200
VectorImp::~VectorImp
~VectorImp()
Definition: other_imp.cc:196
VectorImp::b
const Coordinate b() const
Return the end point of this vector.
Definition: other_imp.cc:569
AngleImp::isPropertyDefinedOnOrThroughThisImp
bool isPropertyDefinedOnOrThroughThisImp(int which) const
Definition: other_imp.cc:671
curve_imp.h
VectorImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: other_imp.cc:590
AngleImp::size
double size() const
Return the size in radians of this angle.
Definition: other_imp.cc:181
VectorImp::containsPoint
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
Definition: other_imp.cc:761
ArcImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: other_imp.cc:506
AngleImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: other_imp.cc:305
ObjectImpVisitor
Definition: object_imp.h:56
ArcImp::properties
const QByteArrayList properties() const
Definition: other_imp.cc:402
VectorImp::copy
VectorImp * copy() const
Returns a copy of this ObjectImp.
Definition: other_imp.cc:295
AngleImp
An ObjectImp representing an angle.
Definition: other_imp.h:28
ArcImp::ArcImp
ArcImp(const Coordinate &center, const double radius, const double startangle, const double angle)
Construct an Arc with a given center, radius, start angle and dimension (both in radians).
Definition: other_imp.cc:320
CurveImp
This class represents a curve: something which is composed of points, like a line, a circle, a locus.
Definition: curve_imp.h:27
AngleImp::impRequirementForProperty
const ObjectImpType * impRequirementForProperty(int which) const
Definition: other_imp.cc:140
VectorImp::properties
const QByteArrayList properties() const
Definition: other_imp.cc:240
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:39 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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