HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_Types.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GT_Types.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_Types__
12 #define __GT_Types__
13 
14 #include "GT_API.h"
15 #include <SYS/SYS_Types.h>
16 #include <UT/UT_StringHolder.h>
17 
19 {
30 
32 };
33 
34 enum GT_Type
35 {
36  GT_TYPE_NONE = -1, // Implicit type based on data
37  GT_TYPE_POINT, // Position
38  GT_TYPE_HPOINT, // Homogeneous position
39  GT_TYPE_VECTOR, // Direction vector
40  GT_TYPE_NORMAL, // Normal
41  GT_TYPE_COLOR, // Color
42  GT_TYPE_QUATERNION, // Quaternion
43  GT_TYPE_MATRIX3, // 3x3 Matrix
44  GT_TYPE_MATRIX, // Matrix
45  GT_TYPE_ST, // Parametric interval
46  GT_TYPE_HIDDEN, // "Private" (hidden)
47  GT_TYPE_BOX2, // 2x2 Bounding box
48  GT_TYPE_BOX, // 3x3 Bounding box
49  GT_TYPE_TEXTURE, // Texture coordinate
50  GT_TYPE_INDEXPAIR, // Capture index/weight pair
51 };
52 
54 {
56 
64 
66 };
67 
68 // Breakpoint curve parameterization
70 {
76 };
77 
78 /// Subdivision schemes
80 {
84 };
85 
87 {
89 
94 
98 
100 };
101 
103 {
104  GT_INDEXING_SMALL, // Use small data types for indexing (i.e. int32)
105  GT_INDEXING_LARGE, // Use large data types for indexing (i.e. int64)
106  GT_INDEXING_QUICK, // Perform a quick check to see which indexing to use
107  GT_INDEXING_CHECK, // Check, perhaps using a more expensive test
108 };
109 
111 {
112  GT_CACHE_DETAIL_DELETE, // Delete all references to detail
113  GT_CACHE_ATTRIBUTE_CHANGE, // Attribute value change
114  GT_CACHE_ATTRIBUTE_CREATE, // Attribute created
115  GT_CACHE_ATTRIBUTE_DELETE, // Attribute deleted
116  GT_CACHE_INDEXMAP_CHANGE, // Index map change (grow/shrink)
117  GT_CACHE_GROUP_CHANGE, // Group was changed
118  GT_CACHE_GROUP_CREATE, // New group added
119  GT_CACHE_GROUP_DELETE, // Group deleted
120 };
121 
123 using GT_Size = int64;
124 using GT_Offset = int64;
125 
126 template <typename T> constexpr GT_Storage
128 
129 template <> constexpr GT_Storage GTstorage<uint8>() { return GT_STORE_UINT8; }
130 template <> constexpr GT_Storage GTstorage<int8>() { return GT_STORE_INT8; }
131 template <> constexpr GT_Storage GTstorage<int16>() { return GT_STORE_INT16; }
132 template <> constexpr GT_Storage GTstorage<int32>() { return GT_STORE_INT32; }
133 template <> constexpr GT_Storage GTstorage<int64>() { return GT_STORE_INT64; }
134 template <> constexpr GT_Storage GTstorage<fpreal16>() { return GT_STORE_REAL16; }
135 template <> constexpr GT_Storage GTstorage<fpreal32>() { return GT_STORE_REAL32; }
136 template <> constexpr GT_Storage GTstorage<fpreal64>() { return GT_STORE_REAL64; }
137 template <> constexpr GT_Storage GTstorage<GT_String>() { return GT_STORE_STRING; }
138 
139 /// @{
140 /// Perform mapping between enum and string name
141 GT_API extern int GTsizeof(GT_Storage storage);
142 GT_API extern const char *GTstorage(GT_Storage storage);
143 GT_API extern GT_Storage GTstorage(const char *storage);
144 GT_API extern const char *GTtype(GT_Type type);
145 GT_API extern GT_Type GTtype(const char *type);
146 GT_API extern const char *GTbasis(GT_Basis basis);
147 GT_API extern GT_Basis GTbasis(const char *basis);
148 GT_API extern const char *GTscheme(GT_Scheme scheme);
149 GT_API extern GT_Scheme GTscheme(const char *scheme,
151 GT_API extern const char *GTowner(GT_Owner owner);
152 GT_API extern GT_Owner GTowner(const char *owner);
153 /// @}
154 
155 /// Compute the number of spans for a given basis and cv count. For basis
156 /// types other than linear, the order is assumed to be 4.
157 GT_API extern GT_Size GTbasisSpans(GT_Basis basis,
158  GT_Size count, bool wrapped,
159  int order = 4);
160 GT_API extern GT_Size GTbasisStep(GT_Basis basis, int order = 4);
161 
162 static inline constexpr bool GTisInteger(GT_Storage s)
163  {
164  return s == GT_STORE_INT32 ||
165  s == GT_STORE_INT64 ||
166  s == GT_STORE_INT16 ||
167  s == GT_STORE_INT8 ||
168  s == GT_STORE_UINT8;
169  }
170 static inline constexpr bool GTisFloat(GT_Storage s)
171  {
172  return s == GT_STORE_REAL16 ||
173  s == GT_STORE_REAL32 ||
174  s == GT_STORE_REAL64;
175  }
176 static inline constexpr bool GTisString(GT_Storage s)
177  { return s == GT_STORE_STRING; }
178 
179 template <typename T> static inline int64
180 GThandleMemoryUsage(const T &handle)
181 {
182  return handle ? handle->getMemoryUsage() : 0;
183 }
184 
185 #endif
GT_Storage
Definition: GT_Types.h:18
GT_API const char * GTscheme(GT_Scheme scheme)
GT_API const char * GTbasis(GT_Basis basis)
GLuint GLdouble GLdouble GLint GLint order
Definition: glew.h:3460
GT_API const char * GTtype(GT_Type type)
constexpr GT_Storage GTstorage< uint8 >()
Definition: GT_Types.h:129
constexpr GT_Storage GTstorage< fpreal64 >()
Definition: GT_Types.h:136
GT_IndexingMode
Definition: GT_Types.h:102
constexpr GT_Storage GTstorage< fpreal32 >()
Definition: GT_Types.h:135
#define GT_API
Definition: GT_API.h:11
GT_Type
Definition: GT_Types.h:34
constexpr GT_Storage GTstorage< int8 >()
Definition: GT_Types.h:130
GT_CacheEventType
Definition: GT_Types.h:110
GT_API GT_Size GTbasisStep(GT_Basis basis, int order=4)
constexpr GT_Storage GTstorage< GT_String >()
Definition: GT_Types.h:137
GT_Scheme
Subdivision schemes.
Definition: GT_Types.h:79
constexpr GT_Storage GTstorage< fpreal16 >()
Definition: GT_Types.h:134
int64 GT_Offset
Definition: GT_Types.h:124
long long int64
Definition: SYS_Types.h:116
GT_Parameterization
Definition: GT_Types.h:69
GLint GLsizei count
Definition: glcorearb.h:405
GT_Owner
Definition: GT_Types.h:86
int64 GT_Size
Definition: GT_Types.h:123
constexpr GT_Storage GTstorage< int32 >()
Definition: GT_Types.h:132
constexpr GT_Storage GTstorage< int64 >()
Definition: GT_Types.h:133
getOption("OpenEXR.storage") storage
Definition: HDK_Image.dox:276
GT_API GT_Size GTbasisSpans(GT_Basis basis, GT_Size count, bool wrapped, int order=4)
GT_Basis
Definition: GT_Types.h:53
type
Definition: core.h:1059
GLdouble s
Definition: glew.h:1395
GT_API int GTsizeof(GT_Storage storage)
constexpr GT_Storage GTstorage< int16 >()
Definition: GT_Types.h:131
GT_API const char * GTowner(GT_Owner owner)
constexpr GT_Storage GTstorage()
Definition: GT_Types.h:127