HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_GEOPrimCollect Class Referenceabstract

#include <GT_GEOPrimCollect.h>

+ Inheritance diagram for GT_GEOPrimCollect:

Public Member Functions

 GT_GEOPrimCollect ()
 Constructor. More...
 
virtual ~GT_GEOPrimCollect ()
 Destructor. More...
 
virtual GT_GEOPrimCollectDatabeginCollecting (const GT_GEODetailListHandle &geometry, const GT_RefineParms *parms) const
 
virtual GT_PrimitiveHandle collect (const GT_GEODetailListHandle &geometry, const GEO_Primitive *const *prim_list, int nsegments, GT_GEOPrimCollectData *data) const =0
 
virtual GT_PrimitiveHandle endCollecting (const GT_GEODetailListHandle &geometry, GT_GEOPrimCollectData *data) const
 
void bind (const GA_PrimitiveTypeId &id) const
 

Static Public Member Functions

static GT_GEOPrimCollectPtr getCollector (const GA_PrimitiveTypeId &id)
 Get the current collector bound for a primitive. More...
 

Detailed Description

Refine primitives for a detail.

When a detail refines itself, it asks the "collectors" to refine primitives. The refiners can "collect" primitives on the fly, or they can collect primitives and generate a single primitive at the end of the collection.

Examples:
packedsphere/GT_GEOPackedSphere.h, and tetprim/GT_PrimTetra.h.

Definition at line 58 of file GT_GEOPrimCollect.h.

Constructor & Destructor Documentation

GT_GEOPrimCollect::GT_GEOPrimCollect ( )

Constructor.

virtual GT_GEOPrimCollect::~GT_GEOPrimCollect ( )
virtual

Destructor.

Member Function Documentation

virtual GT_GEOPrimCollectData* GT_GEOPrimCollect::beginCollecting ( const GT_GEODetailListHandle geometry,
const GT_RefineParms parms 
) const
virtual

This method is called when the detail begins collecting. The method may or may not be called if there are now collectable primitives in the detail.

The data container is passed to the collect() and endCollect() methods. It is automatically deleted on completion. If no data is needed for collection, this method should return a NULL pointer (which is the default behaviour).

Reimplemented in GT_GEOPrimCollectVolume, GusdGT_PrimCollect, GABC_NAMESPACE::GABC_CollectPacked, GT_GEOPrimCollectChannel, HDK_Sample::GT_PrimTetraCollect, and GT_GEOPrimCollectPacked.

void GT_GEOPrimCollect::bind ( const GA_PrimitiveTypeId id) const

Register to process primitives of the given primitive id. You can bind to multiple primitive types, in which case, beginCollecting() and endCollecting() will be invoked only once for each detail traversal. collect() will be called for each primitive that matches any of the bound primitive types. For example:

gt_GEOPrimQuadricCollect *q = new gt_GEOPrimQuadricCollect();
q->bind(GA_PrimitiveType(GA_PRIMCIRCLE));
q->bind(GA_PrimitiveType(GA_PRIMSPHERE));
q->bind(GA_PrimitiveType(GA_PRIMTUBE));
virtual GT_PrimitiveHandle GT_GEOPrimCollect::collect ( const GT_GEODetailListHandle geometry,
const GEO_Primitive *const *  prim_list,
int  nsegments,
GT_GEOPrimCollectData data 
) const
pure virtual

For each matching primitive in the detail, this method will be called. If no GT primitive should be created, return an empty handle.

Implemented in GT_GEOPrimCollectVolume, GusdGT_PrimCollect, GT_GEOPrimCollectVDB, GABC_NAMESPACE::GABC_CollectPacked, GT_GEOPrimCollectChannel, HDK_Sample::GT_PrimTetraCollect, and GT_GEOPrimCollectPacked.

virtual GT_PrimitiveHandle GT_GEOPrimCollect::endCollecting ( const GT_GEODetailListHandle geometry,
GT_GEOPrimCollectData data 
) const
virtual

Complete any processing fter all primitives have been collected

This method should not delete the collection data

Reimplemented in GT_GEOPrimCollectVolume, GusdGT_PrimCollect, GABC_NAMESPACE::GABC_CollectPacked, GT_GEOPrimCollectChannel, HDK_Sample::GT_PrimTetraCollect, and GT_GEOPrimCollectPacked.

static GT_GEOPrimCollectPtr GT_GEOPrimCollect::getCollector ( const GA_PrimitiveTypeId id)
static

Get the current collector bound for a primitive.


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