Engauge Digitizer  2
Public Member Functions | List of all members
DlgValidatorFactory Class Reference

Validator factory. More...

#include <DlgValidatorFactory.h>

Collaboration diagram for DlgValidatorFactory:
Collaboration graph

Public Member Functions

 DlgValidatorFactory ()
 Single constructor. More...
 
DlgValidatorAbstract * createAboveZero (const QLocale &locale) const
 Factory method for generating validators for scale length which must be a number greater than zero. More...
 
DlgValidatorAbstract * createCartesianOrPolarWithNonPolarPolar (CoordScale coordScale, bool isCartesian, CoordUnitsNonPolarTheta coordUnitsCartesian, CoordUnitsNonPolarTheta coordUnitsPolar, CoordUnitsDate coordUnitsDate, CoordUnitsTime coordUnitsTime, const QLocale &locale) const
 Factory method for generating validators for either cartesian or polar case, when polar format is specified by CoordUnitsNonPolarTheta. More...
 
DlgValidatorAbstract * createCartesianOrPolarWithPolarPolar (CoordScale coordScale, bool isCartesian, CoordUnitsNonPolarTheta coordUnitsCartesian, CoordUnitsPolarTheta coordUnitsPolar, CoordUnitsDate coordUnitsDate, CoordUnitsTime coordUnitsTime, const QLocale &locale) const
 Factory method for generating validators for either cartesian or polar case, when polar format is specified by CoordUnitsPolarTheta. More...
 
DlgValidatorAbstract * createWithNonPolar (CoordScale coordScale, CoordUnitsNonPolarTheta coordUnits, CoordUnitsDate coordUnitsDate, CoordUnitsTime coordUnitsTime, const QLocale &locale) const
 Factory method for generating validators when cartesian/polar case handling is handled externally, and format is specified by CoordUnitsNonPolarTheta. More...
 
DlgValidatorAbstract * createWithPolar (CoordScale coordScale, CoordUnitsPolarTheta coordUnits, const QLocale &locale) const
 Factory method for generating validators when cartesian/polar case handling is handled externally, and format is specified by CoordUnitsNonPolarTheta. More...
 

Detailed Description

Validator factory.

Definition at line 18 of file DlgValidatorFactory.h.

Constructor & Destructor Documentation

◆ DlgValidatorFactory()

DlgValidatorFactory::DlgValidatorFactory ( )

Single constructor.

Definition at line 16 of file DlgValidatorFactory.cpp.

17 {
18  LOG4CPP_INFO_S ((*mainCat)) << "DlgValidatorFactory::DlgValidatorFactory";
19 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14

Member Function Documentation

◆ createAboveZero()

DlgValidatorAbstract * DlgValidatorFactory::createAboveZero ( const QLocale &  locale) const

Factory method for generating validators for scale length which must be a number greater than zero.

Definition at line 21 of file DlgValidatorFactory.cpp.

22 {
23  return new DlgValidatorAboveZero (locale);
24 }
Validator for generic (=simple) numbers that must be greater than zero.

◆ createCartesianOrPolarWithNonPolarPolar()

DlgValidatorAbstract * DlgValidatorFactory::createCartesianOrPolarWithNonPolarPolar ( CoordScale  coordScale,
bool  isCartesian,
CoordUnitsNonPolarTheta  coordUnitsCartesian,
CoordUnitsNonPolarTheta  coordUnitsPolar,
CoordUnitsDate  coordUnitsDate,
CoordUnitsTime  coordUnitsTime,
const QLocale &  locale 
) const

Factory method for generating validators for either cartesian or polar case, when polar format is specified by CoordUnitsNonPolarTheta.

Definition at line 26 of file DlgValidatorFactory.cpp.

33 {
34  LOG4CPP_INFO_S ((*mainCat)) << "DlgValidatorFactory::createCartesianOrPolarWithNonPolarPolar";
35 
36  if (isCartesian) {
37  return createWithNonPolar (coordScale,
38  coordUnitsCartesian,
39  coordUnitsDate,
40  coordUnitsTime,
41  locale);
42  } else {
43  return createWithNonPolar (coordScale,
44  coordUnitsPolar,
45  coordUnitsDate,
46  coordUnitsTime,
47  locale);
48  }
49 }
DlgValidatorAbstract * createWithNonPolar(CoordScale coordScale, CoordUnitsNonPolarTheta coordUnits, CoordUnitsDate coordUnitsDate, CoordUnitsTime coordUnitsTime, const QLocale &locale) const
Factory method for generating validators when cartesian/polar case handling is handled externally...
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14

◆ createCartesianOrPolarWithPolarPolar()

DlgValidatorAbstract * DlgValidatorFactory::createCartesianOrPolarWithPolarPolar ( CoordScale  coordScale,
bool  isCartesian,
CoordUnitsNonPolarTheta  coordUnitsCartesian,
CoordUnitsPolarTheta  coordUnitsPolar,
CoordUnitsDate  coordUnitsDate,
CoordUnitsTime  coordUnitsTime,
const QLocale &  locale 
) const

Factory method for generating validators for either cartesian or polar case, when polar format is specified by CoordUnitsPolarTheta.

Definition at line 51 of file DlgValidatorFactory.cpp.

58 {
59  LOG4CPP_INFO_S ((*mainCat)) << "DlgValidatorFactory::createCartesianOrPolarWithPolarPolar";
60 
61  if (isCartesian) {
62  return createWithNonPolar (coordScale,
63  coordUnitsCartesian,
64  coordUnitsDate,
65  coordUnitsTime,
66  locale);
67  } else {
68  return createWithPolar (coordScale,
69  coordUnitsPolar,
70  locale);
71  }
72 }
DlgValidatorAbstract * createWithNonPolar(CoordScale coordScale, CoordUnitsNonPolarTheta coordUnits, CoordUnitsDate coordUnitsDate, CoordUnitsTime coordUnitsTime, const QLocale &locale) const
Factory method for generating validators when cartesian/polar case handling is handled externally...
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
DlgValidatorAbstract * createWithPolar(CoordScale coordScale, CoordUnitsPolarTheta coordUnits, const QLocale &locale) const
Factory method for generating validators when cartesian/polar case handling is handled externally...

◆ createWithNonPolar()

DlgValidatorAbstract * DlgValidatorFactory::createWithNonPolar ( CoordScale  coordScale,
CoordUnitsNonPolarTheta  coordUnits,
CoordUnitsDate  coordUnitsDate,
CoordUnitsTime  coordUnitsTime,
const QLocale &  locale 
) const

Factory method for generating validators when cartesian/polar case handling is handled externally, and format is specified by CoordUnitsNonPolarTheta.

Definition at line 74 of file DlgValidatorFactory.cpp.

79 {
80  LOG4CPP_INFO_S ((*mainCat)) << "DlgValidatorFactory::createWithNonPolar";
81 
82  switch (coordUnits) {
84  return new DlgValidatorDateTime (coordScale,
85  coordUnitsDate,
86  coordUnitsTime);
87 
89  return new DlgValidatorDegreesMinutesSeconds (coordScale);
90 
92  return new DlgValidatorNumber(coordScale,
93  locale);
94 
95  default:
96  LOG4CPP_ERROR_S ((*mainCat)) << "DlgValidatorFactory::createWithNonPolar";
97  exit (-1);
98  }
99 }
Validator for numeric value expressed as date and/or time.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
#define LOG4CPP_ERROR_S(logger)
Definition: convenience.h:12
Validator for angles in real degrees, integer degrees and real minutes, or integer degrees with integ...
log4cpp::Category * mainCat
Definition: Logger.cpp:14
Validator for generic (=simple) numbers.

◆ createWithPolar()

DlgValidatorAbstract * DlgValidatorFactory::createWithPolar ( CoordScale  coordScale,
CoordUnitsPolarTheta  coordUnits,
const QLocale &  locale 
) const

Factory method for generating validators when cartesian/polar case handling is handled externally, and format is specified by CoordUnitsNonPolarTheta.

Definition at line 101 of file DlgValidatorFactory.cpp.

104 {
105  LOG4CPP_INFO_S ((*mainCat)) << "DlgValidatorFactory::createWithPolar";
106 
107  switch (coordUnits) {
112  return new DlgValidatorDegreesMinutesSeconds (coordScale);
113 
117  return new DlgValidatorNumber (coordScale,
118  locale);
119 
120  default:
121  LOG4CPP_ERROR_S ((*mainCat)) << "DlgValidatorFactory::createWithNonPolar";
122  exit (-1);
123  }
124 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
#define LOG4CPP_ERROR_S(logger)
Definition: convenience.h:12
Validator for angles in real degrees, integer degrees and real minutes, or integer degrees with integ...
log4cpp::Category * mainCat
Definition: Logger.cpp:14
Validator for generic (=simple) numbers.

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