Class to define a numeric display format. More...
#include <MeshViz/graph/PbNumericDisplayFormat.h>
Public Types | |
enum | FormatType { AUTO_FORMAT, FLOAT_FORMAT, INTEGER_FORMAT } |
Public Member Functions | |
PbNumericDisplayFormat (FormatType type=AUTO_FORMAT, int tenPower=0, int numDecimal=0) | |
PbNumericDisplayFormat (const PbNumericDisplayFormat &format) | |
void | setFormat (FormatType type=AUTO_FORMAT, int tenPower=0, int numDecimal=0) |
void | getFormat (FormatType &type, int &tenPower, int &numDecimal) const |
PbNumericDisplayFormat & | operator= (const PbNumericDisplayFormat &format) |
This class is used to define a numerical display format for numerical values to be displayed. There are three formats available: automatic format, floating point format, integer format. The default format is the automatic format. The automatic format selects the best format adapted to the domain of values to be displayed. The floating point format and the integer format divide the numerical value to be displayed by the power of ten, and then display it in the selected format.
PbNumericDisplayFormat::PbNumericDisplayFormat | ( | FormatType | type = AUTO_FORMAT , |
|
int | tenPower = 0 , |
|||
int | numDecimal = 0 | |||
) |
Constructor.
PbNumericDisplayFormat::PbNumericDisplayFormat | ( | const PbNumericDisplayFormat & | format | ) |
Copy constructor.
void PbNumericDisplayFormat::getFormat | ( | FormatType & | type, | |
int & | tenPower, | |||
int & | numDecimal | |||
) | const [inline] |
Gets the numerical display format.
PbNumericDisplayFormat& PbNumericDisplayFormat::operator= | ( | const PbNumericDisplayFormat & | format | ) |
Assignment operator.
Reimplemented from PbBase.
void PbNumericDisplayFormat::setFormat | ( | FormatType | type = AUTO_FORMAT , |
|
int | tenPower = 0 , |
|||
int | numDecimal = 0 | |||
) |
Sets the numerical display format.
If the format is AUTO_FORMAT, numDecimal and tenPower are useless. If the format is FLOAT_FORMAT, numDecimal indicates the number of decimals placed after the decimal point and tenPower is the power of ten divisor. If the format is INTEGER_FORMAT, numDecimal is useless.