HDK
|
A list of primitives. More...
#include <GA_PrimitiveList.h>
Friends | |
class | GA_Detail |
A list of primitives.
Primitives for a detail are stored in a primitive list. The list stores pointers to primitive objects. The list is ordered in the same order as the primitive attribute lists.
Definition at line 48 of file GA_PrimitiveList.h.
GA_PrimitiveList::GA_PrimitiveList | ( | GA_Detail & | detail | ) |
|
inline |
Definition at line 54 of file GA_PrimitiveList.h.
Set capacity of primitive offsets in the list.
void GA_PrimitiveList::bumpDataId | ( | ) |
Use this to mark primitives or their intrinsic data as dirty.
void GA_PrimitiveList::clear | ( | bool | for_deletion | ) |
|
inline |
Check to see whether the primitive list only contains primitives of a given type
Definition at line 252 of file GA_PrimitiveList.h.
|
inline |
Check to see whether the primitive list contains primitives of a given type
Definition at line 248 of file GA_PrimitiveList.h.
void GA_PrimitiveList::countMemory | ( | UT_MemoryCounter & | counter, |
bool | inclusive | ||
) | const |
Count memory usage using a UT_MemoryCounter in order to count shared memory correctly. If inclusive is true, the size of this object is counted, else only memory owned by this object is counted. If this is pointed to by the calling object, inclusive should be true. If this is contained in the calling object, inclusive should be false. (Its memory was already counted in the size of the calling object.)
|
inline |
Return the number of primitives of the given type.
Definition at line 255 of file GA_PrimitiveList.h.
|
inline |
Return the number of primitives of the given family.
Definition at line 258 of file GA_PrimitiveList.h.
void GA_PrimitiveList::defragment | ( | const GA_Defragment & | defrag | ) |
Called by GA_Detail::defragment when defragmenting the primitive index map. NOTE: This bumps the primitive list data ID.
void GA_PrimitiveList::defragmentVertices | ( | const GA_Defragment & | defrag | ) |
Called by GA_Detail::defragment when defragmenting the vertex index map. NOTE: This bumps the primitive list data ID.
void GA_PrimitiveList::destroyStashed | ( | ) |
void GA_PrimitiveList::flushCECaches | ( | const GA_PrimitiveFactory & | f | ) |
Copy any modified caches from the GPU to CPU. Then delete the GPU cache.
void GA_PrimitiveList::flushCEWriteCaches | ( | const GA_PrimitiveFactory & | f | ) |
Copy any modified caches from the GPU back to CPU cache.
|
inline |
Definition at line 60 of file GA_PrimitiveList.h.
|
inline |
Definition at line 69 of file GA_PrimitiveList.h.
SYS_FORCE_INLINE bool GA_PrimitiveList::getClosedFlag | ( | GA_Offset | primoff | ) | const |
Returns the "closed" flag for polygon, NURBS curve, or Bezier curve primitives, or false for other primitive types. You must include GA_Primitive.h to use this.
Definition at line 1095 of file GA_Primitive.h.
|
inline |
Returns the representative (first) vertex list for a "constant" page. The page must be constant-compressed, i.e. isVertexListPageConstant must return true. NOTE: "constant" in this context really means that the vertex lists all have the same vertex count, and represent contiguous vertices.
Definition at line 164 of file GA_PrimitiveList.h.
|
inline |
Definition at line 272 of file GA_PrimitiveList.h.
int64 GA_PrimitiveList::getMemoryUsage | ( | bool | inclusive | ) | const |
Report on memory usage.
bool GA_PrimitiveList::getPrimitivesOfType | ( | const GA_PrimitiveTypeId & | type, |
UT_Array< const GA_Primitive * > & | prims | ||
) | const |
Return the primitives of the given type. Unlike the functions above which use myTracker, this function requires iterating through all primitives.
void GA_PrimitiveList::getPrimitiveTypeCounts | ( | UT_Array< std::pair< int, exint >> & | type_count_pairs, |
const GA_Range * | range = nullptr |
||
) | const |
Append to a run-length encoded array of pairs of a primitive type ID and a count of those primitives. A detail with 5 polygons, followed by 3 tetrahedra, followed by 4 polygons will yield: {GA_PRIMPOLY, 5}, {GA_PRIMTETRAHEDRON, 3}, {GA_PRIMPOLY, 4}
|
inline |
Definition at line 275 of file GA_PrimitiveList.h.
SYS_FORCE_INLINE int GA_PrimitiveList::getTypeId | ( | GA_Offset | primoff | ) | const |
Returns the type ID of the primitive at the specified primitive offset. You must include GA_Primitive.h to use this.
Definition at line 1078 of file GA_Primitive.h.
SYS_FORCE_INLINE GA_Size GA_PrimitiveList::getVertexCount | ( | GA_Offset | primoff | ) | const |
Returns the number of vertices in the primitive at the specified primitive offset. You must include GA_Primitive.h to use this.
Definition at line 1029 of file GA_Primitive.h.
SYS_FORCE_INLINE GA_OffsetListRef GA_PrimitiveList::getVertexList | ( | GA_Offset | primoff | ) | const |
Returns a shallow copy of the vertex list of the primitive at the specified primitive offset. You must include GA_Primitive.h to use this.
Definition at line 933 of file GA_Primitive.h.
SYS_FORCE_INLINE GA_Offset GA_PrimitiveList::getVertexOffset | ( | GA_Offset | primoff, |
GA_Size | i | ||
) | const |
Returns the vertex offset in the primitive at the specified primitive offset in vertex list position i. If you're accessing all vertex offsets, it'll be faster to call getVertexList() once and either read from that or call forEach(fucntor) on it. You must include GA_Primitive.h to use this.
Definition at line 1053 of file GA_Primitive.h.
void GA_PrimitiveList::hardenAllVertexListPages | ( | ) |
NOTE: This is not threadsafe. It hardens all vertex list pages, if applicable.
GA_OffsetList* GA_PrimitiveList::hardenVertexListPage | ( | GA_PageNum | pagenum | ) |
NOTE: This will only work if !isFullRepresentation() NOTE: This is safe to call from multiple threads as long as pagenum is different for each and hardenVertexListPageTable() has been called outside threaded code.
|
inline |
NOTE: This is not threadsafe. Also, this just hardens the table, not any pages.
Definition at line 187 of file GA_PrimitiveList.h.
|
inline |
Test whether the primitive list contains any primitives that have a local transform.
Definition at line 262 of file GA_PrimitiveList.h.
void GA_PrimitiveList::initVertexLists | ( | GA_Offset | prim_block_start, |
GA_Offset | vertex_block_start, | ||
GA_Size | nprimitives, | ||
GA_Size | nvertices_each, | ||
bool | closed = false |
||
) |
void GA_PrimitiveList::initVertexLists | ( | GA_Offset | prim_block_start, |
GA_Offset | vertex_block_start, | ||
const GA_PolyCounts & | vertex_counts, | ||
bool | closed = false |
||
) |
void GA_PrimitiveList::initVertexLists | ( | GA_Offset | prim_block_start, |
GA_Offset | vertex_block_start, | ||
const GA_PolyCounts & | vertex_counts, | ||
const exint * | closed_span_lengths = nullptr , |
||
const exint | ncopies = 1 |
||
) |
First value of closed_span_lengths is the number with closed false. To start with closed true, have a value of 0 first, then the number with closed true. nullptr means closed false for all primitives.
|
inline |
Returns true iff the primitive list representation is as separate allocations for each primitive, instead of using the paged array format.
Definition at line 146 of file GA_PrimitiveList.h.
|
inline |
Returns true iff the specified vertex list page is constant.
Definition at line 153 of file GA_PrimitiveList.h.
bool GA_PrimitiveList::jsonLoad | ( | UT_JSONParser & | p, |
GA_LoadMap & | load, | ||
GA_Offset & | load_end | ||
) |
Load from a JSON stream
bool GA_PrimitiveList::jsonSave | ( | UT_JSONWriter & | w, |
const GA_SaveMap & | save | ||
) | const |
Save data to a JSON stream.
void GA_PrimitiveList::merge | ( | GA_Detail & | dgeo, |
const GA_MergeMap & | map | ||
) |
|
inline |
Offset size of the list.
Definition at line 131 of file GA_PrimitiveList.h.
void GA_PrimitiveList::rebuildTracker | ( | ) |
Force a rebuild of primitive counts. This is triggered if primitives have changed their types without being added/removed explicitly. Packed primitives, for example, are polymorphic in this manner.
NOTE: Since the primitive maps of dstgeo and srcgeo must have already been made equal by the time this is called.
SYS_FORCE_INLINE void GA_PrimitiveList::setClosedFlag | ( | GA_Offset | primoff, |
bool | closed | ||
) |
Sets the "closed" flag for polygon primitives. For NURBS curve or Bezier curve primitives, use GEO_Face::close() or GEO_Face::open(). You must include GA_Primitive.h to use this.
Definition at line 1119 of file GA_Primitive.h.
SYS_FORCE_INLINE void GA_PrimitiveList::setVertexList | ( | GA_Offset | primoff, |
const GA_OffsetListRef & | vertices | ||
) |
NOTE: This is safe to call from multiple threads as long as they aren't writing to the same page, and hardenVertexListPageTable() has been called from single-threaded code. You must include GA_Primitive.h to use this.
Definition at line 963 of file GA_Primitive.h.
SYS_FORCE_INLINE void GA_PrimitiveList::setVertexList | ( | GA_Offset | primoff, |
const GA_OffsetList & | vertices | ||
) |
NOTE: This is safe to call from multiple threads as long as they aren't writing to the same page, and hardenVertexListPageTable() has been called from single-threaded code. You must include GA_Primitive.h to use this.
Definition at line 987 of file GA_Primitive.h.
SYS_FORCE_INLINE void GA_PrimitiveList::setVertexList | ( | GA_Offset | primoff, |
GA_OffsetList && | vertices | ||
) |
NOTE: This is safe to call from multiple threads as long as they aren't writing to the same page, and hardenVertexListPageTable() has been called from single-threaded code. You must include GA_Primitive.h to use this.
Definition at line 1008 of file GA_Primitive.h.
void GA_PrimitiveList::stashAll | ( | ) |
void GA_PrimitiveList::stealCEBuffers | ( | const GA_PrimitiveList & | src, |
const GA_PrimitiveFactory & | f | ||
) |
Steal the CE buffers from the source primitive list.
bool GA_PrimitiveList::validate | ( | const GA_Detail & | detail | ) | const |
Goes through the primitive list to confirm that it's in a consistent state, returning true if it is, and false if it isn't. This is only for debugging purposes.
Definition at line 394 of file GA_PrimitiveList.h.