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...
 
DlgValidatorAbstractcreateAboveZero (const QLocale &locale) const
 Factory method for generating validators for scale length which must be a number greater than zero. More...
 
DlgValidatorAbstractcreateCartesianOrPolarWithNonPolarPolar (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...
 
DlgValidatorAbstractcreateCartesianOrPolarWithPolarPolar (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...
 
DlgValidatorAbstractcreateWithNonPolar (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...
 
DlgValidatorAbstractcreateWithPolar (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 17 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 }

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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

The documentation for this class was generated from the following files:
DlgValidatorDegreesMinutesSeconds
Validator for angles in real degrees, integer degrees and real minutes, or integer degrees with integ...
Definition: DlgValidatorDegreesMinutesSeconds.h:16
COORD_UNITS_POLAR_THETA_TURNS
Definition: CoordUnitsPolarTheta.h:20
COORD_UNITS_NON_POLAR_THETA_DATE_TIME
Definition: CoordUnitsNonPolarTheta.h:20
COORD_UNITS_POLAR_THETA_DEGREES
Definition: CoordUnitsPolarTheta.h:14
COORD_UNITS_POLAR_THETA_DEGREES_MINUTES
Definition: CoordUnitsPolarTheta.h:15
COORD_UNITS_POLAR_THETA_GRADIANS
Definition: CoordUnitsPolarTheta.h:18
LOG4CPP_ERROR_S
#define LOG4CPP_ERROR_S(logger)
Definition: convenience.h:12
DlgValidatorFactory::createWithNonPolar
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,...
Definition: DlgValidatorFactory.cpp:74
COORD_UNITS_NON_POLAR_THETA_DEGREES_MINUTES_SECONDS
Definition: CoordUnitsNonPolarTheta.h:18
DlgValidatorDateTime
Validator for numeric value expressed as date and/or time.
Definition: DlgValidatorDateTime.h:15
COORD_UNITS_NON_POLAR_THETA_NUMBER
Definition: CoordUnitsNonPolarTheta.h:17
LOG4CPP_INFO_S
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
COORD_UNITS_POLAR_THETA_DEGREES_MINUTES_SECONDS
Definition: CoordUnitsPolarTheta.h:16
DlgValidatorFactory::createWithPolar
DlgValidatorAbstract * createWithPolar(CoordScale coordScale, CoordUnitsPolarTheta coordUnits, const QLocale &locale) const
Factory method for generating validators when cartesian/polar case handling is handled externally,...
Definition: DlgValidatorFactory.cpp:101
mainCat
log4cpp::Category * mainCat
Definition: Logger.cpp:14
COORD_UNITS_POLAR_THETA_RADIANS
Definition: CoordUnitsPolarTheta.h:19
DlgValidatorAboveZero
Validator for generic (=simple) numbers that must be greater than zero.
Definition: DlgValidatorAboveZero.h:13
DlgValidatorNumber
Validator for generic (=simple) numbers.
Definition: DlgValidatorNumber.h:16
COORD_UNITS_POLAR_THETA_DEGREES_MINUTES_SECONDS_NSEW
Definition: CoordUnitsPolarTheta.h:17