9 #ifndef __PDG_ATTRIBUTE_Geometry_H__
10 #define __PDG_ATTRIBUTE_Geometry_H__
18 #include <type_traits>
74 return dynamic_cast<const T*
>(geometry());
80 return dynamic_cast<T*
>(geometry());
87 return (myGeometry.get() !=
nullptr);
95 inline bool valid(
int component)
const
97 return (component == 0);
105 geometry = myGeometry.get();
109 template <
typename T>
112 myGeometry = UTmakeUnique<T>();
113 return static_cast<T*
>(myGeometry.get());
118 std::swap(myGeometry, other->myGeometry);
const T * geometryT() const
void swap(UT::ArraySet< Key, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual > &a, UT::ArraySet< Key, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual > &b)
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
GLsizei const GLfloat * value
virtual bool compare(const PDG_AttributeData *) const =0
Compares this data object with another data object.
std::size_t SYS_HashType
Define the type for hash values.
Class which writes ASCII or binary JSON streams.
bool valid(int component) const
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
A single PDG_ApplicationShim::Geometry instance.
virtual bool loadData(const UT_JSONValue &)=0
Loads data from a JSON value.
virtual PDG_AttributeMergeError merge(PDG_AttributeMergeOp merge_op, int stride)=0
Applies a merge op to the data in this attribute.
GLint GLenum GLboolean GLsizei stride
virtual bool saveData(UT_JSONWriter &) const =0
Serializes the data to a JSON writer.
PDG_AttributeType
Enumeration of possible attribute types.
void swap(PDG_AttributeGeometry *other)
PDG_AttributeMergeOp
Enumeration of different ways that attributes can be combined.
bool value(Data &geometry, int component) const
virtual bool hash(SYS_HashType &hash_value, exint index, UT_WorkBuffer &errors) const =0
Return a hash value derived from the attribute data.
virtual int64 getMemoryUsage(bool inclusive) const =0
Returns the memory usage of the attribute and its data.
Class to store JSON objects as C++ objects.
PDG_AttributeMergeError
Enumerations of errors that can occur when merging attributes.
size_t hash_value(const CH_ChannelRef &ref)
virtual PDG_AttributeData * clone() const =0
Deep copies this attribute.
PDG_AttributeCopyOp
Enumeration of attribute copy operations.