Engauge Digitizer 2
Loading...
Searching...
No Matches
CallbackNextOrdinal.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
8#include "Logger.h"
9#include "Point.h"
10#include <qmath.h>
11
13 m_curveName (curveName),
14 m_maxOrdinalUsed (0)
15{
16}
17
19 const Point &point)
20{
21 if (curveName == m_curveName) {
22 if (point.ordinal() > m_maxOrdinalUsed) {
23 m_maxOrdinalUsed = point.ordinal();
24 }
25 }
26
28}
29
31{
32 int nextOrdinal = qFloor (m_maxOrdinalUsed) + 1;
33
34 LOG4CPP_INFO_S ((*mainCat)) << "CallbackNextOrdinal::nextOrdinal"
35 << " ordinal=" << nextOrdinal;
36
37 return nextOrdinal;
38}
CallbackSearchReturn
Return values for search callback methods.
@ CALLBACK_SEARCH_RETURN_CONTINUE
Continue normal execution of the search.
log4cpp::Category * mainCat
Definition Logger.cpp:14
double nextOrdinal() const
Computed next ordinal.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
CallbackNextOrdinal(const QString &curveName)
Single constructor.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition Point.h:26
double ordinal(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Get method for ordinal. Skip check if copying one instance to another.
Definition Point.cpp:386
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18