Kig Python Scripting API Documentation

conic_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_CONIC_IMP_H
19#define KIG_OBJECTS_CONIC_IMP_H
20
21#include "curve_imp.h"
22
23#include "../misc/conic-common.h"
24
38class ConicImp
39 : public CurveImp
40{
41protected:
42 ConicImp();
43 ~ConicImp();
44public:
45 typedef CurveImp Parent;
49 static const ObjectImpType* stype();
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 bool valid() const;
57 Rect surroundingRect() const;
58
59 const uint numberOfProperties() const;
60 const ObjectImpType* impRequirementForProperty( uint which ) const;
61 bool isPropertyDefinedOnOrThroughThisImp( uint which ) const;
62 const QCStringList properties() const;
63 const QCStringList propertiesInternalNames() const;
64 const char* iconForProperty( uint which ) const;
65 ObjectImp* property( uint which, const KigDocument& w ) const;
66
67 double getParam( const Coordinate& point, const KigDocument& ) const;
68 const Coordinate getPoint( double param, const KigDocument& ) const;
69
70 // information about ourselves.. These are all virtual, because a
71 // trivial subclass like CircleImp can override these with trivial
72 // versions..
73
81 virtual int conicType() const;
85 virtual TQString conicTypeString() const;
90 virtual TQString cartesianEquationString( const KigDocument& w ) const;
96 virtual TQString polarEquationString( const KigDocument& w ) const;
100 virtual const ConicCartesianData cartesianData() const;
104 virtual const ConicPolarData polarData() const = 0;
108 virtual Coordinate focus1() const;
112 virtual Coordinate focus2() const;
113
114 const ObjectImpType* type() const;
115 void visit( ObjectImpVisitor* vtor ) const;
116
117 bool equals( const ObjectImp& rhs ) const;
118
119 bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
120 bool internalContainsPoint( const Coordinate& p, double threshold ) const;
121};
122
127class ConicImpCart
128 : public ConicImp
129{
130 ConicCartesianData mcartdata;
131 ConicPolarData mpolardata;
132public:
133 ConicImpCart( const ConicCartesianData& data );
134 ~ConicImpCart();
135 ConicImpCart* copy() const;
136
139};
140
145class ConicImpPolar
146 : public ConicImp
147{
148 ConicPolarData mdata;
149public:
150 ConicImpPolar( const ConicPolarData& data );
151 ~ConicImpPolar();
152 ConicImpPolar* copy() const;
153
155};
156
157#endif
An implementation of Conic to be used when only the cartesian equation of the conic is known.
Definition: conic_imp.h:129
const ConicPolarData polarData() const
Return the polar representation of this conic.
ConicCart * copy() const
Returns a copy of this Object.
const ConicCartesianData cartesianData() const
Return the cartesian representation of this conic.
Cartesian Conic Data.
Definition: conic-common.h:38
This class represents an equation of a conic in the form .
Definition: conic-common.h:86
An implementation of Conic to be used when only the cartesian equation of the conic is known.
Definition: conic_imp.h:147
const ConicPolarData polarData() const
Return the polar representation of this conic.
ConicPolar * copy() const
Returns a copy of this Object.
An Object representing a conic.
Definition: conic_imp.h:40
virtual TQString conicTypeString() const
A string containing "Hyperbola", "Parabola" or "Ellipse".
virtual int conicType() const
Type of conic.
virtual Coordinate focus2() const
Return the second focus of this conic.
virtual const ConicPolarData polarData() const =0
Return the polar representation of this conic.
virtual TQString polarEquationString(const KigDocument &w) const
A string containing the polar equation of the conic.
Object * transform(const Transformation &) const
Return this Object, transformed by the transformation t.
virtual TQString cartesianEquationString(const KigDocument &w) const
A string containing the cartesian equation of the conic.
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
bool equals(const Object &rhs) const
Returns true if this Object is equal to rhs.
virtual Coordinate focus1() const
Return the first focus of this conic.
virtual const ConicCartesianData cartesianData() const
Return the cartesian representation of this conic.
static const ObjectType * stype()
Returns the ObjectType representing the Conic type.
const ObjectType * type() const
Returns the lowermost ObjectType that this object is an instantiation of.
The Coordinate class is the basic class representing a 2D location by its x and y components.
Definition: coordinate.h:34
This class represents a curve: something which is composed of points, like a line,...
Definition: curve_imp.h:29
Instances of this class represent a certain Object type.
Definition: object_imp.h:89
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
KDE Logo
This file is part of the documentation for tdelibs .
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Dec 21 2024 20:11:58 by doxygen 1.9.4 written by Dimitri van Heesch, © 1997-2001