4 #ifndef _ArnoldPATCH_H_
5 #define _ArnoldPATCH_H_
9 #include "LumiverseCoreConfig.h"
17 #include "../lib/libjson/libjson.h"
20 #include "DistributedArnoldInterface.h"
32 struct ArnoldLightRecord :
public SimulationLightRecord {
34 : light(NULL), SimulationLightRecord() {}
35 ArnoldLightRecord(AtNode *node)
37 metadata = AiNodeGetName(node);
46 virtual void clear() {
62 class ArnoldPatch :
public SimulationPatch
91 virtual void update(set<Device *> devices);
96 virtual void init()
override;
101 virtual void close()
override;
108 virtual JSONNode
toJSON()
override;
115 virtual string getType()
override {
return "ArnoldPatch"; }
154 if (w > 0 && h > 0) {
161 size_t getBufferSize() {
220 virtual bool renderLoop(
const std::set<Device *> &devices);
268 virtual void loadJSON(
const JSONNode data)
override;
279 void setOrientation(AtNode *light_ptr,
Device *d_ptr, std::string pan_str, std::string tilt_str);
virtual float getPercentage() const
Gets the progress of current frame in percentage.
Definition: ArnoldPatch.h:194
An interface for serving distributed cached Arnold render responses.
virtual int getWidth()
Gets the width of result.
Definition: ArnoldPatch.h:122
void setAssFile(std::string fileName)
Sets the path to ass file.
Definition: ArnoldInterface.h:217
void setSamples(int samples)
Sets the sample rate (n * n per pixel).
Definition: ArnoldPatch.cpp:515
The Arnold Patch object is responsible for the communication between the Arnold renderer and the Lumi...
Definition: SimulationPatch.h:46
virtual void setOptionParameter(std::string paramName, int val)
Set global arnold options on the interface.
Definition: ArnoldPatch.cpp:183
ArnoldInterface * m_interface
Arnold Interface If we're distributing our rendering this is a DistributedArnoldInterface.
Definition: ArnoldPatch.h:274
void forceInterrupt()
Forcefully stops the current arnold render function.
Definition: ArnoldPatch.h:187
virtual void interrupt()
Interrupts current rendering.
Definition: ArnoldInterface.cpp:560
void init(const char *jsonPatchStr, const char *filename)
Initializes data structures.
Definition: Dumiverse.cpp:29
int getSamples()
Gets the sample rate (n * n per pixel).
Definition: ArnoldPatch.h:170
bool useDistributedRendering(JSONNode patch)
Check if an Arnold patch should use distributed rendering.
Definition: ArnoldPatch.cpp:206
virtual void init()
Initializes connections and other network settings for the patch.
Definition: ArnoldPatch copy.cpp:381
virtual size_t getBucketNumber() const
Gets number of buckets rendered simultanously. This is usually the number of threads supported by har...
Definition: ArnoldPatch.h:207
int getHeight()
Gets the height of result.
Definition: ArnoldInterface.h:135
void setAssFile(std::string assFile)
Set the path to this patch's ass.
Definition: ArnoldPatch.h:233
void modifyLightColor(Device *d, Eigen::Vector3d white)
Modifies light color according to Picture Perfect RGB Rendering Using Spectral Prefiltering and Sharp...
Definition: ArnoldPatch.cpp:368
virtual float * getBufferPointer()
Gets the pointer to the frame buffer.
Definition: ArnoldPatch.h:144
void updateLightPredictive(set< Device * > devices)
Resets the arnold light node and surface with updated parameters of deices. Experiment with methods f...
Definition: ArnoldPatch.cpp:408
Defines an orientation in Lumiverse.
Definition: LumiverseOrientation.h:61
bool setDims(int w, int h)
Sets the width and height of the resulting image.
Definition: ArnoldPatch.h:153
virtual JSONNode toJSON()
Exports a JSONNode with the data in this patch.
Definition: ArnoldPatch copy.cpp:413
An interface for serving cached Arnold render responses.
virtual bool renderLoop()
Calls Arnold render function. This function runs in a separate thread.
Definition: ArnoldPatch.cpp:485
bool m_rendering
Internal flag used to ensure thread safety.
Definition: ArnoldPatch.h:311
void loadJSON(const JSONNode data)
Loads data from a parsed JSON object.
Definition: ArnoldPatch copy.cpp:20
virtual BucketPositionInfo * getBucketPositionInfo() const
Gets the current bucket for each worker thread.
Definition: ArnoldPatch.h:200
virtual float getPercentage()
Gets the progress of current frame as a percentage.
Definition: ArnoldInterface.h:317
bool cacheRendering(const JSONNode data)
Check if an Arnold patch should used cached rendering.
Definition: ArnoldPatch.cpp:195
bool _caching
Internal flag used to see if cached rendering is being used.
Definition: ArnoldPatch.h:316
Implementation of a patch for Arnold.
virtual void init()
Initializes the Arnold renderer.
Definition: ArnoldInterface.cpp:435
bool isOpen()
Checks if this interface is currently open.
Definition: ArnoldInterface.h:363
void setArnoldInterface(ArnoldInterface *arnold_interface)
Set the interface we're using Set the ArnoldInterface reference we're using to perform rendering...
Definition: ArnoldPatch.h:214
bool updateLight(set< Device * > devices)
Gets the progress of current frame in percentage.
Definition: ArnoldPatch copy.cpp:327
virtual void close()
Closes connections to the interfaces.
Definition: ArnoldPatch copy.cpp:404
ArnoldPatch()
Constructs a ArnoldPatch object.
Definition: ArnoldPatch.h:68
virtual ~ArnoldPatch()
Destroys the object.
Definition: ArnoldPatch copy.cpp:323
BucketPositionInfo * getBucketPositionInfo() const
Gets the current bucket for each worker thread.
Definition: ArnoldInterface.h:327
Stores a vector used by ArnoldPatch.
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2
int getSamples()
Gets the sampling rate.
Definition: ArnoldInterface.h:282
size_t getBucketNumber() const
Gets number of buckets rendered simultanously. This is usually the number of threads supported by har...
Definition: ArnoldInterface.h:334
virtual string getType() override
Gets the type of this object.
Definition: ArnoldPatch.h:115
bool m_using_distributed
Are we using a distributed renderer with this patch.
Definition: ArnoldPatch.h:299
Implementation of a interface between ArnoldPatch and arnold.
Wrapper for unit (bucket) being rendered.
Definition: ArnoldInterface.h:48
virtual int getHeight()
Gets the height of result.
Definition: ArnoldPatch.h:133
A Device in Lumiverse maintains information about a lighting device.
Definition: Device.h:55
virtual float * getBufferPointer()
Gets the pointer to the frame buffer.
Definition: ArnoldInterface.h:147
virtual void update(set< Device * > devices)
Updates the values sent to the DMX network given the list of devices in the rig.
Definition: ArnoldPatch copy.cpp:352
virtual bool setDims(int w, int h)
Sets the dimensions of the image.
Definition: ArnoldInterface.cpp:140
Interface between ArnoldPatch and arnold. Almost all arnold APIs are called from this class...
Definition: ArnoldInterface.h:73
virtual void interruptRender() override
Stops the working rendering procedure if Arnold is running.
Definition: ArnoldPatch.cpp:501
void loadLight(Device *d_ptr)
Loads a arnold light node. This function is also used to update a light node.
Definition: ArnoldPatch copy.cpp:297
int getWidth()
Gets the width of result.
Definition: ArnoldInterface.h:128