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

Definition of a geometric primitive. More...

#include <GA_PrimitiveDefinition.h>

Classes

class  SharedDataLoader
 Class to load shared data. More...
 

Public Member Functions

const UT_StringHoldergetToken () const
 The name of the primitive. More...
 
const UT_StringHoldergetLabel () const
 The label (user friendly & readable token) of the primitive. More...
 
const UT_StringHoldergetIcon () const
 The icon associated with the primitive type (if any). More...
 
SYS_FORCE_INLINE const
GA_PrimitiveTypeId
getId () const
 The unique ID assigned by the GA_PrimitiveFactory. More...
 
GA_PrimitiveFamilyMask getFamilyMask () const
 The optional family mask. More...
 
const GA_IntrinsicManagergetIntrinsicManager () const
 Primitive intrinsic attributes defined for this primitive. More...
 
GA_IntrinsicManagergetIntrinsicManager ()
 
void setLabel (const UT_StringHolder &label)
 Set the label for the primitive. More...
 
void setIcon (const UT_StringHolder &icon)
 Set the icon for the primitive. More...
 
void setMergeConstructor (GA_Primitive *(*ctor)(const GA_MergeMap &map, GA_Detail &dest_detail, GA_Offset dest_offset, const GA_Primitive &src_prim))
 
bool hasLocalTransform () const
 Return whether the primitive has a transform associated with it. More...
 
void setHasLocalTransform (bool x)
 Set whether the primitive is has a transform associated with it. More...
 
bool hasCECaches () const
 Return whether the primitive is able to be cached on the GPU. More...
 
void setHasCECaches (bool x)
 
bool isForPrimaryDetail () const
 
bool hasSharedLoadData () const
 Return whether the primitive type has a shared data loader. More...
 
void setSharedDataLoader (const SharedDataLoader *l)
 Associate the primitive type with a shared data loader. More...
 
const SharedDataLoadersharedDataLoader () const
 

Friends

class GA_PrimitiveFactory
 
class GA_PrimitiveList
 

Detailed Description

Definition of a geometric primitive.

Every primitive type is registered with a GA_PrimitiveFactory which creates a GA_PrimitiveDefinition. Each GA_PrimitiveDefinition in a given GA_PrimitiveFactory is assigned a unique identifier. In addition, an optional family mask can be registered with the type to specify from which standard primitive types (managed by that factory) the new GA_Primitive subclass derives.

The GA_PrimitiveDefinition for the new type registers a constructor function that will be used to allocate new instances of that type.

Finally, the definition also contains a list of "intrinsics" that can be queried from primitives of that type.

Examples:
tetprim/GEO_PrimTetra.C, and tetprim/GEO_PrimTetra.h.

Definition at line 58 of file GA_PrimitiveDefinition.h.

Member Function Documentation

GA_PrimitiveFamilyMask GA_PrimitiveDefinition::getFamilyMask ( ) const
inline

The optional family mask.

Definition at line 72 of file GA_PrimitiveDefinition.h.

const UT_StringHolder& GA_PrimitiveDefinition::getIcon ( ) const
inline

The icon associated with the primitive type (if any).

Definition at line 66 of file GA_PrimitiveDefinition.h.

SYS_FORCE_INLINE const GA_PrimitiveTypeId& GA_PrimitiveDefinition::getId ( ) const
inline

The unique ID assigned by the GA_PrimitiveFactory.

Examples:
tetprim/GEO_PrimTetra.C, and tetprim/GEO_PrimTetra.h.

Definition at line 70 of file GA_PrimitiveDefinition.h.

const GA_IntrinsicManager& GA_PrimitiveDefinition::getIntrinsicManager ( ) const
inline

Primitive intrinsic attributes defined for this primitive.

Definition at line 75 of file GA_PrimitiveDefinition.h.

GA_IntrinsicManager& GA_PrimitiveDefinition::getIntrinsicManager ( )
inline

Definition at line 77 of file GA_PrimitiveDefinition.h.

const UT_StringHolder& GA_PrimitiveDefinition::getLabel ( ) const
inline

The label (user friendly & readable token) of the primitive.

Definition at line 64 of file GA_PrimitiveDefinition.h.

const UT_StringHolder& GA_PrimitiveDefinition::getToken ( ) const
inline

The name of the primitive.

Definition at line 62 of file GA_PrimitiveDefinition.h.

bool GA_PrimitiveDefinition::hasCECaches ( ) const
inline

Return whether the primitive is able to be cached on the GPU.

Definition at line 104 of file GA_PrimitiveDefinition.h.

bool GA_PrimitiveDefinition::hasLocalTransform ( ) const
inline

Return whether the primitive has a transform associated with it.

Definition at line 99 of file GA_PrimitiveDefinition.h.

bool GA_PrimitiveDefinition::hasSharedLoadData ( ) const
inline

Return whether the primitive type has a shared data loader.

Definition at line 144 of file GA_PrimitiveDefinition.h.

bool GA_PrimitiveDefinition::isForPrimaryDetail ( ) const
inline

Returns true if this type is for use by GEO_Detail and false if this type is for use by GD_Detail.

Definition at line 109 of file GA_PrimitiveDefinition.h.

void GA_PrimitiveDefinition::setHasCECaches ( bool  x)
inline

Definition at line 105 of file GA_PrimitiveDefinition.h.

void GA_PrimitiveDefinition::setHasLocalTransform ( bool  x)
inline

Set whether the primitive is has a transform associated with it.

Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 101 of file GA_PrimitiveDefinition.h.

void GA_PrimitiveDefinition::setIcon ( const UT_StringHolder icon)
inline

Set the icon for the primitive.

Definition at line 85 of file GA_PrimitiveDefinition.h.

void GA_PrimitiveDefinition::setLabel ( const UT_StringHolder label)
inline

Set the label for the primitive.

Definition at line 81 of file GA_PrimitiveDefinition.h.

void GA_PrimitiveDefinition::setMergeConstructor ( GA_Primitive *(*)(const GA_MergeMap &map, GA_Detail &dest_detail, GA_Offset dest_offset, const GA_Primitive &src_prim)  ctor)
inline

NOTE: This used to set the merge constructor, but merge constructors are no longer a thing. Please make sure that the regular constructor of your primitive types don't add any vertices to the detail or anything else thread-unsafe like that. You can always add vertices and initialize them later. This change was required in order for all primitive types to be able to be constructed in parallel.

Definition at line 95 of file GA_PrimitiveDefinition.h.

void GA_PrimitiveDefinition::setSharedDataLoader ( const SharedDataLoader l)
inline

Associate the primitive type with a shared data loader.

Definition at line 147 of file GA_PrimitiveDefinition.h.

const SharedDataLoader* GA_PrimitiveDefinition::sharedDataLoader ( ) const
inline

Definition at line 149 of file GA_PrimitiveDefinition.h.

Friends And Related Function Documentation

friend class GA_PrimitiveFactory
friend

Definition at line 206 of file GA_PrimitiveDefinition.h.

friend class GA_PrimitiveList
friend

Definition at line 207 of file GA_PrimitiveDefinition.h.


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