1 // Copyright (C) 2003 Dominique Devriese <devriese@kde.org>
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA
18 #ifndef KIG_OBJECTS_CUBIC_IMP_H
19 #define KIG_OBJECTS_CUBIC_IMP_H
21 #include "curve_imp.h"
23 #include "../misc/cubic-common.h"
30 const CubicCartesianData mdata
;
32 typedef CurveImp Parent
;
33 static const ObjectImpType
* stype();
35 CubicImp( const CubicCartesianData
& data
);
38 ObjectImp
* transform( const Transformation
& ) const;
39 void draw( KigPainter
& p
) const;
40 bool contains( const Coordinate
& p
, int width
, const KigWidget
& ) const;
41 bool inRect( const Rect
& r
, int width
, const KigWidget
& ) const;
42 Rect
surroundingRect() const;
43 QString
cartesianEquationString( const KigDocument
& ) const;
45 const uint
numberOfProperties() const;
46 const QCStringList
properties() const;
47 const QCStringList
propertiesInternalNames() const;
48 ObjectImp
* property( uint which
, const KigDocument
& w
) const;
49 const char* iconForProperty( uint which
) const;
50 const ObjectImpType
* impRequirementForProperty( uint which
) const;
51 bool isPropertyDefinedOnOrThroughThisImp( uint which
) const;
53 CubicImp
* copy() const;
55 double getParam( const Coordinate
& point
, const KigDocument
& ) const;
57 // The getPoint function doesn't need the KigDocument argument, the
58 // first getPoint function is identical to the other one. It is
59 // only provided for implementing the CurveImp interface.
60 const Coordinate
getPoint( double param
, const KigDocument
& ) const;
61 const Coordinate
getPoint( double param
) const;
64 const CubicCartesianData
data() const;
66 const ObjectImpType
* type() const;
67 void visit( ObjectImpVisitor
* vtor
) const;
69 bool equals( const ObjectImp
& rhs
) const;
71 bool containsPoint( const Coordinate
& p
, const KigDocument
& doc
) const;
72 bool internalContainsPoint( const Coordinate
& p
, double threshold
) const;