Coordinates the process of rendering a single image. More...
#include <mitsuba/render/renderjob.h>
Public Member Functions | |
RenderJob (const std::string &threadName, Scene *scene, RenderQueue *queue, int sceneResID=-1, int sensorResID=-1, int samplerResID=-1, bool threadIsCritical=true, bool interactive=false) | |
Create a new render job for the given scene. More... | |
void | flush () |
Write out the current (partially rendered) image. More... | |
void | cancel () |
Cancel a running render job. More... | |
bool | wait () |
Wait for the job to finish and return whether it was successful. More... | |
bool | isInteractive () const |
Are partial results of the rendering process visible, e.g. in a graphical user interface? More... | |
void | setInteractive (bool interactive) |
Define whether or not this is an interactive job. More... | |
Scene * | getScene () |
Get a pointer to the underlying scene. More... | |
const Scene * | getScene () const |
Get a pointer to the underlying scene (const version) More... | |
RenderQueue * | getRenderQueue () |
Get a pointer to the underlying render queue. More... | |
const RenderQueue * | getRenderQueue () const |
Get a pointer to the underlying render queue (const version) More... | |
Float | getRenderTime () const |
Return the amount of time spent rendering the given job (in seconds) More... | |
virtual const Class * | getClass () const |
Retrieve this object's class. More... | |
Public Member Functions inherited from mitsuba::Thread | |
Thread (const std::string &name) | |
Create a new thread object. More... | |
bool | setPriority (EThreadPriority priority) |
Set the thread priority. More... | |
EThreadPriority | getPriority () const |
Return the thread priority. More... | |
void | setCoreAffinity (int core) |
Set the core affinity. More... | |
int | getCoreAffinity () const |
Return the core affinity. More... | |
void | setCritical (bool critical) |
Specify whether or not this thread is critical. More... | |
bool | getCritical () const |
Return the value of the critical flag. More... | |
const std::string & | getName () const |
Return the name of this thread. More... | |
void | setName (const std::string &name) |
Set the name of this thread. More... | |
Thread * | getParent () |
Return the parent thread. More... | |
const Thread * | getParent () const |
Return the parent thread (const version) More... | |
void | setLogger (Logger *logger) |
Set the logger instance used to process log messages from this thread. More... | |
Logger * | getLogger () |
Return the thread's logger instance. More... | |
void | setFileResolver (FileResolver *fresolver) |
Set the thread's file resolver. More... | |
FileResolver * | getFileResolver () |
Return the thread's file resolver. More... | |
bool | isRunning () const |
Is this thread still running? More... | |
void | start () |
Start the thread. More... | |
void | detach () |
Detach the thread and release resources. More... | |
void | join () |
Wait until the thread finishes. More... | |
virtual std::string | toString () const |
Return a string representation. More... | |
Public Member Functions inherited from Object | |
Object () | |
Construct a new object. More... | |
int | getRefCount () const |
Return the current reference count. More... | |
void | incRef () const |
Increase the reference count of the object by one. More... | |
void | decRef (bool autoDeallocate=true) const |
Decrease the reference count of the object and possibly deallocate it. More... | |
Static Public Attributes | |
static Class * | m_theClass |
Static Public Attributes inherited from mitsuba::Thread | |
static Class * | m_theClass |
Static Public Attributes inherited from Object | |
static Class * | m_theClass |
Pointer to the object's class descriptor. More... | |
Protected Member Functions | |
virtual | ~RenderJob () |
Virtual destructor. More... | |
void | run () |
Run method. More... | |
Protected Member Functions inherited from mitsuba::Thread | |
virtual | ~Thread () |
Virtual destructor. More... | |
void | exit () |
void | yield () |
Yield to another processor. More... | |
Protected Member Functions inherited from Object | |
virtual | ~Object () |
Virtual private deconstructor. (Will only be called by ref) More... | |
Additional Inherited Members | |
Public Types inherited from mitsuba::Thread | |
enum | EThreadPriority { EIdlePriority = 0, ELowestPriority, ELowPriority, ENormalPriority, EHighPriority, EHighestPriority, ERealtimePriority } |
Possible priority values for Thread::setPriority() More... | |
Static Public Member Functions inherited from mitsuba::Thread | |
static int | getID () |
Return the thread ID. More... | |
static Thread * | getThread () |
Return the current thread. More... | |
static void | sleep (unsigned int ms) |
Sleep for a certain amount of time. More... | |
static void | staticInitialization () |
Initialize the threading system. More... | |
static void | staticShutdown () |
Shut down the threading system. More... | |
static void | initializeOpenMP (size_t threadCount) |
Initialize Mitsuba's threading system for simultaneous use of OpenMP. More... | |
static Thread * | registerUnmanagedThread (const std::string &name) |
Register an unmanaged thread with Mitsuba (i.e. one that doesn't derive from mitsuba::Thread ) More... | |
static void | registerCrashHandler (bool(*handler)(void)) |
Register a thread crash handler. More... | |
Static Public Member Functions inherited from Object | |
static void | staticInitialization () |
Initializes the built-in reference count debugger (if enabled) More... | |
static void | staticShutdown () |
Free the memory taken by staticInitialization() More... | |
Static Protected Member Functions inherited from mitsuba::Thread | |
static void | dispatch (Thread *thread) |
Thread dispatch function. More... | |
Coordinates the process of rendering a single image.
Implemented as a thread so that multiple jobs can be executed concurrently.
mitsuba::RenderJob::RenderJob | ( | const std::string & | threadName, |
Scene * | scene, | ||
RenderQueue * | queue, | ||
int | sceneResID = -1 , |
||
int | sensorResID = -1 , |
||
int | samplerResID = -1 , |
||
bool | threadIsCritical = true , |
||
bool | interactive = false |
||
) |
Create a new render job for the given scene.
When the Resource ID parameters (sceneResID
, sensorResID
, ..) are set to -1
, the implementation will automatically register the associated objects (scene, sensor, sampler) with the scheduler and forward copies to all involved network rendering workers. When some of these resources have already been registered with the scheduler, their IDs can be provided to avoid this extra communication cost.
threadName | Thread name identifier for this render job |
scene | Scene to be rendered |
queue | Pointer to a queue, to which this job should be added |
sceneResID | Resource ID of scene (or -1 ) |
sensorResID | Resource ID of scene->getSensor() (or -1 ) |
samplerResID | Resource ID of the sample generator (or -1 ) |
threadIsCritical | When set to true , the entire program will terminate if this thread fails unexpectedly. |
interactive | Are partial results of the rendering process visible, e.g. in a graphical user interface? |
|
protectedvirtual |
Virtual destructor.
|
inline |
Cancel a running render job.
|
inline |
Write out the current (partially rendered) image.
|
virtual |
Retrieve this object's class.
Reimplemented from mitsuba::Thread.
|
inline |
Get a pointer to the underlying render queue.
|
inline |
Get a pointer to the underlying render queue (const version)
|
inline |
Return the amount of time spent rendering the given job (in seconds)
|
inline |
Get a pointer to the underlying scene.
|
inline |
Get a pointer to the underlying scene (const version)
|
inline |
Are partial results of the rendering process visible, e.g. in a graphical user interface?
Some integrators may choose to invest more time on generating high-quality intermediate results in this case.
|
protectedvirtual |
Run method.
Implements mitsuba::Thread.
|
inline |
Define whether or not this is an interactive job.
|
inline |
Wait for the job to finish and return whether it was successful.
|
static |