HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_ContextOptionsMicroNode.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OP_DataMicroNode.h (OP Library, C++)
7  *
8  * COMMENTS: DEP_MicroNode subclass representing an OP_Node's output data.
9  */
10 
11 #ifndef __OP_CONTEXTOPTIONSMICRONODE_H_INCLUDED__
12 #define __OP_CONTEXTOPTIONSMICRONODE_H_INCLUDED__
13 
14 #include "OP_API.h"
15 #include "OP_Version.h"
16 #include <DEP/DEP_MicroNode.h>
17 
18 class OP_Context;
19 
21 {
22 public:
24 
25  const char * className() const override
26  { return "OP_ContextOptionsMicroNode"; }
27 
28  /// update() is used by users of micro-nodes to mark this node as clean at
29  /// the given time t.
30  void update(fpreal t) override;
31 
32  /// requiresUpdate() specifies if the micro-node was dirtied, possibly
33  /// based on the time t (if isTimeDependent() is true).
34  bool requiresUpdate(fpreal t) const override;
35 
36  /// update() is used by users of micro-nodes to mark this node as clean for
37  /// the given context options.
38  void updateOptions(const OP_Context &context);
39 
40  /// requiresUpdate() specifies if the micro-node was dirtied
41  /// based on a change to context options.
42  bool requiresUpdateOptions(
44  const DEP_ContextOptionsStack *optstack) const;
45 
46  /// Returns the options and values _used_ in the last cook of this data.
48  { return myLastUsedContextOptions; }
49  /// Returns all options and values provided to the last cook of this data.
51  { return myLastAllContextOptions; }
53  { return myLastUsedContextStack.get(); }
55  { return myLastMissingContextOptions; }
56 
58  { return myLastUpdateTime; }
60  { return isSameTime(t, myLastUpdateTime); }
61 
62 private:
63  DEP_ContextOptionsHandle myLastUsedContextOptions;
64  UT_UniquePtr<DEP_ContextOptionsStack> myLastUsedContextStack;
65  DEP_ContextOptionsReadHandle myLastAllContextOptions;
66  UT_StringArray myLastMissingContextOptions;
67  fpreal myLastUpdateTime;
68 };
69 
70 #endif // __OP_CONTEXTOPTIONSMICRONODE_H_INCLUDED__
static SYS_FORCE_INLINE bool isSameTime(fpreal a, fpreal b)
virtual void update(fpreal t)
Definition: DEP_MicroNode.h:87
bool isEqualToLastUpdateTime(fpreal t) const
virtual bool requiresUpdate(fpreal t) const
Definition: DEP_MicroNode.h:94
DEP_ContextOptionsReadHandle getLastUsedContextOptions() const
Returns the options and values used in the last cook of this data.
const UT_StringArray & getLastMissingContextOptions() const
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
const DEP_ContextOptionsReadHandle & getLastAllContextOptions() const
Returns all options and values provided to the last cook of this data.
GLdouble t
Definition: glad.h:2397
fpreal64 fpreal
Definition: SYS_Types.h:278
#define OP_API
Definition: OP_API.h:10
const char * className() const override
DEP_ContextOptionsStack * getLastUsedContextOptionsStack() const