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

#include <BRAY_Interface.h>

Public Member Functions

 ScenePtr ()=default
 
 ~ScenePtr ()
 
bool isKarmaCPU () const
 
bool isKarmaXPU () const
 
bool isValid () const
 Test validity. More...
 
bool threadSafe () const
 Test whether the scene is thread-safe. More...
 
bool nestedInstancing () const
 Test whether the renderer supports nested instancing. More...
 
void updateObject (const ObjectPtr &ptr, BRAY_EventType event)
 Update an object in the scene. More...
 
void updateLight (const LightPtr &ptr, BRAY_EventType event)
 Update light object in the scene. More...
 
void updateCamera (const CameraPtr &ptr, BRAY_EventType event)
 Update camera object in the scene. More...
 
void updateMaterial (const MaterialPtr &ptr, BRAY_EventType event)
 Update material object in the scene. More...
 
void setCameraRayMask (BRAY_RayVisibility mask)
 
void setShadowRayMask (BRAY_RayVisibility mask)
 
void forceRedice ()
 
void commitOptions ()
 After changing any options, must commit prior to rendering. More...
 
OptionSet planeProperties ()
 Grab a copy of the current image plane properties. More...
 
const OptionSet constPlaneProperties () const
 
OptionSet defaultProperties (BRAY_PropertyType type) const
 
LightPtr createLight (const UT_StringHolder &name)
 Create a light. More...
 
CameraPtr createCamera (const UT_StringHolder &name)
 Create a camera. More...
 
MaterialPtr createMaterial (const UT_StringHolder &name)
 Create a material. More...
 
MaterialPtr findMaterial (const UT_StringRef &name) const
 Find a material. More...
 
bool destroyMaterial (const UT_StringRef &name)
 Destroy/Delete a material (returns false if material wasn't found) More...
 
bool addSpace (const UT_StringHolder &name, const SpacePtr &space, bool replace_existing=true)
 
bool addTraceset (const UT_StringHolder &name)
 
bool isTraceset (const UT_StringHolder &name)
 Check to see if a traceset exists. More...
 
ShaderGraphPtr createShaderGraph (const UT_StringHolder &name)
 Create a shader nodegraph. More...
 
bool loadHDA (const char *path)
 
void setSceneUnits (fpreal64 units)
 
fpreal64 sceneUnits () const
 
SYS_SAFE_BOOL operator bool () const
 
const BRAY_Scene * scenePtr () const
 
BRAY_Scene * scenePtr ()
 
OptionSet sceneOptions ()
 
const OptionSet constSceneOptions () const
 
OptionSet objectProperties ()
 
const OptionSet constObjectProperties () const
 
OptionSet lightProperties ()
 
const OptionSet constLightProperties () const
 
OptionSet cameraProperties ()
 
const OptionSet constCameraProperties () const
 
template<typename T >
SYS_FORCE_INLINE const T * optionImport (BRAY_SceneOption token, T *val, size_t n) const
 
template<typename T >
SYS_FORCE_INLINE bool setOption (BRAY_SceneOption token, const T *value, exint tuple_size)
 Interface to set an option. This template class is specialized for: More...
 
template<typename T >
SYS_FORCE_INLINE bool setOption (BRAY_SceneOption token, const T &value)
 Simple interface to set a scalar option. More...
 
SYS_FORCE_INLINE exint optionSize (BRAY_SceneOption token) const
 
SYS_FORCE_INLINE GT_Storage optionStorage (BRAY_SceneOption token) const
 Return the storage class of an option. More...
 
SYS_FORCE_INLINE bool optionIsVariadic (BRAY_SceneOption token) const
 Return whether an option has variadic arguments. More...
 
bool optionB (BRAY_SceneOption t) const
 
int64 optionI (BRAY_SceneOption t) const
 
fpreal64 optionF (BRAY_SceneOption t) const
 
UT_StringHolder optionS (BRAY_SceneOption t) const
 
template<typename T >
SYS_FORCE_INLINE const T * propertyImport (BRAY_ObjectProperty token, T *val, size_t n) const
 
template<typename T >
SYS_FORCE_INLINE bool setProperty (BRAY_ObjectProperty token, const T *value, exint tuple_size)
 Interface to set an property. This template class is specialized for: More...
 
bool lockProperty (BRAY_ObjectProperty token, bool state)
 
exint lockProperties (const char *pattern, bool state)
 
SYS_FORCE_INLINE exint lockAllObjectProperties (bool state)
 Lock or unlock all object properties. More...
 
template<typename T >
SYS_FORCE_INLINE bool setProperty (BRAY_ObjectProperty token, const T &value)
 Simple interface to set a scalar property. More...
 
SYS_FORCE_INLINE exint propertySize (BRAY_ObjectProperty token) const
 
SYS_FORCE_INLINE GT_Storage propertyStorage (BRAY_ObjectProperty token) const
 Return the storage class of an option. More...
 
SYS_FORCE_INLINE bool propertyIsVariadic (BRAY_ObjectProperty token) const
 Return whether an property has variadic arguments. More...
 
bool propertyB (BRAY_SceneOption t) const
 
int64 propertyI (BRAY_SceneOption t) const
 
fpreal64 propertyF (BRAY_SceneOption t) const
 
UT_StringHolder propertyS (BRAY_SceneOption t) const
 

Static Public Member Functions

static ScenePtr allocScene ()
 Allocate a new scene. More...
 

Detailed Description

When defining materials for face sets, the material specification is given by a pair of the MaterialPtr and an array of integers. The integers specify the list of faces to material and must appear in sorted order (smallest to largest). Interface to the scene manager

Examples:
karma_procedurals/BRAY_HdBox.C.

Definition at line 211 of file BRAY_Interface.h.

Constructor & Destructor Documentation

BRAY::ScenePtr::ScenePtr ( )
default
BRAY::ScenePtr::~ScenePtr ( )

Member Function Documentation

bool BRAY::ScenePtr::addSpace ( const UT_StringHolder name,
const SpacePtr space,
bool  replace_existing = true 
)

Add a named transform space (that can be referenced from VEX) Returns true if the space was added (false if the space already exists)

bool BRAY::ScenePtr::addTraceset ( const UT_StringHolder name)

Add traceset name to global list (categories on objects that do not belong to this list will be ignored) Returns true if added, false if already exists.

static ScenePtr BRAY::ScenePtr::allocScene ( )
static

Allocate a new scene.

OptionSet BRAY::ScenePtr::cameraProperties ( )

Grab a copy of the current camera properties

void BRAY::ScenePtr::commitOptions ( )

After changing any options, must commit prior to rendering.

const OptionSet BRAY::ScenePtr::constCameraProperties ( ) const

Grab a copy of the current light properties

const OptionSet BRAY::ScenePtr::constLightProperties ( ) const

Grab a copy of the current light properties

const OptionSet BRAY::ScenePtr::constObjectProperties ( ) const

Grab a copy of the current object properties.

const OptionSet BRAY::ScenePtr::constPlaneProperties ( ) const
const OptionSet BRAY::ScenePtr::constSceneOptions ( ) const

Grab a copy of the current scene options

CameraPtr BRAY::ScenePtr::createCamera ( const UT_StringHolder name)

Create a camera.

LightPtr BRAY::ScenePtr::createLight ( const UT_StringHolder name)

Create a light.

MaterialPtr BRAY::ScenePtr::createMaterial ( const UT_StringHolder name)

Create a material.

Examples:
karma_procedurals/BRAY_HdBox.C.
ShaderGraphPtr BRAY::ScenePtr::createShaderGraph ( const UT_StringHolder name)

Create a shader nodegraph.

OptionSet BRAY::ScenePtr::defaultProperties ( BRAY_PropertyType  type) const

Grab a the default properties for a given type. Changing their values will cause all future objects created to inherit the new values.

bool BRAY::ScenePtr::destroyMaterial ( const UT_StringRef name)

Destroy/Delete a material (returns false if material wasn't found)

MaterialPtr BRAY::ScenePtr::findMaterial ( const UT_StringRef name) const

Find a material.

void BRAY::ScenePtr::forceRedice ( )

Force redicing of displacement and subd surfaces on the next render. This will only take effect on the next call to beginRender().

bool BRAY::ScenePtr::isKarmaCPU ( ) const

convenience methods to determine which renderer is active (tests the value of the BRAY_OPT_ENGINE option)

bool BRAY::ScenePtr::isKarmaXPU ( ) const
bool BRAY::ScenePtr::isTraceset ( const UT_StringHolder name)

Check to see if a traceset exists.

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

Test validity.

Definition at line 226 of file BRAY_Interface.h.

OptionSet BRAY::ScenePtr::lightProperties ( )

Grab a copy of the current light properties

bool BRAY::ScenePtr::loadHDA ( const char *  path)

Load an HDA to define shader code. Not all applications support this feature.

SYS_FORCE_INLINE exint BRAY::ScenePtr::lockAllObjectProperties ( bool  state)
inline

Lock or unlock all object properties.

Definition at line 404 of file BRAY_Interface.h.

exint BRAY::ScenePtr::lockProperties ( const char *  pattern,
bool  state 
)

Lock properties based on a string pattern of parameter names. This method returns the number of properties modified.

bool BRAY::ScenePtr::lockProperty ( BRAY_ObjectProperty  token,
bool  state 
)

Locking the object property prevents any overriding of the property after the fact, essentially turning the property into a read-only property. This method is intended to lock default properties. The current value of the property is used as the value.

The return value is the previous lock state of the property.

bool BRAY::ScenePtr::nestedInstancing ( ) const

Test whether the renderer supports nested instancing.

OptionSet BRAY::ScenePtr::objectProperties ( )

Grab a copy of the current object properties.

Examples:
karma_procedurals/BRAY_HdBox.C.
SYS_SAFE_BOOL BRAY::ScenePtr::operator bool ( ) const
inline

Private access to the underling scene

Definition at line 275 of file BRAY_Interface.h.

bool BRAY::ScenePtr::optionB ( BRAY_SceneOption  t) const
inline

Convenience methods to look up scene and scene options. Get an scene option value.

Definition at line 362 of file BRAY_Interface.h.

fpreal64 BRAY::ScenePtr::optionF ( BRAY_SceneOption  t) const
inline

Convenience methods to look up scene and scene options. Get an scene option value.

Definition at line 366 of file BRAY_Interface.h.

int64 BRAY::ScenePtr::optionI ( BRAY_SceneOption  t) const
inline

Convenience methods to look up scene and scene options. Get an scene option value.

Definition at line 364 of file BRAY_Interface.h.

template<typename T >
SYS_FORCE_INLINE const T* BRAY::ScenePtr::optionImport ( BRAY_SceneOption  token,
T *  val,
size_t  n 
) const
inline

Convenience methods to look up scene and scene options. Get an scene option value.

Definition at line 319 of file BRAY_Interface.h.

SYS_FORCE_INLINE bool BRAY::ScenePtr::optionIsVariadic ( BRAY_SceneOption  token) const
inline

Return whether an option has variadic arguments.

Definition at line 358 of file BRAY_Interface.h.

UT_StringHolder BRAY::ScenePtr::optionS ( BRAY_SceneOption  t) const
inline

Convenience methods to look up scene and scene options. Get an scene option value.

Definition at line 368 of file BRAY_Interface.h.

SYS_FORCE_INLINE exint BRAY::ScenePtr::optionSize ( BRAY_SceneOption  token) const
inline

Return the size of an option. This can be used for variadics (e.g. shading quality will be 1)

Definition at line 344 of file BRAY_Interface.h.

SYS_FORCE_INLINE GT_Storage BRAY::ScenePtr::optionStorage ( BRAY_SceneOption  token) const
inline

Return the storage class of an option.

Definition at line 351 of file BRAY_Interface.h.

OptionSet BRAY::ScenePtr::planeProperties ( )

Grab a copy of the current image plane properties.

bool BRAY::ScenePtr::propertyB ( BRAY_SceneOption  t) const
inline

Convenience methods to look up object properties. Get an object property value.

Definition at line 435 of file BRAY_Interface.h.

fpreal64 BRAY::ScenePtr::propertyF ( BRAY_SceneOption  t) const
inline

Convenience methods to look up object properties. Get an object property value.

Definition at line 439 of file BRAY_Interface.h.

int64 BRAY::ScenePtr::propertyI ( BRAY_SceneOption  t) const
inline

Convenience methods to look up object properties. Get an object property value.

Definition at line 437 of file BRAY_Interface.h.

template<typename T >
SYS_FORCE_INLINE const T* BRAY::ScenePtr::propertyImport ( BRAY_ObjectProperty  token,
T *  val,
size_t  n 
) const
inline

Convenience methods to look up object properties. Get an object property value.

Definition at line 376 of file BRAY_Interface.h.

SYS_FORCE_INLINE bool BRAY::ScenePtr::propertyIsVariadic ( BRAY_ObjectProperty  token) const
inline

Return whether an property has variadic arguments.

Definition at line 431 of file BRAY_Interface.h.

UT_StringHolder BRAY::ScenePtr::propertyS ( BRAY_SceneOption  t) const
inline

Convenience methods to look up object properties. Get an object property value.

Definition at line 441 of file BRAY_Interface.h.

SYS_FORCE_INLINE exint BRAY::ScenePtr::propertySize ( BRAY_ObjectProperty  token) const
inline

Return the size of an option. This can be used for variadics (e.g. shading quality will be 1)

Definition at line 417 of file BRAY_Interface.h.

SYS_FORCE_INLINE GT_Storage BRAY::ScenePtr::propertyStorage ( BRAY_ObjectProperty  token) const
inline

Return the storage class of an option.

Definition at line 424 of file BRAY_Interface.h.

OptionSet BRAY::ScenePtr::sceneOptions ( )

Grab a copy of the current scene options

const BRAY_Scene* BRAY::ScenePtr::scenePtr ( ) const
inline

Private access to the underling scene

Definition at line 276 of file BRAY_Interface.h.

BRAY_Scene* BRAY::ScenePtr::scenePtr ( )
inline

Private access to the underling scene

Definition at line 277 of file BRAY_Interface.h.

fpreal64 BRAY::ScenePtr::sceneUnits ( ) const

Set the unit scale for the scene - this is in meters/unit. For example, centimeters would be 0.01.

void BRAY::ScenePtr::setCameraRayMask ( BRAY_RayVisibility  mask)

Set camera ray visibility. The mask should be a combination of

  • BRAY_RAY_CAMERA
  • BRAY_PROXY_CAMERA
  • BRAY_GUIDE_CAMERA For example, (BRAY_RAY_CAMERA|BRAY_GUIDE_CAMERA) will cause guide and renderable object to be visible to camera rays, but not proxy objects
template<typename T >
SYS_FORCE_INLINE bool BRAY::ScenePtr::setOption ( BRAY_SceneOption  token,
const T *  value,
exint  tuple_size 
)
inline

Interface to set an option. This template class is specialized for:

Definition at line 327 of file BRAY_Interface.h.

template<typename T >
SYS_FORCE_INLINE bool BRAY::ScenePtr::setOption ( BRAY_SceneOption  token,
const T &  value 
)
inline

Simple interface to set a scalar option.

Definition at line 337 of file BRAY_Interface.h.

template<typename T >
SYS_FORCE_INLINE bool BRAY::ScenePtr::setProperty ( BRAY_ObjectProperty  token,
const T *  value,
exint  tuple_size 
)
inline

Interface to set an property. This template class is specialized for:

Definition at line 384 of file BRAY_Interface.h.

template<typename T >
SYS_FORCE_INLINE bool BRAY::ScenePtr::setProperty ( BRAY_ObjectProperty  token,
const T &  value 
)
inline

Simple interface to set a scalar property.

Definition at line 410 of file BRAY_Interface.h.

void BRAY::ScenePtr::setSceneUnits ( fpreal64  units)

Set the unit scale for the scene - this is in meters/unit. For example, centimeters would be 0.01.

void BRAY::ScenePtr::setShadowRayMask ( BRAY_RayVisibility  mask)

Set shadow ray visibility. The mask should be a combination of

  • BRAY_RAY_SHADOW
  • BRAY_PROXY_SHADOW
  • BRAY_GUIDE_SHADOW For example, (BRAY_RAY_SHADOW|BRAY_PROXY_SHADOW) will cause proxy and renderable object to cast shadows, but not GUIDE objects.
bool BRAY::ScenePtr::threadSafe ( ) const

Test whether the scene is thread-safe.

void BRAY::ScenePtr::updateCamera ( const CameraPtr ptr,
BRAY_EventType  event 
)

Update camera object in the scene.

void BRAY::ScenePtr::updateLight ( const LightPtr ptr,
BRAY_EventType  event 
)

Update light object in the scene.

void BRAY::ScenePtr::updateMaterial ( const MaterialPtr ptr,
BRAY_EventType  event 
)

Update material object in the scene.

void BRAY::ScenePtr::updateObject ( const ObjectPtr ptr,
BRAY_EventType  event 
)

Update an object in the scene.

Examples:
karma_procedurals/BRAY_HdBox.C.

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