HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SOP_Edit.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SOP Library (C++)
7  *
8  * COMMENTS: The Edit SOP, which works in conjunction with the
9  * Edit State and the GDT classes.
10  *
11  */
12 
13 #ifndef __SOP_Edit_h__
14 #define __SOP_Edit_h__
15 
16 #include "SOP_API.h"
17 
18 #include "SOP_BrushBase.h"
19 
21 #include <UT/UT_PointTree.h>
22 
23 class PRM_MenuEntry;
25 
26 enum {
27  // Group parameters
28  SOP_EDIT_GRP_IDX, // = SOP_GDT_GRP_IDX,
30 
32 #define SOP_EDIT_NUM_EDIT_PARMS (3)
33 #define SOP_EDIT_NUM_SCULPT_PARMS (1)
34 
35  // Main Transform/Peak Switcher
37 
38  // Transform parameters
39 #define SOP_EDIT_NUM_TRANSFORM_PARMS (12)
47 #define SOP_EDIT_NUM_PIVOTXFORM_PARMS (2)
51 #define SOP_EDIT_NUM_PREXFORM_PARMS (6)
62 
63  // Peak Parameters
64 #define SOP_EDIT_NUM_PEAK_PARMS (2)
67 
68  // Commit Button
70 
71  // Soft Parameters
73 
74 #define SOP_EDIT_NUM_SOFT_PARMS (6)
81 
82 // SCULPT parameters
83 
84  // Group parameters
86 
87 #define SOP_EDIT_SCULPT_NUM_DEFORM_PARMS (8)
98 
99 #define SOP_EDIT_SCULPT_NUM_NIB_PARMS (18)
118 
119 #define SOP_EDIT_SCULPT_NUM_RAY_PARMS (10)
130 
132 
133  // Symmetry Parameters
140 
142 
143  // Reset Button
145 };
146 
148 {
149 friend class MSS_EditState;
150 public:
151  SOP_Edit(OP_Network *net, const char *name, OP_Operator *entry);
152  virtual ~SOP_Edit();
153 
154  virtual int isRefInput(unsigned int i) const override;
155  virtual void unloadDataHack() override;
156  virtual bool unloadData() override;
157 
158  // Allow toggling of operation type
159  void toggleXformPeak();
160 
161  virtual bool updateParmsFlags() override;
162 
163  static OP_Node *myConstructor(OP_Network *net,
164  const char *name,
165  OP_Operator *entry);
166 
167  static PRM_Template myTemplateList[];
168  static PRM_Template myObsoleteList[];
169 
170  // Get the selection group string:
171  // We have to override this since the parameter's index has changed
172  virtual void getSelString(UT_String &str) override
173  { evalString(str, SOP_EDIT_GRP_IDX, 0, 0.0); }
174 
175  virtual void setAccumulateStencil(bool yesno) override
176  {
178  }
179  virtual void setRayOrigin(const UT_Vector3 &orig, fpreal t) override
180  {
184  }
185  virtual void setRayOrientation(const UT_Vector3 &orient, fpreal t) override
186  {
187  setFloat(SOP_EDIT_SCULPT_RAY_ORIENT_IDX, 0, t, orient.x());
188  setFloat(SOP_EDIT_SCULPT_RAY_ORIENT_IDX, 1, t, orient.y());
189  setFloat(SOP_EDIT_SCULPT_RAY_ORIENT_IDX, 2, t, orient.z());
190  }
191  virtual void setHitPrimitive(int primidx, fpreal t) override
192  {
193  setInt(SOP_EDIT_SCULPT_RAY_HITPRIM_IDX, 0, t, primidx);
194  }
195  virtual void setHitPoint(int pt, fpreal t) override
196  {
198  }
199  virtual void setHitUVW(fpreal u, fpreal v, fpreal w, fpreal t) override
200  {
204  }
205  virtual void setHitPressure(fpreal p, fpreal t) override
206  {
208  }
209  virtual void setRadius(fpreal r, fpreal t) override
210  {
212  }
213  virtual void setUVRadius(fpreal r, fpreal t) override
214  {
216  }
217  virtual void setBrushEvent(SOP_BrushEvent event) override
218  {
219  setInt(SOP_EDIT_SCULPT_RAY_EVENT_IDX, 0, 0, int(event));
220  }
221  virtual void setBrushOp(SOP_BrushOp op) override
222  {
223  int iop;
224  switch (op)
225  {
226  case SOP_BRUSHOP_SMOOTH: iop = 1; break;
227  case SOP_BRUSHOP_SMOOTHDEFORM: iop = 2; break;
228  case SOP_BRUSHOP_ERASE: iop = 3; break;
229  case SOP_BRUSHOP_DEFORM:
230  default: iop = 0; break;
231  }
232  setInt(SOP_EDIT_SCULPT_OP_IDX, 0, 0, iop);
233  }
234  virtual void setBrushShape(SOP_BrushShape shape) override
235  {
236  setInt(SOP_EDIT_SCULPT_SHAPE_IDX, 0, 0, int(shape));
237  }
238  virtual void setProjectionType(int projtype) override
239  {
240  setInt(SOP_EDIT_SCULPT_PROJTYPE_IDX, 0, 0, projtype);
241  }
242  virtual void useForegroundColor() override
243  {
245  }
246  virtual void useBackgroundColor() override
247  {
249  }
250 
251  virtual int altersGeometry() const override { return 1; }
252  virtual int altersColor() const override { return 0; }
253 
254  int MODE()
255  { return evalInt(SOP_EDIT_MODESWITCHER_IDX, 0, 0); }
256  virtual fpreal RAWRADIUS(fpreal t) override
257  { return evalFloat(SOP_EDIT_SCULPT_RAD_IDX, 0, t); }
258  virtual fpreal RAWUVRADIUS(fpreal t) override
259  { return evalFloat(SOP_EDIT_SCULPT_UVRAD_IDX, 0, t); }
260  virtual fpreal RADIUSPRESSURE(fpreal t) override
261  { return evalFloat(SOP_EDIT_SCULPT_RADPRESSURE_IDX, 0, t); }
262  virtual fpreal RAWOPACITY(fpreal t) override
263  {return evalFloat(SOP_EDIT_SCULPT_OPAC_IDX, 0, t); }
264  virtual fpreal OPACITYPRESSURE(fpreal t) override
266 
268  { return evalInt("modeswitcher", 0, t); }
269 
270  virtual SOP_BrushOp OP() override
271  {
272  switch (evalInt(SOP_EDIT_SCULPT_OP_IDX, 0, 0))
273  {
274  case 0: return SOP_BRUSHOP_DEFORM;
275  case 1: return SOP_BRUSHOP_SMOOTH;
276  case 2: return SOP_BRUSHOP_SMOOTHDEFORM;
277  case 3: return SOP_BRUSHOP_ERASE;
278  default: return SOP_BRUSHOP_DEFORM;
279  }
280  }
281  virtual int ACCUMSTENCIL() override
283  virtual int PROJECTIONTYPE() override
284  { return evalInt(SOP_EDIT_SCULPT_PROJTYPE_IDX, 0, 0); }
285  virtual int REALTIME() override
286  { return evalInt(SOP_EDIT_SCULPT_REALTIME_IDX, 0, 0); }
287  virtual int SHAPE(fpreal t) override
288  { return evalInt(SOP_EDIT_SCULPT_SHAPE_IDX, 0, t); }
289 
290  virtual OP_ERROR cookInputGroups(OP_Context &context,
291  int alone = 0) override;
292 
293  virtual void getXformOrder(UT_XformOrder &xord,
294  const CH_Channel *chp) const override;
295 
296  virtual void resolveObsoleteParms(
297  PRM_ParmList *obsolete_parms) override;
298 
299  // This will force myRayIntersect to be recomputed
300  void clearRayIntersect();
301 
302  virtual void beginNewOperation() override;
303  virtual void clearAllDeltas(fpreal t) override;
304 
305  // Functions for the BlendShapes SOP hack to only apply scaled deltas
306  // without cooking
307  void applyScaledDeltas(
308  GEO_Detail &apply_gdp,
309  const GDT_CoordinateFrames *coord_frames,
310  float scale,
311  const GA_PointGroup *ptgroup);
312 
313  bool getCookedFlag() const { return myCookedFlag; }
314 
315  void setUseOrient(bool f)
316  { setInt(SOP_EDIT_USEORIENT_IDX, 0, 0, f ? 1 : 0); }
317 
318  bool hasChange(fpreal t);
319 
320  virtual const GA_PrimitiveGroup *getPrimitiveSelection() const override
321  { return myPrimitiveGroup; }
322 
323  virtual void setVisualization(int val) override;
324 
325  // An enum by which functions can report actions taken regarding a
326  // particular attribute.
328  {
329  NO_CHANGE, CHANGED_EXISTING, REPLACED_EXISTING, ADDED_MISSING
330  };
331 
332 
333 protected:
334  // Helper class for avoiding evaluating mirror parameters multiple times
335  // during a cook.
337  {
338  public:
341  float myDistance;
342  float myPlaneTol;
345  };
346 
347  void clearTransformParms();
348  virtual OP_ERROR cookMySop(OP_Context &context) override;
349  virtual const char *inputLabel(unsigned idx) const override;
350 
351  virtual void rollbackCurrentDelta() override;
352  void mirrorDelta(MirrorParmCache &cache);
353  virtual void applyAndClearCurrentDelta() override;
354  virtual void applyPermanentDelta() override;
355  virtual void initializeInput(OP_Context &context);
356 
357  virtual bool getGroupCentroid(OP_Context &context,
358  UT_Vector3 &centroid) override;
359 
360  virtual void doErase() override;
361 
362  // This function takes the transform parameters and modifies the gdp
363  // pointer, while creating the appropriate deltas in myCurrentDelta.
364  // It is virtual so that HDK classes may hook into this.
365  virtual void doTransform(MirrorParmCache &mirror_cache,
366  AttribAction &falloff_action);
367 
368  virtual int MERGEMODE() override { return 0; }
369  virtual void SCRIPT(UT_String &, fpreal) override {}
370 
371  virtual int AXIS() override
372  { return evalInt(SOP_EDIT_SCULPT_AXIS_IDX, 0, 0); }
373  virtual fpreal USERX(fpreal t) override
374  { return evalFloat(SOP_EDIT_SCULPT_USER_IDX, 0, t); }
375  virtual fpreal USERY(fpreal t) override
376  { return evalFloat(SOP_EDIT_SCULPT_USER_IDX, 1, t); }
377  virtual fpreal USERZ(fpreal t) override
378  { return evalFloat(SOP_EDIT_SCULPT_USER_IDX, 2, t); }
379 
380  virtual fpreal RAYORIENTX(fpreal t) override
381  { return evalFloat(SOP_EDIT_SCULPT_RAY_ORIENT_IDX,0,t); }
382  virtual fpreal RAYORIENTY(fpreal t) override
383  { return evalFloat(SOP_EDIT_SCULPT_RAY_ORIENT_IDX,1,t); }
384  virtual fpreal RAYORIENTZ(fpreal t) override
385  { return evalFloat(SOP_EDIT_SCULPT_RAY_ORIENT_IDX,2,t); }
386  virtual fpreal RAYHITX(fpreal t) override
387  { return evalFloat(SOP_EDIT_SCULPT_RAY_HITPOS_IDX,0,t); }
388  virtual fpreal RAYHITY(fpreal t) override
389  { return evalFloat(SOP_EDIT_SCULPT_RAY_HITPOS_IDX,1,t); }
390  virtual fpreal RAYHITZ(fpreal t) override
391  { return evalFloat(SOP_EDIT_SCULPT_RAY_HITPOS_IDX,2,t); }
392  virtual fpreal RAYHITU(fpreal t) override
393  { return evalFloat(SOP_EDIT_SCULPT_RAY_HITUVW_IDX, 0,t); }
394  virtual fpreal RAYHITV(fpreal t) override
395  { return evalFloat(SOP_EDIT_SCULPT_RAY_HITUVW_IDX, 1,t); }
396  virtual fpreal RAYHITW(fpreal t) override
397  { return evalFloat(SOP_EDIT_SCULPT_RAY_HITUVW_IDX, 2,t); }
398  virtual fpreal RAYHITPRESSURE(fpreal t) override
399  { return evalFloat(SOP_EDIT_SCULPT_RAY_HITPRESSURE_IDX, 0, t); }
400  virtual int PRIMHIT(fpreal t) override
401  { return evalInt(SOP_EDIT_SCULPT_RAY_HITPRIM_IDX, 0,t); }
402  virtual int PTHIT(fpreal t) override
403  { return evalInt(SOP_EDIT_SCULPT_RAY_HITPT_IDX, 0, t); }
404  virtual int EVENT() override
405  { return evalInt(SOP_EDIT_SCULPT_RAY_EVENT_IDX, 0,0); }
406  virtual bool USE_FOREGROUND() override
407  { return evalInt(SOP_EDIT_SCULPT_COLOR_SWITCHER_IDX,
408  0, 0) == 0; }
409  virtual fpreal FGR(fpreal t) override { return evalFloat(SOP_EDIT_SCULPT_FG_IDX, 0, t); }
410  virtual fpreal FGG(fpreal ) override { return 0.0; }
411  virtual fpreal FGB(fpreal ) override { return 0.0; }
412  virtual fpreal BGR(fpreal t) override { return evalFloat(SOP_EDIT_SCULPT_BG_IDX, 0, t); }
413  virtual fpreal BGG(fpreal ) override { return 0.0; }
414  virtual fpreal BGB(fpreal ) override { return 0.0; }
415 
416  virtual fpreal SOFTEDGE(fpreal t) override
417  { return evalFloat(SOP_EDIT_SCULPT_SOFTEDGE_IDX, 0, t); }
418  virtual void KERNEL(UT_String &str, fpreal t) override
419  { evalString(str, SOP_EDIT_SCULPT_KERNEL_IDX, 0, t); }
420  virtual int UPTYPE(fpreal t) override
421  { return evalInt(SOP_EDIT_SCULPT_UPTYPE_IDX, 0, t);}
422  virtual fpreal UPX(fpreal t) override
423  { return evalFloat(SOP_EDIT_SCULPT_UPVECTOR_IDX, 0, t);}
424  virtual fpreal UPY(fpreal t) override
425  { return evalFloat(SOP_EDIT_SCULPT_UPVECTOR_IDX, 1, t);}
426  virtual fpreal UPZ(fpreal t) override
427  { return evalFloat(SOP_EDIT_SCULPT_UPVECTOR_IDX, 2, t);}
428 
429  virtual fpreal PAPERNOISE(fpreal t) override
430  { return evalFloat(SOP_EDIT_SCULPT_PAPER_IDX, 0, t);}
431  virtual fpreal SPLATTER(fpreal t) override
432  { return evalFloat(SOP_EDIT_SCULPT_SPLATTER_IDX, 0, t); }
433  virtual void BITMAP(UT_String &str, fpreal t) override
434  { evalString(str, SOP_EDIT_SCULPT_BITMAP_IDX, 0, t); }
435  virtual int BITMAPCHAN(fpreal t) override
436  { return evalInt(SOP_EDIT_SCULPT_BITMAPCHAN_IDX, 0, t); }
437  virtual fpreal ANGLE(fpreal t) override
438  { return evalFloat(SOP_EDIT_SCULPT_ANGLE_IDX, 0, t); }
439  virtual fpreal SQUASH(fpreal t) override
440  { return evalFloat(SOP_EDIT_SCULPT_SQUASH_IDX, 0, t); }
441 
442  virtual int DOSTAMPING() override { return 0; }
443  virtual int WRITEALPHA() override { return 0; }
444  virtual int OVERRIDECD() override { return 0; }
445  virtual void CDNAME(UT_String &, fpreal) override { }
446  virtual int OVERRIDEALPHA() override { return 0; }
447  virtual void ALPHANAME(UT_String &, fpreal) override { }
448  virtual int OVERRIDENML() override { return 0; }
449  virtual void NMLNAME(UT_String & /*str*/, fpreal /*t*/) override {}
450  virtual int ADDATTRIB() override { return 0; }
451 
452  virtual fpreal SYMMETRYDIRX(fpreal /*t*/) override { return 0.0; }
453  virtual fpreal SYMMETRYDIRY(fpreal /*t*/) override { return 0.0; }
454  virtual fpreal SYMMETRYDIRZ(fpreal /*t*/) override { return 0.0; }
455  virtual fpreal SYMMETRYORIGX(fpreal /*t*/) override { return 0.0; }
456  virtual fpreal SYMMETRYORIGY(fpreal /*t*/) override { return 0.0; }
457  virtual fpreal SYMMETRYORIGZ(fpreal /*t*/) override { return 0.0; }
458  virtual int DOREFLECTION() override { return 0; }
459  virtual int DOPOINTREFLECTION() override { return 0; }
460  virtual int DOROTATION() override { return 0; }
461  virtual int SYMMETRYROT(fpreal /*t*/) override { return 0; }
462  virtual fpreal SYMMETRYDIST(fpreal /*t*/) override { return 0.0; }
463  virtual int DOUVREFLECTION() override { return 0; }
464  virtual fpreal SYMMETRYUVORIGU(fpreal /*t*/) override { return 0.0; }
465  virtual fpreal SYMMETRYUVORIGV(fpreal /*t*/) override { return 0.0; }
466  virtual fpreal SYMMETRYUVANGLE(fpreal /*t*/) override { return 0.0;}
467 
468  virtual int USECONNECTIVITY() override
469  { return evalInt(SOP_EDIT_SCULPT_USECONNECTIVITY_IDX, 0, 0); }
470  virtual int USEDEPTH() override
471  { return evalInt(SOP_EDIT_SCULPT_USEDEPTH_IDX, 0, 0); }
472  virtual fpreal DEPTH(fpreal t) override
473  { return evalFloat(SOP_EDIT_SCULPT_DEPTH_IDX, 0, t); }
474  virtual fpreal HEIGHT(fpreal t) override
475  { return evalFloat(SOP_EDIT_SCULPT_DEPTH_IDX, 1, t); }
476 
477 
478  // Find out if the brush has moved or done anything to cause us to add its
479  // effect to the current gdp.
480  virtual bool hasStrokeChanged(fpreal t) override;
481  virtual bool hasStyleChanged(fpreal t) override;
482 
483  // Find if the nib file has changed:
484  virtual bool hasNibFileChanged(fpreal t) override;
485  virtual bool hasAccumStencilChanged(fpreal t) override;
486  virtual bool hasNibLookChanged(fpreal t) override;
487 
488  // Do we want our cook selection to be updated and displayed?
489  virtual bool wantsCookSelection() const override { return true; }
490 
492  { return &myCoordinateFrames; }
493 
494  virtual const GA_PointGroup *getPointGroup() override { return myPointGroup; }
495  virtual const GA_Group *getGroup() { return myGroup; }
496 
497  virtual void syncNodeVersion(const char *old_version,
498  const char *cur_version,
499  bool *node_deleted) override;
500 
501 private: // methods
502 
503  // Selection
504  int GRPTYPE(fpreal t) const
505  { return evalInt(SOP_EDIT_GRPTYPE_IDX, 0, t); }
506 
507  // Access to switcher parm
508  int SWITCHER(fpreal t) const
509  { return evalInt(SOP_EDIT_SWITCHER_IDX, 0, t); }
510  void SET_SWITCHER(int i)
511  { setInt(SOP_EDIT_SWITCHER_IDX, 0, 0, i); }
512 
513  // Transform
514  int TRS(fpreal t) const
515  { return evalInt(SOP_EDIT_TRS_IDX, 0, t); }
516  int XYZ(fpreal t) const
517  { return evalInt(SOP_EDIT_XYZ_IDX, 0, t); }
518  fpreal TX(fpreal t) const { return evalFloat(SOP_EDIT_T_IDX, 0, t); }
519  fpreal TY(fpreal t) const { return evalFloat(SOP_EDIT_T_IDX, 1, t); }
520  fpreal TZ(fpreal t) const { return evalFloat(SOP_EDIT_T_IDX, 2, t); }
521  fpreal RX(fpreal t) const { return evalFloat(SOP_EDIT_R_IDX, 0, t); }
522  fpreal RY(fpreal t) const { return evalFloat(SOP_EDIT_R_IDX, 1, t); }
523  fpreal RZ(fpreal t) const { return evalFloat(SOP_EDIT_R_IDX, 2, t); }
524  fpreal SX(fpreal t) const { return evalFloat(SOP_EDIT_S_IDX, 0, t); }
525  fpreal SY(fpreal t) const { return evalFloat(SOP_EDIT_S_IDX, 1, t); }
526  fpreal SZ(fpreal t) const { return evalFloat(SOP_EDIT_S_IDX, 2, t); }
527  fpreal SHEAR_XY(fpreal t) const
528  { return evalFloat(SOP_EDIT_SHEAR_IDX, 0, t); }
529  fpreal SHEAR_XZ(fpreal t) const
530  { return evalFloat(SOP_EDIT_SHEAR_IDX, 1, t); }
531  fpreal SHEAR_YZ(fpreal t) const
532  { return evalFloat(SOP_EDIT_SHEAR_IDX, 2, t); }
533  fpreal PX(fpreal t) const { return evalFloat(SOP_EDIT_P_IDX, 0, t); }
534  void SET_PX(fpreal f) { setFloat(SOP_EDIT_P_IDX, 0, 0, f); }
535  fpreal PY(fpreal t) const { return evalFloat(SOP_EDIT_P_IDX, 1, t); }
536  void SET_PY(fpreal f) { setFloat(SOP_EDIT_P_IDX, 1, 0, f); }
537  fpreal PZ(fpreal t) const { return evalFloat(SOP_EDIT_P_IDX, 2, t); }
538  void SET_PZ(fpreal f) { setFloat(SOP_EDIT_P_IDX, 2, 0, f); }
539  fpreal PRX(fpreal t) const { return evalFloat(SOP_EDIT_PR_IDX, 0,t); }
540  fpreal PRY(fpreal t) const { return evalFloat(SOP_EDIT_PR_IDX, 1,t); }
541  fpreal PRZ(fpreal t) const { return evalFloat(SOP_EDIT_PR_IDX, 2,t); }
542  int PREXFORM_TRS(fpreal t) const
543  { return evalInt(SOP_EDIT_PREXFORM_TRS_IDX, 0, t); }
544  int PREXFORM_XYZ(fpreal t) const
545  { return evalInt(SOP_EDIT_PREXFORM_XYZ_IDX, 0, t); }
546  fpreal PREXFORM_TX(fpreal t) const
547  { return evalFloat(SOP_EDIT_PREXFORM_T_IDX, 0, t); }
548  fpreal PREXFORM_TY(fpreal t) const
549  { return evalFloat(SOP_EDIT_PREXFORM_T_IDX, 1, t); }
550  fpreal PREXFORM_TZ(fpreal t) const
551  { return evalFloat(SOP_EDIT_PREXFORM_T_IDX, 2, t); }
552  fpreal PREXFORM_RX(fpreal t) const
553  { return evalFloat(SOP_EDIT_PREXFORM_R_IDX, 0, t); }
554  fpreal PREXFORM_RY(fpreal t) const
555  { return evalFloat(SOP_EDIT_PREXFORM_R_IDX, 1, t); }
556  fpreal PREXFORM_RZ(fpreal t) const
557  { return evalFloat(SOP_EDIT_PREXFORM_R_IDX, 2, t); }
558  fpreal PREXFORM_SX(fpreal t) const
559  { return evalFloat(SOP_EDIT_PREXFORM_S_IDX, 0, t); }
560  fpreal PREXFORM_SY(fpreal t) const
561  { return evalFloat(SOP_EDIT_PREXFORM_S_IDX, 1, t); }
562  fpreal PREXFORM_SZ(fpreal t) const
563  { return evalFloat(SOP_EDIT_PREXFORM_S_IDX, 2, t); }
564  fpreal PREXFORM_SHEAR_XY(fpreal t) const
565  { return evalFloat(SOP_EDIT_PREXFORM_SHEAR_IDX, 0, t); }
566  fpreal PREXFORM_SHEAR_XZ(fpreal t) const
567  { return evalFloat(SOP_EDIT_PREXFORM_SHEAR_IDX, 1, t); }
568  fpreal PREXFORM_SHEAR_YZ(fpreal t) const
569  { return evalFloat(SOP_EDIT_PREXFORM_SHEAR_IDX, 2, t); }
570  int KEEP(fpreal t) const
571  { return evalInt(SOP_EDIT_KEEP_IDX, 0, t); }
572  bool LOCALSPACE(fpreal t) const
573  { return evalInt( SOP_EDIT_LOCALSPACE_IDX, 0, t) == 1; }
574 
575  fpreal LOCAL_UPX(fpreal t) const
576  { return evalFloat(SOP_EDIT_LOCALSPACEUPVECTOR_IDX, 0, t); }
577  fpreal LOCAL_UPY(fpreal t) const
578  { return evalFloat(SOP_EDIT_LOCALSPACEUPVECTOR_IDX, 1, t); }
579  fpreal LOCAL_UPZ(fpreal t) const
580  { return evalFloat(SOP_EDIT_LOCALSPACEUPVECTOR_IDX, 2, t); }
581  bool SLIDEONSURFACE(fpreal t) const
582  { return evalInt( SOP_EDIT_SLIDEONSURFACE_IDX, 0, t) == 1; }
583 
584  // Peak
585  fpreal DIST(fpreal t) const
586  { return evalFloat(SOP_EDIT_DIST_IDX, 0, t); }
587  int LEADNML(fpreal t) const
588  { return evalInt(SOP_EDIT_LEADNML_IDX, 0, t); }
589 
590  // Soft
591  fpreal SOFTRADIUS(fpreal t) const
592  { return evalFloat(SOP_EDIT_SOFTRADIUS_IDX, 0, t); }
593  int SOFTTYPE(fpreal t) const
594  { return evalInt(SOP_EDIT_SOFTTYPE_IDX, 0, t); }
595  fpreal TANDEG0(fpreal t) const
596  { return evalFloat(SOP_EDIT_TANGENT_IDX, 0, t); }
597  fpreal TANDEG1(fpreal t) const
598  { return evalFloat(SOP_EDIT_TANGENT_IDX, 1, t); }
599  void EDIT_KERNEL(UT_String &str, fpreal t)
600  { evalString(str, SOP_EDIT_KERNEL_IDX, 0, t); }
601  int DIST_METRIC(fpreal t) const
602  { return evalInt(SOP_EDIT_DIST_METRIC_IDX, 0, t); }
603  int VISUALIZE_FALLOFF(fpreal t) const
604  { return evalInt(SOP_EDIT_VISFALLOFF_IDX, 0, t); }
605  bool falloffAttributeRequested(fpreal t) const;
606 
607  bool USEORIENT(fpreal t) const
608  { return evalInt(SOP_EDIT_USEORIENT_IDX, 0, t) != 0; }
609 
610  // Symmetry
611  bool USEMIRROR(fpreal t) const
612  { return evalInt(SOP_EDIT_USEMIRROR_IDX, 0, t) != 0; }
613  fpreal SYMMETRYAXISX(fpreal t) const
614  { return evalFloat(SOP_EDIT_SYMMETRYAXIS_IDX, 0, t); }
615  fpreal SYMMETRYAXISY(fpreal t) const
616  { return evalFloat(SOP_EDIT_SYMMETRYAXIS_IDX, 1, t); }
617  fpreal SYMMETRYAXISZ(fpreal t) const
618  { return evalFloat(SOP_EDIT_SYMMETRYAXIS_IDX, 2, t); }
619  fpreal SYMMETRYORIGINX(fpreal t) const
620  { return evalFloat(SOP_EDIT_SYMMETRYORIGIN_IDX, 0, t); }
621  fpreal SYMMETRYORIGINY(fpreal t) const
622  { return evalFloat(SOP_EDIT_SYMMETRYORIGIN_IDX, 1, t); }
623  fpreal SYMMETRYORIGINZ(fpreal t) const
624  { return evalFloat(SOP_EDIT_SYMMETRYORIGIN_IDX, 2, t); }
625  fpreal SYMMETRYDISTANCE(fpreal t) const
626  { return evalFloat(SOP_EDIT_SYMMETRYDISTANCE_IDX, 0, t); }
627  fpreal SYMMETRYTHRESHOLD(fpreal t) const
628  { return evalFloat(SOP_EDIT_SYMMETRYTHRESHOLD_IDX, 0, t); }
629  fpreal SYMMETRYPLANETOL(fpreal t) const
630  { return evalFloat(SOP_EDIT_SYMMETRYPLANETOL_IDX, 0, t); }
631 
632  int UPDATENMLS(fpreal t) const
633  { return evalInt(SOP_EDIT_UPDATENMLS_IDX, 0, t); }
634 
635  void updateMirrorParmCache(MirrorParmCache &cache, fpreal t);
636  bool getSoftSymmetryParms(GEO_Detail::SoftSymmetryParms &symmetry,
637  MirrorParmCache &cache, fpreal t);
638 
639  // Transform / Peak
640  bool isTransform(fpreal t) const { return SWITCHER(t) == 0; }
641  bool isPeak(fpreal t) const { return SWITCHER(t) != 0; }
642  void doPeak(fpreal t, MirrorParmCache &mirror_cache,
643  AttribAction &falloff_action);
644 
645  // Soft-related methods
646  bool isSoft(fpreal t) const { return SOFTRADIUS(t) != 0.0; }
647 
648 private: // data
649 
650  UT_Vector3 myInitialCentroid;
651 
652  GDT_CoordinateFrames myCoordinateFrames;
653  bool myUsedOrient;
654  int myCurrentInputId;
655  int myCurrentGeoCookCount;
656  int myReferenceInputId;
657  int myReferenceGeoCookCount;
658  const GA_PrimitiveGroup *myPrimitiveGroup;
659  const GA_PointGroup *myPointGroup;
660  UT_String myPrimitiveClosureName;
661  UT_String myPointClosureName;
662 
663  bool myVisualizationFlag;
664  bool mySetFalloffOnLastCook;
665  bool myOverwroteInputFalloff;
666 
667  // cached data for soft transforms
668  GU_SurfaceDistanceCache* mySurfaceDistanceCache;
669 
670  // syncNodeVersion is called after resolveObsoleteParms, so we save what the
671  // value of IgnorePointConnectivity is in resolveObsoleteParms, then if we
672  // need to we use it in syncNodeVersion
673  bool myPreSoftDistanceMetric;
674 
675  exint myCachedInputUniqueId;
676  exint myCachedInputMetaCacheCount;
677 };
678 
679 #endif
virtual OP_ERROR cookInputGroups(OP_Context &context, int alone=0)
virtual fpreal SYMMETRYUVANGLE(fpreal) override
Definition: SOP_Edit.h:466
virtual fpreal RADIUSPRESSURE(fpreal t) override
Definition: SOP_Edit.h:260
virtual bool updateParmsFlags()
virtual fpreal OPACITYPRESSURE(fpreal t) override
Definition: SOP_Edit.h:264
virtual bool wantsCookSelection() const override
Definition: SOP_Edit.h:489
virtual int OVERRIDEALPHA() override
Definition: SOP_Edit.h:446
virtual void setProjectionType(int projtype) override
Definition: SOP_Edit.h:238
virtual void ALPHANAME(UT_String &, fpreal) override
Definition: SOP_Edit.h:447
virtual fpreal HEIGHT(fpreal t) override
Definition: SOP_Edit.h:474
virtual int PTHIT(fpreal t) override
Definition: SOP_Edit.h:402
virtual fpreal SYMMETRYDIRX(fpreal) override
Definition: SOP_Edit.h:452
virtual int WRITEALPHA() override
Definition: SOP_Edit.h:443
virtual void setHitPressure(fpreal p, fpreal t) override
Definition: SOP_Edit.h:205
virtual fpreal FGG(fpreal) override
Definition: SOP_Edit.h:410
const GLdouble * v
Definition: glcorearb.h:836
virtual fpreal FGB(fpreal) override
Definition: SOP_Edit.h:411
virtual void setRayOrientation(const UT_Vector3 &orient, fpreal t) override
Definition: SOP_Edit.h:185
virtual int UPTYPE(fpreal t) override
Definition: SOP_Edit.h:420
virtual fpreal SYMMETRYDIRZ(fpreal) override
Definition: SOP_Edit.h:454
virtual const GA_Group * getGroup()
Definition: SOP_Edit.h:495
virtual void setAccumulateStencil(bool yesno) override
Definition: SOP_Edit.h:175
virtual int DOUVREFLECTION() override
Definition: SOP_Edit.h:463
virtual fpreal SYMMETRYORIGZ(fpreal) override
Definition: SOP_Edit.h:457
virtual void getXformOrder(UT_XformOrder &xord, const CH_Channel *chp) const
virtual int MERGEMODE() override
Definition: SOP_Edit.h:368
virtual int AXIS() override
Definition: SOP_Edit.h:371
virtual fpreal UPY(fpreal t) override
Definition: SOP_Edit.h:424
virtual fpreal DEPTH(fpreal t) override
Definition: SOP_Edit.h:472
fpreal evalFloat(int pi, int vi, fpreal t) const
UT_ErrorSeverity
Definition: UT_Error.h:25
virtual void setBrushShape(SOP_BrushShape shape) override
Definition: SOP_Edit.h:234
virtual void BITMAP(UT_String &str, fpreal t) override
Definition: SOP_Edit.h:433
virtual int PRIMHIT(fpreal t) override
Definition: SOP_Edit.h:400
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:581
virtual fpreal SYMMETRYUVORIGV(fpreal) override
Definition: SOP_Edit.h:465
virtual int PROJECTIONTYPE() override
Definition: SOP_Edit.h:283
virtual fpreal ANGLE(fpreal t) override
Definition: SOP_Edit.h:437
virtual fpreal RAYORIENTZ(fpreal t) override
Definition: SOP_Edit.h:384
virtual void clearAllDeltas(fpreal t)
virtual fpreal RAWOPACITY(fpreal t) override
Definition: SOP_Edit.h:262
virtual int ACCUMSTENCIL() override
Definition: SOP_Edit.h:281
png_uint_32 i
Definition: png.h:2877
virtual fpreal BGR(fpreal t) override
Definition: SOP_Edit.h:412
virtual fpreal RAWRADIUS(fpreal t) override
Definition: SOP_Edit.h:256
virtual int USECONNECTIVITY() override
Definition: SOP_Edit.h:468
bool getCookedFlag() const
Definition: SOP_Edit.h:313
virtual fpreal BGB(fpreal) override
Definition: SOP_Edit.h:414
struct _cl_event * event
Definition: glcorearb.h:2960
virtual fpreal RAYHITU(fpreal t) override
Definition: SOP_Edit.h:392
virtual void NMLNAME(UT_String &, fpreal) override
Definition: SOP_Edit.h:449
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:585
virtual int ADDATTRIB() override
Definition: SOP_Edit.h:450
GA_API const UT_StringHolder scale
GLfloat f
Definition: glcorearb.h:1925
int MODE()
Definition: SOP_Edit.h:254
virtual void setBrushEvent(SOP_BrushEvent event) override
Definition: SOP_Edit.h:217
virtual const GA_PrimitiveGroup * getPrimitiveSelection() const override
Definition: SOP_Edit.h:320
virtual fpreal FGR(fpreal t) override
Definition: SOP_Edit.h:409
virtual fpreal PAPERNOISE(fpreal t) override
Definition: SOP_Edit.h:429
virtual bool unloadData()
virtual int SHAPE(fpreal t) override
Definition: SOP_Edit.h:287
int64 exint
Definition: SYS_Types.h:109
virtual fpreal SYMMETRYDIRY(fpreal) override
Definition: SOP_Edit.h:453
virtual void useForegroundColor() override
Definition: SOP_Edit.h:242
void evalString(UT_String &val, int pi, int vi, fpreal t) const
virtual int BITMAPCHAN(fpreal t) override
Definition: SOP_Edit.h:435
virtual void useBackgroundColor() override
Definition: SOP_Edit.h:246
void setFloat(int parmi, int vectori, fpreal t, fpreal value, int h=0)
virtual void beginNewOperation()
virtual fpreal RAYORIENTY(fpreal t) override
Definition: SOP_Edit.h:382
virtual fpreal USERZ(fpreal t) override
Definition: SOP_Edit.h:377
virtual fpreal UPX(fpreal t) override
Definition: SOP_Edit.h:422
virtual void setHitPoint(int pt, fpreal t) override
Definition: SOP_Edit.h:195
virtual void getSelString(UT_String &str) override
Get the selection group string:
Definition: SOP_Edit.h:172
virtual fpreal SYMMETRYORIGY(fpreal) override
Definition: SOP_Edit.h:456
SOP_BrushOp
Definition: SOP_BrushBase.h:38
virtual int EVENT() override
Definition: SOP_Edit.h:404
virtual int OVERRIDECD() override
Definition: SOP_Edit.h:444
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual fpreal RAYHITPRESSURE(fpreal t) override
Definition: SOP_Edit.h:398
virtual void setBrushOp(SOP_BrushOp op) override
Definition: SOP_Edit.h:221
virtual void setRadius(fpreal r, fpreal t) override
Definition: SOP_Edit.h:209
GA_API const UT_StringHolder orient
GDT_CoordinateFrames * getCoordinateFrames()
Definition: SOP_Edit.h:491
virtual fpreal SYMMETRYUVORIGU(fpreal) override
Definition: SOP_Edit.h:464
virtual fpreal USERY(fpreal t) override
Definition: SOP_Edit.h:375
virtual void CDNAME(UT_String &, fpreal) override
Definition: SOP_Edit.h:445
virtual fpreal RAYHITV(fpreal t) override
Definition: SOP_Edit.h:394
virtual fpreal UPZ(fpreal t) override
Definition: SOP_Edit.h:426
virtual int altersColor() const override
Definition: SOP_Edit.h:252
virtual fpreal SPLATTER(fpreal t) override
Definition: SOP_Edit.h:431
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:583
double fpreal
Definition: SYS_Types.h:263
virtual bool USE_FOREGROUND() override
Definition: SOP_Edit.h:406
virtual fpreal SYMMETRYDIST(fpreal) override
Definition: SOP_Edit.h:462
bool inBrushMode(fpreal t)
Definition: SOP_Edit.h:267
virtual fpreal RAYHITY(fpreal t) override
Definition: SOP_Edit.h:388
virtual int DOROTATION() override
Definition: SOP_Edit.h:460
virtual int SYMMETRYROT(fpreal) override
Definition: SOP_Edit.h:461
virtual void resolveObsoleteParms(PRM_ParmList *)
virtual void setUVRadius(fpreal r, fpreal t) override
Definition: SOP_Edit.h:213
void setInt(int parmi, int vectori, fpreal t, exint value)
virtual fpreal SQUASH(fpreal t) override
Definition: SOP_Edit.h:439
virtual fpreal RAYHITW(fpreal t) override
Definition: SOP_Edit.h:396
virtual fpreal RAWUVRADIUS(fpreal t) override
Definition: SOP_Edit.h:258
GLuint GLfloat * val
Definition: glcorearb.h:1607
AttribAction
Definition: SOP_Edit.h:327
virtual int DOSTAMPING() override
Definition: SOP_Edit.h:442
bool myCookedFlag
Definition: SOP_GDT.h:113
#define SOP_API
Definition: SOP_API.h:10
virtual void setVisualization(int)
Definition: SOP_Node.h:835
virtual int USEDEPTH() override
Definition: SOP_Edit.h:470
void setUseOrient(bool f)
Definition: SOP_Edit.h:315
virtual int DOREFLECTION() override
Definition: SOP_Edit.h:458
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
virtual void setHitUVW(fpreal u, fpreal v, fpreal w, fpreal t) override
Definition: SOP_Edit.h:199
virtual const GA_PointGroup * getPointGroup() override
Definition: SOP_Edit.h:494
virtual int DOPOINTREFLECTION() override
Definition: SOP_Edit.h:459
virtual fpreal RAYORIENTX(fpreal t) override
Definition: SOP_Edit.h:380
virtual fpreal BGG(fpreal) override
Definition: SOP_Edit.h:413
exint evalInt(int pi, int vi, fpreal t) const
SOP_BrushEvent
Definition: SOP_BrushBase.h:30
GLboolean r
Definition: glcorearb.h:1221
virtual int OVERRIDENML() override
Definition: SOP_Edit.h:448
SOP_BrushShape
Definition: SOP_BrushBase.h:62
virtual int altersGeometry() const override
Definition: SOP_Edit.h:251
virtual SOP_BrushOp OP() override
Definition: SOP_Edit.h:270
virtual fpreal RAYHITZ(fpreal t) override
Definition: SOP_Edit.h:390
virtual void unloadDataHack()
Do not use this function! Using it will likely cause crashes.
virtual int isRefInput(unsigned idx) const
virtual void setHitPrimitive(int primidx, fpreal t) override
Definition: SOP_Edit.h:191
virtual fpreal SYMMETRYORIGX(fpreal) override
Definition: SOP_Edit.h:455
virtual void SCRIPT(UT_String &, fpreal) override
Definition: SOP_Edit.h:369
virtual fpreal RAYHITX(fpreal t) override
Definition: SOP_Edit.h:386
virtual void setRayOrigin(const UT_Vector3 &orig, fpreal t) override
Definition: SOP_Edit.h:179
virtual fpreal SOFTEDGE(fpreal t) override
Definition: SOP_Edit.h:416
virtual int REALTIME() override
Definition: SOP_Edit.h:285
virtual void KERNEL(UT_String &str, fpreal t) override
Definition: SOP_Edit.h:418
virtual fpreal USERX(fpreal t) override
Definition: SOP_Edit.h:373