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  bool inheritTimeDependentFromUsedDataInputs();
34  bool inheritTimeInterestedFromUsedDataInputs();
35 
36  virtual void getInputs(DEP_MicroNodeList &inputs) const;
37  virtual void clearInputs();
38  virtual void getOutputs(DEP_MicroNodeList &outputs) const;
39 
40  /// Like getInputs() but excludes wired OP_Node inputs
41  void getExtraInputs(DEP_MicroNodeList &inputs) const;
42 
43  /// Like getOutputs() but excludes wired OP_Node outputs. For parmlist
44  /// micronodes, this will exclude the its owner OP_Node.
45  void getExtraOutputs(DEP_MicroNodeList &outputs) const;
46 
47  /// update() is used by users of micro-nodes to mark this node as clean at
48  /// the given time t.
49  virtual void update(fpreal t);
51  const DEP_ContextOptionsStack *optstack);
52 
53  /// requiresUpdate() specifies if the micro-node was dirtied, possibly
54  /// based on the time t.
55  virtual bool requiresUpdate(fpreal t) const;
56  bool requiresUpdate(
58  const DEP_ContextOptionsStack *optstack) const;
59 
60  /// Returns the options and values _used_ in the last cook of this data.
62  { return myLastUsedContextOptions; }
63  /// Returns all options and values provided to the last cook of this data.
65  { return myLastAllContextOptions; }
67  { return myLastMissingContextOptions; }
68 
69  /// Used to determine if a micronode is currently evaluating. If this
70  /// returns true, during dirty propagation, it will prevent dependencies
71  /// from being removed from it.
72  virtual bool isEvaluating() const;
73 
74  /// evaluateExports() is called after isExporting() is noted to be true
75  /// during a dirty propagation pass initiated by dirtySubtree().
76  virtual void evaluateExports();
77 
78  /// Used to determine if a micronode requires its exports to be evaluated
79  /// during the propagation pass.
80  virtual bool isExporting() const;
81 
82  virtual int64 getMemoryUsage(bool inclusive) const;
83 
84  virtual void dump(
85  std::ostream &os,
86  const char *prefix = 0,
87  int indent_level = 0) const;
88 
89  OP_Node & ownerNode() const
90  { return myNode; }
91 
93  { myModVersion++; }
94  bool isModVersionOutdated() const
95  { return myModVersion != myLastModVersion; }
97  { return myModVersion; }
99  { return myLastModVersion; }
100 
102  { return myLastUpdateTime; }
103 
105  { return isSameTime(t, myLastUpdateTime); }
106 
107  virtual void becameDirty(DEP_MicroNode &src,
108  const DEP_PropagateData &data);
109 
111  { myModVersion = v; }
112 
113 private:
114  OP_Node &myNode;
115  DEP_ContextOptionsHandle myLastUsedContextOptions;
116  UT_UniquePtr<DEP_ContextOptionsStack> myLastUsedContextStack;
117  DEP_ContextOptionsReadHandle myLastAllContextOptions;
118  UT_StringArray myLastMissingContextOptions;
119  // Bumped everytime the node gets dirty.
120  OP_VERSION myModVersion;
121  // Current version of the entire cache
122  OP_VERSION myLastModVersion;
123  fpreal myLastUpdateTime;
124 };
125 
126 #endif // __OP_DATAMICRONODE_H_INCLUDED__
virtual void getInputs(DEP_MicroNodeList &inputs) const
GLenum src
Definition: glew.h:2410
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:81
virtual int64 getMemoryUsage(bool inclusive) const
Obtain approximate memory usage.
virtual bool requiresUpdate(fpreal t) const
Definition: DEP_MicroNode.h:88
virtual bool isExporting() const
const GLdouble * v
Definition: glew.h:1391
virtual void clearInputs()
void setModVersion(OP_VERSION v)
long long int64
Definition: SYS_Types.h:111
OP_VERSION lastModVersion() const
DEP_ContextOptionsReadHandle getLastUsedContextOptions() const
Returns the options and values used in the last cook of this data.
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
virtual bool isEvaluating() const
OP_Node & ownerNode() const
virtual const char * className() const
bool isEqualToLastUpdateTime(fpreal t) const
const UT_StringArray & getLastMissingContextOptions() const
double fpreal
Definition: SYS_Types.h:276
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:36
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.
GLdouble GLdouble t
Definition: glew.h:1398
fpreal lastUpdateTime() const