22 m_modelExport (modelExport),
23 m_xThetaValuesRaw (xThetaValuesRaw),
24 m_transformation (transformation)
28void ExportXThetaValuesMergedFunctions::firstSimplestNumberLinear (
double &xThetaFirstSimplestNumber,
30 double &xThetaMax)
const
35 xThetaMin = m_xThetaValuesRaw.firstKey();
36 xThetaMax = m_xThetaValuesRaw.lastKey();
42 xThetaFirstSimplestNumber = alignLinear.firstSimplestNumber ();
45void ExportXThetaValuesMergedFunctions::firstSimplestNumberLog (
double &xThetaFirstSimplestNumber,
47 double &xThetaMax)
const
52 xThetaMin = m_xThetaValuesRaw.firstKey();
53 xThetaMax = m_xThetaValuesRaw.lastKey();
59 xThetaFirstSimplestNumber = alignLog.firstSimplestNumber();
66 if (m_xThetaValuesRaw.count () > 0) {
68 double xThetaFirstSimplestNumber, xThetaMin, xThetaMax;
69 firstSimplestNumberLinear (xThetaFirstSimplestNumber,
76 return periodicLinearGraph(xThetaFirstSimplestNumber,
80 return periodicLinearScreen(xThetaMin,
90ExportValuesXOrY ExportXThetaValuesMergedFunctions::periodicLinearGraph(
double xThetaFirstSimplestNumber,
92 double xThetaMax)
const
98 double xTheta = xThetaFirstSimplestNumber;
99 while (xTheta > xThetaMin) {
102 if (xTheta < xThetaMin) {
103 values [xThetaMin] =
true;
107 while (xTheta <= xThetaMax) {
108 values [xTheta] =
true;
112 if (xTheta > xThetaMax) {
113 values [xThetaMax] =
true;
116 return values.keys();
119ExportValuesXOrY ExportXThetaValuesMergedFunctions::periodicLinearScreen (
double xThetaMin,
120 double xThetaMax)
const
126 const double ARBITRARY_Y = 1.0;
129 QPointF posScreenFirst, posScreenLast;
136 double deltaScreenX = posScreenLast.x() - posScreenFirst.x();
141 if ((interval > 0) &&
142 (interval < deltaScreenX)) {
143 s = interval / deltaScreenX;
148 double xNext = xThetaMin + s * (xThetaMax - xThetaMin);
149 double delta = xNext - xThetaMin;
153 double xTheta = xThetaMin;
154 while (xTheta <= xThetaMax) {
156 values [xTheta] =
true;
161 return values.keys();
168 double xThetaFirstSimplestNumber, xThetaMin, xThetaMax;
169 firstSimplestNumberLog (xThetaFirstSimplestNumber,
176 return periodicLogGraph(xThetaFirstSimplestNumber,
180 return periodicLogScreen(xThetaMin,
185ExportValuesXOrY ExportXThetaValuesMergedFunctions::periodicLogGraph (
double xThetaFirstSimplestNumber,
187 double xThetaMax)
const
193 double xTheta = xThetaFirstSimplestNumber;
195 while (xTheta > xThetaMin) {
199 if (xTheta < xThetaMin) {
200 values [xThetaMin] =
true;
205 while (xTheta <= xThetaMax) {
206 values [xTheta] =
true;
211 if (xTheta > xThetaMax) {
212 values [xThetaMax] =
true;
215 return values.keys();
218ExportValuesXOrY ExportXThetaValuesMergedFunctions::periodicLogScreen (
double xThetaMin,
219 double xThetaMax)
const
223 const double ARBITRARY_Y = 0.0;
226 QPointF posScreenFirst, posScreenLast;
233 double deltaScreenX = posScreenLast.x() - posScreenFirst.x();
234 double deltaScreenY = posScreenLast.y() - posScreenFirst.y();
235 double deltaScreen = qSqrt (deltaScreenX * deltaScreenX + deltaScreenY * deltaScreenY);
240 if ((interval > 0) &&
241 (interval < deltaScreen)) {
242 s = interval / deltaScreen;
247 double xNext = qExp (qLn (xThetaMin) + s * (qLn (xThetaMax) - qLn (xThetaMin)));
248 double scale = xNext / xThetaMin;
252 double xTheta = xThetaMin;
253 while (xTheta <= xThetaMax) {
255 values [xTheta] =
true;
260 return values.keys();
279 return periodicLinear ();
281 return periodicLog ();
287 return m_xThetaValuesRaw.keys();
@ EXPORT_POINTS_INTERVAL_UNITS_GRAPH
@ EXPORT_POINTS_SELECTION_FUNCTIONS_INTERPOLATE_PERIODIC
QList< double > ExportValuesXOrY
log4cpp::Category * mainCat
QMap< double, bool > ValuesVectorXOrY
Pick first simplest x value between specified min and max, for linear scaling.
Pick first simplest x value between specified min and max, for log scaling.
ExportValuesXOrY xThetaValues() const
Resulting x/theta values for all included functions.
ExportXThetaValuesMergedFunctions(const DocumentModelExportFormat &modelExport, const ValuesVectorXOrY &xThetaValuesRaw, const Transformation &transformation)
Single constructor.
#define LOG4CPP_INFO_S(logger)