HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_ATIGroupBool.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GA_ATIGroupBool.h ( GA Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #pragma once
12 
13 #ifndef __GA_ATIGroupBool__
14 #define __GA_ATIGroupBool__
15 
16 #include "GA_API.h"
17 #include "GA_Attribute.h"
18 #include "GA_AttributeType.h" // for GA_AttributeType
19 #include "GA_DataBitArray.h"
20 #include "GA_ElementGroupOrder.h"
21 #include "GA_Group.h"
22 #include "GA_IndexMap.h"
23 #include "GA_Iterator.h"
24 #include "GA_Range.h" // for GA_Range
25 #include "GA_Types.h" // for GA_Offset, GA_Size, etc
26 
27 #include <UT/UT_Assert.h>
28 #include <UT/UT_Lock.h>
29 #include <UT/UT_StringHolder.h>
30 #include <SYS/SYS_Inline.h>
31 #include <SYS/SYS_Types.h> // for int64
32 
33 #include <iosfwd> // for ostream
34 
35 
36 class GA_AIFCopyData;
37 class GA_AIFInterp;
38 class GA_AIFMerge;
39 class GA_AIFTuple;
40 class GA_Defragment;
41 class GA_Detail;
42 class GA_LoadMap;
43 class GA_MergeMap;
44 class GA_SaveMap;
45 
46 class UT_BitArray;
47 class UT_IStream;
48 class UT_JSONParser;
49 class UT_JSONWriter;
50 class UT_MemoryCounter;
51 class UT_WorkBuffer;
52 
53 
55 {
56  // typedef for use inside this class
58 public:
59  /// GA_Group has some of the same function names as GA_Attribute,
60  /// so we need to pick one.
63 
64  const GA_Detail &getDetail() const override final
65  {
66  return GA_Attribute::getDetail();
67  }
69  {
70  return GA_Attribute::getDetail();
71  }
72 
73  static void registerType();// Register group attribute type
74 
76  static const UT_StringHolder &getTypeName()
77  { return theAttributeType->getTypeName(); }
79  static const GA_AttributeType &getType() { return *theAttributeType; }
80 
82  static bool isType(const GA_Attribute *attrib)
83  {
84  return attrib && &attrib->getType() == theAttributeType;
85  }
88  {
89  if (attrib && &attrib->getType() == theAttributeType)
90  return static_cast<GA_ATIGroupBool *>(attrib);
91  return nullptr;
92  }
94  static const GA_ATIGroupBool *cast(const GA_Attribute *attrib)
95  {
96  if (attrib && &attrib->getType() == theAttributeType)
97  return static_cast<const GA_ATIGroupBool *>(attrib);
98  return nullptr;
99  }
101  static bool isType(const GA_Group *group)
102  {
103  if (!group)
104  return false;
106  return (type & (GA_GMASK_POINT | GA_GMASK_VERTEX | GA_GMASK_PRIMITIVE)) != 0;
107  }
109  static const GA_ElementGroup *cast(const GA_Group *group)
110  {
111  if (!isType(group))
112  return nullptr;
113  return UTverify_cast<const GA_ElementGroup *>(group);
114  }
117  {
118  if (!isType(group))
119  return nullptr;
121  }
122 
123 protected:
125  const UT_StringHolder &name, bool internal, bool detached);
126 public:
127  GA_ElementGroup(const GA_Detail &detail, GA_AttributeOwner owner);
128  ~GA_ElementGroup() override;
129 
130  int64 getMemoryUsage(bool inclusive) const override;
131 
132  void countMemory(UT_MemoryCounter &counter, bool inclusive) const override;
133 
134  /// @{
135  /// Interface for defragmentation
136  void defragment(const GA_Defragment &defrag) override;
137  /// @}
138 
139  /// Returns \c true if the group is currently ordered.
140  bool isOrdered() const override final
141  {
142  return myOrder != nullptr;
143  }
144 
145  /// When \c ordered is set to \c true, convert this group to an ordered
146  /// group, otherwise convert to an unordered group. If the group contains
147  /// mixed entries, a conversion to unordered will fail, and the function
148  /// return \c false. Conversion to ordered group will always succeed.
149  bool setOrdered(bool ordered)
150  {
151  if (ordered)
152  {
153  makeOrdered();
154  return true;
155  }
156  if (!getOrdered())
157  return true;
158  if (getOrdered()->mixedEntries())
159  return false;
160 
161  clearOrdered();
162  return true;
163  }
164 
165  void makeOrdered();
166 
168  {
169  if (getOrdered() && !getOrdered()->mixedEntries())
170  clearOrdered();
171  }
172 
173  /// Clear all order information, including any mixed entries.
174  void clearOrdered();
175 
176  /// Copy membership information from the source group. This will fail if
177  /// the groups have different index maps. This will also copy over the
178  /// ordered information if \c copy_ordering is set to \c true.
179  bool copyMembership(const GA_ATIGroupBool &src,
180  bool copy_ordering = true);
181 
182  /// Return GA offset of the Nth element of the group.
183  /// NOTE: This may be quite expensive to compute.
184  /// Returns GA_INVALID_OFFSET if there aren't enough elements in the group.
185  GA_Offset findOffsetAtGroupIndex(GA_Size i) const;
186 
187  /// NOTE: When using setElement(GA_Offset,bool) in parallel,
188  /// you *must* call invalidateGroupEntries() afterward, else
189  /// getGroupEntries() may return an incorrect value.
190  /// NOTE: This cannot be used in parallel on an ordered group.
192  void setElement(GA_Offset ai, bool v)
193  {
194  if (v != contains(ai))
195  {
196  if (v)
197  setMembership<true>(ai);
198  else
199  setMembership<false>(ai);
200  }
201  }
202  /// NOTE: This cannot be used in parallel on an ordered group.
204  void setElement(const GA_Range &it, bool v)
205  {
206  if (v)
207  setMembership<true>(it);
208  else
209  setMembership<false>(it);
210  }
211 
212  /// NOTE: When using toggleElement(GA_Offset) in parallel,
213  /// you *must* call invalidateGroupEntries() afterward, else
214  /// getGroupEntries() may return an incorrect value.
215  /// NOTE: This cannot be used in parallel on an ordered group.
216  void toggleElement(GA_Offset ai);
217  /// NOTE: This cannot be used in parallel on an ordered group.
218  void toggleElement(const GA_Range &it);
219 
220  /// These methods only work on unordered groups.
221  /// @{
222  void orEqual(const GA_ATIGroupBool *src);
223  void andEqual(const GA_ATIGroupBool *src);
224  void xorEqual(const GA_ATIGroupBool *src);
225  void subEqual(const GA_ATIGroupBool *src);
226  void toggleAll(GA_Size numelements);
227  /// @}
228 
229  /// Add all elements corresponding with src to this group.
230  /// src can be a point, vertex, primitive, or edge group.
231  /// Breakpoint groups won't crash, but may add more
232  /// elements than required.
233  bool combine(const GA_Group *src) override final;
234 
235  /// operator|= supports point, vertex, and primitive groups,
236  /// regardless of this group type.
237  /// @deprecated Use @c combine or point/vertex/primitive group operator.
240 
241  /// These operators only support g having the
242  /// same owner as this.
243  /// @deprecated Use point/vertex/primitive group operator.
244  /// @{
253  {
254  copyMembership(g, /* copy_ordering */ true);
255  return *this;
256  }
257  /// @}
258 
261  {
262  return myData.get(offset);
263  }
264  bool containsIndex(GA_Index ai) const
265  {
267  return contains(ao);
268  }
269 
272  {
273  return contains(offset);
274  }
276  bool containsAny(const GA_Range &range) const
277  {
278  return myData.isAnySet(range);
279  }
281  bool isGroupEmpty() const
282  {
283  return (getGroupEntries() == 0);
284  }
285  /// Query whether the group is empty of primary elements.
287  bool isEmpty() const
288  {
289  return (getGroupEntries() == 0);
290  }
291  /// Query whether the group is empty of elements, primary or mixed.
292  bool isEmptyMix() const
293  {
294  return (entriesMix() == 0);
295  }
296  /// Will return the number of primary elements.
297  GA_Size entries() const override final
298  { return getGroupEntries(); }
299  /// Will return the total number of elements, primary and mixed.
300  virtual GA_Size entriesMix() const final
301  {
302  if (getOrdered())
303  return getOrdered()->entries();
304  else
305  return getGroupEntries();
306  }
308  {
309  if (myGroupEntries >= 0)
310  return myGroupEntries;
311 
312  return computeGroupEntries();
313  }
314  GA_Size computeGroupEntries() const;
315 
316  /// Query if the group contains any mixed elements.
317  bool isMixed() const override final
318  {
319  return myOrder && (myOrder->mixedEntries() > 0);
320  }
321 
323  void setOffset(GA_Offset ai, bool v)
324  {
325  setElement(ai, v);
326  }
327 
328  /// @{
329  /// Access elements of the group by ordered index rather than offset.
330  /// Internally, this method just find the data offset and calls appropriate
331  /// method.
334  {
336  addOffset(ao);
337  }
340  {
342  toggleOffset(ao);
343  }
346  {
348  removeOffset(ao);
349  }
350  /// @}
351 
352  /// @{
353  /// Access elements by their offset in the index map
354  /// NOTE: When using addOffset, toggleOffset, removeOffset in parallel,
355  /// you *must* call invalidateGroupEntries() afterward, else
356  /// entries() may return an incorrect value.
357  /// NOTE: These cannot be used in parallel on an ordered group.
360  {
361  if (GAisValid(ai))
362  setElement(ai, true);
363  }
366  {
367  if (GAisValid(ai))
368  toggleElement(ai);
369  }
372  {
373  if (GAisValid(ai))
374  setElement(ai, false);
375  }
376  /// @}
377 
378  /// @{
379  /// Access elements by a GA_Range
380  /// These have the advantage of being able to operate a page at a time
381  /// when applicable.
382  /// NOTE: These cannot be used in parallel on an ordered group.
384  void addRange(const GA_Range &it)
385  {
386  setMembership<true>(it);
387  }
389  void toggleRange(const GA_Range &it)
390  {
391  toggleElement(it);
392  }
394  void removeRange(const GA_Range &it)
395  {
396  setMembership<false>(it);
397  }
398  /// @}
399 
400 
401  /// Query the length of repeated bit values starting from 'start' until
402  /// 'end' or a change in bit values.
404  GA_Size &size, bool &value) const
405  {
406  return myData.getConstantSpan(start, end,
407  size, value);
408  }
409 
410  void clear() override;
411  void makeConstant(bool value);
413  { myGroupEntries = -1; }
414 
415  bool needDestruction() const override;
416  void destructElement(GA_Offset offset) override;
418  GA_Offset nelements) override;
419 
420  /// Add all elements to the group
421  void addAll() override final
422  {
423  makeConstant(true);
424  }
425  /// Add all elements to the group, only writing to real elements' offsets.
426  void setEntries()
427  {
428  setElement(GA_Range(getIndexMap()), true);
429  }
430  /// Toggle membership of all elements
432  {
433  // We are no longer ordered.
434  makeUnordered();
435  toggleAll(getIndexMap().offsetSize());
436  invalidateGroupEntries();
437  }
438 
439  /// Data is paged, so concurrent writes to separate pages supported,
440  /// unless the group is ordered. Rather, that would be the case if
441  /// the updates to myGroupEntries were thread-safe.
443  { return WRITE_CONCURRENCE_NONE; }
444 
445  const GA_AIFCopyData *getAIFCopyData() const override
446  {return myAIFCopyData;}
447  const GA_AIFTuple *getAIFTuple() const override
448  { return myAIFTuple; }
449  const GA_AIFInterp *getAIFInterp() const override
450  { return myAIFInterp; }
451  const GA_AIFMerge *getAIFMerge() const override
452  { return myAIFMerge; }
453  const GA_AIFCompare *getAIFCompare() const override
454  { return myAIFCompare; }
455 
456  // TODO: Need to override arithmetic operations too! (for ordered groups)
458  const GA_ElementGroupOrder *getOrdered() const { return myOrder; }
459  GA_ElementGroup *getGroup() { return this; }
460  const GA_ElementGroup *getGroup() const { return this; }
461  GA_ElementGroup *getAttribute() { return this; }
462  const GA_ElementGroup *getAttribute() const { return this; }
463 
464  bool loadGroupH9(UT_IStream &is);
465  bool loadGroupByIndexOrderH9(const UT_BitArray &array);
466  bool saveGroupH9(std::ostream &os, bool binary) const;
467 
468  /// @private Method called in merging
469  void mergeGrowArray(const GA_MergeMap &map,
470  const GA_ATIGroupBool &sattrib);
471 
472  // Debug code
473  // Note: Groups don't have to have the same capacity?
474  bool debugValidateArrayCapacity(GA_Offset sz)const override;
475 
476  /// Save data to a JSON file. We do not provide an GA_AIFJSON interface
477  /// since the data is saved by the group (not the attribute). This method
478  /// is called directly by GA_ElementGroup instead.
479  /// @section JSON-GA_ATIGroupBool JSON Schema: GA_ATIGroupBool
480  /// @code
481  /// {
482  /// "name" : "GA_ATIGroupBool",
483  /// "description" :
484  /// "Selection information for a GA_ElementGroup. There should
485  /// only be one of 'ordered' or 'unordered' depending on
486  /// whether the group is ordered or unordered.",
487  /// "type" : "orderedmap",
488  /// "properties": {
489  /// "defaults": {
490  /// "type" : { "$ref" : "GA_Defaults" }
491  /// "description" : "Default values",
492  /// },
493  /// "ordered": {
494  /// "type" : {"$ref":"GA_ElementGroupOrder"},
495  /// "optional" : true,
496  /// "description" : "Ordered group selection.",
497  /// },
498  /// "unordered": {
499  /// "type" : {"$ref":"GA_DataBitArray"},
500  /// "optional" : true,
501  /// "description" : "Unordered selection of group selection.",
502  /// },
503  /// },
504  /// }
505  /// @endcode
506  /// @see @ref JSON_FileFormat
507  bool jsonSave(UT_JSONWriter &w, const GA_SaveMap&map) const;
508 
509  /// Load from a JSON stream
510  bool jsonLoad(UT_JSONParser &p, const GA_LoadMap &map);
511 
512  /// Save data to a JSON stream.
513  /// @section JSON-GA_ElementGroup JSON Schema: GA_ElementGroup
514  /// Private data for an element group
515  /// @code
516  /// {
517  /// "name" : "GA_ElementGroup-Data",
518  /// "description" : "Data for an element group.",
519  /// "type" : "orderedmap",
520  /// "properties": {
521  /// "selection": {
522  /// "type" : {"$ref" : "GA_ATIGroupBool" },
523  /// "description" : "Group memebership data",
524  /// "optional" : true
525  /// }
526  /// },
527  /// }
528  /// @endcode
529  ///
530  /// @see @ref JSON_FileFormat, GA_GroupTable
532  const GA_SaveMap &map) const override;
533 
534  /// Load from a JSON stream
536  const GA_LoadMap &map) override;
537 
538  /// Compute detailed information
539  bool stat(UT_WorkBuffer &info, uint level) const override;
540 
541  /// Grow or shrink the array size
542  bool setArraySize(GA_Offset new_size) override;
543 
544  /// Get the array size of the attribute. This is primarily here
545  /// for checking detached groups, when the detail may have
546  /// more elements added since the group was created.
548  { return myData.getArraySize(); }
549 
550  /// Returns the writable raw bit array.
551  /// WARNING: Only use this if this is an unordered group,
552  /// and invalidateGroupEntries() has been called,
553  /// so that writing doesn't cause problems.
556  {
557  UT_ASSERT_P(!isOrdered() && myGroupEntries < 0);
558  return myData;
559  }
560 
561  /// Returns the read-only raw bit array.
563  const GA_DataBitArray &getData() const
564  {
565  return myData;
566  }
567 
568  /// Returns true iff the specified page is constant-compressed,
569  /// where a single value is stored to represent GA_PAGE_SIZE
570  /// values in the page, (or possibly fewer if only one page).
572  {
573  return myData.isPageConstant(pagenum);
574  }
575  /// If pagenum is a constant page, this returns the constant value
576  /// of the page. Otherwise, this function shouldn't be called.
578  {
579  return myData.getPageCVal(pagenum);
580  }
581  /// Sets all elements of the specified page to the given value.
583  {
584  myData.makePageConstant(pagenum, value);
585  }
586 
587  /// Try to compress data pages
588  void tryCompressAllPages(
589  GA_Offset start_offset = GA_Offset(0),
590  GA_Offset end_offset = GA_INVALID_OFFSET) override;
591  /// Harden data pages
592  void hardenAllPages(
593  GA_Offset start_offset = GA_Offset(0),
594  GA_Offset end_offset = GA_INVALID_OFFSET) override;
595 
596  /// In the case that we're copying from an attribute whose storage
597  /// type matches this exactly, this function copies the metadata
598  /// not associated with the storage, e.g. myOptions,
599  /// *excluding* the name and the data ID.
600  void copyNonStorageMetadata(const GA_Attribute *that) override final;
601 
602  /// This replaces the entirety of this attribute's content and non-
603  /// storage metadata (except the name) with that of the src attribute.
604  /// This copies the src group order if present and destroys any if not.
605  /// matchesStorage(src) should already return true.
606  /// This is primarily for use by GA_AttributeSet::replace().
607  /// NOTE: The internal content sizes may not match exactly if the
608  /// attribute type may overallocate, but the sizes should be such
609  /// that any real data will fit in the destination, so be careful
610  /// and deal with the myTailInitialize flag appropriately if
611  /// any extra elements aren't equal to the default.
612  void replace(const GA_Attribute &src) override final;
613 
614  /// Copy attribute values for a single element.
615  /// @{
616  bool copy(GA_Offset desti, GA_Offset srci) override final
617  {
618  setElement(desti, contains(srci));
619  return true;
620  }
621  bool copy(GA_Offset desti,
622  const GA_Attribute &src, GA_Offset srci) override final
623  {
625  return false;
626  setElement(desti, UTverify_cast<const GA_ATIGroupBool *>(&src)->contains(srci));
627  return true;
628  }
629  bool copy(GA_Offset desti, const GA_ATIGroupBool &src, GA_Offset srci)
630  {
631  setElement(desti, src.contains(srci));
632  return true;
633  }
634  /// @}
635 
636  /// Copy attribute values for a range of elements.
637  /// @{
638  bool copy(const GA_Range &destrange,
639  const GA_Range &srcrange) override final
640  {
641  return tupleSet(destrange, *this, srcrange);
642  }
643  bool copy(const GA_Range &destrange,
644  const GA_Attribute &src, const GA_Range &srcrange) override final
645  {
647  return false;
648  return tupleSet(destrange, *UTverify_cast<const GA_ATIGroupBool*>(&src), srcrange);
649  }
650  bool copy(const GA_Range &destrange, const GA_ATIGroupBool &src, const GA_Range &srcrange)
651  {
652  return tupleSet(destrange, src, srcrange);
653  }
654  /// @}
655 
656  /// Assign all elements of a range from a single attribute value.
657  /// @{
658  bool fill(const GA_Range &destrange, GA_Offset srci) override final
659  {
660  setElement(destrange, contains(srci));
661  return true;
662  }
663  bool fill(const GA_Range &destrange,
664  const GA_Attribute &src, GA_Offset srci) override final
665  {
667  return false;
668  setElement(destrange, UTverify_cast<const GA_ATIGroupBool *>(&src)->contains(srci));
669  return true;
670  }
671  bool fill(const GA_Range &destrange, const GA_ATIGroupBool &src, GA_Offset srci)
672  {
673  setElement(destrange, src.contains(srci));
674  return true;
675  }
676  /// @}
677 
678 private:
679 
680  template <bool ADD>
681  void setMembership(GA_Offset ai)
682  {
683  UT_ASSERT_MSG_P(isDetached() || (GAisValid(ai) && ai < myData.getArraySize() && getIndexMap().isOffsetActive(ai)), "Writing to attached group at an inactive offset!");
684  UT_ASSERT_MSG_P(!isDetached() || (GAisValid(ai) && ai < myData.getArraySize() && getIndexMap().isOffsetActive(ai)), "Writing to detached group out of range! Note that they don't update when you add or remove elements from the detail!");
685 
686  if (myOrder)
687  {
688  if (ADD)
689  myOrder->append(ai);
690  else
691  myOrder->remove(ai);
692  }
693 
694  // maintain count
695  if (myGroupEntries >= 0)
696  myGroupEntries += ADD ? +1 : -1;
697 
698  myData.set<ADD>(ai);
699  }
700 
701  template <bool ADD>
702  void setMembership(const GA_Range &range)
703  {
704  if (myOrder && range.canContainDuplicates())
705  {
706  for (GA_Iterator it(range); !it.atEnd(); ++it)
707  {
708  if (ADD != contains(*it))
709  setMembership<ADD>(*it);
710  }
711  return;
712  }
713  // else unordered group, or ordered group with
714  // range that cannot contain duplicates.
715 
716  if (myOrder)
717  {
718  for (GA_Iterator it(range); !it.atEnd(); ++it)
719  {
720  if (ADD != contains(*it))
721  {
722  if (ADD)
723  myOrder->append(*it);
724  else
725  myOrder->remove(*it);
726  }
727  }
728  }
730  if (isDetached())
731  {
732  for (GA_Iterator it(range); !it.atEnd(); ++it)
733  {
734  GA_Offset ai = *it;
735  if (!GAisValid(ai) || ai >= myData.getArraySize() || !getIndexMap().isOffsetActive(ai))
736  UT_ASSERT_MSG_P(0, "Writing to detached group out of range! Note that they don't update when you add or remove elements from the detail!");
737  }
738  })
739  myData.set(range, ADD);
740  invalidateGroupEntries();
741  }
742 
743  /// Only called by GA_GroupTable::rename(const char *, const char *).
744  bool setName(const UT_StringHolder &n) override;
745 
746  GA_Attribute *doClone(const GA_IndexMap &index_map,
747  const UT_StringHolder &name) const override;
748 
749  /// @{ GA_AIFTuple
750  bool tupleSet(GA_Offset di, const GA_ATIGroupBool &s, GA_Offset si);
751  bool tupleSet(const GA_Range &di, const GA_ATIGroupBool &s,
752  const GA_Range &si);
753  /// @}
754 
755  /// @{ GA_AIFMerge
756  bool mergeAppendData(const GA_MergeMap &map,
757  const GA_Attribute *sattrib);
758  /// @}
759 
760  GA_DataBitArray myData;
761 
763  mutable GA_Size myGroupEntries;
764  mutable UT_Lock myGroupEntriesConstLock;
765 
766  static GA_AIFCopyData *myAIFCopyData;
767  static GA_AIFTuple *myAIFTuple;
768  static GA_AIFInterp *myAIFInterp; // GA_AIFCondInterp
769  static GA_AIFMerge *myAIFMerge;
770  static GA_AIFCompare *myAIFCompare;
771 
772  static const GA_AttributeType *theAttributeType;
773 
774  friend class GU_Group; // For operators
775  friend class GU_ElementGroup; // For operators
776  friend class GOP_GroupParse; // For |= operator
777 
778  /// @cond INTERNAL_DOX
779  class ga_GroupBoolCopyData;
780  class ga_GroupBoolTuple;
781  class ga_GroupBoolMerge;
782  class ga_GroupType;
783  /// @endcond
784 };
785 
787 
788 #endif
GLdouble s
Definition: glew.h:1390
void setEntries()
Add all elements to the group, only writing to real elements' offsets.
bool isMixed() const overridefinal
Query if the group contains any mixed elements.
static SYS_FORCE_INLINE bool isType(const GA_Attribute *attrib)
A class to manage an ordered array which has fixed offset handles.
Definition: GA_IndexMap.h:63
bool fill(const GA_Range &destrange, GA_Offset srci) overridefinal
GLenum GLint * range
Definition: glew.h:3500
Definition of a geometry attribute.
Definition: GA_Attribute.h:196
static SYS_FORCE_INLINE const GA_ATIGroupBool * cast(const GA_Attribute *attrib)
bool setOrdered(bool ordered)
GLsizeiptr size
Definition: glew.h:1681
GLenum src
Definition: glew.h:2410
GA_ElementGroup * getGroup()
GLuint const GLchar * name
Definition: glew.h:1814
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
Iteration over a range of elements.
Definition: GA_Iterator.h:28
SYS_FORCE_INLINE bool containsAny(const GA_Range &range) const
const GA_Detail & getDetail() const
int myOrder
Definition: GT_CurveEval.h:263
const GA_AIFInterp * getAIFInterp() const override
Return the attribute's interpolation interface or NULL.
virtual bool setName(const UT_StringHolder &n)
Definition: GA_Group.h:184
bool GAisValid(GA_Size v)
Definition: GA_Types.h:647
GA_GroupMaskType classMaskType() const
Definition: GA_Group.h:56
GA_Size entries() const overridefinal
Will return the number of primary elements.
#define SYS_DEPRECATED_HDK_REPLACE(__V__, __R__)
Matrix44< T > addOffset(const Matrix44< T > &inMat, const Vec3< T > &tOffset, const Vec3< T > &rOffset, const Vec3< T > &sOffset, const Vec3< T > &ref)
The merge map keeps track of information when merging details.
Definition: GA_MergeMap.h:53
friend class GA_ElementGroup
Definition: GA_Attribute.h:726
SYS_FORCE_INLINE void setOffset(GA_Offset ai, bool v)
virtual void reconstructElementBlock(GA_Offset offset, GA_Offset nelements)=0
void getConstantSpan(GA_Offset start, GA_Offset end, GA_Size &size, bool &value) const
static SYS_FORCE_INLINE const GA_ElementGroup * cast(const GA_Group *group)
SYS_FORCE_INLINE void toggleOffset(GA_Offset ai)
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:76
virtual bool setArraySize(GA_Offset size)=0
GA_Offset getArraySize() const
#define GA_API
Definition: GA_API.h:12
void toggleEntries()
Toggle membership of all elements.
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:34
const GLdouble * v
Definition: glew.h:1391
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
Definition: UT_Assert.h:208
#define UT_ASSERT_MSG_P(ZZ,...)
Definition: UT_Assert.h:137
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
static SYS_FORCE_INLINE GA_ATIGroupBool * cast(GA_Attribute *attrib)
virtual bool combine(const GA_Group *inputGroup)
virtual int64 getMemoryUsage(bool inclusive) const =0
std::enable_if< UT_EnableBitMask< T >::enable, T & >::type operator&=(T &lhs, T rhs)
Definition: UT_EnumHelper.h:57
#define UT_IF_ASSERT_P(ZZ)
Definition: UT_Assert.h:161
const UT_StringHolder & getName() const
Definition: GA_Attribute.h:280
bool containsIndex(GA_Index ai) const
GA_Size getGroupEntries() const
SYS_FORCE_INLINE void removeOffset(GA_Offset ai)
virtual void tryCompressAllPages(GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)=0
void addAll() overridefinal
Add all elements to the group.
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:233
SYS_FORCE_INLINE void setPageConstant(GA_PageNum pagenum, const bool value)
Sets all elements of the specified page to the given value.
bool copy(const GA_Range &destrange, const GA_ATIGroupBool &src, const GA_Range &srcrange)
No concurrent writes supported.
Definition: GA_Attribute.h:362
virtual void clear()=0
#define GA_INVALID_OFFSET
Definition: GA_Types.h:676
SYS_FORCE_INLINE void addRange(const GA_Range &it)
A range of elements in an index-map.
Definition: GA_Range.h:42
GA_Size GA_Offset
Definition: GA_Types.h:639
bool atEnd() const
Definition: GA_Iterator.h:100
bool fill(const GA_Range &destrange, const GA_ATIGroupBool &src, GA_Offset srci)
const GA_Detail & getDetail() const overridefinal
SYS_FORCE_INLINE void toggleIndex(GA_Index ai)
static SYS_FORCE_INLINE const GA_AttributeType & getType()
virtual bool isOrdered() const =0
virtual bool needDestruction() const
Methods which can be overridden from GA_Attribute.
bool canContainDuplicates() const
Definition: GA_Range.h:265
virtual bool jsonSaveData(UT_JSONWriter &w, const GA_SaveMap &map) const =0
Save the private group data.
SYS_FORCE_INLINE void addIndex(GA_Index ai)
SYS_FORCE_INLINE void setElement(GA_Offset ai, bool v)
virtual void replace(const GA_Attribute &src)=0
Attribute Interface for merging attribute data between details.
Definition: GA_AIFMerge.h:56
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:134
SYS_FORCE_INLINE void setElement(const GA_Range &it, bool v)
NOTE: This cannot be used in parallel on an ordered group.
const GLuint GLenum const void * binary
Definition: glew.h:3502
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
bool fill(const GA_Range &destrange, const GA_Attribute &src, GA_Offset srci) overridefinal
GLuint GLuint end
Definition: glew.h:1253
SYS_FORCE_INLINE void toggleRange(const GA_Range &it)
virtual bool stat(UT_WorkBuffer &info, uint level) const
GLsizei n
Definition: glew.h:4040
static SYS_FORCE_INLINE bool isType(const GA_Group *group)
long long int64
Definition: SYS_Types.h:116
Attribute Interface class to perform comparisons on attributes.
Definition: GA_AIFCompare.h:27
Options during loading.
Definition: GA_LoadMap.h:42
GA_ElementGroup * getAttribute()
Defragmentation of IndexMaps.
Definition: GA_Defragment.h:45
bool isOrdered() const overridefinal
Returns true if the group is currently ordered.
bool isEmptyMix() const
Query whether the group is empty of elements, primary or mixed.
SYS_FORCE_INLINE void removeIndex(GA_Index ai)
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:633
virtual void copyNonStorageMetadata(const GA_Attribute *that)
Definition: GA_Attribute.h:752
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
WriteConcurrence getSupportedWriteConcurrence() const override
const GA_ElementGroup * getGroup() const
GLuint start
Definition: glew.h:1253
SYS_FORCE_INLINE bool isPageConstant(GA_PageNum pagenum) const
SYS_FORCE_INLINE GA_DataBitArray & getData()
const GA_AttributeType & getType() const
Definition: GA_Attribute.h:204
bool copy(GA_Offset desti, GA_Offset srci) overridefinal
GT_API const UT_StringHolder version
bool OIIO_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
SYS_FORCE_INLINE bool containsOffset(GA_Offset offset) const
GLfloat GLfloat p
Definition: glew.h:16321
SYS_FORCE_INLINE bool isGroupEmpty() const
GA_AttributeOwner
Definition: GA_Types.h:33
bool copy(const GA_Range &destrange, const GA_Range &srcrange) overridefinal
bool isOffsetActive(GA_Offset offset) const
Returns true if the specified offset is referenced by an ordered element.
Definition: GA_IndexMap.h:483
const GA_ElementGroupOrder * getOrdered() const
GLuint counter
Definition: glew.h:2740
virtual bool jsonLoadData(UT_JSONParser &p, const GA_LoadMap &map)=0
Load the private group data.
GA_ElementGroupOrder * getOrdered()
GA_Detail & getDetail()
const GA_IndexMap & getIndexMap() const
Definition: GA_Attribute.h:205
static SYS_FORCE_INLINE const UT_StringHolder & getTypeName()
GA_Size GA_PageNum
Definition: GA_Types.h:642
GA_ElementGroup GA_ATIGroupBool
const GA_AIFTuple * getAIFTuple() const override
Return the attribute's tuple interface or NULL.
SYS_FORCE_INLINE GA_Offset offsetFromIndex(GA_Index ordered_index) const
Definition: GA_IndexMap.h:117
std::enable_if< UT_EnableBitMask< T >::enable, T & >::type operator^=(T &lhs, T rhs)
Definition: UT_EnumHelper.h:76
bool copy(GA_Offset desti, const GA_Attribute &src, GA_Offset srci) overridefinal
bool copy(GA_Offset desti, const GA_ATIGroupBool &src, GA_Offset srci)
OIIO_FORCEINLINE const vint4 & operator-=(vint4 &a, const vint4 &b)
Definition: simd.h:4269
bool isDetached() const
Definition: GA_Attribute.h:442
Container class for all geometry.
Definition: GA_Detail.h:95
virtual void destructElement(GA_Offset offset)
Callback invoked if needsDestruction() returns true.
GLenum array
Definition: glew.h:9066
Attribute Interface class to copy attribute data.
GA_GroupMaskType
Definition: GA_Types.h:173
const GA_ElementGroup * getAttribute() const
bool copy(const GA_Range &destrange, const GA_Attribute &src, const GA_Range &srcrange) overridefinal
SYS_FORCE_INLINE void removeRange(const GA_Range &it)
#define const
Definition: zconf.h:214
SYS_FORCE_INLINE bool isEmpty() const
Query whether the group is empty of primary elements.
const GA_AIFCompare * getAIFCompare() const override
Return the attribute's comparison interface or NULL.
An array of bits.
virtual bool debugValidateArrayCapacity(GA_Offset sz) const
Debug validation of allocated array size.
const GA_AIFCopyData * getAIFCopyData() const override
Return the attribute's copy interface or NULL.
virtual GA_Size entriesMix() const final
Will return the total number of elements, primary and mixed.
virtual void hardenAllPages(GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)=0
const GA_AIFMerge * getAIFMerge() const override
Return the attribute's merge interface or NULL.
virtual void defragment(const GA_Defragment &defrag)=0
Generic Attribute Interface class to access an attribute as a tuple.
Definition: GA_AIFTuple.h:32
GLsizei const GLfloat * value
Definition: glew.h:1849
unsigned int uint
Definition: SYS_Types.h:45
GLint level
Definition: glew.h:1252
SYS_FORCE_INLINE void addOffset(GA_Offset ai)
SYS_FORCE_INLINE const GA_DataBitArray & getData() const
Returns the read-only raw bit array.
void invalidateGroupEntries()
static SYS_FORCE_INLINE GA_ElementGroup * cast(GA_Group *group)
SYS_FORCE_INLINE bool getPageValue(GA_PageNum pagenum) const
std::enable_if< UT_EnableBitMask< T >::enable, T & >::type operator|=(T &lhs, T rhs)
Definition: UT_EnumHelper.h:37
GLboolean GLuint group
Definition: glew.h:2745
SYS_FORCE_INLINE bool contains(GA_Offset offset) const
GLboolean GLboolean g
Definition: glew.h:9477
GLintptr offset
Definition: glew.h:1682