Engauge Digitizer 2
Loading...
Searching...
No Matches
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.
 
QStringList axisCurvePointIdentifiers () const
 Points in axis curve.
 
CallbackSearchReturn callback (const QString &curveName, const Point &point)
 Callback method.
 
double scaleBarLength () const
 Length of scale bar.
 
QString scaleBarPointIdentifier () const
 Identified axis point.
 

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::CallbackScaleBar ( )

Single constructor.

Definition at line 17 of file CallbackScaleBar.cpp.

17 :
18 m_scaleBarLength (0)
19{
20}

Member Function Documentation

◆ axisCurvePointIdentifiers()

QStringList CallbackScaleBar::axisCurvePointIdentifiers ( ) const

Points in axis curve.

Definition at line 22 of file CallbackScaleBar.cpp.

23{
24 return m_axisCurvePointIdentifiers;
25}

◆ callback()

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}
const QString AXIS_CURVE_NAME
@ CALLBACK_SEARCH_RETURN_CONTINUE
Continue normal execution of the search.
const int INNER_RADIUS_MIN
log4cpp::Category * mainCat
Definition Logger.cpp:14
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
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20

◆ scaleBarLength()

double CallbackScaleBar::scaleBarLength ( ) const

Length of scale bar.

Definition at line 53 of file CallbackScaleBar.cpp.

54{
55 return m_scaleBarLength;
56}

◆ scaleBarPointIdentifier()

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

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