Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
CallbackNextOrdinal Class Reference

Callback for computing the next ordinal for a new point. More...

#include <CallbackNextOrdinal.h>

Collaboration diagram for CallbackNextOrdinal:
Collaboration graph

Public Member Functions

 CallbackNextOrdinal (const QString &curveName)
 Single constructor. More...
 
CallbackSearchReturn callback (const QString &curveName, const Point &point)
 Callback method. More...
 
double nextOrdinal () const
 Computed next ordinal. More...
 

Detailed Description

Callback for computing the next ordinal for a new point.

Definition at line 17 of file CallbackNextOrdinal.h.

Constructor & Destructor Documentation

CallbackNextOrdinal::CallbackNextOrdinal ( const QString &  curveName)

Single constructor.

Definition at line 12 of file CallbackNextOrdinal.cpp.

12  :
13  m_curveName (curveName),
14  m_maxOrdinalUsed (0)
15 {
16 }

Member Function Documentation

CallbackSearchReturn CallbackNextOrdinal::callback ( const QString &  curveName,
const Point point 
)

Callback method.

Definition at line 18 of file CallbackNextOrdinal.cpp.

20 {
21  if (curveName == m_curveName) {
22  if (point.ordinal() > m_maxOrdinalUsed) {
23  m_maxOrdinalUsed = point.ordinal();
24  }
25  }
26 
28 }
Continue normal execution of the search.
double ordinal(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Get method for ordinal. Skip check if copying one instance to another.
Definition: Point.cpp:386
double CallbackNextOrdinal::nextOrdinal ( ) const

Computed next ordinal.

Definition at line 30 of file CallbackNextOrdinal.cpp.

31 {
32  int nextOrdinal = qFloor (m_maxOrdinalUsed) + 1;
33 
34  LOG4CPP_INFO_S ((*mainCat)) << "CallbackNextOrdinal::nextOrdinal"
35  << " ordinal=" << nextOrdinal;
36 
37  return nextOrdinal;
38 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
double nextOrdinal() const
Computed next ordinal.
log4cpp::Category * mainCat
Definition: Logger.cpp:14

The documentation for this class was generated from the following files: