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 <SOP/SOP_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  myGoalPosWeight = 0.1;
91  myGoalPos = 0;
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 (myGoalPosWeight != src.myGoalPosWeight) return false;
135  if (myGoalPos != src.myGoalPos) 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  return true;
147  }
149  {
150  return !operator==(src);
151  }
154 
155 
156 
157  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
158  {
159  myGroup = ""_UTsh;
160  if (true)
161  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
162  myEnableAvoidance = true;
163  if (true)
164  graph->evalOpParm(myEnableAvoidance, nodeidx, "enableavoidance", time, 0);
165  myMaxCollisionTime = 3;
166  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
167  graph->evalOpParm(myMaxCollisionTime, nodeidx, "maxcollisiontime", time, 0);
168  myEnableNeighbors = true;
169  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
170  graph->evalOpParm(myEnableNeighbors, nodeidx, "enableneighbors", time, 0);
171  myNeighborDistance = 10;
172  if (true && ( (true&&!(((getEnableAvoidance()==0))||((getEnableNeighbors()==0)))) ) )
173  graph->evalOpParm(myNeighborDistance, nodeidx, "neighbordistance", time, 0);
174  myMaxNeighbors = 100;
175  if (true && ( (true&&!(((getEnableAvoidance()==0))||((getEnableNeighbors()==0)))) ) )
176  graph->evalOpParm(myMaxNeighbors, nodeidx, "maxneighbors", time, 0);
177  myEnableObstacles = true;
178  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
179  graph->evalOpParm(myEnableObstacles, nodeidx, "enableobstacles", time, 0);
180  myObstacleDistance = 10;
181  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0)))) ) )
182  graph->evalOpParm(myObstacleDistance, nodeidx, "obstacledistance", time, 0);
183  myObstaclePadding = 1;
184  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0)))) ) )
185  graph->evalOpParm(myObstaclePadding, nodeidx, "obstaclepadding", time, 0);
186  myHorizontalFOV = 180;
187  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0)))) ) )
188  graph->evalOpParm(myHorizontalFOV, nodeidx, "horizontalfov", time, 0);
189  myVerticalFOV = 0;
190  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0)))) ) )
191  graph->evalOpParm(myVerticalFOV, nodeidx, "verticalfov", time, 0);
192  myFOVSamples = 8;
193  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0)))) ) )
194  graph->evalOpParm(myFOVSamples, nodeidx, "fovsamples", time, 0);
195  myFOVSeed = 1;
196  if (true && ( (true&&!(((getEnableObstacles()==0))||((getEnableAvoidance()==0))||((getVerticalFOV()==0)))) ) )
197  graph->evalOpParm(myFOVSeed, nodeidx, "fovseed", time, 0);
198  mySteeringMode = 0;
199  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
200  graph->evalOpParm(mySteeringMode, nodeidx, "steeringmode", time, 0);
201  myTurnSpeedThreshold = 0.25;
202  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
203  graph->evalOpParm(myTurnSpeedThreshold, nodeidx, "turnspeedthreshold", time, 0);
204  myUseMaxInitialRotation = false;
205  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
206  graph->evalOpParm(myUseMaxInitialRotation, nodeidx, "usemaxinitialrotation", time, 0);
207  myMaxInitialRotation = 45;
208  if (true && ( (true&&!(((getEnableAvoidance()==0))||((getUseMaxInitialRotation()==0)))) ) )
209  graph->evalOpParm(myMaxInitialRotation, nodeidx, "maxinitialrotation", time, 0);
210  myMaxTurnRate = 90;
211  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
212  graph->evalOpParm(myMaxTurnRate, nodeidx, "maxturnrate", time, 0);
213  myConstrainTurnAccel = false;
214  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
215  graph->evalOpParm(myConstrainTurnAccel, nodeidx, "constrainturnaccel", time, 0);
216  myTurnStiffness = 10;
217  if (true && ( (true&&!(((getConstrainTurnAccel()==0))||((getEnableAvoidance()==0)))) ) )
218  graph->evalOpParm(myTurnStiffness, nodeidx, "turnstiffness", time, 0);
219  myTurnDamping = 5;
220  if (true && ( (true&&!(((getConstrainTurnAccel()==0))||((getEnableAvoidance()==0)))) ) )
221  graph->evalOpParm(myTurnDamping, nodeidx, "turndamping", time, 0);
222  myGoalPosWeight = 0.1;
223  if (true && ( (true&&!(((getEnableAvoidance()==0)))) ) )
224  graph->evalOpParm(myGoalPosWeight, nodeidx, "goalposweight", time, 0);
225  myGoalPos = 0;
226  if (true && ( (true&&!(((getEnableAvoidance()==0))||((getGoalPosWeight()==0)))) ) )
227  graph->evalOpParm(myGoalPos, nodeidx, "goalpos", time, 0);
228  myDistanceVariance = 5;
229  if (true && ( (true&&!(((int64(getGoalPos())!=1))||((getEnableAvoidance()==0))||((getGoalPosWeight()==0))||((int64(getGoalPos())!=1)))) ) )
230  graph->evalOpParm(myDistanceVariance, nodeidx, "distancevariance", time, 0);
231  myAddCollisionPointGroup = false;
232  if (true)
233  graph->evalOpParm(myAddCollisionPointGroup, nodeidx, "addcollisionptgroup", time, 0);
234  myCollisionPointGroup = "collided"_UTsh;
235  if (true && ( (true&&!(((getAddCollisionPointGroup()==0)))) ) )
236  graph->evalOpParm(myCollisionPointGroup, nodeidx, "collisionptgroup", time, 0);
237  myTimestep = 0;
238  if (true)
239  graph->evalOpParm(myTimestep, nodeidx, "timestep", time, 0);
240  myUseStartTime = false;
241  if (true)
242  graph->evalOpParm(myUseStartTime, nodeidx, "usestarttime", time, 0);
243  myStartTime = 0;
244  if (true && ( (true&&!(((getUseStartTime()==0)))) ) )
245  graph->evalOpParm(myStartTime, nodeidx, "starttime", time, 0);
246  myUseEndTime = false;
247  if (true)
248  graph->evalOpParm(myUseEndTime, nodeidx, "useendtime", time, 0);
249  myEndTime = -1;
250  if (true && ( (true&&!(((getUseEndTime()==0)))) ) )
251  graph->evalOpParm(myEndTime, nodeidx, "endtime", time, 0);
252  myReferenceUp = UT_Vector3D(0,1,0);
253  if (true)
254  graph->evalOpParm(myReferenceUp, nodeidx, "refup", time, 0);
255 
256  }
257 
258 
259  void loadFromOpSubclass(const LoadParms &loadparms) override
260  {
261  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
262  }
263 
264 
265  void copyFrom(const OP_NodeParms *src) override
266  {
267  *this = *((const SOP_CrowdMotionPathAvoidCoreParms *)src);
268  }
269 
270  template <typename T>
271  void
272  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
273  {
274  if (idx.size() < 1)
275  return;
276  UT_ASSERT(idx.size() == instance.size()+1);
277  if (idx.size() != instance.size()+1)
278  return;
279  switch (idx[0])
280  {
281  case 0:
282  coerceValue(value, myGroup);
283  break;
284  case 1:
285  coerceValue(value, myEnableAvoidance);
286  break;
287  case 2:
288  coerceValue(value, myMaxCollisionTime);
289  break;
290  case 3:
291  coerceValue(value, myEnableNeighbors);
292  break;
293  case 4:
294  coerceValue(value, myNeighborDistance);
295  break;
296  case 5:
297  coerceValue(value, myMaxNeighbors);
298  break;
299  case 6:
300  coerceValue(value, myEnableObstacles);
301  break;
302  case 7:
303  coerceValue(value, myObstacleDistance);
304  break;
305  case 8:
306  coerceValue(value, myObstaclePadding);
307  break;
308  case 9:
309  coerceValue(value, myHorizontalFOV);
310  break;
311  case 10:
312  coerceValue(value, myVerticalFOV);
313  break;
314  case 11:
315  coerceValue(value, myFOVSamples);
316  break;
317  case 12:
318  coerceValue(value, myFOVSeed);
319  break;
320  case 13:
321  coerceValue(value, mySteeringMode);
322  break;
323  case 14:
324  coerceValue(value, myTurnSpeedThreshold);
325  break;
326  case 15:
327  coerceValue(value, myUseMaxInitialRotation);
328  break;
329  case 16:
330  coerceValue(value, myMaxInitialRotation);
331  break;
332  case 17:
333  coerceValue(value, myMaxTurnRate);
334  break;
335  case 18:
336  coerceValue(value, myConstrainTurnAccel);
337  break;
338  case 19:
339  coerceValue(value, myTurnStiffness);
340  break;
341  case 20:
342  coerceValue(value, myTurnDamping);
343  break;
344  case 21:
345  coerceValue(value, myGoalPosWeight);
346  break;
347  case 22:
348  coerceValue(value, myGoalPos);
349  break;
350  case 23:
351  coerceValue(value, myDistanceVariance);
352  break;
353  case 24:
354  coerceValue(value, myAddCollisionPointGroup);
355  break;
356  case 25:
357  coerceValue(value, myCollisionPointGroup);
358  break;
359  case 26:
360  coerceValue(value, myTimestep);
361  break;
362  case 27:
363  coerceValue(value, myUseStartTime);
364  break;
365  case 28:
366  coerceValue(value, myStartTime);
367  break;
368  case 29:
369  coerceValue(value, myUseEndTime);
370  break;
371  case 30:
372  coerceValue(value, myEndTime);
373  break;
374  case 31:
375  coerceValue(value, myReferenceUp);
376  break;
377 
378  }
379  }
380 
381  bool isParmColorRamp(exint idx) const override
382  {
383  switch (idx)
384  {
385 
386  }
387  return false;
388  }
389 
390  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
391  { doGetParmValue(idx, instance, value); }
392  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
393  { doGetParmValue(idx, instance, value); }
394  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
395  { doGetParmValue(idx, instance, value); }
396  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
397  { doGetParmValue(idx, instance, value); }
398  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
399  { doGetParmValue(idx, instance, value); }
400  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
401  { doGetParmValue(idx, instance, value); }
402  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
403  { doGetParmValue(idx, instance, value); }
404  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
405  { doGetParmValue(idx, instance, value); }
406  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
407  { doGetParmValue(idx, instance, value); }
408  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
409  { doGetParmValue(idx, instance, value); }
410  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
411  { doGetParmValue(idx, instance, value); }
412 
413  template <typename T>
414  void
415  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
416  {
417  if (idx.size() < 1)
418  return;
419  UT_ASSERT(idx.size() == instance.size()+1);
420  if (idx.size() != instance.size()+1)
421  return;
422  switch (idx[0])
423  {
424  case 0:
425  coerceValue(myGroup, ( ( value ) ));
426  break;
427  case 1:
428  coerceValue(myEnableAvoidance, ( ( value ) ));
429  break;
430  case 2:
431  coerceValue(myMaxCollisionTime, ( ( value ) ));
432  break;
433  case 3:
434  coerceValue(myEnableNeighbors, ( ( value ) ));
435  break;
436  case 4:
437  coerceValue(myNeighborDistance, clampMinValue(0, ( value ) ));
438  break;
439  case 5:
440  coerceValue(myMaxNeighbors, clampMinValue(0, ( value ) ));
441  break;
442  case 6:
443  coerceValue(myEnableObstacles, ( ( value ) ));
444  break;
445  case 7:
446  coerceValue(myObstacleDistance, clampMinValue(0, ( value ) ));
447  break;
448  case 8:
449  coerceValue(myObstaclePadding, clampMinValue(0, ( value ) ));
450  break;
451  case 9:
452  coerceValue(myHorizontalFOV, clampMinValue(0, ( value ) ));
453  break;
454  case 10:
455  coerceValue(myVerticalFOV, clampMinValue(0, ( value ) ));
456  break;
457  case 11:
458  coerceValue(myFOVSamples, clampMinValue(0, ( value ) ));
459  break;
460  case 12:
461  coerceValue(myFOVSeed, ( ( value ) ));
462  break;
463  case 13:
464  coerceValue(mySteeringMode, clampMinValue(0, clampMaxValue(1, value ) ));
465  break;
466  case 14:
467  coerceValue(myTurnSpeedThreshold, ( ( value ) ));
468  break;
469  case 15:
470  coerceValue(myUseMaxInitialRotation, ( ( value ) ));
471  break;
472  case 16:
473  coerceValue(myMaxInitialRotation, clampMinValue(0, ( value ) ));
474  break;
475  case 17:
476  coerceValue(myMaxTurnRate, ( ( value ) ));
477  break;
478  case 18:
479  coerceValue(myConstrainTurnAccel, ( ( value ) ));
480  break;
481  case 19:
482  coerceValue(myTurnStiffness, ( ( value ) ));
483  break;
484  case 20:
485  coerceValue(myTurnDamping, ( ( value ) ));
486  break;
487  case 21:
488  coerceValue(myGoalPosWeight, clampMinValue(0, ( value ) ));
489  break;
490  case 22:
491  coerceValue(myGoalPos, clampMinValue(0, clampMaxValue(1, value ) ));
492  break;
493  case 23:
494  coerceValue(myDistanceVariance, ( ( value ) ));
495  break;
496  case 24:
497  coerceValue(myAddCollisionPointGroup, ( ( value ) ));
498  break;
499  case 25:
500  coerceValue(myCollisionPointGroup, ( ( value ) ));
501  break;
502  case 26:
503  coerceValue(myTimestep, clampMinValue(0, ( value ) ));
504  break;
505  case 27:
506  coerceValue(myUseStartTime, ( ( value ) ));
507  break;
508  case 28:
509  coerceValue(myStartTime, ( ( value ) ));
510  break;
511  case 29:
512  coerceValue(myUseEndTime, ( ( value ) ));
513  break;
514  case 30:
515  coerceValue(myEndTime, ( ( value ) ));
516  break;
517  case 31:
518  coerceValue(myReferenceUp, ( ( value ) ));
519  break;
520 
521  }
522  }
523 
524  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
525  { doSetParmValue(idx, instance, value); }
526  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
527  { doSetParmValue(idx, instance, value); }
528  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
529  { doSetParmValue(idx, instance, value); }
530  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
531  { doSetParmValue(idx, instance, value); }
532  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
533  { doSetParmValue(idx, instance, value); }
534  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
535  { doSetParmValue(idx, instance, value); }
536  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
537  { doSetParmValue(idx, instance, value); }
538  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
539  { doSetParmValue(idx, instance, value); }
540  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
541  { doSetParmValue(idx, instance, value); }
542  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
543  { doSetParmValue(idx, instance, value); }
544  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
545  { doSetParmValue(idx, instance, value); }
546 
547  exint getNestNumParms(TempIndex idx) const override
548  {
549  if (idx.size() == 0)
550  return 32;
551  switch (idx[0])
552  {
553 
554  }
555  // Invalid
556  return 0;
557  }
558 
559  const char *getNestParmName(TempIndex fieldnum) const override
560  {
561  if (fieldnum.size() < 1)
562  return 0;
563  switch (fieldnum[0])
564  {
565  case 0:
566  return "group";
567  case 1:
568  return "enableavoidance";
569  case 2:
570  return "maxcollisiontime";
571  case 3:
572  return "enableneighbors";
573  case 4:
574  return "neighbordistance";
575  case 5:
576  return "maxneighbors";
577  case 6:
578  return "enableobstacles";
579  case 7:
580  return "obstacledistance";
581  case 8:
582  return "obstaclepadding";
583  case 9:
584  return "horizontalfov";
585  case 10:
586  return "verticalfov";
587  case 11:
588  return "fovsamples";
589  case 12:
590  return "fovseed";
591  case 13:
592  return "steeringmode";
593  case 14:
594  return "turnspeedthreshold";
595  case 15:
596  return "usemaxinitialrotation";
597  case 16:
598  return "maxinitialrotation";
599  case 17:
600  return "maxturnrate";
601  case 18:
602  return "constrainturnaccel";
603  case 19:
604  return "turnstiffness";
605  case 20:
606  return "turndamping";
607  case 21:
608  return "goalposweight";
609  case 22:
610  return "goalpos";
611  case 23:
612  return "distancevariance";
613  case 24:
614  return "addcollisionptgroup";
615  case 25:
616  return "collisionptgroup";
617  case 26:
618  return "timestep";
619  case 27:
620  return "usestarttime";
621  case 28:
622  return "starttime";
623  case 29:
624  return "useendtime";
625  case 30:
626  return "endtime";
627  case 31:
628  return "refup";
629 
630  }
631  return 0;
632  }
633 
634  ParmType getNestParmType(TempIndex fieldnum) const override
635  {
636  if (fieldnum.size() < 1)
637  return PARM_UNSUPPORTED;
638  switch (fieldnum[0])
639  {
640  case 0:
641  return PARM_STRING;
642  case 1:
643  return PARM_INTEGER;
644  case 2:
645  return PARM_FLOAT;
646  case 3:
647  return PARM_INTEGER;
648  case 4:
649  return PARM_FLOAT;
650  case 5:
651  return PARM_INTEGER;
652  case 6:
653  return PARM_INTEGER;
654  case 7:
655  return PARM_FLOAT;
656  case 8:
657  return PARM_FLOAT;
658  case 9:
659  return PARM_FLOAT;
660  case 10:
661  return PARM_FLOAT;
662  case 11:
663  return PARM_INTEGER;
664  case 12:
665  return PARM_FLOAT;
666  case 13:
667  return PARM_INTEGER;
668  case 14:
669  return PARM_FLOAT;
670  case 15:
671  return PARM_INTEGER;
672  case 16:
673  return PARM_FLOAT;
674  case 17:
675  return PARM_FLOAT;
676  case 18:
677  return PARM_INTEGER;
678  case 19:
679  return PARM_FLOAT;
680  case 20:
681  return PARM_FLOAT;
682  case 21:
683  return PARM_FLOAT;
684  case 22:
685  return PARM_INTEGER;
686  case 23:
687  return PARM_FLOAT;
688  case 24:
689  return PARM_INTEGER;
690  case 25:
691  return PARM_STRING;
692  case 26:
693  return PARM_FLOAT;
694  case 27:
695  return PARM_INTEGER;
696  case 28:
697  return PARM_FLOAT;
698  case 29:
699  return PARM_INTEGER;
700  case 30:
701  return PARM_FLOAT;
702  case 31:
703  return PARM_VECTOR3;
704 
705  }
706  return PARM_UNSUPPORTED;
707  }
708 
709  // Boiler plate to load individual types.
710  static void loadData(UT_IStream &is, int64 &v)
711  { is.bread(&v, 1); }
712  static void loadData(UT_IStream &is, bool &v)
713  { int64 iv; is.bread(&iv, 1); v = iv; }
714  static void loadData(UT_IStream &is, fpreal64 &v)
715  { is.bread<fpreal64>(&v, 1); }
716  static void loadData(UT_IStream &is, UT_Vector2D &v)
717  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
718  static void loadData(UT_IStream &is, UT_Vector3D &v)
719  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
720  is.bread<fpreal64>(&v.z(), 1); }
721  static void loadData(UT_IStream &is, UT_Vector4D &v)
722  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
723  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
724  static void loadData(UT_IStream &is, UT_Matrix2D &v)
725  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
726  static void loadData(UT_IStream &is, UT_Matrix3D &v)
727  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
728  static void loadData(UT_IStream &is, UT_Matrix4D &v)
729  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
730  static void loadData(UT_IStream &is, UT_Vector2I &v)
731  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
732  static void loadData(UT_IStream &is, UT_Vector3I &v)
733  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
734  is.bread<int64>(&v.z(), 1); }
735  static void loadData(UT_IStream &is, UT_Vector4I &v)
736  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
737  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
739  { is.bread(v); }
741  { UT_StringHolder rampdata;
742  loadData(is, rampdata);
743  if (rampdata.isstring())
744  {
745  v.reset(new UT_Ramp());
746  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
747  v->load(istr);
748  }
749  else v.reset();
750  }
753  loadData(is, data);
754  if (data.isstring())
755  {
756  // Find the data type.
757  const char *colon = UT_StringWrap(data).findChar(':');
758  if (colon)
759  {
760  int typelen = colon - data.buffer();
762  type.strncpy(data.buffer(), typelen);
763  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
764 
765  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
766  }
767  }
768  else v.reset();
769  }
770 
771  static void saveData(std::ostream &os, int64 v)
772  { UTwrite(os, &v); }
773  static void saveData(std::ostream &os, bool v)
774  { int64 iv = v; UTwrite(os, &iv); }
775  static void saveData(std::ostream &os, fpreal64 v)
776  { UTwrite<fpreal64>(os, &v); }
777  static void saveData(std::ostream &os, UT_Vector2D v)
778  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
779  static void saveData(std::ostream &os, UT_Vector3D v)
780  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
781  UTwrite<fpreal64>(os, &v.z()); }
782  static void saveData(std::ostream &os, UT_Vector4D v)
783  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
784  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
785  static void saveData(std::ostream &os, UT_Matrix2D v)
787  static void saveData(std::ostream &os, UT_Matrix3D v)
789  static void saveData(std::ostream &os, UT_Matrix4D v)
791  static void saveData(std::ostream &os, UT_StringHolder s)
792  { UT_StringWrap(s).saveBinary(os); }
793  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
795  UT_OStringStream ostr;
796  if (s) s->save(ostr);
797  result = ostr.str();
798  saveData(os, result);
799  }
800  static void saveData(std::ostream &os, PRM_DataItemHandle s)
802  UT_OStringStream ostr;
803  if (s)
804  {
805  ostr << s->getDataTypeToken();
806  ostr << ":";
807  s->saveBinary(ostr);
808  }
809  result = ostr.str();
810  saveData(os, result);
811  }
812 
813 
814  void save(std::ostream &os) const
815  {
816  int32 v = version();
817  UTwrite(os, &v);
818  saveData(os, myGroup);
819  saveData(os, myEnableAvoidance);
820  saveData(os, myMaxCollisionTime);
821  saveData(os, myEnableNeighbors);
822  saveData(os, myNeighborDistance);
823  saveData(os, myMaxNeighbors);
824  saveData(os, myEnableObstacles);
825  saveData(os, myObstacleDistance);
826  saveData(os, myObstaclePadding);
827  saveData(os, myHorizontalFOV);
828  saveData(os, myVerticalFOV);
829  saveData(os, myFOVSamples);
830  saveData(os, myFOVSeed);
831  saveData(os, mySteeringMode);
832  saveData(os, myTurnSpeedThreshold);
833  saveData(os, myUseMaxInitialRotation);
834  saveData(os, myMaxInitialRotation);
835  saveData(os, myMaxTurnRate);
836  saveData(os, myConstrainTurnAccel);
837  saveData(os, myTurnStiffness);
838  saveData(os, myTurnDamping);
839  saveData(os, myGoalPosWeight);
840  saveData(os, myGoalPos);
841  saveData(os, myDistanceVariance);
842  saveData(os, myAddCollisionPointGroup);
843  saveData(os, myCollisionPointGroup);
844  saveData(os, myTimestep);
845  saveData(os, myUseStartTime);
846  saveData(os, myStartTime);
847  saveData(os, myUseEndTime);
848  saveData(os, myEndTime);
849  saveData(os, myReferenceUp);
850 
851  }
852 
853  bool load(UT_IStream &is)
854  {
855  int32 v;
856  is.bread(&v, 1);
857  if (version() != v)
858  {
859  // Fail incompatible versions
860  return false;
861  }
862  loadData(is, myGroup);
863  loadData(is, myEnableAvoidance);
864  loadData(is, myMaxCollisionTime);
865  loadData(is, myEnableNeighbors);
866  loadData(is, myNeighborDistance);
867  loadData(is, myMaxNeighbors);
868  loadData(is, myEnableObstacles);
869  loadData(is, myObstacleDistance);
870  loadData(is, myObstaclePadding);
871  loadData(is, myHorizontalFOV);
872  loadData(is, myVerticalFOV);
873  loadData(is, myFOVSamples);
874  loadData(is, myFOVSeed);
875  loadData(is, mySteeringMode);
876  loadData(is, myTurnSpeedThreshold);
877  loadData(is, myUseMaxInitialRotation);
878  loadData(is, myMaxInitialRotation);
879  loadData(is, myMaxTurnRate);
880  loadData(is, myConstrainTurnAccel);
881  loadData(is, myTurnStiffness);
882  loadData(is, myTurnDamping);
883  loadData(is, myGoalPosWeight);
884  loadData(is, myGoalPos);
885  loadData(is, myDistanceVariance);
886  loadData(is, myAddCollisionPointGroup);
887  loadData(is, myCollisionPointGroup);
888  loadData(is, myTimestep);
889  loadData(is, myUseStartTime);
890  loadData(is, myStartTime);
891  loadData(is, myUseEndTime);
892  loadData(is, myEndTime);
893  loadData(is, myReferenceUp);
894 
895  return true;
896  }
897 
898  const UT_StringHolder & getGroup() const { return myGroup; }
899  void setGroup(const UT_StringHolder & val) { myGroup = val; }
901  {
902  SOP_Node *thissop = cookparms.getNode();
903  if (!thissop) return getGroup();
905  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
906  return result;
907  }
908  bool getEnableAvoidance() const { return myEnableAvoidance; }
909  void setEnableAvoidance(bool val) { myEnableAvoidance = val; }
910  bool opEnableAvoidance(const SOP_NodeVerb::CookParms &cookparms) const
911  {
912  SOP_Node *thissop = cookparms.getNode();
913  if (!thissop) return getEnableAvoidance();
914  bool result;
915  OP_Utils::evalOpParm(result, thissop, "enableavoidance", cookparms.getCookTime(), 0);
916  return result;
917  }
918  fpreal64 getMaxCollisionTime() const { return myMaxCollisionTime; }
919  void setMaxCollisionTime(fpreal64 val) { myMaxCollisionTime = val; }
921  {
922  SOP_Node *thissop = cookparms.getNode();
923  if (!thissop) return getMaxCollisionTime();
925  OP_Utils::evalOpParm(result, thissop, "maxcollisiontime", cookparms.getCookTime(), 0);
926  return result;
927  }
928  bool getEnableNeighbors() const { return myEnableNeighbors; }
929  void setEnableNeighbors(bool val) { myEnableNeighbors = val; }
930  bool opEnableNeighbors(const SOP_NodeVerb::CookParms &cookparms) const
931  {
932  SOP_Node *thissop = cookparms.getNode();
933  if (!thissop) return getEnableNeighbors();
934  bool result;
935  OP_Utils::evalOpParm(result, thissop, "enableneighbors", cookparms.getCookTime(), 0);
936  return result;
937  }
938  fpreal64 getNeighborDistance() const { return myNeighborDistance; }
939  void setNeighborDistance(fpreal64 val) { myNeighborDistance = val; }
941  {
942  SOP_Node *thissop = cookparms.getNode();
943  if (!thissop) return getNeighborDistance();
945  OP_Utils::evalOpParm(result, thissop, "neighbordistance", cookparms.getCookTime(), 0);
946  return result;
947  }
948  int64 getMaxNeighbors() const { return myMaxNeighbors; }
949  void setMaxNeighbors(int64 val) { myMaxNeighbors = val; }
951  {
952  SOP_Node *thissop = cookparms.getNode();
953  if (!thissop) return getMaxNeighbors();
954  int64 result;
955  OP_Utils::evalOpParm(result, thissop, "maxneighbors", cookparms.getCookTime(), 0);
956  return result;
957  }
958  bool getEnableObstacles() const { return myEnableObstacles; }
959  void setEnableObstacles(bool val) { myEnableObstacles = val; }
960  bool opEnableObstacles(const SOP_NodeVerb::CookParms &cookparms) const
961  {
962  SOP_Node *thissop = cookparms.getNode();
963  if (!thissop) return getEnableObstacles();
964  bool result;
965  OP_Utils::evalOpParm(result, thissop, "enableobstacles", cookparms.getCookTime(), 0);
966  return result;
967  }
968  fpreal64 getObstacleDistance() const { return myObstacleDistance; }
969  void setObstacleDistance(fpreal64 val) { myObstacleDistance = val; }
971  {
972  SOP_Node *thissop = cookparms.getNode();
973  if (!thissop) return getObstacleDistance();
975  OP_Utils::evalOpParm(result, thissop, "obstacledistance", cookparms.getCookTime(), 0);
976  return result;
977  }
978  fpreal64 getObstaclePadding() const { return myObstaclePadding; }
979  void setObstaclePadding(fpreal64 val) { myObstaclePadding = val; }
981  {
982  SOP_Node *thissop = cookparms.getNode();
983  if (!thissop) return getObstaclePadding();
985  OP_Utils::evalOpParm(result, thissop, "obstaclepadding", cookparms.getCookTime(), 0);
986  return result;
987  }
988  fpreal64 getHorizontalFOV() const { return myHorizontalFOV; }
989  void setHorizontalFOV(fpreal64 val) { myHorizontalFOV = val; }
991  {
992  SOP_Node *thissop = cookparms.getNode();
993  if (!thissop) return getHorizontalFOV();
995  OP_Utils::evalOpParm(result, thissop, "horizontalfov", cookparms.getCookTime(), 0);
996  return result;
997  }
998  fpreal64 getVerticalFOV() const { return myVerticalFOV; }
999  void setVerticalFOV(fpreal64 val) { myVerticalFOV = val; }
1001  {
1002  SOP_Node *thissop = cookparms.getNode();
1003  if (!thissop) return getVerticalFOV();
1004  fpreal64 result;
1005  OP_Utils::evalOpParm(result, thissop, "verticalfov", cookparms.getCookTime(), 0);
1006  return result;
1007  }
1008  int64 getFOVSamples() const { return myFOVSamples; }
1009  void setFOVSamples(int64 val) { myFOVSamples = val; }
1011  {
1012  SOP_Node *thissop = cookparms.getNode();
1013  if (!thissop) return getFOVSamples();
1014  int64 result;
1015  OP_Utils::evalOpParm(result, thissop, "fovsamples", cookparms.getCookTime(), 0);
1016  return result;
1017  }
1018  fpreal64 getFOVSeed() const { return myFOVSeed; }
1019  void setFOVSeed(fpreal64 val) { myFOVSeed = val; }
1021  {
1022  SOP_Node *thissop = cookparms.getNode();
1023  if (!thissop) return getFOVSeed();
1024  fpreal64 result;
1025  OP_Utils::evalOpParm(result, thissop, "fovseed", cookparms.getCookTime(), 0);
1026  return result;
1027  }
1028  SteeringMode getSteeringMode() const { return SteeringMode(mySteeringMode); }
1029  void setSteeringMode(SteeringMode val) { mySteeringMode = int64(val); }
1031  {
1032  SOP_Node *thissop = cookparms.getNode();
1033  if (!thissop) return getSteeringMode();
1034  int64 result;
1035  OP_Utils::evalOpParm(result, thissop, "steeringmode", cookparms.getCookTime(), 0);
1036  return SteeringMode(result);
1037  }
1038  fpreal64 getTurnSpeedThreshold() const { return myTurnSpeedThreshold; }
1039  void setTurnSpeedThreshold(fpreal64 val) { myTurnSpeedThreshold = val; }
1041  {
1042  SOP_Node *thissop = cookparms.getNode();
1043  if (!thissop) return getTurnSpeedThreshold();
1044  fpreal64 result;
1045  OP_Utils::evalOpParm(result, thissop, "turnspeedthreshold", cookparms.getCookTime(), 0);
1046  return result;
1047  }
1048  bool getUseMaxInitialRotation() const { return myUseMaxInitialRotation; }
1049  void setUseMaxInitialRotation(bool val) { myUseMaxInitialRotation = val; }
1051  {
1052  SOP_Node *thissop = cookparms.getNode();
1053  if (!thissop) return getUseMaxInitialRotation();
1054  bool result;
1055  OP_Utils::evalOpParm(result, thissop, "usemaxinitialrotation", cookparms.getCookTime(), 0);
1056  return result;
1057  }
1058  fpreal64 getMaxInitialRotation() const { return myMaxInitialRotation; }
1059  void setMaxInitialRotation(fpreal64 val) { myMaxInitialRotation = val; }
1061  {
1062  SOP_Node *thissop = cookparms.getNode();
1063  if (!thissop) return getMaxInitialRotation();
1064  fpreal64 result;
1065  OP_Utils::evalOpParm(result, thissop, "maxinitialrotation", cookparms.getCookTime(), 0);
1066  return result;
1067  }
1068  fpreal64 getMaxTurnRate() const { return myMaxTurnRate; }
1069  void setMaxTurnRate(fpreal64 val) { myMaxTurnRate = val; }
1071  {
1072  SOP_Node *thissop = cookparms.getNode();
1073  if (!thissop) return getMaxTurnRate();
1074  fpreal64 result;
1075  OP_Utils::evalOpParm(result, thissop, "maxturnrate", cookparms.getCookTime(), 0);
1076  return result;
1077  }
1078  bool getConstrainTurnAccel() const { return myConstrainTurnAccel; }
1079  void setConstrainTurnAccel(bool val) { myConstrainTurnAccel = val; }
1080  bool opConstrainTurnAccel(const SOP_NodeVerb::CookParms &cookparms) const
1081  {
1082  SOP_Node *thissop = cookparms.getNode();
1083  if (!thissop) return getConstrainTurnAccel();
1084  bool result;
1085  OP_Utils::evalOpParm(result, thissop, "constrainturnaccel", cookparms.getCookTime(), 0);
1086  return result;
1087  }
1088  fpreal64 getTurnStiffness() const { return myTurnStiffness; }
1089  void setTurnStiffness(fpreal64 val) { myTurnStiffness = val; }
1091  {
1092  SOP_Node *thissop = cookparms.getNode();
1093  if (!thissop) return getTurnStiffness();
1094  fpreal64 result;
1095  OP_Utils::evalOpParm(result, thissop, "turnstiffness", cookparms.getCookTime(), 0);
1096  return result;
1097  }
1098  fpreal64 getTurnDamping() const { return myTurnDamping; }
1099  void setTurnDamping(fpreal64 val) { myTurnDamping = val; }
1101  {
1102  SOP_Node *thissop = cookparms.getNode();
1103  if (!thissop) return getTurnDamping();
1104  fpreal64 result;
1105  OP_Utils::evalOpParm(result, thissop, "turndamping", cookparms.getCookTime(), 0);
1106  return result;
1107  }
1108  fpreal64 getGoalPosWeight() const { return myGoalPosWeight; }
1109  void setGoalPosWeight(fpreal64 val) { myGoalPosWeight = val; }
1111  {
1112  SOP_Node *thissop = cookparms.getNode();
1113  if (!thissop) return getGoalPosWeight();
1114  fpreal64 result;
1115  OP_Utils::evalOpParm(result, thissop, "goalposweight", cookparms.getCookTime(), 0);
1116  return result;
1117  }
1118  GoalPos getGoalPos() const { return GoalPos(myGoalPos); }
1119  void setGoalPos(GoalPos val) { myGoalPos = int64(val); }
1121  {
1122  SOP_Node *thissop = cookparms.getNode();
1123  if (!thissop) return getGoalPos();
1124  int64 result;
1125  OP_Utils::evalOpParm(result, thissop, "goalpos", cookparms.getCookTime(), 0);
1126  return GoalPos(result);
1127  }
1128  fpreal64 getDistanceVariance() const { return myDistanceVariance; }
1129  void setDistanceVariance(fpreal64 val) { myDistanceVariance = val; }
1131  {
1132  SOP_Node *thissop = cookparms.getNode();
1133  if (!thissop) return getDistanceVariance();
1134  fpreal64 result;
1135  OP_Utils::evalOpParm(result, thissop, "distancevariance", cookparms.getCookTime(), 0);
1136  return result;
1137  }
1138  bool getAddCollisionPointGroup() const { return myAddCollisionPointGroup; }
1139  void setAddCollisionPointGroup(bool val) { myAddCollisionPointGroup = val; }
1141  {
1142  SOP_Node *thissop = cookparms.getNode();
1143  if (!thissop) return getAddCollisionPointGroup();
1144  bool result;
1145  OP_Utils::evalOpParm(result, thissop, "addcollisionptgroup", cookparms.getCookTime(), 0);
1146  return result;
1147  }
1148  const UT_StringHolder & getCollisionPointGroup() const { return myCollisionPointGroup; }
1149  void setCollisionPointGroup(const UT_StringHolder & val) { myCollisionPointGroup = val; }
1151  {
1152  SOP_Node *thissop = cookparms.getNode();
1153  if (!thissop) return getCollisionPointGroup();
1155  OP_Utils::evalOpParm(result, thissop, "collisionptgroup", cookparms.getCookTime(), 0);
1156  return result;
1157  }
1158  fpreal64 getTimestep() const { return myTimestep; }
1159  void setTimestep(fpreal64 val) { myTimestep = val; }
1161  {
1162  SOP_Node *thissop = cookparms.getNode();
1163  if (!thissop) return getTimestep();
1164  fpreal64 result;
1165  OP_Utils::evalOpParm(result, thissop, "timestep", cookparms.getCookTime(), 0);
1166  return result;
1167  }
1168  bool getUseStartTime() const { return myUseStartTime; }
1169  void setUseStartTime(bool val) { myUseStartTime = val; }
1170  bool opUseStartTime(const SOP_NodeVerb::CookParms &cookparms) const
1171  {
1172  SOP_Node *thissop = cookparms.getNode();
1173  if (!thissop) return getUseStartTime();
1174  bool result;
1175  OP_Utils::evalOpParm(result, thissop, "usestarttime", cookparms.getCookTime(), 0);
1176  return result;
1177  }
1178  fpreal64 getStartTime() const { return myStartTime; }
1179  void setStartTime(fpreal64 val) { myStartTime = val; }
1181  {
1182  SOP_Node *thissop = cookparms.getNode();
1183  if (!thissop) return getStartTime();
1184  fpreal64 result;
1185  OP_Utils::evalOpParm(result, thissop, "starttime", cookparms.getCookTime(), 0);
1186  return result;
1187  }
1188  bool getUseEndTime() const { return myUseEndTime; }
1189  void setUseEndTime(bool val) { myUseEndTime = val; }
1190  bool opUseEndTime(const SOP_NodeVerb::CookParms &cookparms) const
1191  {
1192  SOP_Node *thissop = cookparms.getNode();
1193  if (!thissop) return getUseEndTime();
1194  bool result;
1195  OP_Utils::evalOpParm(result, thissop, "useendtime", cookparms.getCookTime(), 0);
1196  return result;
1197  }
1198  fpreal64 getEndTime() const { return myEndTime; }
1199  void setEndTime(fpreal64 val) { myEndTime = val; }
1201  {
1202  SOP_Node *thissop = cookparms.getNode();
1203  if (!thissop) return getEndTime();
1204  fpreal64 result;
1205  OP_Utils::evalOpParm(result, thissop, "endtime", cookparms.getCookTime(), 0);
1206  return result;
1207  }
1208  UT_Vector3D getReferenceUp() const { return myReferenceUp; }
1209  void setReferenceUp(UT_Vector3D val) { myReferenceUp = val; }
1211  {
1212  SOP_Node *thissop = cookparms.getNode();
1213  if (!thissop) return getReferenceUp();
1215  OP_Utils::evalOpParm(result, thissop, "refup", cookparms.getCookTime(), 0);
1216  return result;
1217  }
1218 
1219 private:
1220  UT_StringHolder myGroup;
1221  bool myEnableAvoidance;
1222  fpreal64 myMaxCollisionTime;
1223  bool myEnableNeighbors;
1224  fpreal64 myNeighborDistance;
1225  int64 myMaxNeighbors;
1226  bool myEnableObstacles;
1227  fpreal64 myObstacleDistance;
1228  fpreal64 myObstaclePadding;
1229  fpreal64 myHorizontalFOV;
1230  fpreal64 myVerticalFOV;
1231  int64 myFOVSamples;
1232  fpreal64 myFOVSeed;
1233  int64 mySteeringMode;
1234  fpreal64 myTurnSpeedThreshold;
1235  bool myUseMaxInitialRotation;
1236  fpreal64 myMaxInitialRotation;
1237  fpreal64 myMaxTurnRate;
1238  bool myConstrainTurnAccel;
1239  fpreal64 myTurnStiffness;
1240  fpreal64 myTurnDamping;
1241  fpreal64 myGoalPosWeight;
1242  int64 myGoalPos;
1243  fpreal64 myDistanceVariance;
1244  bool myAddCollisionPointGroup;
1245  UT_StringHolder myCollisionPointGroup;
1246  fpreal64 myTimestep;
1247  bool myUseStartTime;
1248  fpreal64 myStartTime;
1249  bool myUseEndTime;
1250  fpreal64 myEndTime;
1251  UT_Vector3D myReferenceUp;
1252 
1253 };
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:62
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
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:613
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
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:296
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:277
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:92
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
#define SOP_API
Definition: SOP_API.h:10
bool opUseMaxInitialRotation(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
fpreal64 opTurnSpeedThreshold(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
Definition: UT_String.h:1395
#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
Definition: core.h:1131
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
type
Definition: core.h:1059
static void saveData(std::ostream &os, UT_Matrix4D v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
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