HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_ApplicationShim Class Referenceabstract

#include <PDG_ApplicationShim.h>

+ Inheritance diagram for PDG_ApplicationShim:

Classes

class  DeferredTask
 
class  Geometry
 
class  Graph
 
class  Node
 

Public Types

using TaskPtr = UT_SharedPtr< DeferredTask >
 Managed pointer to a deferred task. More...
 
using DeferredQueue = UT_ConcurrentQueue< TaskPtr >
 

Public Member Functions

 PDG_ApplicationShim ()
 Constructs a new application shim and caches configuration vars. More...
 
virtual ~PDG_ApplicationShim ()
 

Static Public Member Functions

static void addPythonPath (const UT_StringHolder &path)
 Adds a new Python search path to the PDG type system. More...
 
static bool canUseFarm ()
 Returns true if the integration is allowed to use farm schedulers. More...
 
static bool areDependenciesDirty (fpreal t)
 
static void dirtyDependencies (fpreal t, const UT_StringHolder &name)
 Notifies the application that the global PDG work item has been changed. More...
 
static void addDependency (int thread, const UT_StringHolder &name)
 Adds a dependency on the global PDG work item for the specified thread. More...
 
static bool evaluatingChannel (UT_WorkBuffer &buffer, bool full_path, int thread)
 Queries the name of the evaluating channel for the specified thread. More...
 
static bool getVariable (const char *name, UT_StringHolder &value)
 Queries the value of a global variable. More...
 
static void setVariable (const char *name, const UT_StringHolder &value)
 Sets the value of a global variable. More...
 
static bool checkCached (const PDG_FileUtils &file_utils, const UT_StringHolder &path, const UT_StringHolder &tag)
 Returns true if the file in the specified path is cached. More...
 
template<typename Task , typename... Args>
static TaskPtr pushDeferred (Args &&...args)
 
template<typename Func >
static void unlockedExecute (const Func &func)
 Runs a functor with the application unlocked. More...
 
static bool tickMainThread ()
 
static bool isExperimental ()
 Enable experimental features. More...
 
static bool trySaveScene ()
 
static void setShim (PDG_ApplicationShim *shim)
 

Protected Member Functions

virtual void addAppPythonPath (const UT_StringHolder &path) const =0
 
virtual bool canAppUseFarm () const =0
 
virtual bool areAppDependenciesDirty (fpreal t) const =0
 
virtual void dirtyAppDependencies (fpreal t, const UT_StringHolder &name)=0
 
virtual void addAppDependency (int thread, const UT_StringHolder &name)=0
 
virtual bool evaluatingAppChannel (UT_WorkBuffer &buffer, bool full_path, int thread)=0
 
virtual bool getAppVariable (const char *name, UT_StringHolder &value) const =0
 
virtual void setAppVariable (const char *name, const UT_StringHolder &value)=0
 
virtual bool checkAppCached (const PDG_FileUtils &file_utils, const UT_StringHolder &path, const UT_StringHolder &tag) const =0
 
virtual bool tickAppMainThread ()
 
virtual bool unlockApp () const =0
 
virtual bool lockApp () const =0
 
virtual bool trySaveAppScene () const =0
 

Detailed Description

Shim class for integrating PDG with another application, e.g. Houdini. A single subclass of this should be installed statically with PDG using PDG_ApplicationShim::setShim.

Definition at line 38 of file PDG_ApplicationShim.h.

Member Typedef Documentation

Managed pointer to a deferred task.

Definition at line 185 of file PDG_ApplicationShim.h.

Constructor & Destructor Documentation

PDG_ApplicationShim::PDG_ApplicationShim ( )

Constructs a new application shim and caches configuration vars.

virtual PDG_ApplicationShim::~PDG_ApplicationShim ( )
inlinevirtual

Definition at line 265 of file PDG_ApplicationShim.h.

Member Function Documentation

virtual void PDG_ApplicationShim::addAppDependency ( int  thread,
const UT_StringHolder name 
)
protectedpure virtual
virtual void PDG_ApplicationShim::addAppPythonPath ( const UT_StringHolder path) const
protectedpure virtual
static void PDG_ApplicationShim::addDependency ( int  thread,
const UT_StringHolder name 
)
static

Adds a dependency on the global PDG work item for the specified thread.

static void PDG_ApplicationShim::addPythonPath ( const UT_StringHolder path)
static

Adds a new Python search path to the PDG type system.

virtual bool PDG_ApplicationShim::areAppDependenciesDirty ( fpreal  t) const
protectedpure virtual
static bool PDG_ApplicationShim::areDependenciesDirty ( fpreal  t)
static

Returns true if the application-specific work item dependency is dirty

virtual bool PDG_ApplicationShim::canAppUseFarm ( ) const
protectedpure virtual
static bool PDG_ApplicationShim::canUseFarm ( )
static

Returns true if the integration is allowed to use farm schedulers.

virtual bool PDG_ApplicationShim::checkAppCached ( const PDG_FileUtils file_utils,
const UT_StringHolder path,
const UT_StringHolder tag 
) const
protectedpure virtual
static bool PDG_ApplicationShim::checkCached ( const PDG_FileUtils file_utils,
const UT_StringHolder path,
const UT_StringHolder tag 
)
static

Returns true if the file in the specified path is cached.

virtual void PDG_ApplicationShim::dirtyAppDependencies ( fpreal  t,
const UT_StringHolder name 
)
protectedpure virtual
static void PDG_ApplicationShim::dirtyDependencies ( fpreal  t,
const UT_StringHolder name 
)
static

Notifies the application that the global PDG work item has been changed.

virtual bool PDG_ApplicationShim::evaluatingAppChannel ( UT_WorkBuffer buffer,
bool  full_path,
int  thread 
)
protectedpure virtual
static bool PDG_ApplicationShim::evaluatingChannel ( UT_WorkBuffer buffer,
bool  full_path,
int  thread 
)
static

Queries the name of the evaluating channel for the specified thread.

virtual bool PDG_ApplicationShim::getAppVariable ( const char *  name,
UT_StringHolder value 
) const
protectedpure virtual
static bool PDG_ApplicationShim::getVariable ( const char *  name,
UT_StringHolder value 
)
static

Queries the value of a global variable.

static bool PDG_ApplicationShim::isExperimental ( )
static

Enable experimental features.

virtual bool PDG_ApplicationShim::lockApp ( ) const
protectedpure virtual
template<typename Task , typename... Args>
static TaskPtr PDG_ApplicationShim::pushDeferred ( Args &&...  args)
inlinestatic

Queue a task with the deferred processing queue, to be run on the main thread.

Definition at line 224 of file PDG_ApplicationShim.h.

virtual void PDG_ApplicationShim::setAppVariable ( const char *  name,
const UT_StringHolder value 
)
protectedpure virtual
static void PDG_ApplicationShim::setShim ( PDG_ApplicationShim shim)
static

Sets the shared static shim instance. This can only be called once during the lifetime of the program.

static void PDG_ApplicationShim::setVariable ( const char *  name,
const UT_StringHolder value 
)
static

Sets the value of a global variable.

virtual bool PDG_ApplicationShim::tickAppMainThread ( )
protectedvirtual
static bool PDG_ApplicationShim::tickMainThread ( )
static

Runs the application shims logic for a main thread event tick. The base application instance will drain pending deferred events from the queue and run some of them.

virtual bool PDG_ApplicationShim::trySaveAppScene ( ) const
protectedpure virtual
static bool PDG_ApplicationShim::trySaveScene ( )
static

Saves the current application scene. Returns false if the application wants to abort the current operationi because of save conflict or a request to cancel, otherwise returns true.

virtual bool PDG_ApplicationShim::unlockApp ( ) const
protectedpure virtual
template<typename Func >
static void PDG_ApplicationShim::unlockedExecute ( const Func &  func)
inlinestatic

Runs a functor with the application unlocked.

Definition at line 234 of file PDG_ApplicationShim.h.


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