4 #ifndef _SimulationPATCH_H_
5 #define _SimulationPATCH_H_
9 #include "LumiverseCoreConfig.h"
18 #include "../lib/libjson/libjson.h"
27 : metadata(
""), rerender_req(
true) { }
30 virtual void init() { rerender_req =
true; }
31 virtual void clear() { }
53 m_interrupt_flag.clear();
76 virtual void update(set<Device *> devices);
100 virtual string getType() {
return "SimulationPatch"; }
172 virtual void updateLight(set<Device *> devices) = 0;
185 virtual void loadJSON(
const JSONNode data);
193 virtual void bindRenderLoop();
200 std::atomic_flag m_interrupt_flag;
virtual ~SimulationPatch()
Destroys the object.
Definition: SimulationPatch.cpp:48
map< string, SimulationLightRecord * > m_lights
A list contains infos about if a light is updated.
Definition: SimulationPatch.h:198
The Arnold Patch object is responsible for the communication between the Arnold renderer and the Lumi...
Definition: SimulationPatch.h:46
virtual string getType()
Gets the type of this object.
Definition: SimulationPatch.h:100
virtual void rerender()
Manually schedule a re-rendering.
Definition: SimulationPatch.cpp:170
virtual bool renderLoop()=0
Calls Arnold render function. This function runs in a separate thread.
virtual void loadLight(Device *d_ptr)=0
Loads a arnold light node. This function is also used to update a light node.
A Patch maps devices to output channels and handles the output of data to the network.
Definition: Patch.h:24
SimulationPatch()
Constructs a SimulationPatch object.
Definition: SimulationPatch.h:52
virtual int getHeight()=0
Gets the height of result.
virtual void update(set< Device * > devices)
Updates the rendering given the list of devices in the rig.
Definition: SimulationPatch.cpp:110
virtual int getWidth()=0
Gets the width of result.
Record that denotes if a arnold light node requires update.
Definition: SimulationPatch.h:25
virtual void init()
Initializes Arnold with ArnoldInterface.
Definition: SimulationPatch.cpp:128
virtual bool isUpdateRequired(set< Device * > devices)
Checks if any device connected with this patch has updated parameters or metadata.
Definition: SimulationPatch.cpp:56
virtual void updateLight(set< Device * > devices)=0
Gets the progress of current frame in percentage.
virtual void close()
Closes the Arnold session.
Definition: SimulationPatch.cpp:135
virtual void deleteDevice(string id)
Called when a device is deleted from the Rig.
Definition: SimulationPatch.cpp:162
virtual float * getBufferPointer()
Gets the pointer to the frame buffer.
Definition: SimulationPatch.h:123
virtual JSONNode toJSON()
Exports a JSONNode with the data in this patch.
Definition: SimulationPatch.cpp:143
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2
virtual void onDeviceChanged(Device *d)
Callback function for devices.
Definition: SimulationPatch.cpp:104
virtual void clearUpdateFlags()
Resets the update flags for lights.
Definition: SimulationPatch.cpp:91
virtual void interruptRender()
Stops the working rendering procedure if Arnold is running.
Definition: SimulationPatch.cpp:97
A Device in Lumiverse maintains information about a lighting device.
Definition: Device.h:55
virtual void loadJSON(const JSONNode data)
Loads data from a parsed JSON object.
Definition: SimulationPatch.cpp:15
std::thread * m_renderloop
The separate thread running the render loop.
Definition: SimulationPatch.h:205