Strategy base class for exporting to a file. This class provides common methods.
More...
#include <ExportFileAbstractBase.h>
|
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 Document for previewing window. More...
|
|
void | destroy2DArray (QVector< QVector< QString * > > &array) const |
| Deallocate memory for array. More...
|
|
QString | gnuplotComment () const |
| Gnuplot comment delimiter. More...
|
|
void | insertLineSeparator (bool isFirst, ExportHeader exportHeader, QTextStream &str) const |
| Insert line(s) between successive sets of curves. More...
|
|
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 xThetaValue < posGraphBefore.x() or xThetaValue > posGraph.x()) the given x/theta value using the two specified graph points. More...
|
|
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 English/Switzerland when dealing with numbers) then double quotes are required for the value. More...
|
|
Strategy base class for exporting to a file. This class provides common methods.
Definition at line 25 of file ExportFileAbstractBase.h.
ExportFileAbstractBase::ExportFileAbstractBase |
( |
| ) |
|
ExportFileAbstractBase::~ExportFileAbstractBase |
( |
| ) |
|
|
virtual |
Identify curves to include in export. The specified DocumentModelExportFormat overrides same data in Document for previewing window.
Definition at line 29 of file ExportFileAbstractBase.cpp.
41 QStringList::const_iterator itr;
42 for (itr = curvesGraphsNames.begin(); itr != curvesGraphsNames.end(); itr++) {
44 QString curvesGraphName = *itr;
55 curvesToInclude.push_back (curvesGraphName);
LineStyle lineStyle() const
Get method for LineStyle.
#define LOG4CPP_INFO_S(logger)
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 ...
#define ENGAUGE_CHECK_PTR(ptr)
#endif
Container for one set of digitized Points.
log4cpp::Category * mainCat
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.
CurveConnectAs curveConnectAs() const
Get method for connect type.
void ExportFileAbstractBase::destroy2DArray |
( |
QVector< QVector< QString * > > & |
array | ) |
const |
|
protected |
Deallocate memory for array.
Definition at line 63 of file ExportFileAbstractBase.cpp.
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];
#define LOG4CPP_INFO_S(logger)
log4cpp::Category * mainCat
QString ExportFileAbstractBase::gnuplotComment |
( |
| ) |
const |
|
protected |
void ExportFileAbstractBase::insertLineSeparator |
( |
bool |
isFirst, |
|
|
ExportHeader |
exportHeader, |
|
|
QTextStream & |
str |
|
) |
| const |
|
protected |
double ExportFileAbstractBase::linearlyInterpolateYRadiusFromTwoPoints |
( |
double |
xThetaValue, |
|
|
const DocumentModelCoords & |
modelCoords, |
|
|
const QPointF & |
posGraphBefore, |
|
|
const QPointF & |
posGraph |
|
) |
| const |
|
protected |
Interpolate (if xThetaValue is between posGraphBefore.x() and posGraph.x()) or extrapolate (if xThetaValue < posGraphBefore.x() or xThetaValue > posGraph.x()) the given x/theta value using the two specified graph points.
Definition at line 95 of file ExportFileAbstractBase.cpp.
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()));
CoordScale coordScaleYRadius() const
Get method for linear/log scale on y/radius.
CoordScale coordScaleXTheta() const
Get method for linear/log scale on x/theta.
QString ExportFileAbstractBase::wrapInDoubleQuotesIfNeeded |
( |
const DocumentModelExportFormat & |
modelExportOverride, |
|
|
const QString & |
valueString |
|
) |
| const |
|
protected |
RFC 4180 says if values are delimited by a comma AND a value has commas in it (for locale like English/Switzerland when dealing with numbers) then double quotes are required for the value.
In other cases this method is a noop
Definition at line 119 of file ExportFileAbstractBase.cpp.
122 QString newValueString = valueString;
125 (valueString.indexOf (
",") >= 0)) {
128 newValueString = QString (
"\"%1\"").arg (valueString);
131 return newValueString;
The documentation for this class was generated from the following files: