SmartEngine  1.6.0
MathNodes.h
1 // Copyright (C) Entropy Software LLC - All Rights Reserved
2 
3 #pragma once
4 
5 #include "GraphNode.h"
6 
7 namespace SmartEngine
8 {
9 
10 #pragma pack(push, 4)
11 struct ScalarValueNodeCInfo : GraphNodeCInfo
15 {
19  float value = 0.0f;
20 };
21 
25 struct AddNodeCInfo : GraphNodeCInfo
26 {
30  IGraphNode* inputA = nullptr;
31 
35  IGraphNode* inputB = nullptr;
36 };
37 
41 struct SubtractNodeCInfo : GraphNodeCInfo
42 {
46  IGraphNode* inputA = nullptr;
47 
51  IGraphNode* inputB = nullptr;
52 };
53 
57 struct MultiplyNodeCInfo : GraphNodeCInfo
58 {
62  IGraphNode* inputA = nullptr;
63 
67  IGraphNode* inputB = nullptr;
68 };
69 
73 struct DivideNodeCInfo : GraphNodeCInfo
74 {
78  IGraphNode* inputA = nullptr;
79 
83  IGraphNode* inputB = nullptr;
84 };
85 
89 struct ExpNodeCInfo : GraphNodeCInfo
90 {
94  IGraphNode* input = nullptr;
95 };
96 
100 struct LogNodeCInfo : GraphNodeCInfo
101 {
105  IGraphNode* input = nullptr;
106 };
107 
111 struct NegateNodeCInfo : GraphNodeCInfo
112 {
116  IGraphNode* input = nullptr;
117 };
118 
122 struct NormalizeNodeColumnSpan
123 {
124  NormalizeNodeColumnSpan() {}
125 
126  NormalizeNodeColumnSpan(int64 start, int64 count)
127  : columnStart(start)
128  , columnCount(count)
129  {
130  }
131 
135  int64 columnStart = 0;
136 
143  int64 columnCount = -1;
144 };
145 
149 struct NormalizeNodeCInfo : GraphNodeCInfo
150 {
155  IGraphNode* input = nullptr;
156 
160  const NormalizeNodeColumnSpan* spans = nullptr;
161 
165  int spanCount = 0;
166 
175  bool allowSmallLengths = false;
176 };
177 
181 struct Rotate2DNodeCInfo : GraphNodeCInfo
182 {
186  IGraphNode* inputVector = nullptr;
187 
191  IGraphNode* inputRotation = nullptr;
192 };
193 
197 struct LengthNodeCInfo : GraphNodeCInfo
198 {
202  IGraphNode* input = nullptr;
203 };
204 #pragma pack(pop)
205 
209 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateScalarValueNode(const ScalarValueNodeCInfo& cinfo);
210 
214 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateAddNode(const AddNodeCInfo& cinfo);
215 
219 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateSubtractNode(const SubtractNodeCInfo& cinfo);
220 
224 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateMultiplyNode(const MultiplyNodeCInfo& cinfo);
225 
231 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateNormalizeNode(const NormalizeNodeCInfo& cinfo);
232 
236 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateDivideNode(const DivideNodeCInfo& cinfo);
237 
241 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateExpNode(const ExpNodeCInfo& cinfo);
242 
246 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateLogNode(const LogNodeCInfo& cinfo);
247 
251 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateNegateNode(const NegateNodeCInfo& cinfo);
252 
256 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateRotate2DNode(const Rotate2DNodeCInfo& cinfo);
257 
261 SMARTENGINE_EXPORT ObjectPtr<IGraphNode> CreateLengthNode(const LengthNodeCInfo& cinfo);
262 
264 extern "C"
265 {
266  SMARTENGINE_EXPORT ObjPtr ScalarValueNode_CreateInstance(const ScalarValueNodeCInfo& cinfo);
267  SMARTENGINE_EXPORT ObjPtr AddNode_CreateInstance(const AddNodeCInfo& cinfo);
268  SMARTENGINE_EXPORT ObjPtr SubtractNode_CreateInstance(const SubtractNodeCInfo& cinfo);
269  SMARTENGINE_EXPORT ObjPtr MultiplyNode_CreateInstance(const MultiplyNodeCInfo& cinfo);
270  SMARTENGINE_EXPORT ObjPtr DivideNode_CreateInstance(const DivideNodeCInfo& cinfo);
271  SMARTENGINE_EXPORT ObjPtr ExpNode_CreateInstance(const ExpNodeCInfo& cinfo);
272  SMARTENGINE_EXPORT ObjPtr LogNode_CreateInstance(const LogNodeCInfo& cinfo);
273  SMARTENGINE_EXPORT ObjPtr NegateNode_CreateInstance(const NegateNodeCInfo& cinfo);
274  SMARTENGINE_EXPORT ObjPtr NormalizeNode_CreateInstance(const NormalizeNodeCInfo& cinfo);
275  SMARTENGINE_EXPORT ObjPtr Rotate2DNode_CreateInstance(const Rotate2DNodeCInfo& cinfo);
276  SMARTENGINE_EXPORT ObjPtr LengthNode_CreateInstance(const LengthNodeCInfo& cinfo);
277 }
278 
279 } // namespace SmartEngine
SmartEngine
Definition: A2CTrainer.h:10