HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_DataMicroNode.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_DATAMICRONODE_H_INCLUDED__
12 #define __OP_DATAMICRONODE_H_INCLUDED__
13 
14 #include "OP_API.h"
15 #include "OP_Version.h"
16 #include <DEP/DEP_MicroNode.h>
17 #include <SYS/SYS_Math.h>
18 #include <SYS/SYS_Types.h>
19 
20 class OP_Node;
21 
23 {
24 public:
26 
27  virtual const char * className() const
28  { return "OP_DataMicroNode"; }
29 
30  void getParmInputs(DEP_MicroNodeList &inputs) const;
31  void getUsedDataInputs(DEP_MicroNodeList &inputs) const;
32 
33  virtual void getInputs(DEP_MicroNodeList &inputs) const;
34  virtual void clearInputs();
35  virtual void getOutputs(DEP_MicroNodeList &outputs) const;
36 
37  /// Like getInputs() but excludes wired OP_Node inputs
38  void getExtraInputs(DEP_MicroNodeList &inputs) const;
39 
40  /// Like getOutputs() but excludes wired OP_Node outputs. For parmlist
41  /// micronodes, this will exclude the its owner OP_Node.
42  void getExtraOutputs(DEP_MicroNodeList &outputs) const;
43 
44  /// update() is used by users of micro-nodes to mark this node as clean at
45  /// the given time t.
46  virtual void update(fpreal t);
48  const DEP_ContextOptionsStack *optstack);
49 
50  /// requiresUpdate() specifies if the micro-node was dirtied, possibly
51  /// based on the time t.
52  virtual bool requiresUpdate(fpreal t) const;
53  bool requiresUpdate(
55  const DEP_ContextOptionsStack *optstack) const;
56 
57  /// Returns the options and values _used_ in the last cook of this data.
59  { return myLastUsedContextOptions; }
60  /// Returns all options and values provided to the last cook of this data.
62  { return myLastAllContextOptions; }
63 
64  /// Used to determine if a micronode is currently evaluating. If this
65  /// returns true, during dirty propagation, it will prevent dependencies
66  /// from being removed from it.
67  virtual bool isEvaluating() const;
68 
69  /// evaluateExports() is called after isExporting() is noted to be true
70  /// during a dirty propagation pass initiated by dirtySubtree().
71  virtual void evaluateExports();
72 
73  /// Used to determine if a micronode requires its exports to be evaluated
74  /// during the propagation pass.
75  virtual bool isExporting() const;
76 
77  virtual int64 getMemoryUsage(bool inclusive) const;
78 
79  virtual void dump(
80  std::ostream &os,
81  const char *prefix = 0,
82  int indent_level = 0) const;
83 
84  OP_Node & ownerNode() const
85  { return myNode; }
86 
88  { myModVersion++; }
89  bool isModVersionOutdated() const
90  { return myModVersion != myLastModVersion; }
92  { return myModVersion; }
94  { return myLastModVersion; }
95 
97  { return myLastUpdateTime; }
98 
100  { return isSameTime(t, myLastUpdateTime); }
101 
102  virtual void becameDirty(DEP_MicroNode &src,
103  const DEP_PropagateData &data);
104 
106  { myModVersion = v; }
107 
108 private:
109  OP_Node &myNode;
110  DEP_ContextOptionsHandle myLastUsedContextOptions;
111  UT_UniquePtr<DEP_ContextOptionsStack> myLastUsedContextStack;
112  DEP_ContextOptionsReadHandle myLastAllContextOptions;
113  // Bumped everytime the node gets dirty.
114  OP_VERSION myModVersion;
115  // Current version of the entire cache
116  OP_VERSION myLastModVersion;
117  fpreal myLastUpdateTime;
118 };
119 
120 #endif // __OP_DATAMICRONODE_H_INCLUDED__
virtual void getInputs(DEP_MicroNodeList &inputs) const
virtual void becameDirty(DEP_MicroNode &src, const DEP_PropagateData &propdata)
uint64 OP_VERSION
Definition: OP_Version.h:6
static SYS_FORCE_INLINE bool isSameTime(fpreal a, fpreal b)
virtual void update(fpreal t)
Definition: DEP_MicroNode.h:85
virtual int64 getMemoryUsage(bool inclusive) const
Obtain approximate memory usage.
const GLdouble * v
Definition: glcorearb.h:836
virtual bool requiresUpdate(fpreal t) const
Definition: DEP_MicroNode.h:92
virtual bool isExporting() const
virtual void clearInputs()
Definition: DEP_MicroNode.h:71
void setModVersion(OP_VERSION v)
long long int64
Definition: SYS_Types.h:107
OP_VERSION lastModVersion() const
DEP_ContextOptionsReadHandle getLastUsedContextOptions() const
Returns the options and values used in the last cook of this data.
virtual bool isEvaluating() const
OP_Node & ownerNode() const
virtual const char * className() const
bool isEqualToLastUpdateTime(fpreal t) const
GLboolean * data
Definition: glcorearb.h:130
double fpreal
Definition: SYS_Types.h:270
virtual void evaluateExports()
OP_VERSION modVersion() const
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:47
#define OP_API
Definition: OP_API.h:10
virtual void dump(std::ostream &os, const char *prefix=0, int indent_level=0) const
Dump contents to output stream, strictly for debugging purposes.
Propagation info for a dep micro node.
Definition: DEP_MicroNode.h:35
virtual void getOutputs(DEP_MicroNodeList &outputs) const
bool isModVersionOutdated() const
const DEP_ContextOptionsReadHandle & getLastAllContextOptions() const
Returns all options and values provided to the last cook of this data.
fpreal lastUpdateTime() const
GLenum src
Definition: glcorearb.h:1792