line_imp.h Source File (Kig Python Scripting API)

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

line_imp.h
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_LINE_IMP_H
19#define KIG_OBJECTS_LINE_IMP_H
20
21#include "curve_imp.h"
22
23#include "../misc/common.h"
24
25class LineData;
26
31 class AbstractLineImp
32 : public CurveImp
33{
34protected:
35 LineData mdata;
36 AbstractLineImp( const LineData& d );
37 AbstractLineImp( const Coordinate& a, const Coordinate& b );
38
39public:
40 typedef CurveImp Parent;
45 static const ObjectImpType* stype();
46
47 ~AbstractLineImp();
48
49 bool inRect( const Rect& r, int width, const KigWidget& ) const;
50
51 const uint numberOfProperties() const;
52 const QCStringList properties() const;
53 const QCStringList propertiesInternalNames() const;
54 ObjectImp* property( uint which, const KigDocument& d ) const;
55 const char* iconForProperty( uint which ) const;
56 const ObjectImpType* impRequirementForProperty( uint which ) const;
57 bool isPropertyDefinedOnOrThroughThisImp( uint which ) const;
58
64 double slope() const;
69 const TQString equationString() const;
73 LineData data() const;
74
75 bool equals( const ObjectImp& rhs ) const;
76};
77
81 class SegmentImp
82 : public AbstractLineImp
83{
84public:
85 typedef AbstractLineImp Parent;
90 static const ObjectImpType* stype();
91
95 SegmentImp( const Coordinate& a, const Coordinate& b );
99 SegmentImp( const LineData& d );
100
101 void draw( KigPainter& p ) const;
102 bool contains( const Coordinate& p, int width, const KigWidget& si ) const;
103 Rect surroundingRect() const;
104
105 ObjectImp* transform( const Transformation& ) const;
106
107 const Coordinate getPoint( double param, const KigDocument& ) const;
108 double getParam( const Coordinate&, const KigDocument& ) const;
109
110 const uint numberOfProperties() const;
111 const QCStringList properties() const;
112 const QCStringList propertiesInternalNames() const;
113 ObjectImp* property( uint which, const KigDocument& d ) const;
114 const char* iconForProperty( uint which ) const;
115 const ObjectImpType* impRequirementForProperty( uint which ) const;
116
117 SegmentImp* copy() const;
118
122 double length() const;
123
124 const ObjectImpType* type() const;
125 void visit( ObjectImpVisitor* vtor ) const;
126
127 bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
128 bool internalContainsPoint( const Coordinate& p, double threshold ) const;
129};
130
136 class RayImp
137 : public AbstractLineImp
138{
139public:
140 typedef AbstractLineImp Parent;
145 static const ObjectImpType* stype();
146
150 RayImp( const Coordinate& a, const Coordinate& b );
154 RayImp( const LineData& d );
155
156 void draw( KigPainter& p ) const;
157 bool contains( const Coordinate& p, int width, const KigWidget& si ) const;
158 Rect surroundingRect() const;
159
160 ObjectImp* transform( const Transformation& ) const;
161
162 const Coordinate getPoint( double param, const KigDocument& ) const;
163 double getParam( const Coordinate&, const KigDocument& ) const;
164
165 RayImp* copy() const;
166
167 const ObjectImpType* type() const;
168 void visit( ObjectImpVisitor* vtor ) const;
169
170 bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
171 bool internalContainsPoint( const Coordinate& p, double threshold ) const;
172};
173
177 class LineImp
178 : public AbstractLineImp
179{
180public:
181 typedef AbstractLineImp Parent;
182
187 static const ObjectImpType* stype();
188
192 LineImp( const Coordinate& a, const Coordinate& b );
196 LineImp( const LineData& d );
197 void draw( KigPainter& p ) const;
198 bool contains( const Coordinate& p, int width, const KigWidget& si ) const;
199 Rect surroundingRect() const;
200
201 ObjectImp* transform( const Transformation& ) const;
202
203 const Coordinate getPoint( double param, const KigDocument& ) const;
204 double getParam( const Coordinate&, const KigDocument& ) const;
205
206 LineImp* copy() const;
207
208 const ObjectImpType* type() const;
209 void visit( ObjectImpVisitor* vtor ) const;
210
211 bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
212 bool internalContainsPoint( const Coordinate& p, double threshold ) const;
213};
214
215#endif
AbstractLine::slope
double slope() const
Get the slope of this AbstractLine.
AbstractLine::equationString
const TQString equationString() const
Get a string containing the equation of this line in the form "y= a * x + b ".
AbstractLine::equals
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
AbstractLine::data
LineData data() const
Get the LineData for this AbstractLine.
AbstractLine::stype
static const ObjectType * stype()
Returns the ObjectType representing the AbstractLine type.
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
Line::stype
static const ObjectType * stype()
Returns the ObjectType representing the Line type.
Line::Line
Line(const LineData &d)
Construct a Line from a LineData.
Line::transform
Object * transform(const Transformation &) const
Return this Object, transformed by the transformation t.
Line::containsPoint
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
Line::copy
Line * copy() const
Returns a copy of this Object.
Line::Line
Line(const Coordinate &a, const Coordinate &b)
Construct a Line going through points a and b.
Line::type
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
ObjectType
Instances of this class represent a certain Object type.
Definition object_imp.h:89
Ray::type
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
Ray::copy
Ray * copy() const
Returns a copy of this Object.
Ray::Ray
Ray(const Coordinate &a, const Coordinate &b)
Construct a ray, starting at a, and going through b.
Ray::transform
Object * transform(const Transformation &) const
Return this Object, transformed by the transformation t.
Ray::stype
static const ObjectType * stype()
Returns the ObjectType representing the Ray type.
Ray::containsPoint
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
Ray::Ray
Ray(const LineData &d)
Construct a ray from a LineData.
Segment::length
double length() const
Get the length of this segment.
Segment::Segment
Segment(const LineData &d)
Construct a new segment from a LineData.
Segment::stype
static const ObjectType * stype()
Returns the ObjectType representing the Segment type.
Segment::copy
Segment * copy() const
Returns a copy of this Object.
Segment::type
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
Segment::containsPoint
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
Segment::Segment
Segment(const Coordinate &a, const Coordinate &b)
Construct a new segment from point a to point b.
Segment::transform
Object * transform(const Transformation &) const
Return this Object, transformed by the transformation t.
Transformation
Class representing a transformation.
Definition kigtransform.h:38
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