Kig Python Scripting API Documentation

cubic-common.h

00001 // Copyright (C)  2003  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_MISC_CUBIC_COMMON_H
00019 #define KIG_MISC_CUBIC_COMMON_H
00020 
00021 #include "common.h"
00022 
00023 class Transformation;
00024 
00031 class CubicCartesianData
00032 {
00033 public:
00034   double coeffs[10];
00043   explicit CubicCartesianData();
00048   CubicCartesianData( double a000, double a001, double a002,
00049                       double a011, double a012, double a022,
00050                       double a111, double a112, double a122,
00051                       double a222 )
00052     {
00053       coeffs[0] = a000;
00054       coeffs[1] = a001;
00055       coeffs[2] = a002;
00056       coeffs[3] = a011;
00057       coeffs[4] = a012;
00058       coeffs[5] = a022;
00059       coeffs[6] = a111;
00060       coeffs[7] = a112;
00061       coeffs[8] = a122;
00062       coeffs[9] = a222;
00063     }
00064   CubicCartesianData( const double incoeffs[10] );
00065 
00078   static CubicCartesianData invalidData();
00084   bool valid() const;
00085 };
00086 
00087 bool operator==( const CubicCartesianData& lhs, const CubicCartesianData& rhs );
00088 
00095 const CubicCartesianData calcCubicThroughPoints (
00096     const std::vector<Coordinate>& points );
00097 
00098 const CubicCartesianData calcCubicCuspThroughPoints (
00099     const std::vector<Coordinate>& points );
00100 
00101 const CubicCartesianData calcCubicNodeThroughPoints (
00102     const std::vector<Coordinate>& points );
00103 
00104 double calcCubicYvalue ( double x, double ymin, double ymax,
00105                          int root, CubicCartesianData data,
00106                          bool& valid, int& numroots );
00107 
00108 const Coordinate calcCubicLineIntersect( const CubicCartesianData& c,
00109                                          const LineData& l,
00110                                          int root, bool& valid );
00111 
00112 void calcCubicLineRestriction ( CubicCartesianData data,
00113          Coordinate p1, Coordinate dir,
00114          double& a, double& b, double& c, double& d );
00115 
00116 const CubicCartesianData calcCubicTransformation (
00117   const CubicCartesianData& data,
00118   const Transformation& t, bool& valid );
00119 
00120 #endif
KDE Logo
This file is part of the documentation for kdelibs 0.10.7.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Oct 14 12:33:17 2007 by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2001