00001
00002
00003
00004
00005
00006
00007 #include "CallbackGatherXThetaValuesFunctions.h"
00008 #include "DocumentModelExportFormat.h"
00009 #include "ExportAlignLinear.h"
00010 #include "ExportAlignLog.h"
00011 #include "ExportLayoutFunctions.h"
00012 #include "ExportPointsSelectionFunctions.h"
00013 #include "Logger.h"
00014 #include "Point.h"
00015
00016 CallbackGatherXThetaValuesFunctions::CallbackGatherXThetaValuesFunctions(const DocumentModelExportFormat &modelExport,
00017 const QStringList &curvesIncluded,
00018 const Transformation &transformation) :
00019 m_transformation (transformation)
00020 {
00021 bool firstCurveForGatherXTheta = (modelExport.pointsSelectionFunctions() == EXPORT_POINTS_SELECTION_FUNCTIONS_INTERPOLATE_FIRST_CURVE);
00022
00023
00024 QStringList::const_iterator itr;
00025 for (itr = curvesIncluded.begin(); itr != curvesIncluded.end(); itr++) {
00026
00027 QString curveIncluded = *itr;
00028 m_curveNamesIncluded [curveIncluded] = true;
00029
00030 if (firstCurveForGatherXTheta) {
00031
00032
00033 break;
00034
00035 }
00036 }
00037 }
00038
00039 CallbackSearchReturn CallbackGatherXThetaValuesFunctions::callback (const QString &curveName,
00040 const Point &point)
00041 {
00042 LOG4CPP_DEBUG_S ((*mainCat)) << "CallbackGatherXThetaValuesFunctions::callback"
00043 << " curveName=" << curveName.toLatin1().data()
00044 << " point=" << point.identifier().toLatin1().data();
00045
00046 if (m_curveNamesIncluded.contains (curveName)) {
00047
00048 QPointF posGraph;
00049 m_transformation.transformScreenToRawGraph (point.posScreen(),
00050 posGraph);
00051
00052 m_xThetaValues [posGraph.x ()] = true;
00053 }
00054
00055 return CALLBACK_SEARCH_RETURN_CONTINUE;
00056 }
00057
00058 ValuesVectorXOrY CallbackGatherXThetaValuesFunctions::xThetaValuesRaw () const
00059 {
00060 LOG4CPP_INFO_S ((*mainCat)) << "CallbackGatherXThetaValuesFunctions::xThetaValuesRaw";
00061
00062 return m_xThetaValues;
00063 }