54 initializeYRadiusValues (curvesIncluded,
57 loadYRadiusValues (modelExportOverride,
69 outputXThetaYRadiusValues (modelExportOverride,
99 QStringList::const_iterator
itr;
100 for (
itr = curvesIncluded.begin();
itr != curvesIncluded.end();
itr++) {
112 loadYRadiusValues (modelExportOverride,
123 outputXThetaYRadiusValues (modelExportOverride,
175 curveLimitsMin =
ftor.curveLimitsMin();
176 curveLimitsMax =
ftor.curveLimitsMax();
185 curveLimitsMin =
ftor.curveLimitsMin();
186 curveLimitsMax =
ftor.curveLimitsMax();
200 exportAllPerLineXThetaValuesMerged (modelExportOverride,
214 exportOnePerLineXThetaValuesMerged (modelExportOverride,
231void ExportFileFunctions::initializeYRadiusValues (
const QStringList &curvesIncluded,
247double ExportFileFunctions::linearlyInterpolate (
const Points &points,
260 const Point &point = points.at (
ip);
289 if (points.count() > 1) {
293 int N = points.count();
306 }
else if (points.count() == 1) {
339 const QString curveName = curvesIncluded.at (
col);
347 loadYRadiusValuesForCurveRaw (document.
modelCoords(),
362 loadYRadiusValuesForCurveInterpolatedSmooth (document.
modelCoords(),
377 loadYRadiusValuesForCurveInterpolatedStraight (document.
modelCoords(),
392void ExportFileFunctions::loadYRadiusValuesForCurveInterpolatedSmooth (
const DocumentModelCoords &modelCoords,
423 if (points.count() == 0) {
426 for (
int row = 0;
row < xThetaValues.count();
row++) {
430 }
else if (points.count() == 1 ||
431 points.count() == 2) {
434 for (
int row = 0;
row < xThetaValues.count();
row++) {
438 if (points.count() == 1) {
441 double x0 =
xy.at (0).x ();
442 double x1 =
xy.at (1).x ();
443 double y0 =
xy.at (0).y ();
444 double y1 =
xy.at (1).y ();
455 if (xThetaIsNotOutOfBounds (
xTheta,
488 for (
int row = 0;
row < xThetaValues.count();
row++) {
500 if (xThetaIsNotOutOfBounds (
xTheta,
520void ExportFileFunctions::loadYRadiusValuesForCurveInterpolatedStraight (
const DocumentModelCoords &modelCoords,
537 for (
int row = 0;
row < xThetaValues.count();
row++) {
543 if (points.count () > 0) {
545 double yRadius = linearlyInterpolate (points,
550 if (xThetaIsNotOutOfBounds (
xTheta,
567void ExportFileFunctions::loadYRadiusValuesForCurveRaw (
const DocumentModelCoords &modelCoords,
584 for (
int pt = 0;
pt < points.count();
pt++) {
586 const Point &point = points.at (
pt);
596 for (
int row = 0;
row < xThetaValues.count();
row++) {
612 if (xThetaIsNotOutOfBounds (posGraph.x(),
648 modelExportOverride.
header (),
657 str << delimiter << curveName;
708 if (!
entry.isEmpty()) {
719bool ExportFileFunctions::xThetaIsNotOutOfBounds (
double xTheta,
726 if (curveLimitsMin.contains (curveName)) {
727 ok =
ok && (curveLimitsMin [curveName] <=
xTheta);
730 if (curveLimitsMax.contains (curveName)) {
731 ok =
ok && (
xTheta <= curveLimitsMax [curveName]);
@ CONNECT_AS_FUNCTION_STRAIGHT
@ CONNECT_AS_FUNCTION_SMOOTH
QHash< QString, double > CurveLimits
const int INNER_RADIUS_MIN
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...
QString exportDelimiterToText(ExportDelimiter exportDelimiter, bool isGnuplotDelimiter)
@ EXPORT_LAYOUT_ALL_PER_LINE
@ EXPORT_POINTS_SELECTION_FUNCTIONS_RAW
@ EXPORT_POINTS_SELECTION_FUNCTIONS_INTERPOLATE_GRID_LINES
QList< double > ExportValuesXOrY
log4cpp::Category * mainCat
QMap< double, bool > ValuesVectorXOrY
Callback for collecting X/Theta independent variables, for functions, in preparation for exporting,...
virtual CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Callback for collecting X/Theta independent variables, for functions, in preparation for exporting,...
virtual CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Container for one set of digitized Points.
const Points points() const
Return a shallow copy of the Points.
Model for DlgSettingsCoords and CmdSettingsCoords.
CoordScale coordScaleYRadius() const
Get method for linear/log scale on y/radius.
CoordScale coordScaleXTheta() const
Get method for linear/log scale on x/theta.
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Storage of one imported image and the data attached to that image.
DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
const Curve * curveForCurveName(const QString &curveName) const
See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.
void destroy2DArray(QVector< QVector< QString * > > &array) const
Deallocate memory for array.
double linearlyInterpolateYRadiusFromTwoPoints(double xThetaValue, const DocumentModelCoords &modelCoords, const QPointF &posGraphBefore, const QPointF &posGraph) const
Interpolate (if xThetaValue is between posGraphBefore.x() and posGraph.x()) or extrapolate (if xTheta...
QString wrapInDoubleQuotesIfNeeded(const DocumentModelExportFormat &modelExportOverride, const QString &valueString) const
RFC 4180 says if values are delimited by a comma AND a value has commas in it (for locale like Englis...
QString gnuplotComment() const
Gnuplot comment delimiter.
QStringList curvesToInclude(const DocumentModelExportFormat &modelExportOverride, const Document &document, const QStringList &curvesGraphsNames, CurveConnectAs curveConnectAs1, CurveConnectAs curveConnectAs2) const
Identify curves to include in export. The specified DocumentModelExportFormat overrides same data in ...
void insertLineSeparator(bool isFirst, ExportHeader exportHeader, QTextStream &str) const
Insert line(s) between successive sets of curves.
ExportFileFunctions()
Single constructor.
void exportToFile(const DocumentModelExportFormat &modelExportOverride, const Document &document, const MainWindowModel &modelMainWindow, const Transformation &transformation, QTextStream &str, unsigned int &numWritesSoFar) const
Export Document points according to the settings.
Utility class to interpolate points spaced evenly along a piecewise defined curve with fitted spline.
void loadSplinePairsWithTransformation(const Points &points, const Transformation &transformation, bool isLogXTheta, bool isLogYRadius, std::vector< double > &t, std::vector< SplinePair > &xy) const
Load t (=ordinal) and xy (=screen position) spline pairs, converting screen coordinates to graph coor...
Creates the set of merged x/theta values for exporting functions, using interpolation.
Warps log coordinates to make them linear before passing them to code that accepts only linear coordi...
Model for DlgSettingsMainWindow.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
QPointF posScreen() const
Accessor for screen position.
Single X/Y pair for cubic spline interpolation initialization and calculations.
Cubic interpolation given independent and dependent value vectors.
#define LOG4CPP_INFO_S(logger)