All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_ParmChangeMicroNode.h
Go to the documentation of this file.
1 //
2 // Copyright 2017 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
28 #ifndef _GUSD_OP_PARMCHANGEMICRONODE_H_
29 #define _GUSD_OP_PARMCHANGEMICRONODE_H_
30 
31 #include "pxr/pxr.h"
32 
33 #include "gusd/api.h"
34 
35 #include <DEP/DEP_TimedMicroNode.h>
36 #include <OP/OP_Parameters.h>
37 #include <SYS/SYS_SequentialThreadIndex.h>
38 
39 PXR_NAMESPACE_OPEN_SCOPE
40 
49 class GUSD_API GusdOP_ParmChangeMicroNode : public DEP_TimedMicroNode
50 {
51 public:
52  explicit GusdOP_ParmChangeMicroNode(OP_Parameters& node)
53  : DEP_TimedMicroNode(), _node(node), _parmsAdded(false) {}
54 
55  virtual ~GusdOP_ParmChangeMicroNode();
56 
60  void addParm(int parmIdx, int vecIdx=-1);
61 
64  bool updateVals(fpreal t, int thread=SYSgetSTID());
65 
66  bool updateIfNeeded(fpreal t, int thread=SYSgetSTID())
67  { return requiresUpdate(t) && updateVals(t, thread); }
68 
69  virtual void update(fpreal t) { updateVals(t); }
70 
74  virtual void clearInputs() { setTimeDependent(false); }
75 
76  struct _ParmCache;
77 
78 private:
79  OP_Parameters& _node;
80 
81  UT_Array<_ParmCache*> _cachedVals;
82  bool _parmsAdded;
83 };
84 
85 PXR_NAMESPACE_CLOSE_SCOPE
86 
87 #endif /*_GUSD_OP_PARMCHANGEMICRONODE_H_*/
Micro node for tracking changes to a set of parameters.
virtual void clearInputs()
Clear our inputs.