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

#include <BRAY_Interface.h>

Public Types

using FieldList = UT_Array< std::pair< UT_StringHolder, GT_PrimitiveHandle >>
 

Public Member Functions

 ObjectPtr ()=default
 
 ~ObjectPtr ()
 
bool isValid () const
 Test validity. More...
 
bool isLeaf () const
 Query if object is a leaf node (ie not scenegraph or instance) More...
 
bool setMaterial (ScenePtr &scene, const MaterialPtr &mat, const OptionSet &opts, exint nfacesets=0, const FacesetMaterial *faceset_mat=nullptr)
 
void setInstancePrototype (const ObjectPtr &proto)
 Set the prototype for an instance object. More...
 
void setInstanceTransforms (ScenePtr &scene, const UT_Array< SpacePtr > &xforms)
 Set the transform on the instance. More...
 
void setInstanceAttributes (const ScenePtr &scene, const GT_AttributeListHandle &alist)
 Set attributes on instances. More...
 
void setInstanceProperties (const ScenePtr &scene, const GT_AttributeListHandle &alist)
 
void setInstanceIds (UT_Array< exint > ids)
 
void addInstanceToScene (ObjectPtr &obj)
 Add an object to a scene. More...
 
bool validateInstance () const
 Check to make sure that number of xforms, attribute list, ids all match. More...
 
GT_PrimitiveHandle geometry () const
 
BRAY_Proceduralprocedural ()
 Pointer to the contained procedural. This may return a nullptr. More...
 
bool setGeometry (const ScenePtr &scene, const GT_PrimitiveHandle &prim)
 
bool setGeometry (const ScenePtr &scene, const GT_PrimitiveHandle &prim, const GT_DataArrayHandle &holes)
 
bool setVolume (const ScenePtr &scene, const GT_AttributeListHandle &clist, const FieldList &fields)
 
const GT_AttributeListHandlevolumeDetailAttributes () const
 Return the detail attributes for a volume primitive. More...
 
void takeOwnership (BRAY_Object *obj)
 TODO: Deprecate this. More...
 
SYS_SAFE_BOOL operator bool () const
 
const BRAY_Object * objectPtr () const
 
BRAY_Object * objectPtr ()
 
OptionSet objectProperties (ScenePtr &scene)
 
const OptionSet objectProperties (const ScenePtr &scene) const
 

Protected Attributes

UT_SharedPtr< BRAY_Object > myObject
 

Friends

class ScenePtr
 

Detailed Description

Examples:
karma_procedurals/BRAY_HdBox.C.

Definition at line 648 of file BRAY_Interface.h.

Member Typedef Documentation

Update volume fields. This method will fail if the underlying primitive isn't a volume (see createVolume())

Definition at line 730 of file BRAY_Interface.h.

Constructor & Destructor Documentation

BRAY::ObjectPtr::ObjectPtr ( )
default
BRAY::ObjectPtr::~ObjectPtr ( )

Member Function Documentation

void BRAY::ObjectPtr::addInstanceToScene ( ObjectPtr obj)

Add an object to a scene.

GT_PrimitiveHandle BRAY::ObjectPtr::geometry ( ) const

Get the underlying GT_PrimitiveHandle (if possible). This method may return a nullptr.

bool BRAY::ObjectPtr::isLeaf ( ) const

Query if object is a leaf node (ie not scenegraph or instance)

bool BRAY::ObjectPtr::isValid ( ) const
inline

Test validity.

Definition at line 655 of file BRAY_Interface.h.

OptionSet BRAY::ObjectPtr::objectProperties ( ScenePtr scene)

This will return the object's base properties, or the scene defaults if the object isn't defined yet.

const OptionSet BRAY::ObjectPtr::objectProperties ( const ScenePtr scene) const

This will return the object's base properties, or the scene defaults if the object isn't defined yet.

const BRAY_Object* BRAY::ObjectPtr::objectPtr ( ) const
inline

Access to the underlying object

Definition at line 663 of file BRAY_Interface.h.

BRAY_Object* BRAY::ObjectPtr::objectPtr ( )
inline

Access to the underlying object

Definition at line 664 of file BRAY_Interface.h.

SYS_SAFE_BOOL BRAY::ObjectPtr::operator bool ( ) const
inline

Access to the underlying object

Definition at line 662 of file BRAY_Interface.h.

BRAY_Procedural* BRAY::ObjectPtr::procedural ( )

Pointer to the contained procedural. This may return a nullptr.

bool BRAY::ObjectPtr::setGeometry ( const ScenePtr scene,
const GT_PrimitiveHandle prim 
)

Update the geometry for the object. The method will fail if you're trying to change the underlying primitive type.

bool BRAY::ObjectPtr::setGeometry ( const ScenePtr scene,
const GT_PrimitiveHandle prim,
const GT_DataArrayHandle holes 
)

Set the list of "holes" for a polygon mesh (subdivision meshes have the list of holes specified in the subdivision tags).

void BRAY::ObjectPtr::setInstanceAttributes ( const ScenePtr scene,
const GT_AttributeListHandle alist 
)

Set attributes on instances.

void BRAY::ObjectPtr::setInstanceIds ( UT_Array< exint ids)

Set instance IDs. If not set (or given an empty array), it is assumed that the ids are contiguous 0...N-1 where N is the number of xforms.

void BRAY::ObjectPtr::setInstanceProperties ( const ScenePtr scene,
const GT_AttributeListHandle alist 
)

Set property overrides for instances. The array must have an entry for every instance. It's possible to have default options. Each attribute's name should match an object property name. Warnings will be output if an attribute doesn't match.

void BRAY::ObjectPtr::setInstancePrototype ( const ObjectPtr proto)

Set the prototype for an instance object.

void BRAY::ObjectPtr::setInstanceTransforms ( ScenePtr scene,
const UT_Array< SpacePtr > &  xforms 
)

Set the transform on the instance.

bool BRAY::ObjectPtr::setMaterial ( ScenePtr scene,
const MaterialPtr mat,
const OptionSet opts,
exint  nfacesets = 0,
const FacesetMaterial faceset_mat = nullptr 
)

Bind a material to the object. The method will fail if the underlying object cannot set the material.

Examples:
karma_procedurals/BRAY_HdBox.C.
bool BRAY::ObjectPtr::setVolume ( const ScenePtr scene,
const GT_AttributeListHandle clist,
const FieldList fields 
)
void BRAY::ObjectPtr::takeOwnership ( BRAY_Object *  obj)

TODO: Deprecate this.

bool BRAY::ObjectPtr::validateInstance ( ) const

Check to make sure that number of xforms, attribute list, ids all match.

const GT_AttributeListHandle& BRAY::ObjectPtr::volumeDetailAttributes ( ) const

Return the detail attributes for a volume primitive.

Friends And Related Function Documentation

friend class ScenePtr
friend

Definition at line 743 of file BRAY_Interface.h.

Member Data Documentation

UT_SharedPtr<BRAY_Object> BRAY::ObjectPtr::myObject
protected

Definition at line 742 of file BRAY_Interface.h.


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