HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_CrowdMotionPathAvoidCore.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_CrowdMotionPathAvoidCoreEnums
24 {
25  enum class SteeringMode
26  {
27  XY = 0,
28  XYZ
29  };
30 
32  getToken(SteeringMode enum_value)
33  {
34  using namespace UT::Literal;
35  switch (enum_value) {
36  case SteeringMode::XY: return "xy"_sh;
37  case SteeringMode::XYZ: return "xyz"_sh;
38  default: UT_ASSERT(false); return ""_sh;
39  }
40  }
41 
42  enum class GoalPos
43  {
44  ORIGENDPOS = 0,
45  ORIGPATH
46  };
47 
49  getToken(GoalPos enum_value)
50  {
51  using namespace UT::Literal;
52  switch (enum_value) {
53  case GoalPos::ORIGENDPOS: return "origendpos"_sh;
54  case GoalPos::ORIGPATH: return "origpath"_sh;
55  default: UT_ASSERT(false); return ""_sh;
56  }
57  }
58 
59 }
60 
61 
63 {
64 public:
65  static int version() { return 1; }
66 
68  {
69  myGroup = ""_UTsh;
70  myEnableAvoidance = true;
71  myMaxCollisionTime = 3;
72  myEnableNeighbors = true;
73  myNeighborDistance = 10;
74  myMaxNeighbors = 100;
75  myEnableObstacles = true;
76  myObstacleDistance = 10;
77  myObstaclePadding = 1;
78  myHorizontalFOV = 180;
79  myVerticalFOV = 0;
80  myFOVSamples = 8;
81  myFOVSeed = 1;
82  mySteeringMode = 0;
83  myTurnSpeedThreshold = 0.25;
84  myUseMaxInitialRotation = false;
85  myMaxInitialRotation = 45;
86  myMaxTurnRate = 90;
87  myConstrainTurnAccel = false;
88  myTurnStiffness = 10;
89  myTurnDamping = 5;
90  myGoalPos = 0;
91  myGoalPosWeight = 0.1;
92  myDistanceVariance = 5;
93  myAddCollisionPointGroup = false;
94  myCollisionPointGroup = "collided"_UTsh;
95  myTimestep = 0;
96  myUseStartTime = false;
97  myStartTime = 0;
98  myUseEndTime = false;
99  myEndTime = -1;
100  myReferenceUp = UT_Vector3D(0,1,0);
101 
102  }
103 
108 
110 
112  {
113  if (myGroup != src.myGroup) return false;
114  if (myEnableAvoidance != src.myEnableAvoidance) return false;
115  if (myMaxCollisionTime != src.myMaxCollisionTime) return false;
116  if (myEnableNeighbors != src.myEnableNeighbors) return false;
117  if (myNeighborDistance != src.myNeighborDistance) return false;
118  if (myMaxNeighbors != src.myMaxNeighbors) return false;
119  if (myEnableObstacles != src.myEnableObstacles) return false;
120  if (myObstacleDistance != src.myObstacleDistance) return false;
121  if (myObstaclePadding != src.myObstaclePadding) return false;
122  if (myHorizontalFOV != src.myHorizontalFOV) return false;
123  if (myVerticalFOV != src.myVerticalFOV) return false;
124  if (myFOVSamples != src.myFOVSamples) return false;
125  if (myFOVSeed != src.myFOVSeed) return false;
126  if (mySteeringMode != src.mySteeringMode) return false;
127  if (myTurnSpeedThreshold != src.myTurnSpeedThreshold) return false;
128  if (myUseMaxInitialRotation != src.myUseMaxInitialRotation) return false;
129  if (myMaxInitialRotation != src.myMaxInitialRotation) return false;
130  if (myMaxTurnRate != src.myMaxTurnRate) return false;
131  if (myConstrainTurnAccel != src.myConstrainTurnAccel) return false;
132  if (myTurnStiffness != src.myTurnStiffness) return false;
133  if (myTurnDamping != src.myTurnDamping) return false;
134  if (myGoalPos != src.myGoalPos) return false;
135  if (myGoalPosWeight != src.myGoalPosWeight) return false;
136  if (myDistanceVariance != src.myDistanceVariance) return false;
137  if (myAddCollisionPointGroup != src.myAddCollisionPointGroup) return false;
138  if (myCollisionPointGroup != src.myCollisionPointGroup) return false;
139  if (myTimestep != src.myTimestep) return false;
140  if (myUseStartTime != src.myUseStartTime) return false;
141  if (myStartTime != src.myStartTime) return false;
142  if (myUseEndTime != src.myUseEndTime) return false;
143  if (myEndTime != src.myEndTime) return false;
144  if (myReferenceUp != src.myReferenceUp) return false;
145 
146 
147  if (baseGetSignature() != src.baseGetSignature()) return false;
148 
149  return true;
150  }
152  {
153  return !operator==(src);
154  }
157 
158 
159 
160  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
161  {
162  myGroup = ""_UTsh;
163  if (true)
164  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
165  myEnableAvoidance = true;
166  if (true)
167  graph->evalOpParm(myEnableAvoidance, nodeidx, "enableavoidance", time, graph->isDirect()?nullptr:depnode);
168  myMaxCollisionTime = 3;
169  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
170  graph->evalOpParm(myMaxCollisionTime, nodeidx, "maxcollisiontime", time, graph->isDirect()?nullptr:depnode);
171  myEnableNeighbors = true;
172  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
173  graph->evalOpParm(myEnableNeighbors, nodeidx, "enableneighbors", time, graph->isDirect()?nullptr:depnode);
174  myNeighborDistance = 10;
175  if (true && ( (true&&!(((getEnableAvoidance()==0))||((getEnableNeighbors()==0)))) ) )
176  graph->evalOpParm(myNeighborDistance, nodeidx, "neighbordistance", time, graph->isDirect()?nullptr:depnode);
177  myMaxNeighbors = 100;
178  if (true && ( (true&&!(((getEnableAvoidance()==0))||((getEnableNeighbors()==0)))) ) )
179  graph->evalOpParm(myMaxNeighbors, nodeidx, "maxneighbors", time, graph->isDirect()?nullptr:depnode);
180  myEnableObstacles = true;
181  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
182  graph->evalOpParm(myEnableObstacles, nodeidx, "enableobstacles", time, graph->isDirect()?nullptr:depnode);
183  myObstacleDistance = 10;
184  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0)))) ) )
185  graph->evalOpParm(myObstacleDistance, nodeidx, "obstacledistance", time, graph->isDirect()?nullptr:depnode);
186  myObstaclePadding = 1;
187  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0)))) ) )
188  graph->evalOpParm(myObstaclePadding, nodeidx, "obstaclepadding", time, graph->isDirect()?nullptr:depnode);
189  myHorizontalFOV = 180;
190  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0)))) ) )
191  graph->evalOpParm(myHorizontalFOV, nodeidx, "horizontalfov", time, graph->isDirect()?nullptr:depnode);
192  myVerticalFOV = 0;
193  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0)))) ) )
194  graph->evalOpParm(myVerticalFOV, nodeidx, "verticalfov", time, graph->isDirect()?nullptr:depnode);
195  myFOVSamples = 8;
196  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0)))) ) )
197  graph->evalOpParm(myFOVSamples, nodeidx, "fovsamples", time, graph->isDirect()?nullptr:depnode);
198  myFOVSeed = 1;
199  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0))||((getVerticalFOV()==0)))) ) )
200  graph->evalOpParm(myFOVSeed, nodeidx, "fovseed", time, graph->isDirect()?nullptr:depnode);
201  mySteeringMode = 0;
202  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
203  graph->evalOpParm(mySteeringMode, nodeidx, "steeringmode", time, graph->isDirect()?nullptr:depnode);
204  myTurnSpeedThreshold = 0.25;
205  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
206  graph->evalOpParm(myTurnSpeedThreshold, nodeidx, "turnspeedthreshold", time, graph->isDirect()?nullptr:depnode);
207  myUseMaxInitialRotation = false;
208  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
209  graph->evalOpParm(myUseMaxInitialRotation, nodeidx, "usemaxinitialrotation", time, graph->isDirect()?nullptr:depnode);
210  myMaxInitialRotation = 45;
211  if (true && ( (true&&!(((getEnableAvoidance()==0))||((getUseMaxInitialRotation()==0)))) ) )
212  graph->evalOpParm(myMaxInitialRotation, nodeidx, "maxinitialrotation", time, graph->isDirect()?nullptr:depnode);
213  myMaxTurnRate = 90;
214  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
215  graph->evalOpParm(myMaxTurnRate, nodeidx, "maxturnrate", time, graph->isDirect()?nullptr:depnode);
216  myConstrainTurnAccel = false;
217  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
218  graph->evalOpParm(myConstrainTurnAccel, nodeidx, "constrainturnaccel", time, graph->isDirect()?nullptr:depnode);
219  myTurnStiffness = 10;
220  if (true && ( (true&&!(((getConstrainTurnAccel()==0))||((getEnableAvoidance()==0)))) ) )
221  graph->evalOpParm(myTurnStiffness, nodeidx, "turnstiffness", time, graph->isDirect()?nullptr:depnode);
222  myTurnDamping = 5;
223  if (true && ( (true&&!(((getConstrainTurnAccel()==0))||((getEnableAvoidance()==0)))) ) )
224  graph->evalOpParm(myTurnDamping, nodeidx, "turndamping", time, graph->isDirect()?nullptr:depnode);
225  myGoalPos = 0;
226  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
227  graph->evalOpParm(myGoalPos, nodeidx, "goalpos", time, graph->isDirect()?nullptr:depnode);
228  myGoalPosWeight = 0.1;
229  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
230  graph->evalOpParm(myGoalPosWeight, nodeidx, "goalposweight", time, graph->isDirect()?nullptr:depnode);
231  myDistanceVariance = 5;
232  if (true && ( (true&&!(((getEnableAvoidance()==0))||((int64(getGoalPos())!=1)))) ) )
233  graph->evalOpParm(myDistanceVariance, nodeidx, "distancevariance", time, graph->isDirect()?nullptr:depnode);
234  myAddCollisionPointGroup = false;
235  if (true)
236  graph->evalOpParm(myAddCollisionPointGroup, nodeidx, "addcollisionptgroup", time, graph->isDirect()?nullptr:depnode);
237  myCollisionPointGroup = "collided"_UTsh;
238  if (true && ( (true&&!(((getAddCollisionPointGroup()==0)))) ) )
239  graph->evalOpParm(myCollisionPointGroup, nodeidx, "collisionptgroup", time, graph->isDirect()?nullptr:depnode);
240  myTimestep = 0;
241  if (true)
242  graph->evalOpParm(myTimestep, nodeidx, "timestep", time, graph->isDirect()?nullptr:depnode);
243  myUseStartTime = false;
244  if (true)
245  graph->evalOpParm(myUseStartTime, nodeidx, "usestarttime", time, graph->isDirect()?nullptr:depnode);
246  myStartTime = 0;
247  if (true && ( (true&&!(((getUseStartTime()==0)))) ) )
248  graph->evalOpParm(myStartTime, nodeidx, "starttime", time, graph->isDirect()?nullptr:depnode);
249  myUseEndTime = false;
250  if (true)
251  graph->evalOpParm(myUseEndTime, nodeidx, "useendtime", time, graph->isDirect()?nullptr:depnode);
252  myEndTime = -1;
253  if (true && ( (true&&!(((getUseEndTime()==0)))) ) )
254  graph->evalOpParm(myEndTime, nodeidx, "endtime", time, graph->isDirect()?nullptr:depnode);
255  myReferenceUp = UT_Vector3D(0,1,0);
256  if (true)
257  graph->evalOpParm(myReferenceUp, nodeidx, "refup", time, graph->isDirect()?nullptr:depnode);
258 
259  }
260 
261 
262  void loadFromOpSubclass(const LoadParms &loadparms) override
263  {
264  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
265  }
266 
267 
268  void copyFrom(const OP_NodeParms *src) override
269  {
270  *this = *((const SOP_CrowdMotionPathAvoidCoreParms *)src);
271  }
272 
273  template <typename T>
274  void
275  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
276  {
277  if (idx.size() < 1)
278  return;
279  UT_ASSERT(idx.size() == instance.size()+1);
280  if (idx.size() != instance.size()+1)
281  return;
282  switch (idx[0])
283  {
284  case 0:
285  coerceValue(value, myGroup);
286  break;
287  case 1:
288  coerceValue(value, myEnableAvoidance);
289  break;
290  case 2:
291  coerceValue(value, myMaxCollisionTime);
292  break;
293  case 3:
294  coerceValue(value, myEnableNeighbors);
295  break;
296  case 4:
297  coerceValue(value, myNeighborDistance);
298  break;
299  case 5:
300  coerceValue(value, myMaxNeighbors);
301  break;
302  case 6:
303  coerceValue(value, myEnableObstacles);
304  break;
305  case 7:
306  coerceValue(value, myObstacleDistance);
307  break;
308  case 8:
309  coerceValue(value, myObstaclePadding);
310  break;
311  case 9:
312  coerceValue(value, myHorizontalFOV);
313  break;
314  case 10:
315  coerceValue(value, myVerticalFOV);
316  break;
317  case 11:
318  coerceValue(value, myFOVSamples);
319  break;
320  case 12:
321  coerceValue(value, myFOVSeed);
322  break;
323  case 13:
324  coerceValue(value, mySteeringMode);
325  break;
326  case 14:
327  coerceValue(value, myTurnSpeedThreshold);
328  break;
329  case 15:
330  coerceValue(value, myUseMaxInitialRotation);
331  break;
332  case 16:
333  coerceValue(value, myMaxInitialRotation);
334  break;
335  case 17:
336  coerceValue(value, myMaxTurnRate);
337  break;
338  case 18:
339  coerceValue(value, myConstrainTurnAccel);
340  break;
341  case 19:
342  coerceValue(value, myTurnStiffness);
343  break;
344  case 20:
345  coerceValue(value, myTurnDamping);
346  break;
347  case 21:
348  coerceValue(value, myGoalPos);
349  break;
350  case 22:
351  coerceValue(value, myGoalPosWeight);
352  break;
353  case 23:
354  coerceValue(value, myDistanceVariance);
355  break;
356  case 24:
357  coerceValue(value, myAddCollisionPointGroup);
358  break;
359  case 25:
360  coerceValue(value, myCollisionPointGroup);
361  break;
362  case 26:
363  coerceValue(value, myTimestep);
364  break;
365  case 27:
366  coerceValue(value, myUseStartTime);
367  break;
368  case 28:
369  coerceValue(value, myStartTime);
370  break;
371  case 29:
372  coerceValue(value, myUseEndTime);
373  break;
374  case 30:
375  coerceValue(value, myEndTime);
376  break;
377  case 31:
378  coerceValue(value, myReferenceUp);
379  break;
380 
381  }
382  }
383 
384  bool isParmColorRamp(exint idx) const override
385  {
386  switch (idx)
387  {
388 
389  }
390  return false;
391  }
392 
393  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
394  { doGetParmValue(idx, instance, value); }
395  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
396  { doGetParmValue(idx, instance, value); }
397  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
398  { doGetParmValue(idx, instance, value); }
399  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
400  { doGetParmValue(idx, instance, value); }
401  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
402  { doGetParmValue(idx, instance, value); }
403  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
404  { doGetParmValue(idx, instance, value); }
405  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
406  { doGetParmValue(idx, instance, value); }
407  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
408  { doGetParmValue(idx, instance, value); }
409  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
410  { doGetParmValue(idx, instance, value); }
411  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
412  { doGetParmValue(idx, instance, value); }
413  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
414  { doGetParmValue(idx, instance, value); }
415 
416  template <typename T>
417  void
418  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
419  {
420  if (idx.size() < 1)
421  return;
422  UT_ASSERT(idx.size() == instance.size()+1);
423  if (idx.size() != instance.size()+1)
424  return;
425  switch (idx[0])
426  {
427  case 0:
428  coerceValue(myGroup, ( ( value ) ));
429  break;
430  case 1:
431  coerceValue(myEnableAvoidance, ( ( value ) ));
432  break;
433  case 2:
434  coerceValue(myMaxCollisionTime, ( ( value ) ));
435  break;
436  case 3:
437  coerceValue(myEnableNeighbors, ( ( value ) ));
438  break;
439  case 4:
440  coerceValue(myNeighborDistance, clampMinValue(0, ( value ) ));
441  break;
442  case 5:
443  coerceValue(myMaxNeighbors, clampMinValue(0, ( value ) ));
444  break;
445  case 6:
446  coerceValue(myEnableObstacles, ( ( value ) ));
447  break;
448  case 7:
449  coerceValue(myObstacleDistance, clampMinValue(0, ( value ) ));
450  break;
451  case 8:
452  coerceValue(myObstaclePadding, clampMinValue(0, ( value ) ));
453  break;
454  case 9:
455  coerceValue(myHorizontalFOV, clampMinValue(0, ( value ) ));
456  break;
457  case 10:
458  coerceValue(myVerticalFOV, clampMinValue(0, ( value ) ));
459  break;
460  case 11:
461  coerceValue(myFOVSamples, clampMinValue(0, ( value ) ));
462  break;
463  case 12:
464  coerceValue(myFOVSeed, ( ( value ) ));
465  break;
466  case 13:
467  coerceValue(mySteeringMode, clampMinValue(0, clampMaxValue(1, value ) ));
468  break;
469  case 14:
470  coerceValue(myTurnSpeedThreshold, ( ( value ) ));
471  break;
472  case 15:
473  coerceValue(myUseMaxInitialRotation, ( ( value ) ));
474  break;
475  case 16:
476  coerceValue(myMaxInitialRotation, clampMinValue(0, ( value ) ));
477  break;
478  case 17:
479  coerceValue(myMaxTurnRate, ( ( value ) ));
480  break;
481  case 18:
482  coerceValue(myConstrainTurnAccel, ( ( value ) ));
483  break;
484  case 19:
485  coerceValue(myTurnStiffness, ( ( value ) ));
486  break;
487  case 20:
488  coerceValue(myTurnDamping, ( ( value ) ));
489  break;
490  case 21:
491  coerceValue(myGoalPos, clampMinValue(0, clampMaxValue(1, value ) ));
492  break;
493  case 22:
494  coerceValue(myGoalPosWeight, clampMinValue(0, ( value ) ));
495  break;
496  case 23:
497  coerceValue(myDistanceVariance, ( ( value ) ));
498  break;
499  case 24:
500  coerceValue(myAddCollisionPointGroup, ( ( value ) ));
501  break;
502  case 25:
503  coerceValue(myCollisionPointGroup, ( ( value ) ));
504  break;
505  case 26:
506  coerceValue(myTimestep, clampMinValue(0, ( value ) ));
507  break;
508  case 27:
509  coerceValue(myUseStartTime, ( ( value ) ));
510  break;
511  case 28:
512  coerceValue(myStartTime, ( ( value ) ));
513  break;
514  case 29:
515  coerceValue(myUseEndTime, ( ( value ) ));
516  break;
517  case 30:
518  coerceValue(myEndTime, ( ( value ) ));
519  break;
520  case 31:
521  coerceValue(myReferenceUp, ( ( value ) ));
522  break;
523 
524  }
525  }
526 
527  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
528  { doSetParmValue(idx, instance, value); }
529  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
530  { doSetParmValue(idx, instance, value); }
531  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
532  { doSetParmValue(idx, instance, value); }
533  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
534  { doSetParmValue(idx, instance, value); }
535  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
536  { doSetParmValue(idx, instance, value); }
537  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
538  { doSetParmValue(idx, instance, value); }
539  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
540  { doSetParmValue(idx, instance, value); }
541  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
542  { doSetParmValue(idx, instance, value); }
543  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
544  { doSetParmValue(idx, instance, value); }
545  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
546  { doSetParmValue(idx, instance, value); }
547  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
548  { doSetParmValue(idx, instance, value); }
549 
550  exint getNestNumParms(TempIndex idx) const override
551  {
552  if (idx.size() == 0)
553  return 32;
554  switch (idx[0])
555  {
556 
557  }
558  // Invalid
559  return 0;
560  }
561 
562  const char *getNestParmName(TempIndex fieldnum) const override
563  {
564  if (fieldnum.size() < 1)
565  return 0;
566  switch (fieldnum[0])
567  {
568  case 0:
569  return "group";
570  case 1:
571  return "enableavoidance";
572  case 2:
573  return "maxcollisiontime";
574  case 3:
575  return "enableneighbors";
576  case 4:
577  return "neighbordistance";
578  case 5:
579  return "maxneighbors";
580  case 6:
581  return "enableobstacles";
582  case 7:
583  return "obstacledistance";
584  case 8:
585  return "obstaclepadding";
586  case 9:
587  return "horizontalfov";
588  case 10:
589  return "verticalfov";
590  case 11:
591  return "fovsamples";
592  case 12:
593  return "fovseed";
594  case 13:
595  return "steeringmode";
596  case 14:
597  return "turnspeedthreshold";
598  case 15:
599  return "usemaxinitialrotation";
600  case 16:
601  return "maxinitialrotation";
602  case 17:
603  return "maxturnrate";
604  case 18:
605  return "constrainturnaccel";
606  case 19:
607  return "turnstiffness";
608  case 20:
609  return "turndamping";
610  case 21:
611  return "goalpos";
612  case 22:
613  return "goalposweight";
614  case 23:
615  return "distancevariance";
616  case 24:
617  return "addcollisionptgroup";
618  case 25:
619  return "collisionptgroup";
620  case 26:
621  return "timestep";
622  case 27:
623  return "usestarttime";
624  case 28:
625  return "starttime";
626  case 29:
627  return "useendtime";
628  case 30:
629  return "endtime";
630  case 31:
631  return "refup";
632 
633  }
634  return 0;
635  }
636 
637  ParmType getNestParmType(TempIndex fieldnum) const override
638  {
639  if (fieldnum.size() < 1)
640  return PARM_UNSUPPORTED;
641  switch (fieldnum[0])
642  {
643  case 0:
644  return PARM_STRING;
645  case 1:
646  return PARM_INTEGER;
647  case 2:
648  return PARM_FLOAT;
649  case 3:
650  return PARM_INTEGER;
651  case 4:
652  return PARM_FLOAT;
653  case 5:
654  return PARM_INTEGER;
655  case 6:
656  return PARM_INTEGER;
657  case 7:
658  return PARM_FLOAT;
659  case 8:
660  return PARM_FLOAT;
661  case 9:
662  return PARM_FLOAT;
663  case 10:
664  return PARM_FLOAT;
665  case 11:
666  return PARM_INTEGER;
667  case 12:
668  return PARM_FLOAT;
669  case 13:
670  return PARM_INTEGER;
671  case 14:
672  return PARM_FLOAT;
673  case 15:
674  return PARM_INTEGER;
675  case 16:
676  return PARM_FLOAT;
677  case 17:
678  return PARM_FLOAT;
679  case 18:
680  return PARM_INTEGER;
681  case 19:
682  return PARM_FLOAT;
683  case 20:
684  return PARM_FLOAT;
685  case 21:
686  return PARM_INTEGER;
687  case 22:
688  return PARM_FLOAT;
689  case 23:
690  return PARM_FLOAT;
691  case 24:
692  return PARM_INTEGER;
693  case 25:
694  return PARM_STRING;
695  case 26:
696  return PARM_FLOAT;
697  case 27:
698  return PARM_INTEGER;
699  case 28:
700  return PARM_FLOAT;
701  case 29:
702  return PARM_INTEGER;
703  case 30:
704  return PARM_FLOAT;
705  case 31:
706  return PARM_VECTOR3;
707 
708  }
709  return PARM_UNSUPPORTED;
710  }
711 
712  // Boiler plate to load individual types.
713  static void loadData(UT_IStream &is, int64 &v)
714  { is.bread(&v, 1); }
715  static void loadData(UT_IStream &is, bool &v)
716  { int64 iv; is.bread(&iv, 1); v = iv; }
717  static void loadData(UT_IStream &is, fpreal64 &v)
718  { is.bread<fpreal64>(&v, 1); }
719  static void loadData(UT_IStream &is, UT_Vector2D &v)
720  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
721  static void loadData(UT_IStream &is, UT_Vector3D &v)
722  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
723  is.bread<fpreal64>(&v.z(), 1); }
724  static void loadData(UT_IStream &is, UT_Vector4D &v)
725  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
726  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
727  static void loadData(UT_IStream &is, UT_Matrix2D &v)
728  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
729  static void loadData(UT_IStream &is, UT_Matrix3D &v)
730  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
731  static void loadData(UT_IStream &is, UT_Matrix4D &v)
732  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
733  static void loadData(UT_IStream &is, UT_Vector2I &v)
734  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
735  static void loadData(UT_IStream &is, UT_Vector3I &v)
736  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
737  is.bread<int64>(&v.z(), 1); }
738  static void loadData(UT_IStream &is, UT_Vector4I &v)
739  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
740  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
742  { is.bread(v); }
744  { UT_StringHolder rampdata;
745  loadData(is, rampdata);
746  if (rampdata.isstring())
747  {
748  v.reset(new UT_Ramp());
749  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
750  v->load(istr);
751  }
752  else v.reset();
753  }
756  loadData(is, data);
757  if (data.isstring())
758  {
759  // Find the data type.
760  const char *colon = UT_StringWrap(data).findChar(':');
761  if (colon)
762  {
763  int typelen = colon - data.buffer();
765  type.strncpy(data.buffer(), typelen);
766  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
767 
768  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
769  }
770  }
771  else v.reset();
772  }
773 
774  static void saveData(std::ostream &os, int64 v)
775  { UTwrite(os, &v); }
776  static void saveData(std::ostream &os, bool v)
777  { int64 iv = v; UTwrite(os, &iv); }
778  static void saveData(std::ostream &os, fpreal64 v)
779  { UTwrite<fpreal64>(os, &v); }
780  static void saveData(std::ostream &os, UT_Vector2D v)
781  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
782  static void saveData(std::ostream &os, UT_Vector3D v)
783  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
784  UTwrite<fpreal64>(os, &v.z()); }
785  static void saveData(std::ostream &os, UT_Vector4D v)
786  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
787  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
788  static void saveData(std::ostream &os, UT_Matrix2D v)
790  static void saveData(std::ostream &os, UT_Matrix3D v)
792  static void saveData(std::ostream &os, UT_Matrix4D v)
794  static void saveData(std::ostream &os, UT_StringHolder s)
795  { UT_StringWrap(s).saveBinary(os); }
796  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
798  UT_OStringStream ostr;
799  if (s) s->save(ostr);
800  result = ostr.str();
801  saveData(os, result);
802  }
803  static void saveData(std::ostream &os, PRM_DataItemHandle s)
805  UT_OStringStream ostr;
806  if (s)
807  {
808  ostr << s->getDataTypeToken();
809  ostr << ":";
810  s->saveBinary(ostr);
811  }
812  result = ostr.str();
813  saveData(os, result);
814  }
815 
816 
817  void save(std::ostream &os) const
818  {
819  int32 v = version();
820  UTwrite(os, &v);
821  saveData(os, myGroup);
822  saveData(os, myEnableAvoidance);
823  saveData(os, myMaxCollisionTime);
824  saveData(os, myEnableNeighbors);
825  saveData(os, myNeighborDistance);
826  saveData(os, myMaxNeighbors);
827  saveData(os, myEnableObstacles);
828  saveData(os, myObstacleDistance);
829  saveData(os, myObstaclePadding);
830  saveData(os, myHorizontalFOV);
831  saveData(os, myVerticalFOV);
832  saveData(os, myFOVSamples);
833  saveData(os, myFOVSeed);
834  saveData(os, mySteeringMode);
835  saveData(os, myTurnSpeedThreshold);
836  saveData(os, myUseMaxInitialRotation);
837  saveData(os, myMaxInitialRotation);
838  saveData(os, myMaxTurnRate);
839  saveData(os, myConstrainTurnAccel);
840  saveData(os, myTurnStiffness);
841  saveData(os, myTurnDamping);
842  saveData(os, myGoalPos);
843  saveData(os, myGoalPosWeight);
844  saveData(os, myDistanceVariance);
845  saveData(os, myAddCollisionPointGroup);
846  saveData(os, myCollisionPointGroup);
847  saveData(os, myTimestep);
848  saveData(os, myUseStartTime);
849  saveData(os, myStartTime);
850  saveData(os, myUseEndTime);
851  saveData(os, myEndTime);
852  saveData(os, myReferenceUp);
853 
854  }
855 
856  bool load(UT_IStream &is)
857  {
858  int32 v;
859  is.bread(&v, 1);
860  if (version() != v)
861  {
862  // Fail incompatible versions
863  return false;
864  }
865  loadData(is, myGroup);
866  loadData(is, myEnableAvoidance);
867  loadData(is, myMaxCollisionTime);
868  loadData(is, myEnableNeighbors);
869  loadData(is, myNeighborDistance);
870  loadData(is, myMaxNeighbors);
871  loadData(is, myEnableObstacles);
872  loadData(is, myObstacleDistance);
873  loadData(is, myObstaclePadding);
874  loadData(is, myHorizontalFOV);
875  loadData(is, myVerticalFOV);
876  loadData(is, myFOVSamples);
877  loadData(is, myFOVSeed);
878  loadData(is, mySteeringMode);
879  loadData(is, myTurnSpeedThreshold);
880  loadData(is, myUseMaxInitialRotation);
881  loadData(is, myMaxInitialRotation);
882  loadData(is, myMaxTurnRate);
883  loadData(is, myConstrainTurnAccel);
884  loadData(is, myTurnStiffness);
885  loadData(is, myTurnDamping);
886  loadData(is, myGoalPos);
887  loadData(is, myGoalPosWeight);
888  loadData(is, myDistanceVariance);
889  loadData(is, myAddCollisionPointGroup);
890  loadData(is, myCollisionPointGroup);
891  loadData(is, myTimestep);
892  loadData(is, myUseStartTime);
893  loadData(is, myStartTime);
894  loadData(is, myUseEndTime);
895  loadData(is, myEndTime);
896  loadData(is, myReferenceUp);
897 
898  return true;
899  }
900 
901  const UT_StringHolder & getGroup() const { return myGroup; }
902  void setGroup(const UT_StringHolder & val) { myGroup = val; }
904  {
905  SOP_Node *thissop = cookparms.getNode();
906  if (!thissop) return getGroup();
908  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
909  return result;
910  }
911  bool getEnableAvoidance() const { return myEnableAvoidance; }
912  void setEnableAvoidance(bool val) { myEnableAvoidance = val; }
913  bool opEnableAvoidance(const SOP_NodeVerb::CookParms &cookparms) const
914  {
915  SOP_Node *thissop = cookparms.getNode();
916  if (!thissop) return getEnableAvoidance();
917  bool result;
918  OP_Utils::evalOpParm(result, thissop, "enableavoidance", cookparms.getCookTime(), 0);
919  return result;
920  }
921  fpreal64 getMaxCollisionTime() const { return myMaxCollisionTime; }
922  void setMaxCollisionTime(fpreal64 val) { myMaxCollisionTime = val; }
924  {
925  SOP_Node *thissop = cookparms.getNode();
926  if (!thissop) return getMaxCollisionTime();
928  OP_Utils::evalOpParm(result, thissop, "maxcollisiontime", cookparms.getCookTime(), 0);
929  return result;
930  }
931  bool getEnableNeighbors() const { return myEnableNeighbors; }
932  void setEnableNeighbors(bool val) { myEnableNeighbors = val; }
933  bool opEnableNeighbors(const SOP_NodeVerb::CookParms &cookparms) const
934  {
935  SOP_Node *thissop = cookparms.getNode();
936  if (!thissop) return getEnableNeighbors();
937  bool result;
938  OP_Utils::evalOpParm(result, thissop, "enableneighbors", cookparms.getCookTime(), 0);
939  return result;
940  }
941  fpreal64 getNeighborDistance() const { return myNeighborDistance; }
942  void setNeighborDistance(fpreal64 val) { myNeighborDistance = val; }
944  {
945  SOP_Node *thissop = cookparms.getNode();
946  if (!thissop) return getNeighborDistance();
948  OP_Utils::evalOpParm(result, thissop, "neighbordistance", cookparms.getCookTime(), 0);
949  return result;
950  }
951  int64 getMaxNeighbors() const { return myMaxNeighbors; }
952  void setMaxNeighbors(int64 val) { myMaxNeighbors = val; }
954  {
955  SOP_Node *thissop = cookparms.getNode();
956  if (!thissop) return getMaxNeighbors();
957  int64 result;
958  OP_Utils::evalOpParm(result, thissop, "maxneighbors", cookparms.getCookTime(), 0);
959  return result;
960  }
961  bool getEnableObstacles() const { return myEnableObstacles; }
962  void setEnableObstacles(bool val) { myEnableObstacles = val; }
963  bool opEnableObstacles(const SOP_NodeVerb::CookParms &cookparms) const
964  {
965  SOP_Node *thissop = cookparms.getNode();
966  if (!thissop) return getEnableObstacles();
967  bool result;
968  OP_Utils::evalOpParm(result, thissop, "enableobstacles", cookparms.getCookTime(), 0);
969  return result;
970  }
971  fpreal64 getObstacleDistance() const { return myObstacleDistance; }
972  void setObstacleDistance(fpreal64 val) { myObstacleDistance = val; }
974  {
975  SOP_Node *thissop = cookparms.getNode();
976  if (!thissop) return getObstacleDistance();
978  OP_Utils::evalOpParm(result, thissop, "obstacledistance", cookparms.getCookTime(), 0);
979  return result;
980  }
981  fpreal64 getObstaclePadding() const { return myObstaclePadding; }
982  void setObstaclePadding(fpreal64 val) { myObstaclePadding = val; }
984  {
985  SOP_Node *thissop = cookparms.getNode();
986  if (!thissop) return getObstaclePadding();
988  OP_Utils::evalOpParm(result, thissop, "obstaclepadding", cookparms.getCookTime(), 0);
989  return result;
990  }
991  fpreal64 getHorizontalFOV() const { return myHorizontalFOV; }
992  void setHorizontalFOV(fpreal64 val) { myHorizontalFOV = val; }
994  {
995  SOP_Node *thissop = cookparms.getNode();
996  if (!thissop) return getHorizontalFOV();
998  OP_Utils::evalOpParm(result, thissop, "horizontalfov", cookparms.getCookTime(), 0);
999  return result;
1000  }
1001  fpreal64 getVerticalFOV() const { return myVerticalFOV; }
1002  void setVerticalFOV(fpreal64 val) { myVerticalFOV = val; }
1004  {
1005  SOP_Node *thissop = cookparms.getNode();
1006  if (!thissop) return getVerticalFOV();
1007  fpreal64 result;
1008  OP_Utils::evalOpParm(result, thissop, "verticalfov", cookparms.getCookTime(), 0);
1009  return result;
1010  }
1011  int64 getFOVSamples() const { return myFOVSamples; }
1012  void setFOVSamples(int64 val) { myFOVSamples = val; }
1014  {
1015  SOP_Node *thissop = cookparms.getNode();
1016  if (!thissop) return getFOVSamples();
1017  int64 result;
1018  OP_Utils::evalOpParm(result, thissop, "fovsamples", cookparms.getCookTime(), 0);
1019  return result;
1020  }
1021  fpreal64 getFOVSeed() const { return myFOVSeed; }
1022  void setFOVSeed(fpreal64 val) { myFOVSeed = val; }
1024  {
1025  SOP_Node *thissop = cookparms.getNode();
1026  if (!thissop) return getFOVSeed();
1027  fpreal64 result;
1028  OP_Utils::evalOpParm(result, thissop, "fovseed", cookparms.getCookTime(), 0);
1029  return result;
1030  }
1031  SteeringMode getSteeringMode() const { return SteeringMode(mySteeringMode); }
1032  void setSteeringMode(SteeringMode val) { mySteeringMode = int64(val); }
1034  {
1035  SOP_Node *thissop = cookparms.getNode();
1036  if (!thissop) return getSteeringMode();
1037  int64 result;
1038  OP_Utils::evalOpParm(result, thissop, "steeringmode", cookparms.getCookTime(), 0);
1039  return SteeringMode(result);
1040  }
1041  fpreal64 getTurnSpeedThreshold() const { return myTurnSpeedThreshold; }
1042  void setTurnSpeedThreshold(fpreal64 val) { myTurnSpeedThreshold = val; }
1044  {
1045  SOP_Node *thissop = cookparms.getNode();
1046  if (!thissop) return getTurnSpeedThreshold();
1047  fpreal64 result;
1048  OP_Utils::evalOpParm(result, thissop, "turnspeedthreshold", cookparms.getCookTime(), 0);
1049  return result;
1050  }
1051  bool getUseMaxInitialRotation() const { return myUseMaxInitialRotation; }
1052  void setUseMaxInitialRotation(bool val) { myUseMaxInitialRotation = val; }
1054  {
1055  SOP_Node *thissop = cookparms.getNode();
1056  if (!thissop) return getUseMaxInitialRotation();
1057  bool result;
1058  OP_Utils::evalOpParm(result, thissop, "usemaxinitialrotation", cookparms.getCookTime(), 0);
1059  return result;
1060  }
1061  fpreal64 getMaxInitialRotation() const { return myMaxInitialRotation; }
1062  void setMaxInitialRotation(fpreal64 val) { myMaxInitialRotation = val; }
1064  {
1065  SOP_Node *thissop = cookparms.getNode();
1066  if (!thissop) return getMaxInitialRotation();
1067  fpreal64 result;
1068  OP_Utils::evalOpParm(result, thissop, "maxinitialrotation", cookparms.getCookTime(), 0);
1069  return result;
1070  }
1071  fpreal64 getMaxTurnRate() const { return myMaxTurnRate; }
1072  void setMaxTurnRate(fpreal64 val) { myMaxTurnRate = val; }
1074  {
1075  SOP_Node *thissop = cookparms.getNode();
1076  if (!thissop) return getMaxTurnRate();
1077  fpreal64 result;
1078  OP_Utils::evalOpParm(result, thissop, "maxturnrate", cookparms.getCookTime(), 0);
1079  return result;
1080  }
1081  bool getConstrainTurnAccel() const { return myConstrainTurnAccel; }
1082  void setConstrainTurnAccel(bool val) { myConstrainTurnAccel = val; }
1083  bool opConstrainTurnAccel(const SOP_NodeVerb::CookParms &cookparms) const
1084  {
1085  SOP_Node *thissop = cookparms.getNode();
1086  if (!thissop) return getConstrainTurnAccel();
1087  bool result;
1088  OP_Utils::evalOpParm(result, thissop, "constrainturnaccel", cookparms.getCookTime(), 0);
1089  return result;
1090  }
1091  fpreal64 getTurnStiffness() const { return myTurnStiffness; }
1092  void setTurnStiffness(fpreal64 val) { myTurnStiffness = val; }
1094  {
1095  SOP_Node *thissop = cookparms.getNode();
1096  if (!thissop) return getTurnStiffness();
1097  fpreal64 result;
1098  OP_Utils::evalOpParm(result, thissop, "turnstiffness", cookparms.getCookTime(), 0);
1099  return result;
1100  }
1101  fpreal64 getTurnDamping() const { return myTurnDamping; }
1102  void setTurnDamping(fpreal64 val) { myTurnDamping = val; }
1104  {
1105  SOP_Node *thissop = cookparms.getNode();
1106  if (!thissop) return getTurnDamping();
1107  fpreal64 result;
1108  OP_Utils::evalOpParm(result, thissop, "turndamping", cookparms.getCookTime(), 0);
1109  return result;
1110  }
1111  GoalPos getGoalPos() const { return GoalPos(myGoalPos); }
1112  void setGoalPos(GoalPos val) { myGoalPos = int64(val); }
1114  {
1115  SOP_Node *thissop = cookparms.getNode();
1116  if (!thissop) return getGoalPos();
1117  int64 result;
1118  OP_Utils::evalOpParm(result, thissop, "goalpos", cookparms.getCookTime(), 0);
1119  return GoalPos(result);
1120  }
1121  fpreal64 getGoalPosWeight() const { return myGoalPosWeight; }
1122  void setGoalPosWeight(fpreal64 val) { myGoalPosWeight = val; }
1124  {
1125  SOP_Node *thissop = cookparms.getNode();
1126  if (!thissop) return getGoalPosWeight();
1127  fpreal64 result;
1128  OP_Utils::evalOpParm(result, thissop, "goalposweight", cookparms.getCookTime(), 0);
1129  return result;
1130  }
1131  fpreal64 getDistanceVariance() const { return myDistanceVariance; }
1132  void setDistanceVariance(fpreal64 val) { myDistanceVariance = val; }
1134  {
1135  SOP_Node *thissop = cookparms.getNode();
1136  if (!thissop) return getDistanceVariance();
1137  fpreal64 result;
1138  OP_Utils::evalOpParm(result, thissop, "distancevariance", cookparms.getCookTime(), 0);
1139  return result;
1140  }
1141  bool getAddCollisionPointGroup() const { return myAddCollisionPointGroup; }
1142  void setAddCollisionPointGroup(bool val) { myAddCollisionPointGroup = val; }
1144  {
1145  SOP_Node *thissop = cookparms.getNode();
1146  if (!thissop) return getAddCollisionPointGroup();
1147  bool result;
1148  OP_Utils::evalOpParm(result, thissop, "addcollisionptgroup", cookparms.getCookTime(), 0);
1149  return result;
1150  }
1151  const UT_StringHolder & getCollisionPointGroup() const { return myCollisionPointGroup; }
1152  void setCollisionPointGroup(const UT_StringHolder & val) { myCollisionPointGroup = val; }
1154  {
1155  SOP_Node *thissop = cookparms.getNode();
1156  if (!thissop) return getCollisionPointGroup();
1158  OP_Utils::evalOpParm(result, thissop, "collisionptgroup", cookparms.getCookTime(), 0);
1159  return result;
1160  }
1161  fpreal64 getTimestep() const { return myTimestep; }
1162  void setTimestep(fpreal64 val) { myTimestep = val; }
1164  {
1165  SOP_Node *thissop = cookparms.getNode();
1166  if (!thissop) return getTimestep();
1167  fpreal64 result;
1168  OP_Utils::evalOpParm(result, thissop, "timestep", cookparms.getCookTime(), 0);
1169  return result;
1170  }
1171  bool getUseStartTime() const { return myUseStartTime; }
1172  void setUseStartTime(bool val) { myUseStartTime = val; }
1173  bool opUseStartTime(const SOP_NodeVerb::CookParms &cookparms) const
1174  {
1175  SOP_Node *thissop = cookparms.getNode();
1176  if (!thissop) return getUseStartTime();
1177  bool result;
1178  OP_Utils::evalOpParm(result, thissop, "usestarttime", cookparms.getCookTime(), 0);
1179  return result;
1180  }
1181  fpreal64 getStartTime() const { return myStartTime; }
1182  void setStartTime(fpreal64 val) { myStartTime = val; }
1184  {
1185  SOP_Node *thissop = cookparms.getNode();
1186  if (!thissop) return getStartTime();
1187  fpreal64 result;
1188  OP_Utils::evalOpParm(result, thissop, "starttime", cookparms.getCookTime(), 0);
1189  return result;
1190  }
1191  bool getUseEndTime() const { return myUseEndTime; }
1192  void setUseEndTime(bool val) { myUseEndTime = val; }
1193  bool opUseEndTime(const SOP_NodeVerb::CookParms &cookparms) const
1194  {
1195  SOP_Node *thissop = cookparms.getNode();
1196  if (!thissop) return getUseEndTime();
1197  bool result;
1198  OP_Utils::evalOpParm(result, thissop, "useendtime", cookparms.getCookTime(), 0);
1199  return result;
1200  }
1201  fpreal64 getEndTime() const { return myEndTime; }
1202  void setEndTime(fpreal64 val) { myEndTime = val; }
1204  {
1205  SOP_Node *thissop = cookparms.getNode();
1206  if (!thissop) return getEndTime();
1207  fpreal64 result;
1208  OP_Utils::evalOpParm(result, thissop, "endtime", cookparms.getCookTime(), 0);
1209  return result;
1210  }
1211  UT_Vector3D getReferenceUp() const { return myReferenceUp; }
1212  void setReferenceUp(UT_Vector3D val) { myReferenceUp = val; }
1214  {
1215  SOP_Node *thissop = cookparms.getNode();
1216  if (!thissop) return getReferenceUp();
1218  OP_Utils::evalOpParm(result, thissop, "refup", cookparms.getCookTime(), 0);
1219  return result;
1220  }
1221 
1222 private:
1223  UT_StringHolder myGroup;
1224  bool myEnableAvoidance;
1225  fpreal64 myMaxCollisionTime;
1226  bool myEnableNeighbors;
1227  fpreal64 myNeighborDistance;
1228  int64 myMaxNeighbors;
1229  bool myEnableObstacles;
1230  fpreal64 myObstacleDistance;
1231  fpreal64 myObstaclePadding;
1232  fpreal64 myHorizontalFOV;
1233  fpreal64 myVerticalFOV;
1234  int64 myFOVSamples;
1235  fpreal64 myFOVSeed;
1236  int64 mySteeringMode;
1237  fpreal64 myTurnSpeedThreshold;
1238  bool myUseMaxInitialRotation;
1239  fpreal64 myMaxInitialRotation;
1240  fpreal64 myMaxTurnRate;
1241  bool myConstrainTurnAccel;
1242  fpreal64 myTurnStiffness;
1243  fpreal64 myTurnDamping;
1244  int64 myGoalPos;
1245  fpreal64 myGoalPosWeight;
1246  fpreal64 myDistanceVariance;
1247  bool myAddCollisionPointGroup;
1248  UT_StringHolder myCollisionPointGroup;
1249  fpreal64 myTimestep;
1250  bool myUseStartTime;
1251  fpreal64 myStartTime;
1252  bool myUseEndTime;
1253  fpreal64 myEndTime;
1254  UT_Vector3D myReferenceUp;
1255 
1256 };
type
Definition: core.h:556
bool opConstrainTurnAccel(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
fpreal64 opObstacleDistance(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
int64 opMaxNeighbors(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, bool &v)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
bool opUseStartTime(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opVerticalFOV(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
fpreal64 opEndTime(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setCollisionPointGroup(const UT_StringHolder &val)
fpreal64 opTurnStiffness(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opTimestep(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
GLsizei const GLfloat * value
Definition: glcorearb.h:824
bool opEnableObstacles(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
UT_Vector3D opReferenceUp(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
UT_StringHolder opCollisionPointGroup(const SOP_NodeVerb::CookParms &cookparms) const
GLdouble s
Definition: glad.h:3009
static void saveData(std::ostream &os, UT_Matrix2D v)
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
**But if you need a result
Definition: thread.h:622
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
fpreal64 opMaxInitialRotation(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opStartTime(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void saveData(std::ostream &os, UT_Vector2D v)
bool operator==(const SOP_CrowdMotionPathAvoidCoreParms &src) const
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
static void loadData(UT_IStream &is, UT_StringHolder &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
int64 opFOVSamples(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
bool opEnableNeighbors(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opGoalPosWeight(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opFOVSeed(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
SYS_FORCE_INLINE UT_StringHolder getToken(SteeringMode enum_value)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
fpreal64 opHorizontalFOV(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
long long int64
Definition: SYS_Types.h:116
static void saveData(std::ostream &os, bool v)
fpreal64 opObstaclePadding(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
UT_Vector3T< fpreal64 > UT_Vector3D
static void loadData(UT_IStream &is, UT_Vector4D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Vector3D v)
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
const UT_StringHolder & getCollisionPointGroup() const
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool opAddCollisionPointGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
ParmType getNestParmType(TempIndex fieldnum) const override
fpreal64 fpreal
Definition: SYS_Types.h:278
fpreal64 opDistanceVariance(const SOP_NodeVerb::CookParms &cookparms) const
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
LeafData & operator=(const LeafData &)=delete
fpreal64 opTurnDamping(const SOP_NodeVerb::CookParms &cookparms) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool opEnableAvoidance(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opNeighborDistance(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
#define SOP_API
Definition: SOP_API.h:10
bool opUseMaxInitialRotation(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
fpreal64 opTurnSpeedThreshold(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
Definition: UT_String.h:1406
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
GoalPos opGoalPos(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
GLboolean r
Definition: glcorearb.h:1222
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
fpreal64 opMaxTurnRate(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal64 opMaxCollisionTime(const SOP_NodeVerb::CookParms &cookparms) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void saveData(std::ostream &os, UT_Matrix4D v)
bool operator!=(const SOP_CrowdMotionPathAvoidCoreParms &src) const
bool opUseEndTime(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
SteeringMode opSteeringMode(const SOP_NodeVerb::CookParms &cookparms) const