HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_Types.h File Reference
#include "GA_API.h"
#include <UT/UT_ArrayHelp.h>
#include <UT/UT_Assert.h>
#include <SYS/SYS_Inline.h>
#include <SYS/SYS_Math.h>
#include <SYS/SYS_Types.h>
+ Include dependency graph for GA_Types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UT_Array< T >
 

Macros

#define __GA_Types__
 
#define GA_MAX_ORDER   11
 
#define GA_PAGE_BITS   10
 Attributes may paritition their data in pages of GA_PAGE_SIZE offsets. More...
 
#define GA_PAGE_SIZE   (1 << GA_PAGE_BITS)
 
#define GA_PAGE_MASK   (GA_PAGE_SIZE - 1)
 
#define GA_DEFRAGMENT_OCCUPANCY   1.00
 
#define GA_INVALID_INDEX   GA_Index(-1)
 
#define GA_INVALID_OFFSET   GA_Offset(-1)
 
#define GA_DETAIL_INDEX   GA_Index(0)
 Details are always at index and offset zero in their own detail index map. More...
 
#define GA_DETAIL_OFFSET   GA_Offset(0)
 
#define GA_INVALID_DATAID   GA_DataId(-1)
 

Typedefs

typedef exint GA_Size
 Defines the bit width for index and offset types in GA. More...
 
typedef GA_Size GA_Index
 Define the strictness of GA_Offset/GA_Index. More...
 
typedef GA_Size GA_Offset
 
typedef GA_Size GA_PageNum
 
typedef GA_Size GA_PageOff
 
typedef UT_Array< GA_IndexGA_IndexArray
 
typedef UT_Array< GA_OffsetGA_OffsetArray
 
typedef int64 GA_DataId
 

Enumerations

enum  GA_AttributeOwner {
  GA_ATTRIB_VERTEX, GA_ATTRIB_POINT, GA_ATTRIB_PRIMITIVE, GA_ATTRIB_GLOBAL,
  GA_ATTRIB_OWNER_N, GA_ATTRIB_DETAIL = GA_ATTRIB_GLOBAL, GA_ATTRIB_INVALID = -1
}
 
enum  GA_Storage {
  GA_STORE_INVALID =-1, GA_STORE_BOOL, GA_STORE_UINT8, GA_STORE_INT8,
  GA_STORE_INT16, GA_STORE_INT32, GA_STORE_INT64, GA_STORE_REAL16,
  GA_STORE_REAL32, GA_STORE_REAL64, GA_STORE_STRING, GA_STORE_DICT
}
 
enum  GA_StorageClass {
  GA_STORECLASS_INVALID = -1, GA_STORECLASS_INT, GA_STORECLASS_REAL, GA_STORECLASS_FLOAT = GA_STORECLASS_REAL,
  GA_STORECLASS_STRING, GA_STORECLASS_DICT, GA_STORECLASS_OTHER
}
 
enum  GA_Precision {
  GA_PRECISION_INVALID = -1, GA_PRECISION_1, GA_PRECISION_8, GA_PRECISION_16,
  GA_PRECISION_32, GA_PRECISION_64
}
 
enum  GA_TypeInfo {
  GA_TYPE_VOID = -1, GA_TYPE_POINT, GA_TYPE_HPOINT, GA_TYPE_VECTOR,
  GA_TYPE_NORMAL, GA_TYPE_COLOR, GA_TYPE_TRANSFORM, GA_TYPE_QUATERNION,
  GA_TYPE_INDEXPAIR, GA_TYPE_NONARITHMETIC_INTEGER, GA_TYPE_ARITHMETIC_INTEGER, GA_TYPE_TEXTURE_COORD
}
 
enum  GA_AttributeScope { GA_SCOPE_INVALID = -1, GA_SCOPE_PUBLIC, GA_SCOPE_PRIVATE, GA_SCOPE_GROUP }
 
enum  GA_GroupType {
  GA_GROUP_INVALID = -1, GA_GROUP_POINT = 0, GA_GROUP_PRIMITIVE = 1, GA_GROUP_EDGE = 2,
  GA_GROUP_BREAKPOINT = 3, GA_GROUP_VERTEX = 4, GA_GROUP_N
}
 An ordinal enum for the different types of groups in GA. More...
 
enum  GA_GroupMaskType {
  GA_GMASK_NONE = 0, GA_GMASK_POINT = 1 << GA_GROUP_POINT, GA_GMASK_PRIMITIVE = 1 << GA_GROUP_PRIMITIVE, GA_GMASK_EDGE = 1 << GA_GROUP_EDGE,
  GA_GMASK_BREAKPOINT = 1 << GA_GROUP_BREAKPOINT, GA_GMASK_VERTEX = 1 << GA_GROUP_VERTEX, GA_GMASK_FULL_MASK = ((1 << GA_GROUP_N)-1)
}
 
enum  GA_KnotSpaceType { GA_KNOT_SPACE_UNIFORM, GA_KNOT_SPACE_AVERAGING }
 
enum  GA_ParameterizationType {
  GA_PARAMETERIZATION_UNIFORM, GA_PARAMETERIZATION_CHORD, GA_PARAMETERIZATION_CENTRIPETAL, GA_PARAMETERIZATION_APPROXARC,
  GA_PARAMETERIZATION_INVALID = -1
}
 
enum  GA_DataIdStrategy { GA_DATA_ID_BUMP = 0, GA_DATA_ID_CLONE = 1 }
 

Functions

GA_API size_t format (char *buffer, size_t buffer_size, const GA_AttributeOwner &v)
 
GA_API size_t format (char *buffer, size_t buffer_size, const GA_Storage &v)
 
GA_API size_t format (char *buffer, size_t buffer_size, const GA_StorageClass &v)
 
GA_API size_t format (char *buffer, size_t buffer_size, const GA_Precision &v)
 
GA_API size_t format (char *buffer, size_t buffer_size, const GA_TypeInfo &v)
 
GA_API size_t format (char *buffer, size_t buffer_size, const GA_AttributeScope &v)
 
GA_API size_t format (char *buffer, size_t buffer_size, const GA_GroupType &v)
 
SYS_FORCE_INLINE bool GAisValid (GA_Size v)
 
SYS_FORCE_INLINE GA_PageNum GAgetPageNum (GA_Offset v)
 
SYS_FORCE_INLINE GA_PageOff GAgetPageOff (GA_Offset v)
 
bool GAisFullPage (GA_Offset start, GA_Offset end)
 
GA_Offset GAgetPageBoundary (const GA_Offset &start, const GA_Offset &end)
 
GA_API unsigned GAsizeof (GA_Storage store)
 Lookup the size in bytes of a storage type (inaccurate for bool) More...
 
GA_API int GAcomparePrecision (GA_Storage a, GA_Storage b)
 
GA_API GA_Precision GAprecision (GA_Storage a)
 Return the precision associated with the storage. More...
 
GA_API const char * GAprecision (GA_Precision precision)
 Lookup the precision name from the precision. More...
 
GA_API GA_Precision GAprecision (const char *precision)
 Lookup the precision type from the precision name. More...
 
GA_API int GAprecisionBits (GA_Precision precision)
 Returns the nominal bits of provided precision, 0 for invalid. More...
 
GA_API const char * GAowner (GA_AttributeOwner owner)
 Lookup the owner name from the owner type. More...
 
GA_API GA_AttributeOwner GAowner (const char *owner)
 Lookup the owner type from the owner name. More...
 
GA_API const char * GAscope (GA_AttributeScope scope)
 Lookup the scope name from the scope type. More...
 
GA_API GA_AttributeScope GAscope (const char *scope)
 Lookup the scope type from the scope name. More...
 
GA_API const char * GAstorage (GA_Storage store)
 Lookup the storage name from the storage type. More...
 
GA_API GA_Storage GAstorage (const char *store)
 Lookup the storage type from the storage name. More...
 
GA_API const char * GAstorageLabel (GA_Storage store)
 Lookup the storage label (descriptive name) from the storage type. More...
 
GA_API GA_Storage GAstorageLabel (const char *store)
 Lookup the storage type from the storage label. More...
 
GA_API const char * GAstorageClass (GA_StorageClass store)
 Lookup the storage name from the storage type. More...
 
GA_API GA_StorageClass GAstorageClass (const char *store)
 Lookup the intrinsic storage type from the storage name. More...
 
GA_API const char * GAtypeinfo (GA_TypeInfo type)
 Lookup the type-info name from the type-info type. More...
 
GA_API GA_TypeInfo GAtypeinfo (const char *type)
 Lookup the type-info type from the type-info name. More...
 
GA_API const char * GAtypeinfoLabel (GA_TypeInfo type)
 Lookup the type-info label (descriptive name) from the type-info type. More...
 
GA_API GA_TypeInfo GAtypeinfoLabel (const char *type)
 Lookup the type-info type from the type-info label (descriptive name) More...
 
GA_API const char * GAgroupType (GA_GroupType owner)
 Lookup the owner name from the owner type. More...
 
GA_API GA_GroupType GAgroupType (const char *owner)
 Lookup the owner type from the owner name. More...
 
#define GA_INVALID_INTRINSIC_HANDLE   -1
 
typedef int GA_LocalIntrinsic
 
typedef int GA_GlobalIntrinsic
 

Macro Definition Documentation

#define __GA_Types__

Definition at line 14 of file GA_Types.h.

#define GA_DEFRAGMENT_OCCUPANCY   1.00

Definition at line 227 of file GA_Types.h.

#define GA_DETAIL_INDEX   GA_Index(0)

Details are always at index and offset zero in their own detail index map.

Definition at line 690 of file GA_Types.h.

#define GA_DETAIL_OFFSET   GA_Offset(0)

Definition at line 691 of file GA_Types.h.

#define GA_INVALID_DATAID   GA_DataId(-1)

Definition at line 697 of file GA_Types.h.

#define GA_INVALID_INDEX   GA_Index(-1)

Definition at line 686 of file GA_Types.h.

#define GA_INVALID_INTRINSIC_HANDLE   -1

At the current time, intrinsic handles are an integer. This may change in the future.

Definition at line 705 of file GA_Types.h.

#define GA_INVALID_OFFSET   GA_Offset(-1)
#define GA_MAX_ORDER   11

Definition at line 187 of file GA_Types.h.

#define GA_PAGE_BITS   10

Attributes may paritition their data in pages of GA_PAGE_SIZE offsets.

Definition at line 224 of file GA_Types.h.

#define GA_PAGE_MASK   (GA_PAGE_SIZE - 1)

Definition at line 226 of file GA_Types.h.

#define GA_PAGE_SIZE   (1 << GA_PAGE_BITS)
Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 225 of file GA_Types.h.

Typedef Documentation

typedef int64 GA_DataId

Definition at line 696 of file GA_Types.h.

At the current time, intrinsic handles are an integer. This may change in the future.

Definition at line 704 of file GA_Types.h.

typedef GA_Size GA_Index

Define the strictness of GA_Offset/GA_Index.

GA_Index is a contiguous index into an element in a GA_Detail structure. Since the list of elements can contain gaps, the index should be translated into a GA_Offset prior to lookup. The index remains constant if the element list is defragmented, but will be invalid if an element, prior to a given index, is inserted or deleted.

See Also
GA_Detail::pointOffset, GA_Detail::pointIndex,
GA_Detail::primitiveOffset, GA_Detail::primitiveIndex
GA_Detail::vertexOffset, GA_Detail::vertexIndex
Examples:
RAY/RAY_DemoSprite.C, SOP/SOP_CopRaster.C, SOP/SOP_PrimVOP.C, and SOP/SOP_Surface.C.

Definition at line 640 of file GA_Types.h.

Definition at line 693 of file GA_Types.h.

At the current time, intrinsic handles are an integer. This may change in the future.

Definition at line 703 of file GA_Types.h.

typedef GA_Size GA_Offset

GA_Offset is a, possibly, non-contiguous offset to an element in a GA_Detail structure. GA_Offsets remain constant even if an element prior to it is deleted, but will be invalidated if an element is inserted prior to it, or if the element list is defragmented.

Examples:
euclid/SOP_Euclid.C, SOP/SOP_BrushHairLen.C, SOP/SOP_DetailAttrib.C, and tetprim/GEO_PrimTetra.C.

Definition at line 646 of file GA_Types.h.

Definition at line 694 of file GA_Types.h.

Definition at line 649 of file GA_Types.h.

Definition at line 650 of file GA_Types.h.

typedef exint GA_Size

Defines the bit width for index and offset types in GA.

Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 236 of file GA_Types.h.

Enumeration Type Documentation

The GA_AttributeOwner enum is used to differentiate between the different types of attribute arrays stored in a GA_Detail. The different classes represent

  1. unique point attribute data (one per vertex on a primitive)
  2. shared point attribute data (attributes shared multiple vertices)
  3. per-primitive attribute data (one per primitive)
  4. attribute data stored on the detail itself (single value)
Enumerator
GA_ATTRIB_VERTEX 
GA_ATTRIB_POINT 
GA_ATTRIB_PRIMITIVE 
GA_ATTRIB_GLOBAL 
GA_ATTRIB_OWNER_N 
GA_ATTRIB_DETAIL 
GA_ATTRIB_INVALID 

Definition at line 35 of file GA_Types.h.

Scope qualifiers on attributes. Each valid scope has its own namespace, along with other consequences.

Enumerator
GA_SCOPE_INVALID 

Data has no numeric representation.

GA_SCOPE_PUBLIC 

Standard user attribute level.

GA_SCOPE_PRIVATE 
GA_SCOPE_GROUP 

Definition at line 143 of file GA_Types.h.

Strategies that may be used for attribute data IDs, usually when merging or copying attributes.

Note
Most functions with a parameter of this type typically treat it as a hint, and may ignore it when the requested strategy is not appropriate.
Enumerator
GA_DATA_ID_BUMP 

The default strategy, where the caller does not have to explicitly worry about attribute data IDs.

GA_DATA_ID_CLONE 

Attributes should inherit the data IDs from their corresponding source attribute. The caller will typically call GA_Attribute::bumpDataId() on any attributes that they later modify.

Definition at line 211 of file GA_Types.h.

Currently SOP_Node::parseAllGroups takes a mask of different types of groups. This enum allows group types to be packed into a bit field.

Enumerator
GA_GMASK_NONE 
GA_GMASK_POINT 
GA_GMASK_PRIMITIVE 
GA_GMASK_EDGE 
GA_GMASK_BREAKPOINT 
GA_GMASK_VERTEX 
GA_GMASK_FULL_MASK 

Definition at line 175 of file GA_Types.h.

An ordinal enum for the different types of groups in GA.

Enumerator
GA_GROUP_INVALID 
GA_GROUP_POINT 
GA_GROUP_PRIMITIVE 
GA_GROUP_EDGE 
GA_GROUP_BREAKPOINT 
GA_GROUP_VERTEX 
GA_GROUP_N 

Definition at line 161 of file GA_Types.h.

Enumerator
GA_KNOT_SPACE_UNIFORM 
GA_KNOT_SPACE_AVERAGING 

Definition at line 190 of file GA_Types.h.

Enumerator
GA_PARAMETERIZATION_UNIFORM 
GA_PARAMETERIZATION_CHORD 
GA_PARAMETERIZATION_CENTRIPETAL 
GA_PARAMETERIZATION_APPROXARC 
GA_PARAMETERIZATION_INVALID 

Definition at line 197 of file GA_Types.h.

If one only cares about precision, this can be used. Note that 8-bit reals do not exist so will instead refer to 16-bit.

Enumerator
GA_PRECISION_INVALID 
GA_PRECISION_1 
GA_PRECISION_8 
GA_PRECISION_16 
GA_PRECISION_32 
GA_PRECISION_64 

Definition at line 88 of file GA_Types.h.

enum GA_Storage

Attributes (and other data) may be stored with different precision and storage types.

Enumerator
GA_STORE_INVALID 
GA_STORE_BOOL 
GA_STORE_UINT8 
GA_STORE_INT8 
GA_STORE_INT16 
GA_STORE_INT32 
GA_STORE_INT64 
GA_STORE_REAL16 
GA_STORE_REAL32 
GA_STORE_REAL64 
GA_STORE_STRING 
GA_STORE_DICT 

Definition at line 51 of file GA_Types.h.

Often one does not care about the precision. In this case the storage class gives a good idea which AIFs will be supported.

Enumerator
GA_STORECLASS_INVALID 
GA_STORECLASS_INT 
GA_STORECLASS_REAL 
GA_STORECLASS_FLOAT 
GA_STORECLASS_STRING 
GA_STORECLASS_DICT 
GA_STORECLASS_OTHER 

Definition at line 73 of file GA_Types.h.

Type qualifiers on attributes. These qualifiers can help to interpret the data associated with an attribute, but are not required.

Enumerator
GA_TYPE_VOID 

Data has no numeric representation.

GA_TYPE_POINT 

Data represents a position in space. Token "point".

GA_TYPE_HPOINT 

Data represents a position and homogeneous coordinate. The position is stored in non-homogeneous space (i.e. the w coordinate is not multiplied through). Token "hpoint"

GA_TYPE_VECTOR 

Data represents a direction vector. Token "vector".

GA_TYPE_NORMAL 

Data represents a normal vector. Token "normal".

GA_TYPE_COLOR 

Data represents a color. Token "color".

GA_TYPE_TRANSFORM 

Data represents a transform matrix. Token "matrix".

GA_TYPE_QUATERNION 

Data represents a quaternion. Token "quaternion".

GA_TYPE_INDEXPAIR 

Data represents an index-pair. Token "indexpair".

GA_TYPE_NONARITHMETIC_INTEGER 

When a numeric attribute is created with integer storage, the attribute will be tagged as a non-arithmetic integer. This means that mathematical operations will not typically be performed (i.e. integer values will not be averaged). This works well for most cases of integers under Houdini.

GA_TYPE_ARITHMETIC_INTEGER 

Arithmetic integers will be modified under arithmetic operations. Their values will be averaged etc.

Note
This is not the default behaviour for numeric attributes
GA_TYPE_TEXTURE_COORD 

Data represents a coordinate in texture space, a.k.a. uv/uvw, but not a primitive uv/uvw.

Definition at line 101 of file GA_Types.h.

Function Documentation

GA_API size_t format ( char *  buffer,
size_t  buffer_size,
const GA_AttributeOwner v 
)
GA_API size_t format ( char *  buffer,
size_t  buffer_size,
const GA_Storage v 
)
GA_API size_t format ( char *  buffer,
size_t  buffer_size,
const GA_StorageClass v 
)
GA_API size_t format ( char *  buffer,
size_t  buffer_size,
const GA_Precision v 
)
GA_API size_t format ( char *  buffer,
size_t  buffer_size,
const GA_TypeInfo v 
)
GA_API size_t format ( char *  buffer,
size_t  buffer_size,
const GA_AttributeScope v 
)
GA_API size_t format ( char *  buffer,
size_t  buffer_size,
const GA_GroupType v 
)
GA_API int GAcomparePrecision ( GA_Storage  a,
GA_Storage  b 
)

Compare precision of GA_Storage types. The function will return: -2 invalid comparison (i.e. comparing a string to a float) -1 if a is less precise than b 0 if a and be have the same precision 1 if a is more precise than b

GA_Offset GAgetPageBoundary ( const GA_Offset start,
const GA_Offset end 
)
inline

Definition at line 680 of file GA_Types.h.

SYS_FORCE_INLINE GA_PageNum GAgetPageNum ( GA_Offset  v)

Definition at line 664 of file GA_Types.h.

SYS_FORCE_INLINE GA_PageOff GAgetPageOff ( GA_Offset  v)

Definition at line 669 of file GA_Types.h.

GA_API const char* GAgroupType ( GA_GroupType  owner)

Lookup the owner name from the owner type.

GA_API GA_GroupType GAgroupType ( const char *  owner)

Lookup the owner type from the owner name.

bool GAisFullPage ( GA_Offset  start,
GA_Offset  end 
)
inline

Definition at line 673 of file GA_Types.h.

SYS_FORCE_INLINE bool GAisValid ( GA_Size  v)
Examples:
field3d/f3d_io.C, SOP/SOP_BrushHairLen.C, and SOP/SOP_SParticle.C.

Definition at line 655 of file GA_Types.h.

GA_API const char* GAowner ( GA_AttributeOwner  owner)

Lookup the owner name from the owner type.

GA_API GA_AttributeOwner GAowner ( const char *  owner)

Lookup the owner type from the owner name.

GA_API GA_Precision GAprecision ( GA_Storage  a)

Return the precision associated with the storage.

GA_API const char* GAprecision ( GA_Precision  precision)

Lookup the precision name from the precision.

GA_API GA_Precision GAprecision ( const char *  precision)

Lookup the precision type from the precision name.

GA_API int GAprecisionBits ( GA_Precision  precision)

Returns the nominal bits of provided precision, 0 for invalid.

GA_API const char* GAscope ( GA_AttributeScope  scope)

Lookup the scope name from the scope type.

GA_API GA_AttributeScope GAscope ( const char *  scope)

Lookup the scope type from the scope name.

GA_API unsigned GAsizeof ( GA_Storage  store)

Lookup the size in bytes of a storage type (inaccurate for bool)

GA_API const char* GAstorage ( GA_Storage  store)

Lookup the storage name from the storage type.

GA_API GA_Storage GAstorage ( const char *  store)

Lookup the storage type from the storage name.

GA_API const char* GAstorageClass ( GA_StorageClass  store)

Lookup the storage name from the storage type.

GA_API GA_StorageClass GAstorageClass ( const char *  store)

Lookup the intrinsic storage type from the storage name.

GA_API const char* GAstorageLabel ( GA_Storage  store)

Lookup the storage label (descriptive name) from the storage type.

GA_API GA_Storage GAstorageLabel ( const char *  store)

Lookup the storage type from the storage label.

GA_API const char* GAtypeinfo ( GA_TypeInfo  type)

Lookup the type-info name from the type-info type.

GA_API GA_TypeInfo GAtypeinfo ( const char *  type)

Lookup the type-info type from the type-info name.

GA_API const char* GAtypeinfoLabel ( GA_TypeInfo  type)

Lookup the type-info label (descriptive name) from the type-info type.

GA_API GA_TypeInfo GAtypeinfoLabel ( const char *  type)

Lookup the type-info type from the type-info label (descriptive name)