VTK
Classes | Macros | Functions
vtkTypeTraits.h File Reference
#include "vtkSystemIncludes.h"
Include dependency graph for vtkTypeTraits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vtkTypeTraits< T >
 Template defining traits of native types used by VTK. More...
 

Macros

#define VTK_TYPE_TRAITS(type, macro, isSigned, name, print, format)
 
#define VTK_TYPE_NAME_FLOAT   float
 
#define VTK_TYPE_NAME_DOUBLE   double
 
#define VTK_TYPE_SIZED_FLOAT   FLOAT32
 
#define VTK_TYPE_SIZED_DOUBLE   FLOAT64
 
#define VTK_TYPE_NAME_CHAR   char
 
#define VTK_TYPE_SIZED_CHAR   UINT8
 
#define VTK_TYPE_NAME_SIGNED_CHAR   signed char
 
#define VTK_TYPE_NAME_UNSIGNED_CHAR   unsigned char
 
#define VTK_TYPE_SIZED_SIGNED_CHAR   INT8
 
#define VTK_TYPE_SIZED_UNSIGNED_CHAR   UINT8
 
#define VTK_TYPE_NAME_SHORT   short
 
#define VTK_TYPE_NAME_UNSIGNED_SHORT   unsigned short
 
#define VTK_TYPE_SIZED_SHORT   INT16
 
#define VTK_TYPE_SIZED_UNSIGNED_SHORT   UINT16
 
#define VTK_TYPE_NAME_INT   int
 
#define VTK_TYPE_NAME_UNSIGNED_INT   unsigned int
 
#define VTK_TYPE_SIZED_INT   INT32
 
#define VTK_TYPE_SIZED_UNSIGNED_INT   UINT32
 
#define VTK_TYPE_NAME_LONG   long
 
#define VTK_TYPE_NAME_UNSIGNED_LONG   unsigned long
 
#define VTK_TYPE_NAME_ID_TYPE   vtkIdType
 
#define VTK_TYPE_SIZED_ID_TYPE   INT32
 

Functions

 VTK_TYPE_TRAITS (float, FLOAT, 1, Float32, float,"%f")
 
 VTK_TYPE_TRAITS (double, DOUBLE, 1, Float64, double,"%lf")
 
 VTK_TYPE_TRAITS (char, CHAR, 0, UInt8, unsigned short,"%hu")
 
 VTK_TYPE_TRAITS (signed char, SIGNED_CHAR, 1, Int8, short,"%hd")
 
 VTK_TYPE_TRAITS (unsigned char, UNSIGNED_CHAR, 0, UInt8, unsigned short,"%hu")
 
 VTK_TYPE_TRAITS (short, SHORT, 1, Int16, short,"%hd")
 
 VTK_TYPE_TRAITS (unsigned short, UNSIGNED_SHORT, 0, UInt16, unsigned short,"%hu")
 
 VTK_TYPE_TRAITS (int, INT, 1, Int32, int,"%d")
 
 VTK_TYPE_TRAITS (unsigned int, UNSIGNED_INT, 0, UInt32, unsigned int,"%u")
 

Macro Definition Documentation

#define VTK_TYPE_TRAITS (   type,
  macro,
  isSigned,
  name,
  print,
  format 
)
Value:
{ \
/* The type itself. */ \
typedef type ValueType; \
\
/* the value defined for this type in vtkType */ \
enum { VTK_TYPE_ID = VTK_##macro }; \
static int VTKTypeID() { return VTK_##macro; } \
\
/* The smallest possible value represented by the type. */ \
static type Min() { return VTK_##macro##_MIN; } \
\
/* The largest possible value represented by the type. */ \
static type Max() { return VTK_##macro##_MAX; } \
\
/* Whether the type is signed. */ \
static int IsSigned() { return isSigned; } \
\
/* An "alias" type that is the same size and signedness. */ \
typedef vtkType##name SizedType; \
\
/* A name for the type indicating its size and signedness. */ \
static const char* SizedName() { return #name; } \
\
/* A type to use for printing or parsing values in strings. */ \
typedef print PrintType; \
\
/* A format for parsing values from strings. Use with PrintType. */ \
static const char* ParseFormat() { return format; } \
}
bool IsSigned(int VariantType)
#define VTK_TEMPLATE_SPECIALIZE
Definition: vtkConfigure.h:174
Template defining traits of native types used by VTK.
Definition: vtkTypeTraits.h:31

Definition at line 34 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_FLOAT   float

Definition at line 67 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_DOUBLE   double

Definition at line 68 of file vtkTypeTraits.h.

#define VTK_TYPE_SIZED_FLOAT   FLOAT32

Definition at line 69 of file vtkTypeTraits.h.

#define VTK_TYPE_SIZED_DOUBLE   FLOAT64

Definition at line 70 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_CHAR   char

Definition at line 76 of file vtkTypeTraits.h.

#define VTK_TYPE_SIZED_CHAR   UINT8

Definition at line 81 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_SIGNED_CHAR   signed char

Definition at line 84 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_UNSIGNED_CHAR   unsigned char

Definition at line 85 of file vtkTypeTraits.h.

#define VTK_TYPE_SIZED_SIGNED_CHAR   INT8

Definition at line 86 of file vtkTypeTraits.h.

#define VTK_TYPE_SIZED_UNSIGNED_CHAR   UINT8

Definition at line 87 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_SHORT   short

Definition at line 92 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_UNSIGNED_SHORT   unsigned short

Definition at line 93 of file vtkTypeTraits.h.

#define VTK_TYPE_SIZED_SHORT   INT16

Definition at line 94 of file vtkTypeTraits.h.

#define VTK_TYPE_SIZED_UNSIGNED_SHORT   UINT16

Definition at line 95 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_INT   int

Definition at line 101 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_UNSIGNED_INT   unsigned int

Definition at line 102 of file vtkTypeTraits.h.

#define VTK_TYPE_SIZED_INT   INT32

Definition at line 103 of file vtkTypeTraits.h.

#define VTK_TYPE_SIZED_UNSIGNED_INT   UINT32

Definition at line 104 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_LONG   long

Definition at line 109 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_UNSIGNED_LONG   unsigned long

Definition at line 110 of file vtkTypeTraits.h.

#define VTK_TYPE_NAME_ID_TYPE   vtkIdType

Definition at line 160 of file vtkTypeTraits.h.

#define VTK_TYPE_SIZED_ID_TYPE   INT32

Definition at line 164 of file vtkTypeTraits.h.

Function Documentation

VTK_TYPE_TRAITS ( float  ,
FLOAT  ,
,
Float32  ,
float  ,
"%f"   
)
VTK_TYPE_TRAITS ( double  ,
DOUBLE  ,
,
Float64  ,
double  ,
"%lf"   
)
VTK_TYPE_TRAITS ( char  ,
CHAR  ,
,
UInt8  ,
unsigned  short,
"%hu"   
)
VTK_TYPE_TRAITS ( signed  char,
SIGNED_CHAR  ,
,
Int8  ,
short  ,
"%hd"   
)
VTK_TYPE_TRAITS ( unsigned  char,
UNSIGNED_CHAR  ,
,
UInt8  ,
unsigned  short,
"%hu"   
)
VTK_TYPE_TRAITS ( short  ,
SHORT  ,
,
Int16  ,
short  ,
"%hd"   
)
VTK_TYPE_TRAITS ( unsigned  short,
UNSIGNED_SHORT  ,
,
UInt16  ,
unsigned  short,
"%hu"   
)
VTK_TYPE_TRAITS ( int  ,
INT  ,
,
Int32  ,
int  ,
"%d"   
)
VTK_TYPE_TRAITS ( unsigned  int,
UNSIGNED_INT  ,
,
UInt32  ,
unsigned  int,
"%u"   
)