HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_PrimitiveList Class Reference

A list of primitives. More...

#include <GA_PrimitiveList.h>

Public Member Functions

 GA_PrimitiveList (GA_Detail &detail)
 
SYS_FORCE_INLINE ~GA_PrimitiveList ()
 
SYS_FORCE_INLINE const
GA_Primitive
get (GA_Offset off) const
 
SYS_FORCE_INLINE GA_Primitiveget (GA_Offset off)
 
SYS_FORCE_INLINE GA_OffsetListRef getVertexList (GA_Offset primoff) const
 
SYS_FORCE_INLINE GA_Size getVertexCount (GA_Offset primoff) const
 
SYS_FORCE_INLINE GA_Offset getVertexOffset (GA_Offset primoff, GA_Size i) const
 
SYS_FORCE_INLINE int getTypeId (GA_Offset primoff) const
 
SYS_FORCE_INLINE bool getClosedFlag (GA_Offset primoff) const
 
SYS_FORCE_INLINE void setClosedFlag (GA_Offset primoff, bool closed)
 
int64 getMemoryUsage (bool inclusive) const
 Report on memory usage. More...
 
void countMemory (UT_MemoryCounter &counter, bool inclusive) const
 
GA_Offset offsetSize () const
 Offset size of the list. More...
 
void adjustArraySize (GA_Offset size)
 Set capacity of primitive offsets in the list. More...
 
void clear (bool for_deletion)
 
void stashAll ()
 
void destroyStashed ()
 
bool isFullRepresentation () const
 
bool isVertexListPageConstant (GA_PageNum pagenum) const
 Returns true iff the specified vertex list page is constant. More...
 
void merge (GA_Detail &dgeo, const GA_MergeMap &map)
 
void replace (GA_Detail &dstgeo, const GA_Detail &srcgeo)
 
void defragment (const GA_Defragment &defrag)
 
void defragmentVertices (const GA_Defragment &defrag)
 
void flushCEWriteCaches (const GA_PrimitiveFactory &f)
 Copy any modified caches from the GPU back to CPU cache. More...
 
void flushCECaches (const GA_PrimitiveFactory &f)
 
bool jsonSave (UT_JSONWriter &w, const GA_SaveMap &save) const
 
bool jsonLoad (UT_JSONParser &p, GA_LoadMap &load, GA_Offset &load_end)
 
bool containsType (const GA_PrimitiveTypeId &type) const
 
GA_Size countType (const GA_PrimitiveTypeId &type) const
 Return the number of primitives of the given type. More...
 
bool hasLocalTransform (const GA_PrimitiveFactory &factory) const
 
bool getPrimitivesOfType (const GA_PrimitiveTypeId &type, UT_Array< const GA_Primitive * > &prims) const
 
void bumpDataId ()
 Use this to mark primitives or their intrinsic data as dirty. More...
 
int64 getDataId () const
 
const GA_PrimitiveTrackergetTracker () const
 
bool validate (const GA_Detail &detail) const
 

Friends

class GA_Detail
 

Detailed Description

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.

Examples:
tetprim/GEO_PrimTetra.h.

Definition at line 52 of file GA_PrimitiveList.h.

Constructor & Destructor Documentation

GA_PrimitiveList::GA_PrimitiveList ( GA_Detail detail)
SYS_FORCE_INLINE GA_PrimitiveList::~GA_PrimitiveList ( )
inline

Definition at line 58 of file GA_PrimitiveList.h.

Member Function Documentation

void GA_PrimitiveList::adjustArraySize ( GA_Offset  size)

Set capacity of primitive offsets in the list.

void GA_PrimitiveList::bumpDataId ( )

Use this to mark primitives or their intrinsic data as dirty.

Examples:
SOP/SOP_BouncyAgent.C, SOP/SOP_BrushHairLen.C, and SOP/SOP_NURBS.C.
void GA_PrimitiveList::clear ( bool  for_deletion)
bool GA_PrimitiveList::containsType ( const GA_PrimitiveTypeId type) const
inline

Check to see whether the primitive list contains primitives of a given type

Definition at line 211 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.)

GA_Size GA_PrimitiveList::countType ( const GA_PrimitiveTypeId type) const
inline

Return the number of primitives of the given type.

Definition at line 214 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.

SYS_FORCE_INLINE const GA_Primitive* GA_PrimitiveList::get ( GA_Offset  off) const
inline
SYS_FORCE_INLINE GA_Primitive* GA_PrimitiveList::get ( GA_Offset  off)
inline

Definition at line 75 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 938 of file GA_Primitive.h.

int64 GA_PrimitiveList::getDataId ( ) const
inline

Definition at line 228 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.

const GA_PrimitiveTracker& GA_PrimitiveList::getTracker ( ) const
inline

Definition at line 231 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 921 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 872 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 842 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 896 of file GA_Primitive.h.

bool GA_PrimitiveList::hasLocalTransform ( const GA_PrimitiveFactory factory) const
inline

Test whether the primitive list contains any primitives that have a local transform.

Definition at line 218 of file GA_PrimitiveList.h.

bool GA_PrimitiveList::isFullRepresentation ( ) const
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 158 of file GA_PrimitiveList.h.

bool GA_PrimitiveList::isVertexListPageConstant ( GA_PageNum  pagenum) const
inline

Returns true iff the specified vertex list page is constant.

Definition at line 164 of file GA_PrimitiveList.h.

bool GA_PrimitiveList::jsonLoad ( UT_JSONParser p,
GA_LoadMap load,
GA_Offset load_end 
)

Load from a JSON stream

See Also
JSON_FileFormat
bool GA_PrimitiveList::jsonSave ( UT_JSONWriter w,
const GA_SaveMap save 
) const

Save data to a JSON stream.

JSON Schema: GA_PrimitiveList

{
"name" : "GA_PrimitiveList",
"description" : "An array of primitive objects",
"type" : "array",
"items" : { "$ref":"GA_Primitive" },
}
See Also
JSON_FileFormat, GA_Primitive
void GA_PrimitiveList::merge ( GA_Detail dgeo,
const GA_MergeMap map 
)
GA_Offset GA_PrimitiveList::offsetSize ( ) const
inline

Offset size of the list.

Definition at line 139 of file GA_PrimitiveList.h.

void GA_PrimitiveList::replace ( GA_Detail dstgeo,
const GA_Detail srcgeo 
)

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 962 of file GA_Primitive.h.

void GA_PrimitiveList::stashAll ( )
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.

Friends And Related Function Documentation

friend class GA_Detail
friend

Definition at line 329 of file GA_PrimitiveList.h.


The documentation for this class was generated from the following files: