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

Callback for identifying, for the scale bar of a map, various quantities. More...

#include <CallbackScaleBar.h>

Collaboration diagram for CallbackScaleBar:
Collaboration graph

Public Member Functions

 CallbackScaleBar ()
 Single constructor. More...
 
QStringList axisCurvePointIdentifiers () const
 Points in axis curve. More...
 
CallbackSearchReturn callback (const QString &curveName, const Point &point)
 Callback method. More...
 
double scaleBarLength () const
 Length of scale bar. More...
 
QString scaleBarPointIdentifier () const
 Identified axis point. More...
 

Detailed Description

Callback for identifying, for the scale bar of a map, various quantities.

Definition at line 17 of file CallbackScaleBar.h.

Constructor & Destructor Documentation

CallbackScaleBar::CallbackScaleBar ( )

Single constructor.

Definition at line 17 of file CallbackScaleBar.cpp.

17  :
18  m_scaleBarLength (0)
19 {
20 }

Member Function Documentation

QStringList CallbackScaleBar::axisCurvePointIdentifiers ( ) const

Points in axis curve.

Definition at line 22 of file CallbackScaleBar.cpp.

23 {
24  return m_axisCurvePointIdentifiers;
25 }
CallbackSearchReturn CallbackScaleBar::callback ( const QString &  curveName,
const Point point 
)

Callback method.

Definition at line 27 of file CallbackScaleBar.cpp.

29 {
30  LOG4CPP_DEBUG_S ((*mainCat)) << "CallbackScaleBar::callback"
31  << " curveName=" << curveName.toLatin1().data()
32  << " point=" << point.identifier().toLatin1().data();
33 
34  if (curveName == AXIS_CURVE_NAME) {
35 
36  bool isNonzeroX = (qAbs (point.posGraph ().x ()) > 0);
37  bool isNonzeroY = (qAbs (point.posGraph ().y ()) > 0);
38 
39  if (isNonzeroX || isNonzeroY) {
40 
41  m_scaleBarPointIdentifier = point.identifier ();
42  m_scaleBarLength = (isNonzeroX ?
43  point.posGraph ().x () :
44  point.posGraph ().y ());
45  }
46 
47  m_axisCurvePointIdentifiers << point.identifier ();
48  }
49 
51 }
QPointF posGraph(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Accessor for graph position. Skip check if copying one instance to another.
Definition: Point.cpp:395
QString identifier() const
Unique identifier for a specific Point.
Definition: Point.cpp:268
Continue normal execution of the search.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
const QString AXIS_CURVE_NAME
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
double CallbackScaleBar::scaleBarLength ( ) const

Length of scale bar.

Definition at line 53 of file CallbackScaleBar.cpp.

54 {
55  return m_scaleBarLength;
56 }
QString CallbackScaleBar::scaleBarPointIdentifier ( ) const

Identified axis point.

Definition at line 58 of file CallbackScaleBar.cpp.

59 {
60  LOG4CPP_INFO_S ((*mainCat)) << "CallbackScaleBar::scaleBarPointIdentifier";
61 
62  return m_scaleBarPointIdentifier;
63 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14

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