C++ (Qt)struct Curve {// общие данные для всех типов кривых int dataType; // тип значения кривой union { DoubleCurve * doubleCurve; VectorCurve * vectorCurve; СolorCurve * colorCurve; };};
C++ (Qt)struct VectorCurve { ... Container<Key> xList; Container<Key> yList; Container<Key> zList;}; struct Key { double time; double val; union { // опции сплайна };};
C++ (Qt)double inRatioVector; // Incoming Vectordouble outRatioVector; // Outgoing Vectordouble inRatioAngle; // Incoming Angledouble outRatioAngle; // Outgoing Angledouble inWeight; // Incoming Weightdouble outWeight; // Outgoing Weightint ratioFlags; // Flags governing the interpolation
C++ (Qt)struct XYColorCurve{ vector<double> x; vector<double> y; vector<Color> c;}
C++ (Qt)struct XYColor{ double x; double y; Color c;} using XYColorCurve = vector<XYColor>;
C++ (Qt)struct RatioWeight{ double inRatioVector; // Incoming Vector double outRatioVector; // Outgoing Vector double inRatioAngle; // Incoming Angle double outRatioAngle; // Outgoing Angle double inWeight; // Incoming Weight double outWeight; // Outgoing Weight int ratioFlags; // Flags governing the interpolation} using RatioWeightCurve = map<Key, RatioWeight>;
C++ (Qt)struct Key { double time; // время Vector vec; // данные int splineOption1; // параметры сплайна ... double splineOptionN; };
template<class T> Curve { QMap<Key, T> data;public: void getData(&T, QDateTime t)}Curve<QVector3D> c1;Curve<QColor> c2;Curve<double> c3;
double data; static_cast<Curve<double>* >(curveBasePointer)->getData(&data);
template<class T> Curve { QMap<Key, T> data;public: void getData(&T, QDateTime t)}
C++ (Qt)Curve<QVector3D> c1;Curve<QColor> c2;Curve<double> c3;
C++ (Qt)struct Curve { ... ??? GetData( double time ) const; // возвращает значение для времени time void SetData( double time. const ??? & value ); // устанавливает значение для времени time ...};
QVariant GetData( double time ) constswitch(currentType) {case (DOUBLE): double d; static_cast<Curve<double>* >(this)->getData(&d); return Qvariant(d);....