Lumiverse
2.5
A framework for creating lighting control applications
|
The Arnold Patch object is responsible for the communication between the Arnold renderer and the Lumiverse devices. The major part of communication is done with help of an ArnoldInterface object. ArnoldPatch handles parsing Json and passing info to ArnoldInterface. More...
#include <ArnoldPatch copy.h>
Public Member Functions | |
ArnoldPatch () | |
Constructs a DMXPatch object. | |
ArnoldPatch (const JSONNode data) | |
Construct DMXPatch from JSON data. More... | |
virtual | ~ArnoldPatch () |
Destroys the object. | |
virtual void | update (set< Device * > devices) |
Updates the values sent to the DMX network given the list of devices in the rig. More... | |
virtual void | init () |
Initializes connections and other network settings for the patch. More... | |
virtual void | close () |
Closes connections to the interfaces. | |
virtual JSONNode | toJSON () |
Exports a JSONNode with the data in this patch. More... | |
virtual string | getType () |
Gets the type of this object. More... | |
ArnoldPatch () | |
Constructs a ArnoldPatch object. | |
ArnoldPatch (const JSONNode data) | |
Construct ArnoldPatch from JSON data. More... | |
virtual | ~ArnoldPatch () |
Destroys the object. | |
virtual void | update (set< Device * > devices) |
Updates the rendering given the list of devices in the rig. More... | |
virtual void | init () override |
Initializes Arnold with ArnoldInterface. | |
virtual void | close () override |
Closes the Arnold session. | |
virtual JSONNode | toJSON () override |
Exports a JSONNode with the data in this patch. More... | |
virtual string | getType () override |
Gets the type of this object. More... | |
virtual int | getWidth () |
Gets the width of result. More... | |
virtual int | getHeight () |
Gets the height of result. More... | |
virtual float * | getBufferPointer () |
Gets the pointer to the frame buffer. More... | |
bool | setDims (int w, int h) |
Sets the width and height of the resulting image. | |
size_t | getBufferSize () |
int | getSamples () |
Gets the sample rate (n * n per pixel). More... | |
void | setSamples (int samples) |
Sets the sample rate (n * n per pixel). More... | |
virtual void | interruptRender () override |
Stops the working rendering procedure if Arnold is running. | |
void | forceInterrupt () |
Forcefully stops the current arnold render function. | |
virtual float | getPercentage () const |
Gets the progress of current frame in percentage. More... | |
virtual BucketPositionInfo * | getBucketPositionInfo () const |
Gets the current bucket for each worker thread. More... | |
virtual size_t | getBucketNumber () const |
Gets number of buckets rendered simultanously. This is usually the number of threads supported by hardware. More... | |
void | setArnoldInterface (ArnoldInterface *arnold_interface) |
Set the interface we're using Set the ArnoldInterface reference we're using to perform rendering. This is usually either an ArnoldInterface, or a DistributedArnoldInterface. | |
virtual bool | renderLoop (const std::set< Device * > &devices) |
Calls Arnold render function on a set of devices. This function runs in a separate thread. | |
virtual bool | renderLoop () |
Calls Arnold render function. This function runs in a separate thread. | |
void | setAssFile (std::string assFile) |
Set the path to this patch's ass. More... | |
virtual void | setOptionParameter (std::string paramName, int val) |
Set global arnold options on the interface. | |
virtual void | setOptionParameter (std::string paramName, float val) |
void | updateLight (set< Device * > devices) |
Resets the arnold light node with updated parameters of deices. This function updates light node for renderer. More... | |
Public Member Functions inherited from Lumiverse::SimulationPatch | |
SimulationPatch () | |
Constructs a SimulationPatch object. | |
SimulationPatch (const JSONNode data) | |
Construct SimulationPatch from JSON data. More... | |
virtual | ~SimulationPatch () |
Destroys the object. | |
virtual void | deleteDevice (string id) |
Called when a device is deleted from the Rig. More... | |
virtual void | onDeviceChanged (Device *d) |
Callback function for devices. More... | |
virtual void | rerender () |
Manually schedule a re-rendering. More... | |
virtual bool | isUpdateRequired (set< Device * > devices) |
Checks if any device connected with this patch has updated parameters or metadata. More... | |
virtual void | clearUpdateFlags () |
Resets the update flags for lights. | |
Public Member Functions inherited from Lumiverse::Patch | |
virtual | ~Patch () |
Virtual destructor. | |
Protected Member Functions | |
virtual void | loadLight (Device *d_ptr) override |
Loads a arnold light node. This function is also used to update a light node. More... | |
void | updateLightPredictive (set< Device * > devices) |
Resets the arnold light node and surface with updated parameters of deices. Experiment with methods from Picture Perfect RGB rendering. More... | |
virtual void | loadJSON (const JSONNode data) override |
Loads data from a parsed JSON object. More... | |
Protected Member Functions inherited from Lumiverse::SimulationPatch | |
virtual void | bindRenderLoop () |
Protected Attributes | |
ArnoldInterface * | m_interface |
Arnold Interface If we're distributing our rendering this is a DistributedArnoldInterface. | |
Protected Attributes inherited from Lumiverse::SimulationPatch | |
map< string, SimulationLightRecord * > | m_lights |
A list contains infos about if a light is updated. | |
std::atomic_flag | m_interrupt_flag |
std::thread * | m_renderloop |
The separate thread running the render loop. | |
Private Member Functions | |
void | setArrayParameter (AtNode *light_ptr, const std::string ¶mName, const std::string &value) |
void | setParameter (AtNode *light_ptr, const std::string ¶mName, const std::string &value) |
template<size_t D, typename T > | |
void | setSingleParameter (AtNode *node, const std::string ¶mName, const std::string &value, union AiNodeSet< T > aiNodeSet) const |
template<size_t D, typename T , class C > | |
void | setArrayParameter (AtNode *node, const std::string ¶mName, const std::string &value, bool(*AiArraySet)(AtArray *, AtUInt32, C, const char *, int), const int AiType) const |
bool | updateLight (set< Device * > devices) |
Gets the progress of current frame in percentage. More... | |
void | loadJSON (const JSONNode data) |
Loads data from a parsed JSON object. More... | |
template<size_t D, typename T > | |
void | parseArnoldParameter (const std::string &value, ArnoldParameterVector< D, T > &vector) const |
void | loadArnoldParam (const JSONNode data, ArnoldParam ¶m) |
void | loadLight (Device *d_ptr) |
Loads a arnold light node. This function is also used to update a light node. More... | |
void | modifyLightColor (Device *d, Eigen::Vector3d white) |
Modifies light color according to Picture Perfect RGB Rendering Using Spectral Prefiltering and Sharp Color Primaries. More... | |
bool | useDistributedRendering (JSONNode patch) |
Check if an Arnold patch should use distributed rendering. More... | |
bool | cacheRendering (const JSONNode data) |
Check if an Arnold patch should used cached rendering. More... | |
Private Attributes | |
map< string, AtNode * > | m_lights |
map< string, ArnoldParam > | m_arnold_params |
std::string | m_ass_file |
bool | m_using_distributed = false |
Are we using a distributed renderer with this patch. | |
bool | m_rendering |
Internal flag used to ensure thread safety. | |
bool | _caching |
Internal flag used to see if cached rendering is being used. | |
The Arnold Patch object is responsible for the communication between the Arnold renderer and the Lumiverse devices. The major part of communication is done with help of an ArnoldInterface object. ArnoldPatch handles parsing Json and passing info to ArnoldInterface.
Lumiverse::ArnoldPatch::ArnoldPatch | ( | const JSONNode | data | ) |
Lumiverse::ArnoldPatch::ArnoldPatch | ( | const JSONNode | data | ) |
Construct ArnoldPatch from JSON data.
data | JSONNode containing the ArnoldPatch object data. |
|
private |
Check if an Arnold patch should used cached rendering.
JSONNode | containing patch |
|
inlinevirtual |
Gets number of buckets rendered simultanously. This is usually the number of threads supported by hardware.
|
inlinevirtual |
Gets the current bucket for each worker thread.
|
inlinevirtual |
Gets the pointer to the frame buffer.
Reimplemented from Lumiverse::SimulationPatch.
|
inlinevirtual |
|
inlinevirtual |
Gets the progress of current frame in percentage.
Reimplemented in Lumiverse::ArnoldAnimationPatch.
|
inline |
Gets the sample rate (n * n per pixel).
|
inlinevirtual |
Gets the type of this object.
Implements Lumiverse::Patch.
Reimplemented in Lumiverse::ArnoldAnimationPatch.
|
inlineoverridevirtual |
Gets the type of this object.
Implements Lumiverse::Patch.
Reimplemented in Lumiverse::ArnoldAnimationPatch.
|
inlinevirtual |
|
virtual |
Initializes connections and other network settings for the patch.
Call this AFTER all interfaces have been assigned. May need to call again if interfaces change.
Implements Lumiverse::Patch.
Reimplemented in Lumiverse::ArnoldAnimationPatch.
|
privatevirtual |
Loads data from a parsed JSON object.
data | JSON data to load |
Reimplemented from Lumiverse::SimulationPatch.
|
overrideprotectedvirtual |
Loads data from a parsed JSON object.
data | JSON data to load |
Reimplemented from Lumiverse::SimulationPatch.
Reimplemented in Lumiverse::ArnoldAnimationPatch.
|
privatevirtual |
Loads a arnold light node. This function is also used to update a light node.
d_ptr | The device with updated parameters. |
Implements Lumiverse::SimulationPatch.
|
overrideprotectedvirtual |
Loads a arnold light node. This function is also used to update a light node.
d_ptr | The device with updated parameters. |
Implements Lumiverse::SimulationPatch.
|
private |
Modifies light color according to Picture Perfect RGB Rendering Using Spectral Prefiltering and Sharp Color Primaries.
d | The device representing the light. |
white | The white spot in sharp RGB. (currently not used) |
|
inline |
Set the path to this patch's ass.
The | path to this patch's ass |
void Lumiverse::ArnoldPatch::setSamples | ( | int | samples | ) |
Sets the sample rate (n * n per pixel).
samples | The number of AA samples. |
|
virtual |
Exports a JSONNode with the data in this patch.
Implements Lumiverse::Patch.
|
overridevirtual |
Exports a JSONNode with the data in this patch.
Implements Lumiverse::Patch.
|
virtual |
Updates the values sent to the DMX network given the list of devices in the rig.
The list of devices should be maintained outside of this class.
Implements Lumiverse::Patch.
Reimplemented in Lumiverse::ArnoldAnimationPatch.
|
virtual |
Updates the rendering given the list of devices in the rig.
The list of devices should be maintained outside of this class. This function would potentially interrupt the rendering and restart with new parameters.
Implements Lumiverse::Patch.
Reimplemented in Lumiverse::ArnoldAnimationPatch.
|
privatevirtual |
Gets the progress of current frame in percentage.
Resets the arnold light node with updated parameters of deices. This function updates light node for renderer.
devices | The device list. |
Implements Lumiverse::SimulationPatch.
|
virtual |
Resets the arnold light node with updated parameters of deices. This function updates light node for renderer.
devices | The device list. |
Implements Lumiverse::SimulationPatch.
|
protected |
Resets the arnold light node and surface with updated parameters of deices. Experiment with methods from Picture Perfect RGB rendering.
devices | The device list. |
|
private |
Check if an Arnold patch should use distributed rendering.
JSONNode | containing a Patch |