32 #ifndef __GA_ATIIndexPair
33 #define __GA_ATIIndexPair
35 #define GA_INDEX_PAIR_USE_PAGE_ARRAY 0
40 #if !GA_INDEX_PAIR_USE_PAGE_ARRAY
45 #if GA_INDEX_PAIR_USE_PAGE_ARRAY
77 class ga_IndexPairObjectSets;
87 static void registerType();
90 {
return theAttributeType->getTypeName(); }
97 return attrib && &attrib->
getType() == theAttributeType;
102 if (attrib && &attrib->
getType() == theAttributeType)
103 return static_cast<GA_ATIIndexPair *>(attrib);
109 if (attrib && &attrib->
getType() == theAttributeType)
110 return static_cast<const GA_ATIIndexPair *>(attrib);
117 GA_Storage value_store,
int entries,
int tuple_size,
141 {
return myAIFCopyData; }
143 {
return myAIFPair; }
145 {
return myAIFMerge; }
147 {
return myAIFEdit; }
149 {
return myAIFTuple; }
151 {
return myAIFMath; }
153 {
return myAIFInterp; }
155 {
return myAIFCompare; }
202 int getEntries()
const {
return myEntryCapacity.relaxedLoad(); }
205 bool setEntries(
int size);
211 bool growEntriesTo(
int size,
bool concurrent =
false);
218 {
return myValueOperationalDefaults; }
273 int getObjectSetCount()
const;
274 void setObjectSetCount(
int n);
283 bool setTupleSize(
int size);
285 #if GA_INDEX_PAIR_USE_PAGE_ARRAY
287 bool getData(
GA_Offset ai,
int entry,
fpreal32 &
data,
int data_component = 0)
const { data = myData[entry]->get<
fpreal32>(ai, data_component);
return true; }
288 bool getData(
GA_Offset ai,
int entry,
fpreal64 &
data,
int data_component = 0)
const { data = myData[entry]->get<
fpreal64>(ai, data_component);
return true; }
289 bool getData(
GA_Offset ai,
int entry,
int32 &
data,
int data_component = 0)
const { data = myData[entry]->get<
int32>(ai, data_component);
return true; }
290 bool getData(
GA_Offset ai,
int entry,
int64 &
data,
int data_component = 0)
const { data = myData[entry]->get<
int64>(ai, data_component);
return true; }
291 bool setIndex(
GA_Offset ai,
int entry,
int32 index) { myIndex[entry]->set(ai, index);
return true; }
292 bool setIndex(
const GA_Range &ai,
int entry,
int32 index) { myIndex[entry]->setConstant(ai, index);
return true; }
293 bool setData(
GA_Offset ai,
int entry,
fpreal32 data,
int data_component = 0) { myData[entry]->set(ai, data_component, data);
return true; }
294 bool setData(
GA_Offset ai,
int entry,
fpreal64 data,
int data_component = 0) { myData[entry]->set(ai, data_component, data);
return true; }
295 bool setData(
GA_Offset ai,
int entry,
int32 data,
int data_component = 0) { myData[entry]->set(ai, data_component, data);
return true; }
296 bool setData(
GA_Offset ai,
int entry,
int64 data,
int data_component = 0) { myData[entry]->set(ai, data_component, data);
return true; }
299 bool getData(
GA_Offset ai,
int entry,
fpreal32 &data,
int data_component = 0)
const { myData[entry]->getData(data_component)->get(ai, data);
return true; }
300 bool getData(
GA_Offset ai,
int entry,
fpreal64 &data,
int data_component = 0)
const { myData[entry]->getData(data_component)->get(ai, data);
return true; }
301 bool getData(
GA_Offset ai,
int entry,
int32 &data,
int data_component = 0)
const { myData[entry]->getData(data_component)->get(ai, data);
return true; }
302 bool getData(
GA_Offset ai,
int entry,
int64 &data,
int data_component = 0)
const { myData[entry]->getData(data_component)->get(ai, data);
return true; }
305 bool setData(
GA_Offset ai,
int entry,
fpreal32 data,
int data_component = 0) { myData[entry]->getData(data_component)->set(ai, data);
return true; }
306 bool setData(
GA_Offset ai,
int entry,
fpreal64 data,
int data_component = 0) { myData[entry]->getData(data_component)->set(ai, data);
return true; }
307 bool setData(
GA_Offset ai,
int entry,
int32 data,
int data_component = 0) { myData[entry]->getData(data_component)->set(ai, data);
return true; }
308 bool setData(
GA_Offset ai,
int entry,
int64 data,
int data_component = 0) { myData[entry]->getData(data_component)->set(ai, data);
return true; }
311 bool removeIndex(
int index);
312 void invalidateTrailingEntries(
GA_Offset ai,
int start_entry);
313 void invalidateTrailingEntries(
const GA_Range &ai,
int start_entry);
328 const GA_Range &si,
int ulps)
const;
333 void mergeDestroyDestination(
const GA_MergeMap &map,
348 {
return (myTupleSize + 1) * getEntries(); }
349 bool tupleSetSize(
int size);
354 template <
typename T>
inline bool
356 template <
typename T>
inline bool
358 template <
typename T>
inline bool
360 template <
typename T>
inline bool
362 template <
typename T>
inline bool
364 template <
typename T>
inline bool
375 #if GA_INDEX_PAIR_USE_PAGE_ARRAY
376 UT_ConcurrentVector<GA_PageArray<void,1> *> myIndex;
377 UT_ConcurrentVector<GA_PageArray<> *> myData;
380 UT_ConcurrentVector<GA_DataArrayTuple *>
myData;
417 static GA_AIFInterp *myAIFInterp;
423 friend class ga_IndexPairAccess;
424 friend class ga_IndexPairMerge;
425 friend class ga_IndexPairEdit;
426 friend class ga_IndexPairEditDelta;
427 friend class ga_IndexPairEditSnapshot;
428 friend class ga_IndexPairJSON;
429 friend class ga_IndexPairTuple;
430 friend class ga_IndexPairMath;
431 friend class ga_IndexPairInterp;
432 friend class ga_IndexPairCopyData;
433 friend class ga_IndexPairCompare;
A class to manage an ordered array which has fixed offset handles.
SYS_AtomicInt32 myEntryCapacity
Definition of a geometry attribute.
UT_ConcurrentVector< GA_DataArrayTuple * > myData
Generic Attribute Interface class to get/set data as index pairs.
Used to pass options and map offset values during saving.
bool getData(GA_Offset ai, int entry, int64 &data, int data_component=0) const
Class which stores the default values for a GA_Attribute.
GA_Storage getDataStorage() const
getFileOption("OpenEXR:storage") storage
Attribute Interface class to perform numeric operations on attributes.
static SYS_FORCE_INLINE const GA_AttributeType & getType()
const GA_Defaults & getValueDefaults() const
The merge map keeps track of information when merging details.
virtual void reconstructElementBlock(GA_Offset offset, GA_Offset nelements)=0
const GA_AIFIndexPair * getAIFIndexPair() const override
Return the attribute's index pair interface or NULL.
JSON reader class which handles parsing of JSON or bJSON files.
virtual bool setArraySize(GA_Offset size)=0
const GA_AIFTuple * getAIFTuple() const override
Return the attribute's tuple interface or NULL.
bool setIndex(const GA_Range &ai, int entry, int32 index)
Class which writes ASCII or binary JSON streams.
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
int getDataTupleSize() const
The size of the data tuple.
virtual int64 getMemoryUsage(bool inclusive) const =0
virtual bool matchesStorage(const GA_Attribute *that) const
bool setData(GA_Offset ai, int entry, int64 data, int data_component=0)
UT_ConcurrentVector< GA_DataArray * > myIndex
virtual void tryCompressAllPages(GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)=0
GA_Defaults myValueDefaults
const GA_AIFEdit * getAIFEdit() const override
Return the attribute's edit interface or NULL.
SYS_FORCE_INLINE const GA_AttributeType & getType() const
const GA_AIFJSON * getAIFJSON() const override
#define GA_INVALID_OFFSET
static SYS_FORCE_INLINE const GA_ATIIndexPair * cast(const GA_Attribute *attrib)
A range of elements in an index-map.
GA_Defaults myValueOperationalDefaults
GA_API const UT_StringHolder scale
const GA_Defaults & getValueOperationalDefaults() const
static SYS_FORCE_INLINE GA_ATIIndexPair * cast(GA_Attribute *attrib)
GLint GLint GLsizei GLint GLenum GLenum type
const GA_AIFMerge * getAIFMerge() const override
Return the attribute's merge interface or NULL.
bool setData(GA_Offset ai, int entry, fpreal32 data, int data_component=0)
virtual void replace(const GA_Attribute &src)=0
Attribute Interface for merging attribute data between details.
GA_Defaults myIndexDefault
bool getData(GA_Offset ai, int entry, int32 &data, int data_component=0) const
ga_IndexPairObjectSets * myObjects
bool isNan(const float x)
Return true if x is a NaN (Not-A-Number) value.
Attribute Interface class to perform comparisons on attributes.
Defragmentation of IndexMaps.
const GA_AIFInterp * getAIFInterp() const override
Return the attribute's interpolation interface or NULL.
WriteConcurrence getSupportedWriteConcurrence() const override
GLuint const GLchar * name
virtual void copyNonStorageMetadata(const GA_Attribute *that)
static SYS_FORCE_INLINE const UT_StringHolder & getTypeName()
bool setData(GA_Offset ai, int entry, int32 data, int data_component=0)
bool matchesStorage(const GA_Attribute *that) const override
const GA_AIFMath * getAIFMath() const override
Return the attribute's math interface or NULL.
static SYS_FORCE_INLINE bool isType(const GA_Attribute *attrib)
bool setIndex(GA_Offset ai, int entry, int32 index)
const GA_AIFCopyData * getAIFCopyData() const override
Return the attribute's copy interface or NULL.
bool getData(GA_Offset ai, int entry, fpreal64 &data, int data_component=0) const
bool setData(GA_Offset ai, int entry, fpreal64 data, int data_component=0)
bool getIndex(GA_Offset ai, int entry, int32 &index) const
Concurrent writes to separate pages supported.
const GA_AIFCompare * getAIFCompare() const override
Return the attribute's comparison interface or NULL.
Attribute Interface class to copy attribute data.
GLubyte GLubyte GLubyte GLubyte w
Attribute Interface for file I/O.
UT_Lock myEntryGrowthLock
AIF to record changes to attribute values.
virtual void hardenAllPages(GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)=0
virtual void defragment(const GA_Defragment &defrag)=0
Generic Attribute Interface class to access an attribute as a tuple.
bool getData(GA_Offset ai, int entry, fpreal32 &data, int data_component=0) const
GA_Storage myIndexStorage