Class encoding a data type. More...
#include <Inventor/SbDataType.h>
Classes | |
union | DataValue |
union used to cast the generic value into specific type | |
Public Types | |
enum | DataType { UNSIGNED_BYTE = 0, UNSIGNED_SHORT = 1, UNSIGNED_INT32 = 2, SIGNED_BYTE = 4, SIGNED_SHORT = 5, SIGNED_INT32 = 6, FLOAT = 10, DOUBLE = 11, UNKNOWN = 0xFFFF } |
Public Member Functions | |
SbDataType (DataType type) | |
SbDataType (const SbString &type) | |
SbDataType () | |
operator unsigned int () const | |
DataType | getType () const |
unsigned int | getSize () const |
SbBool | isSigned () const |
SbBool | isInteger () const |
unsigned int | getNumBits () const |
SbString | getString () const |
double | getMin () const |
double | getMax () const |
template<> | |
SbDataType | getTemplateType (const unsigned char &) |
template<> | |
SbDataType | getTemplateType (const unsigned short &) |
template<> | |
SbDataType | getTemplateType (const uint32_t &) |
template<> | |
SbDataType | getTemplateType (const signed char &) |
template<> | |
SbDataType | getTemplateType (const signed short &) |
template<> | |
SbDataType | getTemplateType (const int &) |
template<> | |
SbDataType | getTemplateType (const float &) |
template<> | |
SbDataType | getTemplateType (const double &) |
Class encoding a data type.
This is a basic Open Inventor type that is used for representing a data type, for example unsigned int32, and some information about that type, for example is it signed or not. It is used by classes handling user buffers such as SoMemoryObject, SoSFArray2D, SoSFArray3D, SoSFImage and also SoDataSet.
SoMemoryObject, SoSFArray2D, SoSFArray3D
enum SbDataType::DataType |
SbDataType::SbDataType | ( | DataType | type | ) | [inline, explicit] |
Copy constructor.
SbDataType::SbDataType | ( | const SbString & | type | ) |
Constructor from a string.
Valid strings are the enum names.
SbDataType::SbDataType | ( | ) | [inline] |
Default constructor.
The initial value is UNSIGNED_BYTE.
double SbDataType::getMax | ( | ) | const |
Returns the maximum value of the type.
double SbDataType::getMin | ( | ) | const |
Returns the minimum value of the type.
For floating point type, returns the minimum positive normalized value.
unsigned int SbDataType::getNumBits | ( | ) | const [inline] |
Returns the numer of bits in the type.
unsigned int SbDataType::getSize | ( | void | ) | const [inline] |
Returns size in bytes of the type.
SbString SbDataType::getString | ( | ) | const |
Returns the type as a string, e.g.
"FLOAT". See also getType().
SbDataType SbDataType::getTemplateType | ( | const double & | ) | [inline] |
SbDataType SbDataType::getTemplateType | ( | const float & | ) | [inline] |
SbDataType SbDataType::getTemplateType | ( | const int & | ) | [inline] |
SbDataType SbDataType::getTemplateType | ( | const signed short & | ) | [inline] |
SbDataType SbDataType::getTemplateType | ( | const signed char & | ) | [inline] |
SbDataType SbDataType::getTemplateType | ( | const uint32_t & | ) | [inline] |
SbDataType SbDataType::getTemplateType | ( | const unsigned short & | ) | [inline] |
SbDataType SbDataType::getTemplateType | ( | const unsigned char & | ) | [inline] |
SbDataType::DataType SbDataType::getType | ( | ) | const [inline] |
Returns the type as an enum.
See also getString().
SbBool SbDataType::isInteger | ( | ) | const [inline] |
Returns true if the type is an integer type.
SbBool SbDataType::isSigned | ( | ) | const [inline] |
Returns true if the type is signed.
SbDataType::operator unsigned int | ( | ) | const [inline] |