Kig Python Scripting API Documentation

other_imp.h
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  const Coordinate mpoint;
32  const double mstartangle;
33  const double mangle;
34 public:
35  typedef ObjectImp Parent;
39  static const ObjectImpType* stype();
40 
45  AngleImp( const Coordinate& pt, double start_angle_in_radials,
46  double angle_in_radials );
47  ~AngleImp();
48 
49  ObjectImp* transform( const Transformation& ) const;
50 
51  void draw( KigPainter& p ) const;
52  bool contains( const Coordinate& p, int width, const KigWidget& ) const;
53  bool inRect( const Rect& r, int width, const KigWidget& ) const;
54  Rect surroundingRect() const;
55 
57  const uint numberOfProperties() const;
58  const QCStringList properties() const;
59  const QCStringList propertiesInternalNames() const;
60  ObjectImp* property( uint which, const KigDocument& w ) const;
61  const char* iconForProperty( uint which ) const;
62  const ObjectImpType* impRequirementForProperty( uint which ) const;
63  bool isPropertyDefinedOnOrThroughThisImp( uint which ) const;
64 
65  ObjectImp* copy() const;
66 
70  const double size() const;
71  const ObjectImpType* type() const;
72  void visit( ObjectImpVisitor* vtor ) const;
73 
77  const Coordinate point() const { return mpoint; }
81  const double startAngle() const { return mstartangle; }
85  const double angle() const { return mangle; }
86 
87  bool equals( const ObjectImp& rhs ) const;
88 };
89 
93 class VectorImp
94  : public CurveImp
95 {
96  LineData mdata;
97 public:
98  typedef CurveImp Parent;
102  static const ObjectImpType* stype();
103 
107  VectorImp( const Coordinate& a, const Coordinate& b );
108  ~VectorImp();
109 
110  ObjectImp* transform( const Transformation& ) const;
111 
112  const Coordinate getPoint( double param, const KigDocument& ) const;
113  double getParam( const Coordinate&, const KigDocument& ) const;
114 
115  void draw( KigPainter& p ) const;
116  bool contains( const Coordinate& p, int width, const KigWidget& ) const;
117  bool inRect( const Rect& r, int width, const KigWidget& ) const;
118  Rect surroundingRect() const;
119 
120  const uint numberOfProperties() const;
121  const QCStringList properties() const;
122  const QCStringList propertiesInternalNames() const;
123  ObjectImp* property( uint which, const KigDocument& w ) const;
124  const char* iconForProperty( uint which ) const;
125  const ObjectImpType* impRequirementForProperty( uint which ) const;
126  bool isPropertyDefinedOnOrThroughThisImp( uint which ) const;
127 
128  VectorImp* copy() const;
129 
133  const Coordinate dir() const;
137  const Coordinate a() const;
141  const Coordinate b() const;
145  const double length() const;
149  LineData data() const;
150 
151  const ObjectImpType* type() const;
152  void visit( ObjectImpVisitor* vtor ) const;
153 
154  bool equals( const ObjectImp& rhs ) const;
155 
156  bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
157  bool internalContainsPoint( const Coordinate& p, double threshold ) const;
158 };
159 
163 class ArcImp
164  : public CurveImp
165 {
166  Coordinate mcenter;
167  double mradius;
168  double msa;
169  double ma;
170 public:
171  typedef CurveImp Parent;
175  static const ObjectImpType* stype();
176 
181  ArcImp( const Coordinate& center, const double radius,
182  const double startangle, const double angle );
183  ~ArcImp();
184  ArcImp* copy() const;
185 
186  ObjectImp* transform( const Transformation& t ) const;
187 
188  void draw( KigPainter& p ) const;
189  bool contains( const Coordinate& p, int width, const KigWidget& w ) const;
190  bool inRect( const Rect& r, int width, const KigWidget& si ) const;
191  Rect surroundingRect() const;
192  bool valid() const;
193 
194  const uint numberOfProperties() const;
195  const QCStringList properties() const;
196  const QCStringList propertiesInternalNames() const;
197  ObjectImp* property( uint which, const KigDocument& d ) const;
198  const char* iconForProperty( uint which ) const;
199  const ObjectImpType* impRequirementForProperty( uint which ) const;
200  bool isPropertyDefinedOnOrThroughThisImp( uint which ) const;
201 
202  const ObjectImpType* type() const;
203  void visit( ObjectImpVisitor* vtor ) const;
204 
205  double getParam( const Coordinate& c, const KigDocument& d ) const;
206  const Coordinate getPoint( double p, const KigDocument& d ) const;
207 
211  const Coordinate center() const;
215  double radius() const;
219  double startAngle() const;
223  double angle() const;
235  const double sectorSurface() const;
236 
237  bool equals( const ObjectImp& rhs ) const;
238 
239  bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
240  bool internalContainsPoint( const Coordinate& p, double threshold ) const;
241 };
242 
243 #endif
Object * copy() const
Returns a copy of this Object.
const Coordinate point() const
Return the center of this angle.
Definition: other_imp.h:77
const double size() const
Return the size in radians of this angle.
static const ObjectType * stype()
Returns the ObjectType representing the Angle type.
Object * transform(const Transformation &) const
Return this Object, transformed by the transformation t.
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
Coordinate attachPoint() const
Returns a reference point where to attach labels; when this returns an invalidCoord then the attachme...
const double angle() const
Return the dimension in radians of this angle.
Definition: other_imp.h:85
const double startAngle() const
Return the start angle in radians of this angle.
Definition: other_imp.h:81
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
Arc * copy() const
Returns a copy of this Object.
double radius() const
Return the radius of this arc.
double angle() const
Return the dimension in radians of this arc.
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
const Coordinate center() const
Return the center of this arc.
static const ObjectType * stype()
Returns the ObjectType representing the Arc type.
Object * transform(const Transformation &t) const
Return this Object, transformed by the transformation t.
Coordinate firstEndPoint() const
Return the start point of this arc.
Coordinate secondEndPoint() const
Return the end point of this arc.
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
double startAngle() const
Return the start angle in radians of this arc.
const double sectorSurface() const
Return the size of the sector surface of this arc.
The Coordinate class is the basic class representing a 2D location by its x and y components.
Definition: coordinate.h:34
Simple class representing a line.
Definition: common.h:60
The Object class represents the behaviour of an object after it is calculated.
Definition: object_imp.h:219
Class representing a transformation.
Definition: kigtransform.h:38
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
Vector * copy() const
Returns a copy of this Object.
const Coordinate dir() const
Return the direction of this vector.
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
LineData data() const
Get the LineData for this vector.
Object * transform(const Transformation &) const
Return this Object, transformed by the transformation t.
static const ObjectType * stype()
Returns the ObjectType representing the Vector type.
const Coordinate b() const
Return the end point of this vector.
const double length() const
Return the length of this vector.
const Coordinate a() const
Return the start point of this vector.
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
KDE Logo
This file is part of the documentation for tdelibs .
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed May 15 2024 03:39:42 by doxygen 1.9.1 written by Dimitri van Heesch, © 1997-2001