HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_Topology.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_Topology.h ( GA Library, C++)
7  *
8  * COMMENTS: This class keeps track of the topological attributes attached
9  * to a piece of geometry.
10  */
11 
12 #ifndef __GA_Topology__
13 #define __GA_Topology__
14 
15 #include "GA_API.h"
16 #include "GA_Types.h"
17 #include "GA_ElementGroup.h"
18 #include "GA_ATITopology.h"
19 
20 class GA_Detail;
21 class GA_MergeMap;
22 class GA_Attribute;
23 class GA_ATITopology;
24 class UT_JSONWriter;
25 class UT_JSONParser;
26 class GA_SaveMap;
27 class GA_LoadMap;
28 class GA_Defragment;
29 class UT_MemoryCounter;
30 
32 {
33 public:
34  GA_Topology(GA_Detail &detail);
35  ~GA_Topology();
36 
37  // We store topology as 16 bit values for small geometry. As the geometry
38  // grows, we switch to 32 bit values, eventually switching to 64 bit values if
39  // the geometry grows very large. We do this by walking up and down through
40  // this table.
41 
43  {
44  public:
45  ga_StorageSwitch(GA_Storage store, GA_Size lo_water, GA_Size hi_water) :
46  myStorage(store), myLowWater(lo_water), myHighWater(hi_water)
47  {
48  }
49 
50  bool downShift(GA_Size size) const
51  {
52  return size <= myLowWater;
53  }
54  bool upShift(GA_Size size) const
55  {
56  return size >= myHighWater;
57  }
59  {
60  return myStorage;
61  }
62 
63  private:
64  GA_Storage myStorage;
65  GA_Size myLowWater;
66  GA_Size myHighWater;
67  };
68 
69  #define NUM_STORAGE_LEVELS 3
70 
71  static inline int
72  computeStorageDownShift(int storage_level, GA_Size size)
73  {
74  int change = 0;
75  while (storage_level > 0
76  && theStorageLevels[storage_level].downShift(size))
77  {
78  --change;
79  --storage_level;
80  }
81 
82  return change;
83  }
84 
85  static inline int
86  computeStorageUpShift(int storage_level, GA_Size size)
87  {
88  int change = 0;
89  while (storage_level < (NUM_STORAGE_LEVELS - 1)
90  && theStorageLevels[storage_level].upShift(size))
91  {
92  ++change;
93  ++storage_level;
94  }
95 
96  return change;
97  }
98 
99  static inline GA_Storage
101  {
102  return theStorageLevels[level].getStorage();
103  }
104 
105  /// Return the data ID for the topology attributes.
106  GA_DataId getDataId() const;
107 
108 
109  /// Test whether all required attributes built
110  bool isFull() const;
111 
112  /// This method constructs the topology attributes for the detail. It
113  /// should only be called by GA_Detail. Please use rebuildTopology() from
114  /// other code.
115  void makeFull() // Build the topological attributes
116  {
117  if (!myPointRef)
118  makePointRef();
119  if (!myPrimitiveRef)
120  makePrimitiveRef();
121  if (!myVertexRef || !myVertexPrevRef || !myVertexNextRef)
122  makeVertexRef();
123  }
124 
125  /// Re-create the topology links. This method will re-create all the
126  /// topological information. If the <tt>rebuild_topology</tt> option is
127  /// true, then any missing attributes will be created. If support_hedge is
128  /// true, then half-edge topology attributes are constructed.
129  void rebuildTopology(bool rebuild_topology=true,
130  bool support_hedge = false);
131 
132  /// makeMinimal() deletes the non-essential topology attributes. All
133  /// optional attributes (the options which allow reverse lookup of
134  /// elements) are deleted. The attribute to map vertex to point
135  /// (myPointRef) remains untouched.
136  void makeMinimal();
137 
138  /// The topology attributes try to store minimal amounts of information.
139  /// That is, if there are only 4 points in the geometry, we won't store the
140  /// indices as 64-bit integers. This method will change the storage
141  /// attributes if needed.
142  bool checkStorageChange();
143 
144  /// @{
145  /// Called by GA_Detail::defragment when defragmenting offset lists
146  ///
147  /// NOTE: defragmentLinks will bump the data ID of myPointRef,
148  /// myVertexRef, or myPrimitiveRef if any of those are
149  /// modified, because they are modified when defragmenting
150  /// an index map that is different from their owner,
151  /// i.e. their *link* owner's index map.
152  /// defragmentElements does NOT bump any data IDs.
153  void defragmentElements(const GA_Defragment &defrag);
154  void defragmentLinks(const GA_Defragment &defrag);
155  /// @}
156 
157  /// Functions to maintain topological information
159  { return addVertexBlock(vtx, 1); }
161  { return addPointBlock(pt, 1); }
162  void addVertexBlock(GA_Offset vtx, GA_Size nvertices);
163  void addPointBlock(GA_Offset pt, GA_Size npoints);
164  void delPoint(GA_Offset pt);
165  void delVertex(GA_Offset vtx);
166 
167  /// @note When hedge attributes are present wireVertexPoint has to
168  /// try to fix the changes to hedge equivalence classes that take place
169  /// when a vertex is wired to a new point, namely, the two hedges
170  /// incident to the given vertex must be unlinked from their previous
171  /// equivalence classes and must be linked into respective new ones.
172  /// This means that a search on the incident primitives of the new
173  /// point must be carried out to determine the new associations. This
174  /// is where having hedges costs the most. If the caller has access to
175  /// the classes to other hedges from the classes into which the affected
176  /// hedges must be linked, it must call wireVertexPointAndLinkHedges
177  /// which runs in constant time.
178  /// Alternatively, if the caller knows that no hedge information
179  /// needs to be changed, wireVertexPointAndIgnoreHedges can be called.
180  /// @see wireVertexPointAndRelinkHedges
181  /// @see wireVertexPointAndIgnoreHedges
182  void wireVertexPoint(GA_Offset vtx, GA_Offset pt);
183 
184  /// Wires vertex to the point and links the the hedges whose head
185  /// and tail vertices are vtx into prev_into_src_vtx and next_into_src_vtx
186  /// respectively.
187  ///
188  /// @note This method is used to avoid the search that is performed by
189  /// the standard wireVertexPoint to *find* hedges equivalent to those
190  /// incident to vtx. It's useful when these hedges are known in advance.
191  void wireVertexPointAndRelinkHedges(GA_Offset vtx, GA_Offset pt,
192  GA_Offset prev_into_src_vtx,
193  GA_Offset next_into_src_vtx);
194 
195  /// Wires vertex to the point and completely ignores the affected hedges.
196  ///
197  /// This is equivalent to wireVertexPoint before hedges were introduced,
198  /// or when hedge attributes do not exist. Note that if hedge attributes
199  /// are present, this should be called at the risk of violating hedge
200  /// invariants. It is useful, for example, if all the vertices wired to a
201  /// point are being wired to another point and therefore there is no need
202  /// to update hedge attributes.
203  void wireVertexPointAndIgnoreHedges(GA_Offset vtx, GA_Offset pt);
204 
205  void wireVertexPrimitive(GA_Offset vtx, GA_Offset prim);
206 
207  /// Test to see whether a point is used
208  bool isPointUsed(GA_Offset pt) const;
209  /// Test to see whether a point is used by more than one vertex
210  bool isPointShared(GA_Offset pt) const;
211 
212  /// Make the attribute to store vertex->point reference (mandatory)
213  void makePointRef();
214  /// Make the attribute to store vertex->primitive reference (optional)
215  void makePrimitiveRef();
216  /// Make the attributes to store point->vertex references (optional)
217  /// Note: This method will create 3 attributes
218  void makeVertexRef();
219 
221  const GA_ATITopology *getPointRef() const { return myPointRef; }
223  const GA_ATITopology *getPrimitiveRef() const { return myPrimitiveRef; }
225  const GA_ATITopology *getVertexRef() const { return myVertexRef; }
227  const GA_ATITopology *getVertexPrevRef() const { return myVertexPrevRef; }
229  const GA_ATITopology *getVertexNextRef() const { return myVertexNextRef; }
231  GA_ATITopology *getPointRef() { return myPointRef; }
233  GA_ATITopology *getPrimitiveRef() { return myPrimitiveRef; }
235  GA_ATITopology *getVertexRef() { return myVertexRef; }
237  GA_ATITopology *getVertexPrevRef() { return myVertexPrevRef; }
239  GA_ATITopology *getVertexNextRef() { return myVertexNextRef; }
240 
241  bool jsonSavePointRef(UT_JSONWriter &w, const GA_SaveMap &s) const;
242  bool jsonLoadPointRef(UT_JSONParser &p, const GA_LoadMap &s);
243 
244  /// Make any changes to the topology attributes to accommodate the new data
245  /// (i.e. change their sizes if need be). This method is called before the
246  /// merge begins.
247  void mergeRebuild(const GA_MergeMap &map);
248  void mergeGrowCheckStorageChange(GA_Size sz, bool cloned_data_id);
249 
250  /// Verify that the topologies are constructed correctly
251  /// This is just for debugging purposes, and so may call printf
252  bool validate() const;
253 
254  /// Returns the next and previous boundary vertices of a given vertex in
255  /// its primitive.
256  /// @param vtx input vertex
257  /// @param prev_vtx reference into which previous boundary vertex of
258  /// vtx will be written
259  /// @param next_vtx reference into which next boundary vertex of vtx
260  /// will be written
261  void getAdjacentBoundaryVertices(GA_Offset vtx,
262  GA_Offset &prev_vtx,
263  GA_Offset &next_vtx) const;
264 
265  /// Returns true if hedge topology is maintained
266  ///
267  /// A *hedge* (short for half-edge) embodies the notion of an edge
268  /// localised to a primitive incident to it. An edge incident to k
269  /// primitives therefore leads to k distinct hedges, one belonging to
270  /// each of the primitives. Unlike edges, hedges are oriented and therefore
271  /// have distinct *tail* and *head* vertices. The points wired to the tail
272  /// and head vertices of a hedge are respectively called its tail and head
273  /// points and together make up the *endpoints* of the given hedge. Two
274  /// hedges are called *equivalent* if and only if their endpoints (as sets)
275  /// coincide, i.e. if and only if either they both have the same tail point
276  /// and the same head point, or the head point of one is the same as the
277  /// tail point of another and vice versa. Equivalence of hedges puts them
278  /// into *equivalence classes*.
279  bool isHedgeFull() const
280  { return (myHedgePrevRef != 0); }
281 
282  /// Creates hedge topology attributes if they don't already exist
283  /// @see createHedgeTopologyLinks
284  /// @see rebuildHedgeTopologyLinks
286  {
287  if (!myHedgePrevRef || !myHedgeNextRef || !mySecondaryHedges)
288  makeHedgeRef();
289  }
290 
291  /// Creates the hedge topology attributes
292  ///
293  /// @note This method will create 2 vertex topology attributes and 1 vertex group
294  void makeHedgeRef();
295 
296  /// Creates hedge topology attributes and computes them for the existing detail
297  void createHedgeTopologyLinks();
298 
299  /// Destroys the hedge topology attributes
300  void destroyHedgeTopologyLinks();
301 
302  /// Return true if the argument is the tail vertex of a "valid" hedge.
303  ///
304  /// A hedge is *valid* if and only if (1) it belongs to a primitive that
305  /// supports hedges and (2) the primitive returns a non-negative vertex
306  /// offset for its next boundary vertex. A valid hedge is *singleton* if
307  /// it is not linked up with any other hedges into an equivalence class.
308  /// NOTE 1: The validity of a hedge has *nothing* to do with its vertices
309  /// being wired to points.
310  /// NOTE 2: All valid hedges with unwired vertices are singletons.
311  /// The next and previous hedge references of an invalid hedge must be
312  /// GA_INVALID_OFFSET and those of a singleton hedge must be the hedge
313  /// itself. This will be how we distinguish valid hedges from invalid ones.
314  bool isValidHedge(GA_Offset src_vtx) const;
315 
316  /// Returns true if the input hedge is a *primary* hedge.
317  /// @note This method doesn't check for validity of the hedge. It returns
318  /// true as long as the vertex is not marked as being secondary to another
319  /// hedge.
320  ///
321  /// Each equivalence class of hedges (linked into a circular linked list
322  /// using myHedgePrevRef and myHedgeNextRef) must have exactly one *primary*
323  /// hedge. All other hedges in the class are marked secondary by being
324  /// added to the group mySecondaryHedges. This is an invariant maintained
325  /// at all times.
326  /// @note The primary hedge of a class is elected arbitrarily. It stays
327  /// primary until it is unlinked from the class, at which time another hedge
328  /// becomes the primary hedge in that class. A singleton hedge is the
329  /// primary of its own class.
330  bool isPrimaryHedge(GA_Offset src_vtx) const
331  { return !mySecondaryHedges->containsOffset(src_vtx); }
332 
333  /// Returns the previous hedge in the equivalence class of the given hedge.
334  ///
335  /// The equivalence class of a hedge consists of all hedges whose two
336  /// endpoints coincide with those of the hedge in question (although they
337  /// may be reversely paired). By *endpoints* of a hedge we mean the two
338  /// points into which the tail and head vertex of a hedge are respectively
339  /// wired.
340  /// @note Starting with any valid hedge, repeated calls to hedgeToPrevHedge
341  /// or hedgeToNextHedge traverses all hedges to the original one and
342  /// ultimately wraps around.
344  { return myHedgePrevRef->getLink(src_vtx); }
345 
346  /// Returns the next hedge in the equivalence class of the given hedge.
347  /// @see hedgeToPrevHedge
349  { return myHedgeNextRef->getLink(src_vtx); }
350 
351  /// returns the primary hedge in the equivalence class of a given hedge
352  GA_Offset hedgeToPrimaryHedge(GA_Offset vtx);
353 
354  /// Same as linkHedge, but first unlinks hedge before calling linkHedge.
355  /// @see linkHedge
356  void relinkHedge(GA_Offset src_vtx,
357  GA_Offset dst_vtx,
358  GA_Offset into_src_vtx = GA_INVALID_OFFSET);
359 
360  /// This is equivalent to calling relinkHedge on both of the hedges that
361  /// are incident to a vtx.
362  void relinkVertexHedges(GA_Offset vtx);
363 
364  /// This is equivalent to calling relinkHedge on both of the hedges that
365  /// are incident to a vtx. Instead of searching for equivalent hedges to
366  /// link into, it respectively links the the hedges whose head and tail
367  /// vertices are vtx into prev_into_src_vtx and next_into_src_vtx.
368  void relinkVertexHedges(GA_Offset vtx,
369  GA_Offset prev_into_src_vtx,
370  GA_Offset next_into_src_vtx);
371 
372  /// Tosses out existing topology links and rebuilds the whole thing from
373  /// scratch.
374  /// @see createHedgeTopologyLinks
375  void rebuildHedgeTopologyLinks();
376 
377  /// This counts memory using the given UT_MemoryCounter.
378  /// NOTE: GA_Topology doesn't own any of the memory it points to,
379  /// so there's not much to count.
380  void countMemory(UT_MemoryCounter &counter, bool inclusive) const;
381 
382  /// Returns the current storage level as an int.
383  /// Call GA_Topology::getStorage(topology.getStorageLevel())
384  /// to get the GA_Storage.
385  int getStorageLevel() const
386  { return myStorageLevel; }
387 
388  /// Call GA_Attribute::cloneDataId on all the attributes we hold.
389  void cloneDataId( const GA_Topology &src, bool allow_clear=false);
390 
392  {
393  TOPO_CE_PRIMPOINTS, // prim -> int[]
394  TOPO_CE_PRIMVERTICES, // prim -> int[]
395  TOPO_CE_PRIMVERTEXCOUNT, // prim -> int
396 
397  TOPO_CE_POINTPRIMS, // point -> int[]
398  TOPO_CE_POINTVERTICES, // point -> int[]
399  TOPO_CE_POINTNEIGHBOURS, // point -> int[]
400 
401  TOPO_CE_VERTEXPOINT, // vertex -> int
402  TOPO_CE_VERTEXPRIM, // vertex -> int
403  TOPO_CE_VERTEXPRIMINDEX, // vertex -> int
404 
405  NUM_TOPO_CE
406  };
407 
408  static TopologyCE nameToTopologyCE(const char *name);
409  static const char *topologyCEToName(TopologyCE topotype);
410 
411  /// @{
412  /// The topology data may be on the GPU. This also includes
413  /// some meta-topology info such as prim->points.
414  /// Note topology is in index space on the GPU, not offset, so
415  /// we always have a non tirival mapping.
416  ///
417  /// Currently writing isn't supported.
418 
419  /// Gets a named topology attribute, verifying it was cached with
420  /// a matching data id. If not, flushes any cache and returns null.
421  GA_CEAttribute *queryCEAttribute(TopologyCE topotype,
424  int &tuplesize,
425  bool isarray,
426  bool read, bool write);
427  /// Stores this as the canonical CE attribute for this topoid,
428  /// marking current data id as the valid version.
429  void setCEAttribute(UT_UniquePtr<GA_CEAttribute> && ceattrib,
430  TopologyCE topotype,
431  bool leave_on_gpu=false);
432 
433  /// Any CE cache which was marked as written to will be copied
434  /// back to the CPU. It will be left on the GPU, however.
435  void flushCEWriteCaches(bool clearwriteback=true);
436  bool hasPendingCEWriteBack() const;
437 
438  /// Remove all CE Caches, copying back any marked as written to.
439  void flushCECaches();
440 
441  /// Steal the CE attribute from the source topology, leaving the
442  /// src with a null CE attribute.
443  void stealCEAttributes(const GA_Topology &src);
444 
445  /// @}
446 
447 private:
448 
449  /// Unlinks a hedge from the circular linked list that represents its
450  /// equivalence class.
451  ///
452  /// @note We always want to maintain the invariant that at any given
453  /// time each hedge be linked to other hedges in its equivalence class.
454  /// Therefore, unlinking should only be used either right ahead of
455  /// relinking into another class or when a hedge turns into a singleton
456  /// class of its own.
457  /// @note This method must not be called if hedge topology attributes are
458  /// not created
459  /// @see isHedgeFull
460  void unlinkHedge(GA_Offset tailv);
461 
462 
463  /// Links a hedge into the equivalence class of hedges that share its
464  /// endpoints.
465  /// @param src_vtx The tail vertex of the hedge to be linked
466  /// @param dst_vtx The head vertex of the hedge to be linked. This is
467  /// made mandatory even though it can be found by querying the primitive
468  /// because it has to be done anyway and most often the caller has it
469  /// figured out before calling this method. dst_vtx equal to -1 makes
470  /// the hedge invalid.
471  /// @param into_src_vtx (Optional) the tail vertex of an already known
472  /// hedge from the equivalence class. If specified, no searching takes
473  /// place and the given hedge is simply linked into the class of the hedge
474  /// determined by into_src_vtx. Note that no checks are made to ensure
475  /// that the hedge truly belongs to the class. If into_src_vtx is not
476  /// specified, we search for a hedge in the target equivalence class. The
477  /// running time in this case is at least proportional to the number of
478  /// vertices wired to the same point as src_vtx.
479  ///
480  /// @note No unlinking of any hedges is applied before linking them up
481  /// into new ones. The caller must make sure the hedge to be linked is
482  /// already unlinked from any class into which it might have been
483  /// previously linked.
484  ///
485  /// @note It is OK if the hedge determined by src_vtx or the one
486  /// determined by into_src_vtx are invalid (have negative previous
487  /// and next hedge references) although this generally should be avoided.
488  /// If invalid, they are first made valid before linking them into each
489  /// other.
490  void linkHedge(GA_Offset src_vtx,
491  GA_Offset dst_vtx,
492  GA_Offset into_src_vtx = GA_INVALID_OFFSET);
493 
494  /// Called by defragmentation
495  void swapElements(GA_AttributeOwner owner,
497  void moveElements(GA_AttributeOwner owner,
499  /// NOTE: This will bump the data ID of myPointRef, myVertexRef,
500  /// or myPrimitiveRef if any of those are modified,
501  /// because they are modified when defragmenting
502  /// an index map that is different from their owner,
503  /// i.e. their *link* owner's index map.
504  void swapLinks(GA_AttributeOwner owner, const GA_Defragment &d);
505  static void swapTopologyElements(GA_ATITopology *atr,
507  static void moveTopologyElements(GA_ATITopology *atr,
509  static void swapTopologyLinks(GA_ATITopology *atr,
510  const GA_Defragment &defrag);
511  bool checkStorageChange(GA_Size nvertex,
512  GA_Size npoints,
513  GA_Size nprimitives);
514  void rebuildTopologyLinks(bool do_prim, bool do_vertex);
515  void mergeResolvePendingVertexRefs(const GA_MergeMap &map);
516 
517  void unlinkVertex(GA_Offset point, GA_Offset vertex);
518  void linkVertex(GA_Offset point, GA_Offset vertex);
519  void shiftStorage(int change, bool cloned_data_id=false); // Lower storage requirements
520 
521  // GA_Detail::replace needs access to replaceStorageLevel.
522  friend GA_Detail;
523 
524  void replaceStorageLevel(const int storage_level)
525  {
526  myStorageLevel = storage_level;
527 
528  // The topology attributes should already have been replaced.
529  UT_IF_ASSERT_P(GA_Storage storage = theStorageLevels[myStorageLevel].getStorage();)
530  UT_ASSERT_P(!myPointRef || myPointRef->getStorage() == storage);
531  UT_ASSERT_P(!myPrimitiveRef || myPrimitiveRef->getStorage() == storage);
532  UT_ASSERT_P(!myVertexRef || myVertexRef->getStorage() == storage);
533  UT_ASSERT_P(!myVertexPrevRef || myVertexPrevRef->getStorage() == storage);
534  UT_ASSERT_P(!myVertexNextRef || myVertexNextRef->getStorage() == storage);
535  UT_ASSERT_P(!myHedgePrevRef || myHedgePrevRef->getStorage() == storage);
536  UT_ASSERT_P(!myHedgeNextRef || myHedgeNextRef->getStorage() == storage);
537  }
538 
539  /// Traversing equivalent hedges without use of hedge topology attributes
540  /// @note for validation of hedge topology references
541  GA_Offset hedgeToNextHedgeSlow(GA_Offset tailvertex) const;
542 
543 
544  static const ga_StorageSwitch theStorageLevels[NUM_STORAGE_LEVELS];
545 
546  GA_Detail &myDetail; // Reference to detail
547 
548  GA_ATITopology *myPointRef; // Vertex->point edge
549  GA_ATITopology *myPrimitiveRef; // Vertex->primitive edge
550  GA_ATITopology *myVertexRef; // Point->vertex edge
551  GA_ATITopology *myVertexPrevRef; // Vertex->Vertex linked list
552  GA_ATITopology *myVertexNextRef; // Vertex->Vertex linked list
553 
554  GA_ATITopology *myHedgePrevRef; // Hedge->Hedge circular linked list
555  GA_ATITopology *myHedgeNextRef; // Hedge->Hedge circular linked list
556  GA_VertexGroup *mySecondaryHedges; // secondary (non-primary) hedge marker
557 
558  int myStorageLevel; // Storage level
559 
560  mutable GA_DataId myCEAttributeDataId[NUM_TOPO_CE];; // When they were cached.
561  mutable UT_UniquePtr<GA_CEAttribute> myCEAttribute[NUM_TOPO_CE]; // OpenCL Backing.
562 };
563 
564 #endif
SIM_API const UT_StringHolder vertex
Definition of a geometry attribute.
Definition: GA_Attribute.h:198
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
int getStorageLevel() const
Definition: GA_Topology.h:385
bool downShift(GA_Size size) const
Definition: GA_Topology.h:50
GA_StorageClass
Definition: GA_Types.h:72
getFileOption("OpenEXR:storage") storage
Definition: HDK_Image.dox:276
int64 GA_DataId
Definition: GA_Types.h:687
GA_Precision
Definition: GA_Types.h:87
GA_Storage getStorage() const
Definition: GA_Topology.h:58
GA_Offset hedgeToNextHedge(GA_Offset src_vtx) const
Definition: GA_Topology.h:348
The merge map keeps track of information when merging details.
Definition: GA_MergeMap.h:53
GLint level
Definition: glcorearb.h:108
SYS_FORCE_INLINE GA_ATITopology * getPrimitiveRef()
Definition: GA_Topology.h:233
void addPoint(GA_Offset pt)
Definition: GA_Topology.h:160
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
GLdouble s
Definition: glad.h:3009
void makeHedgeFull()
Definition: GA_Topology.h:285
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:87
#define GA_API
Definition: GA_API.h:14
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
SYS_FORCE_INLINE GA_ATITopology * getPointRef()
Definition: GA_Topology.h:231
bool isHedgeFull() const
Definition: GA_Topology.h:279
#define UT_IF_ASSERT_P(ZZ)
Definition: UT_Assert.h:182
void read(T &in, bool &v)
Definition: ImfXdr.h:502
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:235
#define GA_INVALID_OFFSET
Definition: GA_Types.h:678
#define NUM_STORAGE_LEVELS
Definition: GA_Topology.h:69
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
GA_Size GA_Offset
Definition: GA_Types.h:641
static int computeStorageDownShift(int storage_level, GA_Size size)
Definition: GA_Topology.h:72
static GA_Storage getStorage(int level)
Definition: GA_Topology.h:100
GLdouble n
Definition: glcorearb.h:2008
SYS_FORCE_INLINE GA_ATITopology * getVertexPrevRef()
Definition: GA_Topology.h:237
static int computeStorageUpShift(int storage_level, GA_Size size)
Definition: GA_Topology.h:86
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:155
SYS_FORCE_INLINE const GA_ATITopology * getVertexNextRef() const
Definition: GA_Topology.h:229
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
bool upShift(GA_Size size) const
Definition: GA_Topology.h:54
SYS_FORCE_INLINE GA_ATITopology * getVertexNextRef()
Definition: GA_Topology.h:239
Options during loading.
Definition: GA_LoadMap.h:42
Defragmentation of IndexMaps.
Definition: GA_Defragment.h:45
GLuint const GLchar * name
Definition: glcorearb.h:786
void makeFull()
Definition: GA_Topology.h:115
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
SYS_FORCE_INLINE const GA_ATITopology * getPrimitiveRef() const
Definition: GA_Topology.h:223
void addVertex(GA_Offset vtx)
Functions to maintain topological information.
Definition: GA_Topology.h:158
GA_Offset hedgeToPrevHedge(GA_Offset src_vtx) const
Definition: GA_Topology.h:343
GLenum GLint GLint * precision
Definition: glcorearb.h:1925
bool rebuildTopology(GA_Detail &gdp, bool create_attributes=false) const
GLsizeiptr size
Definition: glcorearb.h:664
SYS_FORCE_INLINE const GA_ATITopology * getVertexPrevRef() const
Definition: GA_Topology.h:227
GA_AttributeOwner
Definition: GA_Types.h:34
SYS_FORCE_INLINE const GA_ATITopology * getVertexRef() const
Definition: GA_Topology.h:225
SYS_FORCE_INLINE GA_ATITopology * getVertexRef()
Definition: GA_Topology.h:235
Container class for all geometry.
Definition: GA_Detail.h:96
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
void write(T &out, bool v)
Definition: ImfXdr.h:287
bool isPrimaryHedge(GA_Offset src_vtx) const
Definition: GA_Topology.h:330
SYS_FORCE_INLINE const GA_ATITopology * getPointRef() const
Definition: GA_Topology.h:221
GA_Storage
Definition: GA_Types.h:50
GLenum src
Definition: glcorearb.h:1793
ga_StorageSwitch(GA_Storage store, GA_Size lo_water, GA_Size hi_water)
Definition: GA_Topology.h:45