Lumiverse  2.5
A framework for creating lighting control applications
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Lumiverse::ArnoldInterface Class Reference

Interface between ArnoldPatch and arnold. Almost all arnold APIs are called from this class. More...

#include <ArnoldInterface.h>

Collaboration diagram for Lumiverse::ArnoldInterface:
Collaboration graph
[legend]

Public Member Functions

 ArnoldInterface ()
 Constructs a ArnoldInterface object. More...
 
virtual ~ArnoldInterface ()
 Destroys the object.
 
virtual void init ()
 Initializes the Arnold renderer. More...
 
virtual void init (const JSONNode jsonPatch)
 Initialize the ArnoldRenderer with a reference to a JSON serialized parent patch. More...
 
virtual void close ()
 Closes the Arnold session.
 
virtual string getInterfaceType ()
 Gets the type of this object. More...
 
int getWidth ()
 Gets the width of result. More...
 
int getHeight ()
 Gets the height of result. More...
 
virtual bool setDims (int w, int h)
 Sets the dimensions of the image.
 
virtual float * getBufferPointer ()
 Gets the pointer to the frame buffer. More...
 
void setAssFile (std::string fileName)
 Sets the path to ass file. More...
 
std::string getAssFile ()
 Gets the path to ass file. More...
 
void setPluginDirectory (std::string dir)
 Sets the directory containing the plugin (buffer_driver). More...
 
std::string getPluginDirectory ()
 Gets the directory containing the plugin (buffer_driver). More...
 
void setGamma (float gamma)
 Sets the gamma. More...
 
float getGamma ()
 Gets the gamma. More...
 
void setPredictive (bool predictive)
 Sets the predictive flag. More...
 
bool getPredictive ()
 Gets the predictive flag. More...
 
virtual void setSamples (int samples)
 Sets the camera sampling rate used for current rendering. More...
 
int getSamples ()
 Gets the sampling rate. More...
 
virtual int render ()
 Starts rendering with Arnold. Returns the error code of AiRender, so the caller can know if the renderer was interrupted. More...
 
virtual int render (const std::set< Device * > &)
 Fire off a render request using the given set of devices. More...
 
virtual void interrupt ()
 Interrupts current rendering.
 
virtual JSONNode toJSON ()
 Parses the arnold parameter map to a JSON node. More...
 
virtual float getPercentage ()
 Gets the progress of current frame as a percentage. More...
 
BucketPositionInfogetBucketPositionInfo () const
 Gets the current bucket for each worker thread. More...
 
size_t getBucketNumber () const
 Gets number of buckets rendered simultanously. This is usually the number of threads supported by hardware. More...
 
void setDefaultPath (std::string def_path)
 Sets the default path. More...
 
std::string getDefaultPath ()
 Gets the default path. More...
 
bool isOpen ()
 Checks if this interface is currently open. More...
 
virtual bool isDistributedOpen ()
 Indicates if the distributed interface is currently open In the base class, this is the same as the local status.
 
bool isUsingCaching ()
 Check whether this patch has caching enabled.
 
void setUsingCaching (bool usingCaching)
 Set whether this interface is using caching.
 
virtual void loadIfUsingCaching (const set< Device * > &)
 If the interface is caching it should use this function to perform any preload operations it may be doing.
 

Protected Member Functions

std::string toRelativePath (std::string file)
 Converts to relative path with respect to json path. Currently it only checks if the file contains ".ies". More...
 

Static Protected Member Functions

static bool isRelativeFileName (std::string str)
 Checks to see if this arnold STRING parameter is a file. Currently it only checks if the file contains ".ies". More...
 

Protected Attributes

std::string m_ass_file
 The path to ass file.
 
std::string m_plugin_dir
 The directory containing the plugin (buffer_driver).
 
float * m_buffer
 The pointer to the frame buffer.
 
int m_width
 The width of the result.
 
int m_height
 The height of the result.
 
float m_gamma
 The gamma for gamma correction.
 
int m_samples
 Arnold AA samples.
 
bool m_predictive
 If turn on (so-called) predictive rendering.
 
bool m_open
 If the interface is currently open.
 
BucketPositionInfom_bucket_pos
 
size_t m_bucket_num
 
ProgressInfo m_progress
 
std::string m_default_path
 
string m_bufDriverName
 
bool m_using_caching
 Is this interface using caching – currently only used for notifying the distributed renderer that it should use the caching driver instead of the buffer driver.
 

Detailed Description

Interface between ArnoldPatch and arnold. Almost all arnold APIs are called from this class.

ArnoldInterface is mainly responsible to configure light node of arnold. It keeps a list of mappings from metadata ids to Arnold types. ArnoldInterface also creates and closes Arnold session.

See also
ArnoldPatch

Constructor & Destructor Documentation

Lumiverse::ArnoldInterface::ArnoldInterface ( )
inline

Constructs a ArnoldInterface object.

The frame buffer point is set to NULL. The buffer will be initialized after getting the size of output. The default gamma is 2.2.

Member Function Documentation

std::string Lumiverse::ArnoldInterface::getAssFile ( )
inline

Gets the path to ass file.

Returns
The path to ass file
size_t Lumiverse::ArnoldInterface::getBucketNumber ( ) const
inline

Gets number of buckets rendered simultanously. This is usually the number of threads supported by hardware.

Returns
The number of buckets rendered simultanously.
BucketPositionInfo* Lumiverse::ArnoldInterface::getBucketPositionInfo ( ) const
inline

Gets the current bucket for each worker thread.

Returns
An array of current buckets.
virtual float* Lumiverse::ArnoldInterface::getBufferPointer ( )
inlinevirtual

Gets the pointer to the frame buffer.

Returns
The pointer to the frame buffer.
std::string Lumiverse::ArnoldInterface::getDefaultPath ( )
inline

Gets the default path.

Returns
The default path.
float Lumiverse::ArnoldInterface::getGamma ( )
inline

Gets the gamma.

Returns
The gamma.
int Lumiverse::ArnoldInterface::getHeight ( )
inline

Gets the height of result.

Returns
The height of result
virtual string Lumiverse::ArnoldInterface::getInterfaceType ( )
inlinevirtual

Gets the type of this object.

Returns
String containing "ArnoldInterface"
virtual float Lumiverse::ArnoldInterface::getPercentage ( )
inlinevirtual

Gets the progress of current frame as a percentage.

Returns
The percent.
std::string Lumiverse::ArnoldInterface::getPluginDirectory ( )
inline

Gets the directory containing the plugin (buffer_driver).

Returns
The directory containing the plugin
bool Lumiverse::ArnoldInterface::getPredictive ( )
inline

Gets the predictive flag.

Returns
The predictive flag.
int Lumiverse::ArnoldInterface::getSamples ( )
inline

Gets the sampling rate.

Returns
The sampling rate.
int Lumiverse::ArnoldInterface::getWidth ( )
inline

Gets the width of result.

Returns
The width of result
void Lumiverse::ArnoldInterface::init ( )
virtual

Initializes the Arnold renderer.

Opens a new Arnold session. Loads ass file and the plugin (buffer_driver).

virtual void Lumiverse::ArnoldInterface::init ( const JSONNode  jsonPatch)
inlinevirtual

Initialize the ArnoldRenderer with a reference to a JSON serialized parent patch.

Initializes the ArnoldRenderer with a reference to a JSON serialized parent patch. This is currently used by the distributed renderer to send a patch over the wire

bool Lumiverse::ArnoldInterface::isOpen ( )
inline

Checks if this interface is currently open.

Returns
If it's open.
static bool Lumiverse::ArnoldInterface::isRelativeFileName ( std::string  str)
inlinestaticprotected

Checks to see if this arnold STRING parameter is a file. Currently it only checks if the file contains ".ies".

Returns
If is a file.
int Lumiverse::ArnoldInterface::render ( )
virtual

Starts rendering with Arnold. Returns the error code of AiRender, so the caller can know if the renderer was interrupted.

Returns
Error code of arnold.
virtual int Lumiverse::ArnoldInterface::render ( const std::set< Device * > &  )
inlinevirtual

Fire off a render request using the given set of devices.

Fires off a render request with the given set of devices being used in the rendering. This is currently used to notify a distributed renderer about any changes to nodes.

Returns
Arnold error code
See also
render()
void Lumiverse::ArnoldInterface::setAssFile ( std::string  fileName)
inline

Sets the path to ass file.

Parameters
fileNameThe path to ass file
void Lumiverse::ArnoldInterface::setDefaultPath ( std::string  def_path)
inline

Sets the default path.

Parameters
def_pathThe default path.
void Lumiverse::ArnoldInterface::setGamma ( float  gamma)
inline

Sets the gamma.

Parameters
gammaThe gamma.
void Lumiverse::ArnoldInterface::setPluginDirectory ( std::string  dir)
inline

Sets the directory containing the plugin (buffer_driver).

Parameters
dirThe directory containing the plugin
void Lumiverse::ArnoldInterface::setPredictive ( bool  predictive)
inline

Sets the predictive flag.

Parameters
predictiveThe predictive flag.
void Lumiverse::ArnoldInterface::setSamples ( int  samples)
virtual

Sets the camera sampling rate used for current rendering.

Although the system may have multiple camera sampling rates (e.g. for interactive mode and for real rendering), this rate will be used for the current rendering.

Parameters
samplesThe sampling rate.
JSONNode Lumiverse::ArnoldInterface::toJSON ( )
virtual

Parses the arnold parameter map to a JSON node.

Returns
The Json node.
std::string Lumiverse::ArnoldInterface::toRelativePath ( std::string  file)
inlineprotected

Converts to relative path with respect to json path. Currently it only checks if the file contains ".ies".

Returns
If is a file.

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