00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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