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 
19 {
20 public:
22 
23  const char * className() const override
24  { return "OP_ContextOptionsMicroNode"; }
25 
26  /// update() is used by users of micro-nodes to mark this node as clean at
27  /// the given time t.
28  void update(fpreal t) override;
29 
30  /// requiresUpdate() specifies if the micro-node was dirtied, possibly
31  /// based on the time t (if isTimeDependent() is true).
32  bool requiresUpdate(fpreal t) const override;
33 
34  /// update() is used by users of micro-nodes to mark this node as clean for
35  /// the given context options.
36  void updateOptions(DEP_ContextOptionsReadHandle options,
37  const DEP_ContextOptionsStack *optstack);
38 
39  /// requiresUpdate() specifies if the micro-node was dirtied
40  /// based on a change to context options.
41  bool requiresUpdateOptions(
43  const DEP_ContextOptionsStack *optstack) const;
44 
45  /// Returns the options and values _used_ in the last cook of this data.
47  { return myLastUsedContextOptions; }
48  /// Returns all options and values provided to the last cook of this data.
50  { return myLastAllContextOptions; }
52  { return myLastUsedContextStack.get(); }
54  { return myLastMissingContextOptions; }
55 
57  { return myLastUpdateTime; }
59  { return isSameTime(t, myLastUpdateTime); }
60 
61 private:
62  DEP_ContextOptionsHandle myLastUsedContextOptions;
63  UT_UniquePtr<DEP_ContextOptionsStack> myLastUsedContextStack;
64  DEP_ContextOptionsReadHandle myLastAllContextOptions;
65  UT_StringArray myLastMissingContextOptions;
66  fpreal myLastUpdateTime;
67 };
68 
69 #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:277
#define OP_API
Definition: OP_API.h:10
const char * className() const override
DEP_ContextOptionsStack * getLastUsedContextOptionsStack() const