9 #ifndef __PDG_EVALUATION_CONTEXT_H__
10 #define __PDG_EVALUATION_CONTEXT_H__
116 bool myParameterError;
119 bool myPreviousParent;
135 bool myPreviousParent;
152 {
return myExpressionAttribs; }
178 static
void setWorkItemCaster(
184 static
void setUsePython(
bool use_python);
199 static
void setGlobalSubItemIndex(
int index,
205 static
void setGlobalWorkItem(
210 static
void setGlobalJobWorkItem(
218 static
void setTimeDependentAttribs(
223 static
void dirtyAllAttribs();
227 static
bool saveGlobalWorkItem(
234 static
bool loadGlobalWorkItem(
UT_IStream& is);
238 static const
PDG_WorkItem* globalWorkItem(
bool sub_item);
242 static const
PDG_WorkItem* globalJobWorkItem(
bool sub_item);
255 static
bool useTimeDependentAttribs();
258 static
bool isTimeDependent(
267 static
bool activeIsParent(
int thread);
270 static
bool isLocalGenerating(
int thread);
273 static
bool isLocalRuntime(
int thread);
277 static
bool isLocalActive(
int thread);
283 static
bool isLocalCookingPDG(
int thread);
286 static
State localState(
int thread);
289 static
fpreal localEvalTime(
int thread);
292 static const
PDG_Node* localActiveNode(
int thread);
304 return context->attributeEvaluator<
T>(
315 static void updateDict(
int thread,
318 static void updateDict(
int thread,
321 static void updateDict(
int thread,
326 static void updateDict(
int thread,
331 static void updateDict(
int thread,
336 static void updateDict(
int thread,
341 static void resetDict(
int thread);
371 static EvaluationResult evaluateCodeString(
379 static bool savePyObjectAttr(
386 static bool loadPyObjectAttr(
393 static bool cookWorkItem(
401 static bool literalEval(
408 static bool hashPyObjectAttr(
414 static void updateParameterEvaluation(
419 static void resetParameterEvaluation(
int thraed);
427 bool isParent()
const;
436 bool hasParameterError()
const;
443 {
return (myState == eStateStatic) ||
444 (myState == eStateDynamic); }
448 {
return (myState == eStateCooking); }
452 {
return (myState == eStateDynamic) ||
453 (myState == eStateCooking) ||
454 (myState == eStateNone); }
459 {
return myState != eStateNone; }
463 {
return myIsLocalize; }
471 bool canDirty(
const PDG_Node* node)
const;
474 bool canDirty()
const;
480 if (myAttributeRecord)
481 myAttributeRecord->record(name);
499 AttribRecordScope* attributeRecord()
const;
506 void setActiveNode(
const PDG_Node* node);
518 void setLocalize(
bool localize);
521 void setAttributeRecord(AttribRecordScope* scope);
525 template <
typename T>
528 auto&& evaluator = myAttributeMap.find(
530 if (evaluator == myAttributeMap.end())
534 myAttributeMap[
name].reset(eval);
539 evaluator->second.get();
550 bool include_details,
564 void setLocalDictEntryByScript(
566 const char* py_expression);
568 void setLocalDictEntryByObject(
578 EvaluatorMap myAttributeMap;
579 AttribRecordScope* myAttributeRecord;
584 bool myDictModified : 1;
586 bool myIsLocalize : 1;
587 bool myHasParameterError : 1;
CE_API bool evaluate(const CE_OSDRefinement &topo, const CE_OSDEvaluator &eval, const cl::Buffer &coarse, const CE_OSDPatchCoords &patch_coords, const CE_FloatArray *refined_data, cl::Buffer &out, cl::Buffer *du, cl::Buffer *dv)
OIIO_API bool has_error()
Is there a pending global error message waiting to be retrieved?
GT_API const UT_StringHolder time
GLsizei const GLfloat * value
const GLuint GLenum const void * binary
State
Evaluation context state.
std::size_t SYS_HashType
Define the type for hash values.
UT_Function< PY_PyObject *(const PDG_WorkItem *)> WorkItemCaster
Utility function type for converting a PDG_WorkItem* to a PY_PyObject.
**But if you need a result
EvaluationResult
Enumeration of python script evaluation results.
bool isActive() const
Returns true if the context is actively doing PDG work.
Scoped setter of local work item.
GLint GLint GLsizei GLint GLenum GLenum type
The script succeeded without any exceptions.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
The script encountered an error or exception.
bool isCooking() const
Returns true if the context is in a cooking state.
HUSD_API bool eval(VtValue &val, T &ret_val)
GLuint const GLchar * name
Scoped block that records PDG attribute evaluations.
std::function< T > UT_Function
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
bool isRuntime() const
Returns true if the context is in a runtime state.
bool isLocalize() const
Returns true if the context should force file paths to be localized.
bool isGenerating() const
Returns true if the context is in a generating state.
UT_ErrorManager::Scope UT_AutoErrorManager
Alias UT_AutoErrorManager as UT_ErrorManager::Scope.
Scoped reset of the thread-local context cooking/generation state.
void recordAttribute(const UT_StringHolder &name)
void checkTimeDependent()