Atoms Crowd  7.0.0
utilsNodes.h
1 #pragma once
2 // ===========================================================================
3 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4 //
5 // Use of this software is subject to the terms of the Toolchefs license
6 // agreement provided at the time of installation or download, or which
7 // otherwise accompanies this software in either electronic or hard copy form.
8 // ===========================================================================
9 
10 #include <AtomsGraph/Globals.h>
11 #include <AtomsGraph/Nodes/UnaryFunctionNode.h>
12 #include <AtomsGraph/Nodes/NodeIds.h>
13 #include <cmath>
14 
15 namespace AtomsGraph
16 {
17 
18  ATOMSGRAPH_EXPORT void registerUtilsNodes();
19 
20  class ATOMSGRAPH_EXPORT BufferDouble :
21  public Node
22  {
23  public:
24 
25  NODE_STANDARD_MEMBERS
26 
27  BufferDouble();
28 
29  virtual ~BufferDouble();
30 
31  virtual bool compute(const ComputeData* computeData);
32 
33  DoublePort *inputPort() { return m_in; }
34  DoublePort *outputPort() { return m_out; }
35 
36  private:
37 
38  DoublePort *m_in;
39 
40  DoublePort *m_out;
41  };
42 
43 
44  class ATOMSGRAPH_EXPORT BufferLong:
45  public Node
46  {
47  public:
48 
49  NODE_STANDARD_MEMBERS
50 
51  BufferLong();
52 
53  virtual ~BufferLong();
54 
55  virtual bool compute(const ComputeData* computeData);
56 
57  LongPort *inputPort() { return m_in; }
58  LongPort *outputPort() { return m_out; }
59 
60  private:
61 
62  LongPort *m_in;
63 
64  LongPort *m_out;
65  };
66 
67  class ATOMSGRAPH_EXPORT TimeNode :
68  public Node
69  {
70  public:
71 
72  NODE_STANDARD_MEMBERS;
73 
74  TimeNode();
75 
76  virtual ~TimeNode();
77 
78  virtual bool compute(const ComputeData* computeData);
79 
80  virtual void reset();
81 
82  DoublePort* inputFramePort() { return m_inFrame; }
83 
84  DoublePort* fpsPort() { return m_fps; }
85 
86  DoublePort* frameRatePort() { return m_frameRate; }
87 
88  DoublePort* animFrameRatePort() { return m_animFrameRate; }
89 
90  DoublePort* outFramePort() { return m_outFrame; }
91 
92  DoublePort* outSecondsPort() { return m_outSeconds; }
93 
94  DoublePort* offsetPort() { return m_offset; }
95 
96  private:
97 
98  DoublePort *m_inFrame;
99 
100  DoublePort *m_fps;
101 
102  DoublePort *m_frameRate;
103 
104  DoublePort* m_animFrameRate;
105 
106  DoublePort *m_outFrameRate;
107 
108  DoublePort *m_outFrame;
109 
110  DoublePort *m_outSeconds;
111 
112  DoublePort *m_offset;
113 
114  bool m_first;
115  double m_prevInFrame;
116  double m_prevOutFrame;
117  };
118 }
Definition: utilsNodes.h:22
virtual bool compute(const ComputeData *computeData)
Compute function.
Definition: utilsNodes.h:46
virtual bool compute(const ComputeData *computeData)
Compute function.
Definition: Node.h:21
Definition: Node.h:31
Generic node port class.
Definition: PortTemplate.h:24
Definition: utilsNodes.h:69
virtual void reset()
Reset function.
virtual bool compute(const ComputeData *computeData)
Compute function.
AtomsGraph namespace.
Definition: PosePort.h:15