kig
cubic-common.h
Go to the documentation of this file.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
00088 void normalize();
00089 };
00090
00091 bool operator==( const CubicCartesianData& lhs, const CubicCartesianData& rhs );
00092
00099 const CubicCartesianData calcCubicThroughPoints (
00100 const std::vector<Coordinate>& points );
00101
00102 const CubicCartesianData calcCubicCuspThroughPoints (
00103 const std::vector<Coordinate>& points );
00104
00105 const CubicCartesianData calcCubicNodeThroughPoints (
00106 const std::vector<Coordinate>& points );
00107
00108 double calcCubicYvalue ( double x, double ymin, double ymax,
00109 int root, CubicCartesianData data,
00110 bool& valid, int& numroots );
00111
00112 const Coordinate calcCubicLineIntersect( const CubicCartesianData& c,
00113 const LineData& l,
00114 int root, bool& valid );
00115
00116 void calcCubicLineRestriction ( CubicCartesianData data,
00117 Coordinate p1, Coordinate dir,
00118 double& a, double& b, double& c, double& d );
00119
00120 const CubicCartesianData calcCubicTransformation (
00121 const CubicCartesianData& data,
00122 const Transformation& t, bool& valid );
00123
00124 #endif