![]() |
Kig Python Scripting API Documentation |
||||
|
00001 // Copyright (C) 2002 Dominique Devriese <devriese@kde.org> 00002 00003 // This program is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU General Public License 00005 // as published by the Free Software Foundation; either version 2 00006 // of the License, or (at your option) any later version. 00007 00008 // This program is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 // GNU General Public License for more details. 00012 00013 // You should have received a copy of the GNU General Public License 00014 // along with this program; if not, write to the Free Software 00015 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00016 // 02110-1301, USA. 00017 00018 #ifndef KIG_OBJECTS_CURVE_IMP_H 00019 #define KIG_OBJECTS_CURVE_IMP_H 00020 00021 #include "object_imp.h" 00022 00027 class CurveImp 00028 : public ObjectImp 00029 { 00030 public: 00031 typedef ObjectImp Parent; 00032 00036 static const ObjectImpType* stype(); 00037 00038 Coordinate attachPoint() const; 00039 00040 // param is between 0 and 1. Note that 0 and 1 should be the 00041 // end-points. E.g. for a Line, getPoint(0) returns a more or less 00042 // infinite point. getPoint(0.5) should return the point in the 00043 // middle. 00044 virtual double getParam( const Coordinate& point, const KigDocument& ) const = 0; 00045 // this should be the inverse function of getPoint(). 00046 // Note that it should also do something reasonable when p is not on 00047 // the curve. You can return an invalid Coordinate( 00048 // Coordinate::invalidCoord() ) if you need to in some cases. 00049 virtual const Coordinate getPoint( double param, const KigDocument& ) const = 0; 00050 00051 virtual CurveImp* copy() const = 0; 00052 00059 virtual bool containsPoint( const Coordinate& p, const KigDocument& ) const = 0; 00060 }; 00061 00062 #endif