7 #include "CoordScale.h"
8 #include "CurveConnectAs.h"
10 #include "DocumentModelCoords.h"
11 #include "EngaugeAssert.h"
12 #include "ExportFileAbstractBase.h"
16 #include <QTextStream>
17 #include "Transformation.h"
25 ExportFileAbstractBase::~ExportFileAbstractBase()
31 const QStringList &curvesGraphsNames,
32 CurveConnectAs curveConnectAs1,
33 CurveConnectAs curveConnectAs2)
const
35 LOG4CPP_INFO_S ((*mainCat)) <<
"ExportFileAbstractBase::curvesToInclude";
37 QStringList curvesToInclude;
41 QStringList::const_iterator itr;
42 for (itr = curvesGraphsNames.begin(); itr != curvesGraphsNames.end(); itr++) {
44 QString curvesGraphName = *itr;
49 ENGAUGE_CHECK_PTR (curve);
55 curvesToInclude.push_back (curvesGraphName);
60 return curvesToInclude;
65 LOG4CPP_INFO_S ((*mainCat)) <<
"ExportFileAbstractBase::destroy2DArray";
67 int colCount = array.count();
68 int rowCount = array [0].count();
69 for (
int row = 0; row < rowCount; row++) {
70 for (
int col = 0; col < colCount; col++) {
71 delete array [col] [row];
78 return QString (
"# ");
82 ExportHeader exportHeader,
83 QTextStream &str)
const
87 if (exportHeader == EXPORT_HEADER_GNUPLOT) {
97 const QPointF &posGraphBefore,
98 const QPointF &posGraph)
const
103 s = (xThetaValue - posGraphBefore.x()) / (posGraph.x() - posGraphBefore.x());
105 s = (qLn (xThetaValue) - qLn (posGraphBefore.x())) / (qLn (posGraph.x()) - qLn (posGraphBefore.x()));
111 yRadius = (1.0 - s) * posGraphBefore.y() + s * posGraph.y();
113 yRadius = qExp ((1.0 - s) * qLn (posGraphBefore.y()) + s * qLn (posGraph.y()));
120 const QString &valueString)
const
122 QString newValueString = valueString;
124 if ((modelExportOverride.
delimiter () == EXPORT_DELIMITER_COMMA) &&
125 (valueString.indexOf (
",") >= 0)) {
128 newValueString = QString (
"\"%1\"").arg (valueString);
131 return newValueString;
void insertLineSeparator(bool isFirst, ExportHeader exportHeader, QTextStream &str) const
Insert line(s) between successive sets of curves.
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...
CoordScale coordScaleYRadius() const
Get method for linear/log scale on y/radius.
LineStyle lineStyle() const
Get method for LineStyle.
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 ...
CoordScale coordScaleXTheta() const
Get method for linear/log scale on x/theta.
QString gnuplotComment() const
Gnuplot comment delimiter.
Model for DlgSettingsCoords and CmdSettingsCoords.
Storage of one imported image and the data attached to that image.
Container for one set of digitized Points.
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...
const Curve * curveForCurveName(const QString &curveName) const
See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.
CurveStyle curveStyle() const
Return the curve style.
void destroy2DArray(QVector< QVector< QString * > > &array) const
Deallocate memory for array.
CurveConnectAs curveConnectAs() const
Get method for connect type.
ExportFileAbstractBase()
Single constructor.