14#ifndef DCNUMERICRANGE_H
15#define DCNUMERICRANGE_H
26class EXPCL_DIRECT_DCPARSER DCNumericRange {
30 INLINE DCNumericRange();
31 INLINE DCNumericRange(Number min, Number max);
32 INLINE DCNumericRange(
const DCNumericRange ©);
33 INLINE
void operator = (
const DCNumericRange ©);
36 INLINE
void validate(Number num,
bool &range_error)
const;
43 INLINE
void output(std::ostream &out, Number divisor = 1)
const;
44 INLINE
void output_char(std::ostream &out, Number divisor = 1)
const;
58 INLINE
bool operator < (
const MinMax &other)
const;
63 INLINE
void output_minmax(std::ostream &out, Number divisor,
const MinMax &range)
const;
64 INLINE
void output_minmax_char(std::ostream &out,
const MinMax &range)
const;
66 typedef pvector<MinMax> Ranges;
Represents a range of legal integer or floating-point values.
bool add_range(Number min, Number max)
Adds a new minmax to the list of ranges.
bool has_one_value() const
Returns true if the numeric range specifies exactly one legal value, false if multiple values are leg...
Number get_max(int n) const
Returns the maximum value defined by the nth component.
Number get_min(int n) const
Returns the minimum value defined by the nth component.
int get_num_ranges() const
Returns the number of minmax components in the range description.
void output_char(std::ostream &out, Number divisor=1) const
Outputs the range, formatting the numeric values as quoted ASCII characters.
void validate(Number num, bool &range_error) const
Convenience function to validate the indicated number.
bool is_empty() const
Returns true if the range contains no elements (and thus allows all numbers), false if it contains at...
Number get_one_value() const
If has_one_value() returns true, this returns the one legal value accepted by the numeric range.
bool is_in_range(Number num) const
Returns true if the indicated number is within the specified range, false otherwise.
This class generates an arbitrary hash number from a sequence of ints.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.