65 const char *description=
"")
69 , myTypeInfo(typeinfo)
70 , myTupleSize(tuple_size)
72 , myDescription(description)
77 const char *
getName()
const {
return myName; }
109 const char *description=
"")
112 , myDescription(description)
116 const char *
getName()
const {
return myName; }
133 const char *
name=
"",
int rx=0,
int ry=0,
int rz=0)
142 const char *
getName()
const {
return myName; }
152 { myResX = rx; myResY = ry; myResZ = rz; }
156 GA_Size myResX, myResY, myResZ;
163 setPrimitiveCount(0);
164 clearAllAttributes();
166 clearPrimitiveTypes();
201 myAttributes[owner].clear();
206 myAttributes[owner].append(attrib);
210 return myAttributes[owner].entries();
215 return myAttributes[owner](i);
232 myGroups[gtype].setCapacity(0);
236 myGroups[gtype].append(group);
240 return myGroups[gtype].entries();
244 return myGroups[gtype](i);
265 const char *bounds_name=
"bounds");
272 myPrimitiveTypes.clear();
285 auto it = myPrimitiveTypes.find(type_name);
286 if (it == myPrimitiveTypes.end())
293 for (
auto it = myPrimitiveTypes.begin();
294 it != myPrimitiveTypes.end(); ++it)
296 type_names.
append(it->first);
326 bool pretty_print)
const;
330 bool pretty_print)
const;
333 bool pretty_print)
const;
336 bool pretty_print)
const;
340 void setIO(
const GA_IO *io) { myIO = io; }
341 const GA_IO *
getIO()
const {
return myIO; }
const GA_IO * getIO() const
const ga_StatAttribute & getAttribute(GA_AttributeOwner owner, GA_Size i) const
const ga_StatGroup & getGroup(GA_GroupType gtype, GA_Size i) const
Data has no numeric representation.
void appendPrimitive(const UT_StringHolder &type_name)
void setRes(GA_Size rx, GA_Size ry, GA_Size rz)
ga_StatAttribute(const char *name="", const char *type_name="", GA_AttributeScope scope=GA_SCOPE_PUBLIC, GA_TypeInfo typeinfo=GA_TYPE_VOID, int tuple_size=1, const char *description="")
GA_Index getIndex() const
void setPrecision(GA_Precision prec)
void appendVolume(GA_Index idx, const char *name, int rx, int ry, int rz)
GA_AttributeScope getScope() const
void sort(bool forward, bool numbered)
GA_TypeInfo getTypeInfo() const
void clearAttributes(GA_AttributeOwner owner)
GA_Size getVertexCount() const
const char * getName() const
void clearGroups(GA_GroupType gtype)
GA_Precision getPrecision() const
GA_STAT_LEVEL
Enum to define different levels of verbosity for GA_Detail::stat()
void setName(const UT_StringHolder &n)
const char * getName() const
Standard user attribute level.
void clearAllAttributes()
void setPointCount(GA_Size sz)
GA_Size getAttributeCount(GA_AttributeOwner owner) const
const char * getName() const
exint GA_Size
Defines the bit width for index and offset types in GA.
void setOptions(const UT_Options &o)
void setDescription(const UT_StringHolder &n)
void setVertexCount(GA_Size sz)
GA_Size getGroupCount(GA_GroupType gtype) const
const UT_StringHolder & getNameHolder() const
const ga_StatVolume & getVolume(int idx) const
int getNumVolumes() const
void setDescription(const UT_StringHolder &d)
void setBounds(const UT_BoundingBox &b)
constexpr std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size(){return subtype_count< typename std::tuple_element< I, T >::type >::value+tuple_type_size< T, I+1 >);}template< typename T > struct type_count< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size< T, 0 >)};};template< typename T > struct subtype_count{static constexpr int value{is_mutable_container< T >::value?expected_max_vector_size:type_count< T >::value};};template< typename T, typename Enable=void > struct type_count_min{static const int value{0};};template< typename T >struct type_count_min< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_tuple_like< T >::value &&!is_wrapper< T >::value &&!is_complex< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{type_count< T >::value};};template< typename T > struct type_count_min< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr int value{1};};template< typename T >struct type_count_min< T, typename std::enable_if< is_wrapper< T >::value &&!is_complex< T >::value &&!is_tuple_like< T >::value >::type >{static constexpr int value{subtype_count_min< typename T::value_type >::value};};template< typename T, std::size_t I >constexpr typename std::enable_if< I==type_count_base< T >::value, int >::type tuple_type_size_min(){return 0;}template< typename T, std::size_t I > constexpr typename std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size_min(){return subtype_count_min< typename std::tuple_element< I, T >::type >::value+tuple_type_size_min< T, I+1 >);}template< typename T > struct type_count_min< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size_min< T, 0 >)};};template< typename T > struct subtype_count_min{static constexpr int value{is_mutable_container< T >::value?((type_count< T >::value< expected_max_vector_size)?type_count< T >::value:0):type_count_min< T >::value};};template< typename T, typename Enable=void > struct expected_count{static const int value{0};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_wrapper< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{1};};template< typename T > struct expected_count< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr int value{expected_max_vector_size};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&is_wrapper< T >::value >::type >{static constexpr int value{expected_count< typename T::value_type >::value};};enum class object_category:int{char_value=1, integral_value=2, unsigned_integral=4, enumeration=6, boolean_value=8, floating_point=10, number_constructible=12, double_constructible=14, integer_constructible=16, string_assignable=23, string_constructible=24, other=45, wrapper_value=50, complex_number=60, tuple_value=70, container_value=80,};template< typename T, typename Enable=void > struct classify_object{static constexpr object_category value{object_category::other};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, char >::value &&std::is_signed< T >::value &&!is_bool< T >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::integral_value};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value &&!std::is_same< T, char >::value &&!is_bool< T >::value >::type >{static constexpr object_category value{object_category::unsigned_integral};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_same< T, char >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::char_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_bool< T >::value >::type >{static constexpr object_category value{object_category::boolean_value};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_floating_point< T >::value >::type >{static constexpr object_category value{object_category::floating_point};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&std::is_assignable< T &, std::string >::value >::type >{static constexpr object_category value{object_category::string_assignable};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&(type_count< T >::value==1)&&std::is_constructible< T, std::string >::value >::type >{static constexpr object_category value{object_category::string_constructible};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::enumeration};};template< typename T > struct classify_object< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr object_category value{object_category::complex_number};};template< typename T > struct uncommon_type{using type=typename std::conditional<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&!std::is_constructible< T, std::string >::value &&!is_complex< T >::value &&!is_mutable_container< T >::value &&!std::is_enum< T >::value, std::true_type, std::false_type >::type;static constexpr bool value=type::value;};template< typename T >struct classify_object< T, typename std::enable_if<(!is_mutable_container< T >::value &&is_wrapper< T >::value &&!is_tuple_like< T >::value &&uncommon_type< T >::value)>::type >{static constexpr object_category value{object_category::wrapper_value};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::number_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&!is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::integer_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::double_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< is_tuple_like< T >::value &&((type_count< T >::value >=2 &&!is_wrapper< T >::value)||(uncommon_type< T >::value &&!is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value)||(uncommon_type< T >::value &&type_count< T >::value >=2))>::type >{static constexpr object_category value{object_category::tuple_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr object_category value{object_category::container_value};};template< typename T, enable_if_t< classify_object< T >::value==object_category::char_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"CHAR";}template< typename T, enable_if_t< classify_object< T >::value==object_category::integral_value||classify_object< T >::value==object_category::integer_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"INT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::unsigned_integral, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"UINT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::floating_point||classify_object< T >::value==object_category::number_constructible||classify_object< T >::value==object_category::double_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"FLOAT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::enumeration, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"ENUM";}template< typename T, enable_if_t< classify_object< T >::value==object_category::boolean_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"BOOLEAN";}template< typename T, enable_if_t< classify_object< T >::value==object_category::complex_number, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"COMPLEX";}template< typename T, enable_if_t< classify_object< T >::value >=object_category::string_assignable &&classify_object< T >::value<=object_category::other, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"TEXT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::container_value||classify_object< T >::value==object_category::wrapper_value, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value==1, detail::enabler >=detail::dummy >inline std::string type_name(){return type_name< typename std::decay< typename std::tuple_element< 0, T >::type >::type >);}template< typename T, std::size_t I >inline typename std::enable_if< I==type_count_base< T >::value, std::string >::type tuple_name(){return std::string{};}template< typename T, std::size_t I >inline typename std::enable_if<(I< type_count_base< T >::value), std::string >::type tuple_name(){auto str=std::string{type_name< typename std::decay< typename std::tuple_element< I, T >::type >::type >)}+ ','+tuple_name< T, I+1 >);if(str.back()== ',') str.pop_back();return str;}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler > > std::string type_name()
Recursively generate the tuple type name.
const char * getDescription() const
void setEntries(GA_Size e)
void clearPrimitiveTypes()
ga_StatVolume(GA_Index idx=-1, const char *name="", int rx=0, int ry=0, int rz=0)
const char * getDescription() const
void setPrimitiveCount(const UT_StringHolder &type_name, GA_Size count)
GA_Size getPrimitiveCount() const
GLuint const GLchar * name
Simple class to store attribute definition (without data)
GLboolean GLboolean GLboolean b
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
void setName(const UT_StringHolder &n)
void appendGroup(GA_GroupType gtype, const ga_StatGroup &group)
void setName(const UT_StringHolder &n)
GA_Size getPrimitiveTypeCount(const UT_StringRef &type_name) const
const char * getTypeName() const
void setIO(const GA_IO *io)
A map of string to various well defined value types.
Class to return information about a GA_Detail.
const UT_Options & getInfoOptions() const
void getPrimitiveTypes(UT_StringArray &type_names) const
GA_GroupType
An ordinal enum for the different types of groups in GA.
void setTypeInfo(GA_TypeInfo t)
const UT_BoundingBox & getBounds() const
void appendAttribute(GA_AttributeOwner owner, const ga_StatAttribute &attrib)
Compute primitive type and bounding box information.
GA_Size getPointCount() const
ga_StatGroup(const char *name="", GA_Size entries=-1, const char *description="")
void setPrimitiveCount(GA_Size sz)
void clear()
Resets list to an empty list.
void setTypeName(const UT_StringHolder &n)
void setScope(GA_AttributeScope s)
void setTupleSize(int ts)
void setIndex(GA_Index idx)
const UT_Options & getOptions() const