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

#include <BRAY_ProceduralScene.h>

+ Inheritance diagram for BRAY_ProceduralScene:

Classes

class  Scene
 Wrapper around BRAY::ScenePtr. More...
 
class  SceneHit
 Derive the SceneHit so we can pass around the hit instance. More...
 

Public Member Functions

 BRAY_ProceduralScene ()
 
virtual ~BRAY_ProceduralScene () override
 
HitPtr newHit () const finaloverride
 
BRAY::ScenePtrscene ()
 Get the underlying ScenePtr. More...
 
const BRAY::ScenePtrscene () const
 
void reset ()
 
void doBeginUpdate () override
 
void doEndUpdate () override
 
bool checkIsValid () const override
 Check to see whether the procedural is valid. More...
 
virtual bool updateScene ()=0
 
const BRAY_AttribListattribList () const override
 Get the attribute list. More...
 
void bounds (UT_BoundingBox &bounds, BRAYtime time) const override
 Fills the given bounding box. More...
 
HitPtr intersect (const Ray32 &ray) const finaloverride
 
HitPtr intersect (const Ray64 &ray) const finaloverride
 
const int32attribVal (int attrib, BRAYtime time, const Hit &hit_info, int32 *buf, int size) const finaloverride
 
const int64attribVal (int attrib, BRAYtime time, const Hit &hit_info, int64 *buf, int size) const finaloverride
 
const fpreal32attribVal (int attrib, BRAYtime time, const Hit &hit_info, fpreal32 *buf, int size) const finaloverride
 
const fpreal64attribVal (int attrib, BRAYtime time, const Hit &hit_info, fpreal64 *buf, int size) const finaloverride
 
const UT_StringHolderattribVal (int attrib, BRAYtime time, const Hit &hit_info, UT_StringHolder *buf, int size) const finaloverride
 
const UT_ValArray< int32 > * attribVal (int attrib, BRAYtime time, const Hit &hit_info, UT_ValArray< int32 > *buf, int size) const finaloverride
 
const UT_ValArray< int64 > * attribVal (int attrib, BRAYtime time, const Hit &hit_info, UT_ValArray< int64 > *buf, int size) const finaloverride
 
const UT_ValArray< fpreal32 > * attribVal (int attrib, BRAYtime time, const Hit &hit_info, UT_ValArray< fpreal32 > *buf, int size) const finaloverride
 
const UT_ValArray< fpreal64 > * attribVal (int attrib, BRAYtime time, const Hit &hit_info, UT_ValArray< fpreal64 > *buf, int size) const finaloverride
 
const UT_StringArrayattribVal (int attrib, BRAYtime time, const Hit &hit_info, UT_StringArray *buf, int size) const finaloverride
 
- Public Member Functions inherited from BRAY_Procedural
 BRAY_Procedural ()
 
virtual ~BRAY_Procedural ()
 
const UT_StringHolderclassName () const
 Return a name for this procedural. This defaults to factory()->name();. More...
 
const BRAY_ProceduralFactoryfactory () const
 Return the factory definition. More...
 
virtual const BRAY_AttribListparamList () const
 
bool isValid () const
 Check whether the procedural is valid. More...
 
virtual UT_Vector3 displayColor () const
 Return a display color for low-quality rendering. More...
 
virtual void update (BRAY_EventType event)=0
 This method can be used to be notified of changes to the object. More...
 
virtual void dumpInfo (UT_JSONWriter &w) const
 
template<typename T >
void setParameter (const UT_StringRef &key, const T &val)
 
template<typename T >
void setParameter (const UT_StringRef &key, const T *values, int n)
 
void beginUpdate ()
 
void endUpdate ()
 

Additional Inherited Members

- Public Types inherited from BRAY_Procedural
using Ray32 = Ray< fpreal32 >
 
using Ray64 = Ray< fpreal64 >
 
- Protected Member Functions inherited from BRAY_Procedural
HitPtr getHit () const
 
virtual void errorMessage (const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
 
virtual void doSetParameter (const UT_StringRef &key, const int32 *values, int n=1)=0
 
virtual void doSetParameter (const UT_StringRef &key, const int64 *values, int n=1)=0
 
virtual void doSetParameter (const UT_StringRef &key, const fpreal32 *values, int n=1)=0
 
virtual void doSetParameter (const UT_StringRef &key, const fpreal64 *value, int n=1)=0
 
virtual void doSetParameter (const UT_StringRef &key, const UT_StringHolder *value, int n=1)=0
 

Detailed Description

Examples:
karma_procedurals/BRAY_HdBox.C.

Definition at line 26 of file BRAY_ProceduralScene.h.

Constructor & Destructor Documentation

BRAY_ProceduralScene::BRAY_ProceduralScene ( )
virtual BRAY_ProceduralScene::~BRAY_ProceduralScene ( )
inlineoverridevirtual

Definition at line 94 of file BRAY_ProceduralScene.h.

Member Function Documentation

const BRAY_AttribList* BRAY_ProceduralScene::attribList ( ) const
inlineoverridevirtual

Get the attribute list.

Implements BRAY_Procedural.

Definition at line 119 of file BRAY_ProceduralScene.h.

const int32* BRAY_ProceduralScene::attribVal ( int  attrib,
BRAYtime  time,
const Hit hit_info,
int32 buf,
int  size 
) const
finaloverridevirtual

Evaluate an attribute on this primitive. The methods should return a pointer to the attribute data. If there isn't a direct raw pointer to the data, the buffer passed in can be used to store the data and that pointer can be returned.

Implements BRAY_Procedural.

const int64* BRAY_ProceduralScene::attribVal ( int  attrib,
BRAYtime  time,
const Hit hit_info,
int64 buf,
int  size 
) const
finaloverridevirtual

Evaluate an attribute on this primitive. The methods should return a pointer to the attribute data. If there isn't a direct raw pointer to the data, the buffer passed in can be used to store the data and that pointer can be returned.

Implements BRAY_Procedural.

const fpreal32* BRAY_ProceduralScene::attribVal ( int  attrib,
BRAYtime  time,
const Hit hit_info,
fpreal32 buf,
int  size 
) const
finaloverridevirtual

Evaluate an attribute on this primitive. The methods should return a pointer to the attribute data. If there isn't a direct raw pointer to the data, the buffer passed in can be used to store the data and that pointer can be returned.

Implements BRAY_Procedural.

const fpreal64* BRAY_ProceduralScene::attribVal ( int  attrib,
BRAYtime  time,
const Hit hit_info,
fpreal64 buf,
int  size 
) const
finaloverridevirtual

Evaluate an attribute on this primitive. The methods should return a pointer to the attribute data. If there isn't a direct raw pointer to the data, the buffer passed in can be used to store the data and that pointer can be returned.

Implements BRAY_Procedural.

const UT_StringHolder* BRAY_ProceduralScene::attribVal ( int  attrib,
BRAYtime  time,
const Hit hit_info,
UT_StringHolder buf,
int  size 
) const
finaloverridevirtual

Evaluate an attribute on this primitive. The methods should return a pointer to the attribute data. If there isn't a direct raw pointer to the data, the buffer passed in can be used to store the data and that pointer can be returned.

Implements BRAY_Procedural.

const UT_ValArray<int32>* BRAY_ProceduralScene::attribVal ( int  attrib,
BRAYtime  time,
const Hit hit_info,
UT_ValArray< int32 > *  buf,
int  size 
) const
finaloverridevirtual

Evaluation of array attributes (each attribute can have an arbitrary number of entries. By default, the array attribute evaluators set the arrays to a size of 0 and return the storage array.

Reimplemented from BRAY_Procedural.

const UT_ValArray<int64>* BRAY_ProceduralScene::attribVal ( int  attrib,
BRAYtime  time,
const Hit hit_info,
UT_ValArray< int64 > *  buf,
int  size 
) const
finaloverridevirtual

Evaluation of array attributes (each attribute can have an arbitrary number of entries. By default, the array attribute evaluators set the arrays to a size of 0 and return the storage array.

Reimplemented from BRAY_Procedural.

const UT_ValArray<fpreal32>* BRAY_ProceduralScene::attribVal ( int  attrib,
BRAYtime  time,
const Hit hit_info,
UT_ValArray< fpreal32 > *  buf,
int  size 
) const
finaloverridevirtual

Evaluation of array attributes (each attribute can have an arbitrary number of entries. By default, the array attribute evaluators set the arrays to a size of 0 and return the storage array.

Reimplemented from BRAY_Procedural.

const UT_ValArray<fpreal64>* BRAY_ProceduralScene::attribVal ( int  attrib,
BRAYtime  time,
const Hit hit_info,
UT_ValArray< fpreal64 > *  buf,
int  size 
) const
finaloverridevirtual

Evaluation of array attributes (each attribute can have an arbitrary number of entries. By default, the array attribute evaluators set the arrays to a size of 0 and return the storage array.

Reimplemented from BRAY_Procedural.

const UT_StringArray* BRAY_ProceduralScene::attribVal ( int  attrib,
BRAYtime  time,
const Hit hit_info,
UT_StringArray buf,
int  size 
) const
finaloverridevirtual

Evaluation of array attributes (each attribute can have an arbitrary number of entries. By default, the array attribute evaluators set the arrays to a size of 0 and return the storage array.

Reimplemented from BRAY_Procedural.

void BRAY_ProceduralScene::bounds ( UT_BoundingBox bounds,
BRAYtime  time 
) const
inlineoverridevirtual

Fills the given bounding box.

Implements BRAY_Procedural.

Definition at line 123 of file BRAY_ProceduralScene.h.

bool BRAY_ProceduralScene::checkIsValid ( ) const
inlineoverridevirtual

Check to see whether the procedural is valid.

Implements BRAY_Procedural.

Definition at line 112 of file BRAY_ProceduralScene.h.

void BRAY_ProceduralScene::doBeginUpdate ( )
inlineoverridevirtual

Allow the deriving class to override these, but by default build the scene and set myValid based on it's return result

Implements BRAY_Procedural.

Definition at line 108 of file BRAY_ProceduralScene.h.

void BRAY_ProceduralScene::doEndUpdate ( )
overridevirtual

Implements BRAY_Procedural.

HitPtr BRAY_ProceduralScene::intersect ( const Ray32 ray) const
inlinefinaloverridevirtual

Perform ray-intersection

Implements BRAY_Procedural.

Definition at line 128 of file BRAY_ProceduralScene.h.

HitPtr BRAY_ProceduralScene::intersect ( const Ray64 ray) const
inlinefinaloverridevirtual

Perform ray-intersection

Implements BRAY_Procedural.

Definition at line 130 of file BRAY_ProceduralScene.h.

HitPtr BRAY_ProceduralScene::newHit ( ) const
inlinefinaloverridevirtual

The newHit() method is used to allocate a custom Hit type. The typical way this is done is:

class MyHit : public Hit { };
HitPtr newHit() const override { return HitPtr(new MyHit(...)); }

Reimplemented from BRAY_Procedural.

Definition at line 96 of file BRAY_ProceduralScene.h.

void BRAY_ProceduralScene::reset ( )
inline

Reset the underlying ScenePtr, note you'll need to get the new ScenePtr using scene()

Definition at line 104 of file BRAY_ProceduralScene.h.

BRAY::ScenePtr& BRAY_ProceduralScene::scene ( )
inline

Get the underlying ScenePtr.

Definition at line 99 of file BRAY_ProceduralScene.h.

const BRAY::ScenePtr& BRAY_ProceduralScene::scene ( ) const
inline

Definition at line 100 of file BRAY_ProceduralScene.h.

virtual bool BRAY_ProceduralScene::updateScene ( )
pure virtual

Build or update the underlying scene, return true on success. Use scene() to get the underlying ScenePtr, and use


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