Kig Python Scripting API Documentation

curve_imp.h

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
KDE Logo
This file is part of the documentation for kdelibs 0.10.7.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Mar 19 02:01:26 2008 by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2001