HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEP_TimedMicroNode.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: DEP_TimedMicroNode.h (DEP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __DEP_TIMEDMICRONODE_H_INCLUDED__
12 #define __DEP_TIMEDMICRONODE_H_INCLUDED__
13 
14 #include "DEP_API.h"
15 #include "DEP_MicroNode.h"
16 #include <SYS/SYS_Math.h>
17 #include <SYS/SYS_Types.h>
18 #include <SYS/SYS_TypeDecorate.h>
19 #include <float.h>
20 
21 /// MicroNode that caches the last time it was updated to determine if requires
22 /// an update.
24 {
25 public:
27  : myLastUpdateTime(DBL_MAX)
28  {
29  }
30 
31  const char *
32  className() const override
33  {
34  return "DEP_TimedMicroNode";
35  }
36 
37  bool
38  requiresUpdate(fpreal t) const override
39  {
41  return true;
42  return (isTimeDependent() && !isSameTime(t, myLastUpdateTime));
43  }
44 
45  void
46  update(fpreal t) override
47  {
48  myLastUpdateTime = t;
49  if (!isTimeDependent())
52  }
53 
54 private:
55  fpreal myLastUpdateTime;
56 };
57 
59 
60 #endif // __DEP_TIMEDMICRONODE_H_INCLUDED__
const char * className() const override
static SYS_FORCE_INLINE bool isSameTime(fpreal a, fpreal b)
virtual void update(fpreal t)
Definition: DEP_MicroNode.h:87
virtual bool requiresUpdate(fpreal t) const
Definition: DEP_MicroNode.h:94
bool requiresUpdate(fpreal t) const override
void update(fpreal t) override
SYS_FORCE_INLINE bool isTimeDependent() const
Flag accessors.
SYS_DECLARE_LEGACY_TR(GU_Detail)
GLdouble t
Definition: glad.h:2397
fpreal64 fpreal
Definition: SYS_Types.h:277
bool inheritTimeDependentFromExplicitInputs()
#define DEP_API
Definition: DEP_API.h:10