Kig Python Scripting API Documentation

line_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_LINE_IMP_H
00019 #define KIG_OBJECTS_LINE_IMP_H
00020 
00021 #include "curve_imp.h"
00022 
00023 #include "../misc/common.h"
00024 
00025 class LineData;
00026 
00031 class AbstractLineImp
00032   : public CurveImp
00033 {
00034 protected:
00035   LineData mdata;
00036   AbstractLineImp( const LineData& d );
00037   AbstractLineImp( const Coordinate& a, const Coordinate& b );
00038 
00039 public:
00040   typedef CurveImp Parent;
00045   static const ObjectImpType* stype();
00046 
00047   ~AbstractLineImp();
00048 
00049   bool inRect( const Rect& r, int width, const KigWidget& ) const;
00050 
00051   const uint numberOfProperties() const;
00052   const QCStringList properties() const;
00053   const QCStringList propertiesInternalNames() const;
00054   ObjectImp* property( uint which, const KigDocument& d ) const;
00055   const char* iconForProperty( uint which ) const;
00056   const ObjectImpType* impRequirementForProperty( uint which ) const;
00057   bool isPropertyDefinedOnOrThroughThisImp( uint which ) const;
00058 
00064   double slope() const;
00069   const QString equationString() const;
00073   LineData data() const;
00074 
00075   bool equals( const ObjectImp& rhs ) const;
00076 };
00077 
00081 class SegmentImp
00082   : public AbstractLineImp
00083 {
00084 public:
00085   typedef AbstractLineImp Parent;
00090   static const ObjectImpType* stype();
00091 
00095   SegmentImp( const Coordinate& a, const Coordinate& b );
00099   SegmentImp( const LineData& d );
00100 
00101   void draw( KigPainter& p ) const;
00102   bool contains( const Coordinate& p, int width, const KigWidget& si ) const;
00103   Rect surroundingRect() const;
00104 
00105   ObjectImp* transform( const Transformation& ) const;
00106 
00107   const Coordinate getPoint( double param, const KigDocument& ) const;
00108   double getParam( const Coordinate&, const KigDocument& ) const;
00109 
00110   const uint numberOfProperties() const;
00111   const QCStringList properties() const;
00112   const QCStringList propertiesInternalNames() const;
00113   ObjectImp* property( uint which, const KigDocument& d ) const;
00114   const char* iconForProperty( uint which ) const;
00115   const ObjectImpType* impRequirementForProperty( uint which ) const;
00116 
00117   SegmentImp* copy() const;
00118 
00122   double length() const;
00123 
00124   const ObjectImpType* type() const;
00125   void visit( ObjectImpVisitor* vtor ) const;
00126 
00127   bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
00128   bool internalContainsPoint( const Coordinate& p, double threshold ) const;
00129 };
00130 
00136 class RayImp
00137   : public AbstractLineImp
00138 {
00139 public:
00140   typedef AbstractLineImp Parent;
00145   static const ObjectImpType* stype();
00146 
00150   RayImp( const Coordinate& a, const Coordinate& b );
00154   RayImp( const LineData& d );
00155 
00156   void draw( KigPainter& p ) const;
00157   bool contains( const Coordinate& p, int width, const KigWidget& si ) const;
00158   Rect surroundingRect() const;
00159 
00160   ObjectImp* transform( const Transformation& ) const;
00161 
00162   const Coordinate getPoint( double param, const KigDocument& ) const;
00163   double getParam( const Coordinate&, const KigDocument& ) const;
00164 
00165   RayImp* copy() const;
00166 
00167   const ObjectImpType* type() const;
00168   void visit( ObjectImpVisitor* vtor ) const;
00169 
00170   bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
00171   bool internalContainsPoint( const Coordinate& p, double threshold ) const;
00172 };
00173 
00177 class LineImp
00178   : public AbstractLineImp
00179 {
00180 public:
00181   typedef AbstractLineImp Parent;
00182 
00187   static const ObjectImpType* stype();
00188 
00192   LineImp( const Coordinate& a, const Coordinate& b );
00196   LineImp( const LineData& d );
00197   void draw( KigPainter& p ) const;
00198   bool contains( const Coordinate& p, int width, const KigWidget& si ) const;
00199   Rect surroundingRect() const;
00200 
00201   ObjectImp* transform( const Transformation& ) const;
00202 
00203   const Coordinate getPoint( double param, const KigDocument& ) const;
00204   double getParam( const Coordinate&, const KigDocument& ) const;
00205 
00206   LineImp* copy() const;
00207 
00208   const ObjectImpType* type() const;
00209   void visit( ObjectImpVisitor* vtor ) const;
00210 
00211   bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
00212   bool internalContainsPoint( const Coordinate& p, double threshold ) const;
00213 };
00214 
00215 #endif
KDE Logo
This file is part of the documentation for kdelibs 0.10.7.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Jul 5 12:48:00 2008 by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2001