other_imp.h Source File (Kig Python Scripting API)

| # Kig Python Scripting API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members

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;
34public:
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
56 Coordinate attachPoint() const;
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;
97public:
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;
170public:
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;
227 Coordinate firstEndPoint() const;
231 Coordinate secondEndPoint() 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
Angle::point
const Coordinate point() const
Return the center of this angle.
Definition other_imp.h:77
Angle::size
const double size() const
Return the size in radians of this angle.
Angle::copy
Object * copy() const
Returns a copy of this Object.
Angle::transform
Object * transform(const Transformation &) const
Return this Object, transformed by the transformation t.
Angle::Angle
Angle(const Coordinate &pt, double start_angle_in_radials, double angle_in_radials)
Construct an Angle with a given center, start angle and dimension (both in radians).
Angle::equals
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
Angle::attachPoint
Coordinate attachPoint() const
Returns a reference point where to attach labels; when this returns an invalidCoord then the attachme...
Angle::type
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
Angle::stype
static const ObjectType * stype()
Returns the ObjectType representing the Angle type.
Angle::angle
const double angle() const
Return the dimension in radians of this angle.
Definition other_imp.h:85
Angle::startAngle
const double startAngle() const
Return the start angle in radians of this angle.
Definition other_imp.h:81
Arc::equals
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
Arc::transform
Object * transform(const Transformation &t) const
Return this Object, transformed by the transformation t.
Arc::stype
static const ObjectType * stype()
Returns the ObjectType representing the Arc type.
Arc::radius
double radius() const
Return the radius of this arc.
Arc::angle
double angle() const
Return the dimension in radians of this arc.
Arc::type
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
Arc::center
const Coordinate center() const
Return the center of this arc.
Arc::firstEndPoint
Coordinate firstEndPoint() const
Return the start point of this arc.
Arc::Arc
Arc(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).
Arc::copy
Arc * copy() const
Returns a copy of this Object.
Arc::secondEndPoint
Coordinate secondEndPoint() const
Return the end point of this arc.
Arc::containsPoint
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
Arc::startAngle
double startAngle() const
Return the start angle in radians of this arc.
Arc::sectorSurface
const double sectorSurface() const
Return the size of the sector surface of this arc.
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components.
Definition coordinate.h:34
Curve
This class represents a curve: something which is composed of points, like a line,...
Definition curve_imp.h:29
LineData
Simple class representing a line.
Definition common.h:49
ObjectType
Instances of this class represent a certain Object type.
Definition object_imp.h:89
Object::valid
bool valid() const
Returns true if this is a valid Object.
Transformation
Class representing a transformation.
Definition kigtransform.h:38
Vector::type
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
Vector::dir
const Coordinate dir() const
Return the direction of this vector.
Vector::stype
static const ObjectType * stype()
Returns the ObjectType representing the Vector type.
Vector::transform
Object * transform(const Transformation &) const
Return this Object, transformed by the transformation t.
Vector::containsPoint
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
Vector::Vector
Vector(const Coordinate &a, const Coordinate &b)
Construct a Vector with a given start point and end point.
Vector::copy
Vector * copy() const
Returns a copy of this Object.
Vector::data
LineData data() const
Get the LineData for this vector.
Vector::b
const Coordinate b() const
Return the end point of this vector.
Vector::length
const double length() const
Return the length of this vector.
Vector::a
const Coordinate a() const
Return the start point of this vector.
Vector::equals
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
This file is part of the documentation for tdelibs .
Documentation copyright © 1996-2002 the KDE developers.
Generated on by doxygen 1.16.1 written by Dimitri van Heesch, © 1997-2001