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
75 class ga_IndexPairObjectSets;
84 static void registerType();
87 {
return theAttributeType->getTypeName(); }
94 return attrib && &attrib->
getType() == theAttributeType;
99 if (attrib && &attrib->
getType() == theAttributeType)
100 return static_cast<GA_ATIIndexPair *>(attrib);
106 if (attrib && &attrib->
getType() == theAttributeType)
107 return static_cast<const GA_ATIIndexPair *>(attrib);
114 GA_Storage value_store,
int entries,
int tuple_size,
138 {
return myAIFCopyData; }
140 {
return myAIFPair; }
142 {
return myAIFMerge; }
144 {
return myAIFEdit; }
146 {
return myAIFTuple; }
148 {
return myAIFMath; }
150 {
return myAIFInterp; }
152 {
return myAIFCompare; }
199 int getEntries()
const {
return myEntryCapacity.relaxedLoad(); }
202 bool setEntries(
int size);
208 bool growEntriesTo(
int size,
bool concurrent =
false);
215 {
return myValueOperationalDefaults; }
270 int getObjectSetCount()
const;
271 void setObjectSetCount(
int n);
280 bool setTupleSize(
int size);
282 #if GA_INDEX_PAIR_USE_PAGE_ARRAY
284 bool getData(
GA_Offset ai,
int entry,
fpreal32 &
data,
int data_component = 0)
const { data = myData[entry]->get<
fpreal32>(ai, data_component);
return true; }
285 bool getData(
GA_Offset ai,
int entry,
fpreal64 &
data,
int data_component = 0)
const { data = myData[entry]->get<
fpreal64>(ai, data_component);
return true; }
286 bool getData(
GA_Offset ai,
int entry,
int32 &
data,
int data_component = 0)
const { data = myData[entry]->get<
int32>(ai, data_component);
return true; }
287 bool getData(
GA_Offset ai,
int entry,
int64 &
data,
int data_component = 0)
const { data = myData[entry]->get<
int64>(ai, data_component);
return true; }
288 bool setIndex(
GA_Offset ai,
int entry,
int32 index) { myIndex[entry]->set(ai, index);
return true; }
289 bool setIndex(
const GA_Range &ai,
int entry,
int32 index) { myIndex[entry]->setConstant(ai, index);
return true; }
290 bool setData(
GA_Offset ai,
int entry,
fpreal32 data,
int data_component = 0) { myData[entry]->set(ai, data_component, data);
return true; }
291 bool setData(
GA_Offset ai,
int entry,
fpreal64 data,
int data_component = 0) { myData[entry]->set(ai, data_component, data);
return true; }
292 bool setData(
GA_Offset ai,
int entry,
int32 data,
int data_component = 0) { myData[entry]->set(ai, data_component, data);
return true; }
293 bool setData(
GA_Offset ai,
int entry,
int64 data,
int data_component = 0) { myData[entry]->set(ai, data_component, data);
return true; }
296 bool getData(
GA_Offset ai,
int entry,
fpreal32 &data,
int data_component = 0)
const { myData[entry]->getData(data_component)->get(ai, data);
return true; }
297 bool getData(
GA_Offset ai,
int entry,
fpreal64 &data,
int data_component = 0)
const { myData[entry]->getData(data_component)->get(ai, data);
return true; }
298 bool getData(
GA_Offset ai,
int entry,
int32 &data,
int data_component = 0)
const { myData[entry]->getData(data_component)->get(ai, data);
return true; }
299 bool getData(
GA_Offset ai,
int entry,
int64 &data,
int data_component = 0)
const { myData[entry]->getData(data_component)->get(ai, data);
return true; }
302 bool setData(
GA_Offset ai,
int entry,
fpreal32 data,
int data_component = 0) { myData[entry]->getData(data_component)->set(ai, data);
return true; }
303 bool setData(
GA_Offset ai,
int entry,
fpreal64 data,
int data_component = 0) { myData[entry]->getData(data_component)->set(ai, data);
return true; }
304 bool setData(
GA_Offset ai,
int entry,
int32 data,
int data_component = 0) { myData[entry]->getData(data_component)->set(ai, data);
return true; }
305 bool setData(
GA_Offset ai,
int entry,
int64 data,
int data_component = 0) { myData[entry]->getData(data_component)->set(ai, data);
return true; }
308 bool removeIndex(
int index);
309 void invalidateTrailingEntries(
GA_Offset ai,
int start_entry);
310 void invalidateTrailingEntries(
const GA_Range &ai,
int start_entry);
325 const GA_Range &si,
int ulps)
const;
330 void mergeDestroyDestination(
const GA_MergeMap &map,
345 {
return (myTupleSize + 1) * getEntries(); }
346 bool tupleSetSize(
int size);
351 template <
typename T>
inline bool
353 template <
typename T>
inline bool
355 template <
typename T>
inline bool
357 template <
typename T>
inline bool
359 template <
typename T>
inline bool
361 template <
typename T>
inline bool
372 #if GA_INDEX_PAIR_USE_PAGE_ARRAY
373 UT_ConcurrentVector<GA_PageArray<void,1> *> myIndex;
374 UT_ConcurrentVector<GA_PageArray<> *> myData;
377 UT_ConcurrentVector<GA_DataArrayTuple *>
myData;
414 static GA_AIFInterp *myAIFInterp;
420 friend class ga_IndexPairAccess;
421 friend class ga_IndexPairMerge;
422 friend class ga_IndexPairEdit;
423 friend class ga_IndexPairEditDelta;
424 friend class ga_IndexPairEditSnapshot;
425 friend class ga_IndexPairJSON;
426 friend class ga_IndexPairTuple;
427 friend class ga_IndexPairMath;
428 friend class ga_IndexPairInterp;
429 friend class ga_IndexPairCopyData;
430 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)
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