37 #ifndef vtkVariantExtract_h
38 #define vtkVariantExtract_h
45 vtkGenericWarningMacro(
46 <<
"Cannot convert vtkVariant containing [" << value.
GetTypeAsString() <<
"] "
47 <<
"to unsupported type [" <<
typeid(T).
name() <<
"]. "
48 <<
"Create a vtkVariantExtract<> specialization to eliminate this warning."
60 valid =
value.IsChar();
61 return valid ?
value.ToChar() : 0;
67 valid =
value.IsUnsignedChar();
68 return valid ?
value.ToUnsignedChar() : 0;
74 valid =
value.IsShort();
75 return valid ?
value.ToShort() : 0;
81 valid =
value.IsUnsignedShort();
82 return valid ?
value.ToUnsignedShort() : 0;
88 valid =
value.IsInt();
89 return valid ?
value.ToInt() : 0;
95 valid =
value.IsUnsignedInt();
96 return valid ?
value.ToUnsignedInt() : 0;
102 valid =
value.IsLong();
103 return valid ?
value.ToLong() : 0;
109 valid =
value.IsUnsignedLong();
110 return valid ?
value.ToUnsignedLong() : 0;
113 #ifdef VTK_TYPE_USE___INT64
118 valid =
value.Is__Int64();
119 return valid ?
value.To__Int64() : 0;
125 valid = value.IsUnsigned__Int64();
126 return valid ? value.ToUnsigned__Int64() : 0;
132 #ifdef VTK_TYPE_USE_LONG_LONG
137 valid = value.IsLongLong();
138 return valid ? value.ToLongLong() : 0;
144 valid = value.IsUnsignedLongLong();
145 return valid ? value.ToUnsignedLongLong() : 0;
153 valid = value.IsFloat();
154 return valid ? value.ToFloat() : 0.0f;
160 valid = value.IsDouble();
161 return valid ? value.ToDouble() : 0.0;
167 valid = value.IsString();
174 valid = value.IsUnicodeString();
Wrapper around std::string to keep symbols short.
A atomic type representing the union of many types.
const char * GetTypeAsString() const
String class that stores Unicode text.