HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Node.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 base class for all SOP operators
9  * Every SOP is responsible for filling in the following methods:
10  * cookMe(float t);
11  *
12  */
13 
14 #ifndef __SOP_Node_h__
15 #define __SOP_Node_h__
16 
17 #include "SOP_API.h"
18 
19 #include "SOP_Error.h"
20 #include "SOP_Guide.h"
21 #include "SOP_NodeFlags.h"
23 
24 #include <GOP/GOP_Manager.h>
25 #include <GU/GU_Detail.h>
26 #include <GU/GU_DetailHandle.h>
27 #include <GU/GU_DetailGroupPair.h>
28 #include <GU/GU_SelectType.h>
29 #include <GU/GU_SelectionSet.h>
30 #include <GEO/GEO_Detail.h>
31 #include <GA/GA_AttributeRef.h>
32 #include <GA/GA_Types.h>
33 #include <CH/CH_LocalVariable.h>
35 #include <OP/OP_Network.h>
36 #include <PRM/PRM_Shared.h>
37 #include <UT/UT_Lock.h>
38 #include <UT/UT_SymbolTable.h>
39 #include <UT/UT_IntArray.h>
40 #include <UT/UT_Array.h>
41 #include <UT/UT_String.h>
42 #include <SYS/SYS_Deprecated.h>
43 
44 class UT_InfoTree;
45 class UT_Undo;
46 class GU_Selection;
47 class OP_OperatorTable;
48 class SOP_Node;
49 class SOP_SoftLockData;
50 class DD_Source;
51 
52 class sop_AttributeEvaluator;
53 class SOP_NodeVerb;
54 class SOP_NodeParms;
55 class SOP_NodeCache;
56 
58 {
60 };
61 
62 extern "C" {
64 };
65 
66 class sopVarInfo;
67 
69 {
70 public:
72  int mySize;
74 };
75 
76 // A call back operator for local variables:
78  (sopVarInfo *varinfo);
79 
81 {
82 public:
83  CH_LocalVariable myVar; // Actual variable name.
84  int myTable; // Which table to use
85  UT_String myAttribName; // Name of the attribute
86  GA_ROAttributeRef myOffset; // Offset in attrib
87  sopVarInfo *mySecondaryVariable; // For LIFE that needs two.
88  int myTupleIndex; // Component in tuple
89  fpreal myDefault; // Default value if not present
90  GA_StorageClass myStorageClass; // Float, Int, or String
91  GA_AttributeOwner myDictionary; // Vertex, Point, Primitive, or Detail
92  int myVaridx; // Call back parameter.
93  SOP_LocalVarFunc myCallback; // Call back function
94 };
95 
96 // Handy function to build a meta kernel menu. Used in several sops.
97 SOP_API extern void SOPfillMetaKernelMenu(
98  void *, PRM_Name *names, int size,
99  const PRM_SpareData *, const PRM_Parm *);
100 
101 #define SOP_LOCALVAR_START 1000000 // Start of local variable indices
102 
103 //___________________________________________________________________________
104 
105 typedef void sopVisualizeCallback(void * /*data*/, SOP_Node *, OP_Context &, GU_Detail *);
106 
108 {
109 public:
110  virtual const char *getChildType() const override;
111  virtual const char *getOpType() const override;
112 
113  static const char *theChildTableName;
114  virtual OP_OpTypeId getChildTypeID() const override;
115  virtual OP_OpTypeId getOpTypeID() const override;
116 
117  const SOP_NodeFlags &getFlags() const { return mySopFlags; }
118 
119  // Whether a SOP is cooking render is whether its object creator is.
120  virtual int isCookingRender() const override
121  { return getCreator()->isCookingRender(); }
122 
123  // This allows us to tap into flag changes and perform unloads
124  // if necessary.
125  virtual void opChanged(OP_EventType reason,
126  void *data=0) override;
127 
128  // SOP networks need some logic to switch between using
129  // output nodes, display nodes, or render nodes. This function can
130  // also be used to just return the Output SOPs by passing false to
131  // "fallback_to_display_render".
132  SOP_Node *getOutputSop(int outputidx,
133  bool fallback_to_display_render = true);
134 
135  //
136  // Local variable functions:
137  //
138 
139  // Used to accumulate local variables:
140  virtual const CH_LocalVariable *resolveVariable(
141  const char *name) override;
143  const char *name) override;
144 
145  // Each one gets a precedence from 0-3. Resolution within
146  // a precedence is undefined.
147  // 0 is highest precedence.
148  // This is used for generic variables like Cd
149  void setVariableOrder(int detail, int prim,
150  int pt, int vtx);
151  // Gets the index of specified level. Index is same as the parameter
152  // order in setVariableOrder
153  int getVariableOrder(int level) const;
154  // Given a variable idx, gives the precedence.
155  int getVariablePrecedence(int var) const;
156 
157  // Wipe the table of local variables
158  // This is automatically called by the setup function so
159  // shouldn't be called outside it.
160 
161  virtual bool usesFootprint() const override
162  { return true; }
163 
164  void setVisualizeCallback(sopVisualizeCallback *callback, void *data);
165 
166  /// Moves visualizer into our output list
167  virtual bool addOrMoveVisualizerToOutput(int outputidx) override;
168 
169 private:
170  void clearLocalVars();
171  void updateLocalVarOffsets();
172 
173  // invalidate any cached data
174  virtual void clearCache() override;
175 
176  // This resets the attribute caches for @ style local variables.
177  // It is implied by setupLocalVars, resetLocalVarRefs,
178  // and clearLocalVars.
179  void clearAttributeEvalCaches();
180 public:
181 
182  // the flag indicating the capture override state (on/off)
183  // This override is mirroring the kinematic override at the OBJ level.
184  // It is used to determine whether capture related SOPs use the
185  // capture parameter or regular animation parameters for cooking
186  static void setCaptureOverrideFlag( bool flag )
187  {
188  theGlobalCaptOverride = flag;
189  }
190  static bool getCaptureOverrideFlag()
191  {
192  return theGlobalCaptOverride;
193  }
194 
195 
196  // Build the local variable table
197  // This should be done AFTER you have set the local variable
198  // order & AFTER you have initialized your myGdp[*].
199  bool setupLocalVars();
200 
201  // This resets all the myCur*s to zero so we can be sure they
202  // are all cleared out. It does NOT clear the bounding box
203  // build states.
204  void resetLocalVarRefs();
205 
206  void setCurGdh(int index,
207  const GU_DetailHandle &gdh);
208  void clearCurGdh(int index);
209  const GU_DetailHandle &getCurGdh(int index);
210 
211  void setCurPoint(int index,
212  GA_Offset ptoff);
213  void clearCurPoint(int index);
214  void setCurVertex(int index,
215  GA_Offset ptoff);
216  void clearCurVertex(int index);
217  void setCurPrim(int index,
218  GA_Offset primoff);
219  void clearCurPrim(int index);
220  void setCurVertexNum(int index,
221  exint vtxnum);
222  void clearCurVertexNum(int index);
223 
224  // Called by evalVariableValue() to resolve local variables.
225  // Note that this will not resolve global variables like $F!
226  bool getVariableValueFP(fpreal &val, int index);
227 
228  // This gets the variable value as an fpreal value.
229  // Note that you should call the base class if you don't handle the given
230  // index.
231  virtual bool evalVariableValue(fpreal &val, int index,
232  int thread) override;
233 
234  // This gets the variable value as a string. Not the string
235  // corresponding to the specified index.
236  // Note that you should call the base class if you don't handle the given
237  // index.
238  virtual bool evalVariableValue(UT_String &value, int index,
239  int thread) override;
240 
241  /// A simple wrapper class to help in the semantic transition of specific
242  /// addGenericVariable() and addSpecificVariable() overloads that now use
243  /// higher level tuple index arguments instead of lower level byte offset
244  /// arguments.
246  {
247  public:
248  explicit AttribTupleIndexArg(int index) : myIndex(index) {}
249  operator int() const { return myIndex; }
250  private:
251  int myIndex;
252 
253  };
254 
255  // Tries to add the variable to each of our gdps, using the appropriate
256  // "" or "2" suffix.
257  void addGenericVariable(const char *varname,
259  const AttribTupleIndexArg &tuple_idx,
261  GA_Defaults const& defaults = GA_Defaults(0.0f));
262  void addGenericVariable(const char *varname,
263  const char *attribname,
264  const AttribTupleIndexArg &tuple_idx,
266  GA_Defaults const& defaults = GA_Defaults(0.0f));
267  void addGenericVariable(const char *varname,
268  int varidx,
269  SOP_LocalVarFunc callback,
270  GA_Defaults const& defaults = GA_Defaults(0.0f));
271  // Add variables to our look up table, provided they exist in the GDP
272  // The addGeneric adds all the prefixed versions, then finds the first
273  // one which is valid and sets itself to that.
274  void addGenericVariable(const GU_Detail *gdp,
275  int gdpidx,
276  const char *varname,
277  const char *attribname,
278  const AttribTupleIndexArg &tuple_idx,
280  GA_Defaults const& defaults = GA_Defaults(0.0f));
281  void addGenericVariable(int gpdidx,
282  const char *varname,
283  int varidx,
284  SOP_LocalVarFunc callback,
285  GA_Defaults const& defaults = GA_Defaults(0.0f));
286  void addSpecificVariable(const GU_Detail *gdp,
287  int gdpidx,
288  const char *varname,
289  const char *attribname,
290  const AttribTupleIndexArg &tuple_idx,
292  GA_AttributeOwner dictionary,
293  GA_Defaults const& defaults = GA_Defaults(0.0f));
294  void addSpecificVariable(int gpidx,
295  const char *varname,
296  int varidx,
297  GA_AttributeOwner dictionary,
298  SOP_LocalVarFunc callback,
299  GA_Defaults const& defaults = GA_Defaults(0.0f));
300 
301  static int addCustomVariableCallback(const char *attr,
302  const char *varname, void *data);
303  void addCustomVariable(const char *attr,
304  const char *varname);
305 
306  void cacheVarPtBox(int gpdidx);
307  void cacheVarPrimBox(int gpdidx);
308 
309  //
310  // These are the call back functions to evaluate various variable
311  // types.
312  //
313  fpreal varCallbackT(sopVarInfo *varinfo);
314 
315  fpreal varCallbackPT(sopVarInfo *varinfo);
316  fpreal varCallbackPR(sopVarInfo *varinfo);
317  fpreal varCallbackVTX(sopVarInfo *varinfo);
318 
319  fpreal varCallbackNPT(sopVarInfo *varinfo);
320  fpreal varCallbackNPR(sopVarInfo *varinfo);
321  fpreal varCallbackNVTX(sopVarInfo *varinfo);
322 
323  fpreal varCallbackCE(sopVarInfo *varinfo);
324  fpreal varCallbackMIN(sopVarInfo *varinfo);
325  fpreal varCallbackMAX(sopVarInfo *varinfo);
326  fpreal varCallbackSIZE(sopVarInfo *varinfo);
327  fpreal varCallbackLIFE(sopVarInfo *varinfo);
328  fpreal varCallbackAGE(sopVarInfo *varinfo);
329  fpreal varCallbackBB(sopVarInfo *varinfo);
330  fpreal varCallbackWEIGHT(sopVarInfo *varinfo);
331 
332  // These methods return the variables being iterated over. The index
333  // must be 0 or 1.
334  const GU_DetailHandle &curGdh(int index) const
335  { UT_ASSERT(index == 0 || index == 1); return myCurGdh[index]; }
336 
337  // Note that the current vertex num will be 0 even if there is no
338  // current vertex. Use curVertex() to check if there is a current
339  // vertex.
340  int curVertexNum(int index) const
341  { UT_ASSERT(index == 0 || index == 1); return myCurVtxNum[index]; }
342 
343  const GU_Detail *curGdp(int index) const
344  { UT_ASSERT(index == 0 || index == 1); return myCurGdp[index]; }
345 
346  GA_Offset curVertex(int local_var_gdp_index) const
347  { UT_ASSERT(local_var_gdp_index == 0 || local_var_gdp_index == 1);
348  if (!myCurGdp[local_var_gdp_index]) return GA_INVALID_OFFSET;
349  return myCurVtxOff[local_var_gdp_index]; }
350 
352  { UT_ASSERT(index == 0 || index == 1); if (!myCurGdp[index]) return GA_INVALID_OFFSET; return myCurPtOff[index]; }
353 
354  const GEO_Primitive *curPrim(int index) const
355  { UT_ASSERT(index == 0 || index == 1); if (!myCurGdp[index]) return 0; return myCurGdp[index]->getGEOPrimitive(myCurPrimOff[index]); }
356 
357  // The point bounding box is used from $BBX, $BBY, and $BBZ.
359  {
360  UT_ASSERT(index == 0 || index == 1);
361  cacheVarPtBox(index);
362  return myCurPtBox[index];
363  }
364 
365  // The primitive bounding box is used from $MINX, $MINY, and $MINZ.
367  {
368  UT_ASSERT(index == 0 || index == 1);
369  cacheVarPrimBox(index);
370  return myCurPrimBox[index];
371  }
372 
373 
374  // Function to set the pivot parm to the centroid of the input group
375  void setPivotParmToGroupCentroid(OP_Context &context);
376 
377 private:
378  // Helper function for building the drop down group menus.
379  void getGroupMenuHeader(int sourcenum, const char * title,
380  UT_String & header);
381 
382  static int buildSopGroups(const GU_Detail *src,
383  const char *prim_header,
384  const char *pt_header,
385  const char *edge_header,
386  const char *vertex_header,
387  PRM_Name *menuEntries, int themenusize,
388  unsigned type, int start,
389  bool includeselection, const PRM_Parm *parm);
390 
391  static int buildSopEdgeGroups(const GU_Detail *src,
392  const char * edge_header,
393  const char *prim_header, const char *pt_header,
394  const char *vertex_header,
395  PRM_Name *menuEntries, int themenusize,
396  bool addprim, int start,
397  const PRM_Parm *parm);
398 
399  static int buildSopBreakpointGroups(const GU_Detail *src,
400  const char * brkpt_header,
401  const char * prim_header, const char *pt_header,
402  const char * edge_header,
403  const char *vertex_header,
404  PRM_Name *choicenames, int menusize,
405  bool addprim, int start,
406  const PRM_Parm *parm);
407 
408 public:
409  // The following method has to be public for some static functions in
410  // the code
411  static void buildGroupsFromSop( SOP_Node * src_sop,
412  const PRM_Parm *parm,
413  const PRM_SpareData *spare,
414  unsigned type, int start,
415  PRM_Name *menuEntries, int thelistsize );
416 
417  static int buildEdgeGroupsFromSop( SOP_Node * src_sop,
418  const PRM_Parm *parm,
419  const PRM_SpareData *spare,
420  bool addprim, int start,
421  PRM_Name *menuEntries, int thelistsize );
422 
423  static int buildBreakpointGroupsFromSop( SOP_Node * src_sop,
424  const PRM_Parm *parm,
425  const PRM_SpareData *spare,
426  bool addprim, int start,
427  PRM_Name *menuEntries, int thelistsize );
428 
429  void buildNamedPrims(int thesourcenum,
430  PRM_Name *thechoicenames,
431  int themenusize,
432  const PRM_Parm *parm,
433  bool globvectors,
434  bool numberedvolumes);
435 
436  void buildInputGroups(int thesourcenum,
437  PRM_Name *thechoicenames,
438  int themenusize,
439  unsigned type, int start,
440  bool includeselection,
441  const PRM_Parm *parm);
442 
443  int buildInputEdgeGroups(int sourcenum,
444  PRM_Name *choicenames, int menusize,
445  bool addprim, int start,
446  const PRM_Parm *parm);
447 
448  int buildInputBreakpointGroups(int sourcenum,
449  PRM_Name *choicenames, int menusize,
450  bool addprim, int start,
451  const PRM_Parm *parm);
452 
453  virtual int setModelLock(int lock_type,
454  void *modeler = 0,
455  int allow_softlock_promotion=0,
456  UT_Undo *undo = 0) override;
457 
458  // Nobody should have to override this, but it's public for other people
459  virtual OP_DataType getCookedDataType() const override;
460 
461  virtual void *getCookedData(OP_Context &ctx) override;
462 
463  virtual bool getBoundingBox(UT_BoundingBox &box,
464  OP_Context &ctx) override;
465 
466  // Get cooked geometry. If "forced" is true and cooking fails, we create
467  // an empty gdp and clear the cooking flags.
468  // Note that the resulting handle may be reused in future cooks!
469  // To prevent the handle from being reused, call addPreserveRequest()
470  // on the handle.
471  const GU_Detail *getCookedGeo(OP_Context &, int forced = 0);
472  GU_DetailHandle getCookedGeoHandle(OP_Context &, int forced = 0);
473  GU_DetailHandle cookOutput(OP_Context &context, int outputidx, SOP_Node *interests);
474  const SOP_Guide *getCookedGuide1() const;
475  const SOP_Guide *getCookedGuide2() const;
476 
477  // This is similar to the getCookedGeo except it merely returns the
478  // cached GEO, if any. If none, it returns NULL without trying to cook.
479  const GU_Detail *getLastGeo();
480 
481  // Returns the equivalent of getLastGeo of the given input. This lets
482  // you get an input geometry without locking the input and without
483  // risking cooking it. It can, and will, return NULL without trying
484  // to cook in many cases.
485  const GU_Detail *getInputLastGeo(int input, fpreal time);
486 
487  OP_ERROR cookGuide1(OP_Context &context);
488  OP_ERROR cookGuide2(OP_Context &context);
489 
490  OP_ERROR cookGuideList(OP_Context &context,
492 
493  // The guide list can consist of either GOP_Guide derived objects or simple
494  // GU_Detail objects (but not a combination). This method is used to query
495  // which of the two, if any, the node generates.
497  { return OP_GUIDELIST_GUDETAIL; }
498 
499  virtual OP_ERROR lockInput(unsigned idx,
500  OP_Context &context) override;
501  void unlockInput(unsigned idx) override;
502  virtual OP_ERROR lockInputs(OP_Context &context) override;
503  void unlockInputs() override;
504 
505  static void buildOperatorTable(OP_OperatorTable &table);
506  static void initializeExpressions();
507 
508  // Change the string into a valid group name. A return value of true
509  // indicates that the string needed changing, in which case severity
510  // specifies the level of error this method generated (UT_ERROR_NONE,
511  // UT_ERROR_WARNING, or UT_ERROR_ABORT).
512  // Note that this does not force the name to be non-zero in length.
513  bool forceValidGroupName(UT_String &name,
515  static bool forceValidGroupName(UT_String &name,
516  UT_ErrorManager *error,
518  // Change the string into a valid group prefix. A return value of true
519  // indicates that the string needed changing, in which case severity
520  // specifies the level of error this method generated (UT_ERROR_NONE,
521  // UT_ERROR_WARNING, or UT_ERROR_ABORT).
522  // Note that this does not force the prefix to be non-zero in length.
523  bool forceValidGroupPrefix(UT_String &prefix,
525 
526  void expandGroupMask(const char *pattern,
527  UT_String &outNames,
529  const GU_Detail *pgdp);
530  void expandGroupMask(const char *pattern,
531  UT_String &outNames,
533  { expandGroupMask(pattern, outNames, type, gdp); }
534 
535  /// Typedef to help make use of GroupCreator less verbose.
537 
538  const GA_PrimitiveGroup *parsePrimitiveGroups(const char *pattern,
539  const GroupCreator &creator,
540  bool allow_numeric = true,
541  bool ordered = false,
542  bool strict = false,
543  GA_Index offset = GA_Index(0));
544  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator version of function and dont cast away const on input geo)
545  const GA_PrimitiveGroup *parsePrimitiveGroups(const char *pattern,
546  GU_Detail *pgdp,
547  int allow_numeric=1,
548  int ordered = 1,
549  bool strict = false,
550  int offset = 0);
551  const GA_PrimitiveGroup *parsePrimitiveGroups(const char *pattern)
552  { return parsePrimitiveGroups(pattern, GroupCreator(gdp, false), true, true); }
553 
554  GA_PrimitiveGroup *parsePrimitiveGroupsCopy(const char *pattern,
555  const GroupCreator &creator,
556  bool allow_numeric = true,
557  bool ordered = false,
558  bool strict = false);
559  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator version of function and dont cast away const on input geo)
560  GA_PrimitiveGroup *parsePrimitiveGroupsCopy(const char *pattern,
561  GU_Detail *pgdp,
562  int allow_numeric=1,
563  int ordered = 1,
564  bool strict = false);
566  { return parsePrimitiveGroupsCopy(pattern, GroupCreator(gdp, false), true, true); }
567 
568  const GA_PointGroup *parsePointGroups(const char *pattern,
569  const GroupCreator &creator,
570  bool allow_numeric = true,
571  bool ordered = false,
572  bool strict = false,
573  GA_Index offset = GA_Index(0));
574  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator version of function and dont cast away const on input geo)
575  const GA_PointGroup *parsePointGroups(const char *pattern,
576  GU_Detail *pgdp,
577  int allow_numeric=1,
578  int ordered = 1,
579  bool strict = false,
580  int offset = 0);
581  const GA_PointGroup *parsePointGroups(const char *pattern)
582  { return parsePointGroups(pattern, GroupCreator(gdp, false), true, true); }
583 
584  GA_PointGroup *parsePointGroupsCopy(const char *pattern,
585  const GroupCreator &creator,
586  bool allow_numeric = true,
587  bool ordered = false,
588  bool strict = false);
589  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator version of function and dont cast away const on input geo)
590  GA_PointGroup *parsePointGroupsCopy(const char *pattern,
591  GU_Detail *pgdp,
592  int allow_numeric=1,
593  int ordered = 1,
594  bool strict = false);
595  GA_PointGroup *parsePointGroupsCopy(const char *pattern)
596  { return parsePointGroupsCopy(pattern, GroupCreator(gdp, false), true, true); }
597 
598  const GA_EdgeGroup *parseEdgeGroups(const char *pattern,
599  const GU_Detail *pgdp,
600  bool strict = true,
601  GA_Index prim_offset = GA_Index(0),
602  GA_Index point_offset = GA_Index(0));
603  const GA_EdgeGroup *parseEdgeGroups(const char *pattern)
604  { return parseEdgeGroups(pattern, (const GU_Detail *)gdp); }
605 
606  GA_EdgeGroup *parseEdgeGroupsCopy(const char *pattern,
607  const GU_Detail *pgdp);
608  GA_EdgeGroup *parseEdgeGroupsCopy(const char *pattern)
609  { return parseEdgeGroupsCopy(pattern, (const GU_Detail *)gdp); }
610 
611  const GA_BreakpointGroup *parseBreakpointGroups(const char *pattern,
612  const GU_Detail *pgdp,
613  bool strict = true,
614  GA_Index offset = GA_Index(0));
615  const GA_BreakpointGroup *parseBreakpointGroups(const char *pattern)
616  { return parseBreakpointGroups(pattern, (const GU_Detail *)gdp); }
617 
618  GA_BreakpointGroup *parseBreakpointGroupsCopy(const char *pattern,
619  const GU_Detail *pgdp);
621  {return parseBreakpointGroupsCopy(pattern,(const GU_Detail *)gdp);}
622 
623  const GA_VertexGroup *parseVertexGroups(const char *pattern,
624  const GU_Detail *pgdp,
625  bool strict = true,
626  GA_Index offset = GA_Index(0));
627  const GA_VertexGroup *parseVertexGroups(const char *pattern)
628  { return parseVertexGroups(pattern, (const GU_Detail *)gdp); }
629 
630  GA_VertexGroup *parseVertexGroupsCopy(const char *pattern,
631  const GU_Detail *pgdp);
632  GA_VertexGroup *parseVertexGroupsCopy(const char *pattern)
633  { return parseVertexGroupsCopy(pattern, (const GU_Detail *)gdp); }
634 
635  const GA_Group *parseAllGroups(const char *pattern,
636  const GroupCreator &creator,
637  bool allow_numeric = true,
638  bool ordered = false,
640  GA_GroupType bestguess=GA_GROUP_PRIMITIVE);
641  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator version of function and dont cast away const on input geo)
642  const GA_Group *parseAllGroups(const char *pattern,
643  GU_Detail *pgdp,
644  int allow_numeric=1,
645  int ordered=1,
647  const GA_Group *parseAllGroups(const char *pattern)
648  { return parseAllGroups(pattern, GroupCreator(gdp, false), true, true); }
649 
650  GA_Group *parseAllGroupsCopy(const char *pattern,
651  const GroupCreator &creator,
652  bool allow_numeric = true,
653  bool ordered = false,
655  GA_GroupType bestguess=GA_GROUP_PRIMITIVE);
656  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator version of function and dont cast away const on input geo)
657  GA_Group *parseAllGroupsCopy(const char *pattern,
658  GU_Detail *pgdp,
659  int allow_numeric=1,
660  int ordered=1,
662  GA_Group *parseAllGroupsCopy(const char *pattern)
663  { return parseAllGroupsCopy(pattern, GroupCreator(gdp, false), true, true); }
664 
665  // Explicitly destroy an adhoc group. Usually this is done on your behalf
666  // internally, after the SOP cooks, but this method allows you to delete
667  // an adhoc group within the cooking methods. Return is 0 if not found.
668  // An adhoc group is created when the SOP groups are parsed, or when you
669  // call createAdhocPrimGroup() or createAdhocPointGroup().
670 
671  int destroyAdhocGroup (const GA_Group *group)
672  { return myGroupParse.destroyAdhocGroup(group); }
674  { myGroupParse.destroyAdhocGroups(); }
676  { myGroupParse.destroyAdhocGroups(g); }
677 
678  // Set the selection based on the given geometry:
679 
680  /// Update the selection object on the detail to match the one for this
681  /// SOP node.
682  SYS_DEPRECATED(16.0)
683  void updateUserSelectionOnDetail();
684 
685  /// Set a specific override selection for this node only. Automatically
686  /// updates the selection object on the detail.
687  SYS_DEPRECATED(16.0)
688  void setNodeSelectionSet(GU_SelectionSetHandle selection_set);
689 
690  SYS_DEPRECATED(16.0)
691  GU_SelectionSetHandle nodeSelectionSet() const;
692 
693  /// Clears the override selection. Automatically updates the selection
694  /// object on the detail.
695  SYS_DEPRECATED(16.0)
696  void clearNodeSelectionSet();
697 
698  /// Copies the cooked selection generated by the SOP to the detail-external
699  /// user selection. If \c context is NULL, then the last successful cook,
700  /// if any, is used.
701  SYS_DEPRECATED(16.0)
702  void copyCookedSelectionToUserSelection(OP_Context *context = 0);
703 
704 public:
705 
707  SYS_DEPRECATED_REPLACE(14.0, "SOP_Node::select(GA_GroupType gtype)")
708  void select(GU_SelectionType stype);
710 
711  void select(GA_GroupType gtype = GA_GROUP_PRIMITIVE);
712 
713  void select(GU_SelectionHandle selection,
714  bool add_to_sel = false);
715 
716  // Select the group. opt use its type as sel type
717  void select(const GA_Group &group, bool use_gtype = true,
718  bool add_to_sel = false);
719 
720  void select(const GEO_Primitive &prim, bool sel_prim = true,
721  bool add_to_sel = false);
722  void selectPrimitive(GA_Offset primoff,
723  bool prim_sel = true,
724  bool add_to_sel = false);
725  void selectPoint(GA_Offset ptoff, bool point_sel = true,
726  bool add_to_sel = false);
727  void selectFrom(const GEO_Primitive &prim, bool sel_prim = true,
728  bool add_to_sel = false);
729  void selectPointsFrom(GA_Offset ptoff, bool point_sel = true,
730  bool add_to_sel = false);
731  void select(const GA_Range &range, bool use_rtype = true,
732  bool add_to_sel = false);
733 
734  // Selects input based on the group supplied and the group type. If
735  // group is not null, then it's type is used, otherwise the group type
736  // is used.
737  void selectInputGroup(const GA_Group *group,
738  GA_GroupType grouptype);
739  // FIXME: Delete this function once it's swept out, because
740  // the int corresponds with PRM_GroupType instead of
741  // GA_GroupType.
742  void selectInputGroup(const GA_Group *group,
743  int grouptype);
744 
745  // If no selection is present, then create a new empty primitive cook
746  // selection group. Otherwise, clear the selection.
747  void clearSelection();
748 
750  SYS_DEPRECATED_REPLACE(14.0, "SOP_Node::clearSelection(GA_GroupType gtype)")
751  void clearSelection(GU_SelectionType stype);
753 
754  /// If the cook selection group is not of the given type, create an empty
755  /// cook selection group of that type. Otherwise, clear the existing cook
756  /// selection group.
757  void clearSelection(GA_GroupType gtype);
758 
759  // Blow away the selection and reinitialize it to 0. Much more radical
760  // than clearSelection(), which leaves behind a clean, empty selection.
761  // This method returns 1 if it had anything to destroy, else 0.
762  bool destroySelection();
763 
764  // Return 1 if selection is enabled, 0 if false.
765  bool selectionEnabled() const
766  {
767  return getHighlight();
768  }
769 
770  bool hasCookedSelection() const
771  {
772  return myHasCookedSelection;
773  }
774 
775  // Copy all the temp selections from the given SOP into this one. All
776  // existing selections on this SOP will be destroyed first. If there are
777  // no temp selections, then the cook selection is copied into a temp
778  // selection.
779  bool copyTempSelections(OP_Context &context, SOP_Node *src);
780 
781  /// Functions to convert between different group type representations.
782  /// When no group type can be guessed, GA_GROUP_INVALID,
783  /// PRM_GROUPTYPE_GUESS, PRM_UVGROUPTYPE_GUESS, or GA_ATTRIB_INVALID
784  /// Will be returned.
785  /// @{
786  static GA_GroupType getGAGroupType(PRM_GroupType prmgrouptype, GA_GroupType guess = GA_GROUP_INVALID);
787  static GA_GroupType getGAGroupType(PRM_UVGroupType prmuvgrouptype, GA_GroupType guess = GA_GROUP_INVALID);
789  static GA_GroupType getGAGroupType(GU_SelectionType guseltype);
791  static GA_GroupType getGAGroupType(GA_AttributeOwner owner);
792  static GA_GroupType getGAGroupType(const char *possiblename, GA_GroupType guess = GA_GROUP_INVALID);
793  static PRM_GroupType getPRMGroupType(GA_GroupType gagrouptype);
794  static PRM_UVGroupType getPRMUVGroupType(GA_GroupType gagrouptype);
796  static GU_SelectionType getGUSelType(GA_GroupType gagrouptype, GU_SelectionType guess = GU_SPrimitive);
798  static GA_AttributeOwner getGroupAttribOwner(GA_GroupType gagrouptype, GA_AttributeOwner guess = GA_ATTRIB_INVALID);
799  static const char *getGroupTypeName(GA_GroupType gagrouptype, const char *guess = "guess");
800  /// @}
801 
802 
803  virtual void resetSimulation () {}
804 
805  virtual int getNetOverviewColor( UT_Color &color ) override;
806 
807  void addInstanceReference(SOP_Node *node);
808  void clearInstanceReference(SOP_Node *node);
809 
810  /// This makes *this an instance of node. It must be called within
811  /// a cookMySop. myGdpHandle is assumed to have an active write lock.
812  /// this->gdp is updated to point to the new gdp. It is assumed
813  /// that clearInstance() has already been called.
814  /// The node that you pass in must be cooked prior to instancing!
815  /// This has occured for free if it was lockInputed. Otherwise,
816  /// one must use getCookedGeoHandle to cook the SOP.
817  void makeInstanceOf(SOP_Node *node, OP_Context &context, int inputidx);
818 
819  /// This makes us shallow copy the given gu_detailhandle.
820  /// We are marked as a preserve request so with our next
821  /// cook we will not re-use this gdp. This should be
822  /// called while cooking - ie, gdp is locked.
823  /// While you can alter gdp afterwards, it is a bad idea as
824  /// you will also alter the source.
825  void makeInstanceOf(GU_ConstDetailHandle gdh);
826 
827  /// A hint to this node that it is about to be cooked at an
828  /// unexpected time so shouldn't reuse the existing GDP.
829  /// Should not be used without understanding the consequences.
830  void makePreserveRequest();
831 
832  virtual void setVisualization(int) {}
833  virtual void setForceCapture(int) {}
834 
835  virtual void getNodeSpecificInfoText(OP_Context &context,
836  OP_NodeInfoParms &iparms) override;
837 
838  /// Fill in tree with this SOP's details
839  virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree,
840  const OP_NodeInfoTreeParms &parms) override;
841  /// Helper class that puts our geometry info into a branch.
842  void fillInfoTreeForGeometry(UT_InfoTree &branch,
843  const OP_NodeInfoTreeParms &parms);
844 
845  /// Return an interface to apply appearance operations. The default
846  /// behaviour is to return a NULL pointer.
847  virtual SOP_ObjectAppearancePtr getObjectAppearance();
848 
849  /// This method has to do with 'fillInfoTreeNodeSpecific()' above. When the
850  /// call to OP_Node::fillInfoTree() completes (which is what called
851  /// fillInfoTreeNodeSpecific()), the UT_InfoTree 'tree' will be parsed and
852  /// displayed in a dialog box by OPUI_OpInfoDialog, at which point, that
853  /// class will want to ask us - which branch of the tree would you like to
854  /// be selected by default when the dialog is displayed for the first time?
855  virtual const char *getDefaultSelectedInfoTreeBranchName() const override;
856 
857  /// Spare data used to determine which input the group menu is associated
858  /// with.
859  /// Because these rely on static initialization, do NOT use,
860  /// use the sparedata functions instead.
865  /// Uses the second input if present, else the first input.
866  /// FIXME: Support for this has only been added to allAttribsMenu.
868 
869  /// Spare data to determine whcih input the group menu is associated
870  /// with.
871  static PRM_SpareData *sparedataFirstInput();
872  static PRM_SpareData *sparedataSecondInput();
873  static PRM_SpareData *sparedataThirdInput();
874  static PRM_SpareData *sparedataFourthInput();
875  static PRM_SpareData *sparedataSecondElseFirstInput();
876 
877  ///Absolute Width
878  virtual fpreal getW() const override;
879  ///Absolute Height
880  virtual fpreal getH() const override;
881 
882 
883  /// Provide a verb interface to this SOP. Verb interfaces are designed
884  /// to ensure thread safety and prevent any persistent storage between
885  /// cooks.
886  virtual const SOP_NodeVerb *cookVerb() const { return 0; }
887 
888 protected:
889  SOP_Node(OP_Network *parent, const char *name, OP_Operator *entry);
890  virtual ~SOP_Node();
891 
892  // We listen to these as our Cache relies on unique ids, so must
893  // know when they are no longer valid.
894  virtual void setUniqueId(int id) override;
895  virtual void clearUniqueId() override;
896 
897  // Remove the adhoc group(s) from the list of adhocs to be deleted when
898  // cooking ends. This way, deletion of the group becomes your
899  // responsibility. You should rarely and cautiously use these methods.
900  // Most of the time you need destroyAdhocGroup[s] instead.
901  // You *MUST* use the parse.*Copy methods to get the adhoc group.
902  // Otherwise, you may delete a group which you don't have ownership of.
903  int removeAdhocGroup (const GA_Group *group)
904  { return myGroupParse.removeAdhocGroup(group); }
906  { myGroupParse.removeAdhocGroups(); }
907 
908  // Protected virtuals:
909  //
910  // "cookMe" is where the actual work is done.
911  // The error is returned (OP_ERR_NONE on success).
912  //
913  virtual OP_ERROR cookMe (OP_Context &context) override;
914  virtual OP_ERROR bypassMe (OP_Context &context,
915  int &copied_input) override;
916 
917  virtual OP_ERROR cookMySop(OP_Context &context) = 0;
918 
919  /// This is meant to be called within cookMySop() if all you
920  /// want to do is invoke the verb returned by cookVerb().
921  OP_ERROR cookMyselfAsVerb(OP_Context &context);
922 
923  // The interests node is the node to get an extra input on whatever
924  // actual real data node is at the source of this chain.
925  virtual GU_DetailHandle cookMySopOutput(OP_Context &context, int outputidx, SOP_Node *interests);
926  virtual OP_ERROR cookMyGuide1(OP_Context &context);
927  virtual OP_ERROR cookMyGuide2(OP_Context &context);
928  virtual OP_ERROR cookMyGuideList(OP_Context &context,
930 
931  virtual OP_ERROR pubCookInputGroups(OP_Context &context,
932  int alone = 0) override;
933 
934  void notifyGroupParmListeners(
935  int parm_index, int group_type_index,
936  const GU_Detail *pgdp, const GA_Group *group);
937 
938  /// The cookInput.+Groups functions are helper functions that look at
939  /// your Group Name and Group Type parameters (the offsets for which
940  /// are passed in parm_index, for Group Name, and group_type_index,
941  /// for group_type), evaluate them, and then call parse.+Group on that
942  /// group name. For every method other than cookInputAllGroups,
943  /// group_type_index is used only to determine whether the parm is dirty.
944  /// The pointer group is set as a return value.
945  /// If alone is true, we are cooking for a selector, and can't assume that
946  /// our gdp is valid (because it might not have been constructed by now).
947  /// If allow_reference is true, the group returned may not be modified.
948  /// If fetchgdp is true and alone is true, these new groups will be
949  /// created on the input_index-th input (because the gdp isn't constructed
950  /// yet).
951  /// If fetchgdp is true and alone is false, false, groups will be
952  /// constructed on the current gdp.
953  /// If fetchgdp is false, you must supply a gdp to create groups on in
954  /// the paramerer pgdp.
955  OP_ERROR cookInputPrimitiveGroups(OP_Context &context,
956  const GA_PrimitiveGroup *&group,
957  bool alone = false, bool do_selection = true,
958  int parm_index = 0,
959  int group_type_index = -1,
960  bool allow_reference = true,
961  bool ordered = false,
962  bool detached = true,
963  int input_index = 0);
964  OP_ERROR cookInputPrimitiveGroups(OP_Context &context,
965  const GA_PrimitiveGroup *&group,
966  bool alone, bool do_selection,
967  int parm_index,
968  int group_type_index,
969  bool allow_reference,
970  bool ordered,
971  const GroupCreator &creator);
972  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator or other version of function and dont cast away const on input geo and be careful since defaults have changed)
973  virtual OP_ERROR cookInputPrimitiveGroups(OP_Context &context,
974  const GA_PrimitiveGroup *&group,
975  GU_DetailGroupPair &detail_group_pair,
976  int alone = 0, bool do_selection = true,
977  int input_index = 0, int parm_index = 0,
978  int group_type_index = -1,
979  bool allow_reference = true,
980  bool fetchgdp = true,
981  GU_Detail *pgdp = NULL);
982 
983  /// See cookInputPrimitiveGroups.
984  OP_ERROR cookInputPointGroups(OP_Context &context,
985  const GA_PointGroup *&group,
986  bool alone = false, bool do_selection = true,
987  int parm_index = 0,
988  int group_type_index = -1,
989  bool allow_reference = true,
990  bool ordered = false,
991  bool detached = true,
992  int input_index = 0);
993  OP_ERROR cookInputPointGroups(OP_Context &context,
994  const GA_PointGroup *&group,
995  bool alone, bool do_selection,
996  int parm_index,
997  int group_type_index,
998  bool allow_reference,
999  bool ordered,
1000  const GroupCreator &creator);
1001  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator or other version of function and dont cast away const on input geo and be careful since defaults have changed)
1002  virtual OP_ERROR cookInputPointGroups(OP_Context &context,
1003  const GA_PointGroup *&group,
1004  GU_DetailGroupPair &detail_group_pair,
1005  int alone = 0, bool do_selection = true,
1006  int input_index = 0, int parm_index = 0,
1007  int group_type_index = -1,
1008  bool allow_reference = true,
1009  bool fetchgdp = true,
1010  GU_Detail *pgdp = NULL);
1011 
1012  /// See cookInputPrimitiveGroups.
1013  OP_ERROR cookInputEdgeGroups(OP_Context &context,
1014  const GA_EdgeGroup *&group,
1015  bool alone = false, bool do_selection = true,
1016  int parm_index = 0,
1017  int group_type_index = -1,
1018  bool allow_reference = true,
1019  int input_index = 0);
1020  OP_ERROR cookInputEdgeGroups(OP_Context &context,
1021  const GA_EdgeGroup *&group,
1022  bool alone, bool do_selection,
1023  int parm_index,
1024  int group_type_index,
1025  bool allow_reference,
1026  const GU_Detail *pgdp);
1027  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator or other version of function and dont cast away const on input geo and be careful since defaults have changed)
1028  virtual OP_ERROR cookInputEdgeGroups(OP_Context &context,
1029  const GA_EdgeGroup *&group,
1030  GU_DetailGroupPair &detail_group_pair,
1031  int alone = 0, bool do_selection = true,
1032  int input_index = 0, int parm_index = 0,
1033  int group_type_index = -1,
1034  // JML: I do not know why Edge Groups
1035  // used Copy instead of the reference version.
1036  // They are left like this so as to not cause
1037  // problems unforeseen.
1038  bool allow_reference = false,
1039  bool fetchgdp = true,
1040  GU_Detail *pgdp = NULL);
1041 
1042  /// See cookInputPrimitiveGroups. Also, is_default_prim only affects
1043  /// cases when we're not able to guess the type of groups; in those
1044  /// cases, we try again with primitive groups if is_default_prim is
1045  /// true, and point groups otherwise.
1046  OP_ERROR cookInputAllGroups(OP_Context &context,
1047  const GA_Group *&group,
1048  bool alone = false, bool do_selection = true,
1049  int parm_index = 0,
1050  int group_type_index = -1,
1051  GA_GroupType grouptype = GA_GROUP_INVALID,
1052  bool allow_reference = true,
1053  bool is_default_prim = true,
1054  bool ordered = false,
1055  bool detached = true,
1056  int input_index = 0);
1057  OP_ERROR cookInputAllGroups(OP_Context &context,
1058  const GA_Group *&group,
1059  bool alone, bool do_selection,
1060  int parm_index,
1061  int group_type_index,
1062  GA_GroupType grouptype,
1063  bool allow_reference,
1064  bool is_default_prim,
1065  bool ordered,
1066  const GroupCreator &creator);
1067  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator or other version of function and dont cast away const on input geo and be careful since defaults have changed)
1068  virtual OP_ERROR cookInputAllGroups(OP_Context &context,
1069  const GA_Group *&group,
1070  GU_DetailGroupPair &detail_group_pair,
1071  int alone = 0, bool do_selection = true,
1072  int input_index = 0, int parm_index = 0,
1073  int group_type_index = -1,
1074  bool allow_reference = false,
1075  bool is_default_prim = true,
1076  bool fetchgdp = true,
1077  GU_Detail *pgdp = NULL);
1078 
1079  /// Parse the input group specified by groupname, of type grouptype,
1080  /// in detail gdp. If allow_reference is true, this group cannot be
1081  /// later modified. If is_default_prim is true, if the group's type cannot
1082  /// be guessed, we'll try with a primitive group; otherwise, we'll try
1083  /// with a point group.
1084  const GA_Group *parseInputGroup(const UT_String &groupname,
1085  GA_GroupType grouptype, const GroupCreator &creator,
1086  bool allow_reference, bool is_default_prim,
1087  bool ordered=false);
1088  const GA_Group *parseInputGroup(const UT_String &groupname,
1089  int grouptype, GU_Detail *gdp,
1090  bool allow_reference, bool is_default_prim);
1091 
1092  /// Retrieve a list of the local variables visible to this node.
1093  /// This list is unsorted and may contain duplicates.
1094  virtual void buildLocalVarNames(UT_StringArray &out_vars) override;
1095 
1096 private:
1097  /// Helper function for cookInput.+Groups. You shouldn't need to use it.
1098  OP_ERROR cookInputGroupsPrologue(OP_Context &context,
1099  bool alone, int input_index, bool detached,
1100  GroupCreator &creator);
1101  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator version of function)
1102  OP_ERROR cookInputGroupsPrologue(OP_Context &context, bool fetchgdp,
1103  bool alone, int input_index,
1104  GU_Detail *&pgdp);
1105 
1106  /// Helper function for cookInput.+Groups. You shouldn't need to use it.
1107  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator version of function)
1108  void cookInputGroupsEpilogue(int parm_index, int group_type_index,
1109  const GU_Detail *pgdp, const GA_Group *group,
1110  int input_index, bool fetchgdp, bool alone);
1111 
1112 protected:
1113  virtual void inputConnectChanged(int which_input) override;
1114 
1115 //_________________________________________________________________________
1116 //
1117 // Some very useful methods used in cooking SOPs, convenience if you will
1118 //_________________________________________________________________________
1119 //
1120 
1121  // Note that the context parameter is unused!
1123  { return inputGeo(index); }
1124  const GU_Detail *inputGeo(int index) const;
1125  GU_DetailHandle inputGeoHandle(int index) const;
1126 
1127 //_________________________________________________________________________
1128 //
1129 // Convenience Error methods...
1130 //_________________________________________________________________________
1131 //
1132 public:
1133  void addError(int code, const char *msg = 0)
1134  { getLockedErrorManager()->addError(SOP_OPTYPE_NAME,
1135  code, msg); }
1136  void addMessage(SOP_ErrorCodes code, const char *msg = 0)
1137  { getLockedErrorManager()->addMessage(SOP_OPTYPE_NAME,
1138  code, msg); }
1139  void addWarning(SOP_ErrorCodes code, const char *msg = 0)
1140  { getLockedErrorManager()->addWarning(SOP_OPTYPE_NAME,
1141  code, msg); }
1142  void addFatal(SOP_ErrorCodes code, const char *msg = 0)
1143  { getLockedErrorManager()->addFatal(SOP_OPTYPE_NAME,
1144  code, msg); }
1145  void addSystemError(const char *msg = 0)
1146  { getLockedErrorManager()->systemError(msg);}
1148  const char *msg = 0)
1149  { getLockedErrorManager()->commonError(what, msg);}
1151  const char *msg = 0)
1152  { getLockedErrorManager()->commonWarning(what, msg);}
1153 
1154 protected:
1155  //
1156  // Methods for dealing with groups in SOPs
1157 
1158  /// We want these public as we it is perfectly fine to use them in
1159  /// static parm templates. This occurs, for example, when instancing
1160  /// multiparms.
1161 public:
1162  static PRM_ChoiceList allGroupMenu; // All the groups
1163  static PRM_ChoiceList groupMenu; // Prim and point groups
1167  static PRM_ChoiceList edgePointGroupMenu; // Edge and point groups
1169  static PRM_ChoiceList primNamedGroupMenu; // Named prim grps only
1170  static PRM_ChoiceList pointNamedGroupMenu; // Named pt groups only
1171  static PRM_ChoiceList edgeNamedGroupMenu; // Named edge groups only
1172  static PRM_ChoiceList vertexNamedGroupMenu;// Named vertex groups only
1177 
1183 
1186 
1187  /// Returns spare data that adds a "group select" button which runs a
1188  /// python script to invoke soputils.selectGroupParm. The group_type
1189  /// should be used if only one group type is supported by the group parm.
1190  /// The group_type_parm value should be used (with group_type set to
1191  /// GA_GROUP_INVALID) if there is a separate menu parameter to specify
1192  /// the group type. The input_index indicates which input of the SOP
1193  /// the group refers to. The merge_spare_data can contain any other
1194  /// PRM_SpareData that you want on the parameter (the most common being
1195  /// "&SOP_Node::theSecondInput" to control the input used by the
1196  /// SOP_Node::primGroupMenu, SOP_Node::pointGroupMenu, or other SOP_Node
1197  /// standard parameter group menus.
1198  /// If the SOP requires or supports multi-stage selection, then it's
1199  /// possible to show previous selections during this picking sessions to
1200  /// assist the user. To do this, a comma-separated list of group types /
1201  /// group parm names can be given with assoc_groups
1202  /// (e.g. "point my_point_group_parm, edge my_edge_group_parm").
1204  {
1205  /// AUTO: Use any bound selectors to determine whether the selection
1206  /// should be ordered or not.
1207  AUTO,
1208  /// FORCE_UNORDERED: Force an unordered selection.
1209  FORCE_UNORDERED,
1210  /// FORCE_ORDERED: Force an ordered selection.
1211  FORCE_ORDERED
1212  };
1213  static PRM_SpareData *getGroupSelectButton(
1214  GA_GroupType group_type,
1215  const char *group_type_parm = NULL,
1216  int input_index = 0,
1217  PRM_SpareData *merge_spare_data = NULL,
1218  const char *assoc_groups = NULL,
1219  GroupSelectAsOrdered ordered =
1220  GroupSelectAsOrdered::AUTO);
1221  static PRM_SpareData *getGroupSelectButton(
1222  GA_GroupMaskType group_mask,
1223  const char *group_type_parm = NULL,
1224  int input_index = 0,
1225  PRM_SpareData *merge_spare_data = NULL,
1226  const char *assoc_groups = NULL,
1227  GroupSelectAsOrdered ordered =
1228  GroupSelectAsOrdered::AUTO);
1229 
1230 protected:
1231  /// Open a tree chooser populated by the values from the @c path_attrib
1232  /// string values so the user can select primitives. The @c stringparm
1233  /// parameter is evaluated to choose the selected primitives, and the
1234  /// result is written back to the @c stringparm when the user makes their
1235  /// selection. If the @c path_attrib doesn't exist, then optionally,
1236  /// packed primitive intrinsic names can be used to populate the tree.
1237  void pickPrimitivesUsingPathAttribute(
1238  const GU_Detail &gdp,
1239  const GA_Range &srcrange,
1240  const char *stringparm,
1241  fpreal t,
1242  const char *path_attrib="path",
1243  bool use_packed_names=true);
1244  /// Pick assuming that the range is a full range of primitives. This
1245  /// method gets the primitive range from the specified @c input_number.
1246  void pickPrimitivesUsingPathAttribute(
1247  const char *stringparm,
1248  fpreal t,
1249  int input_number=0,
1250  const char *path_attrib="path",
1251  bool use_packed_names=true);
1252  /// Create a GA_Range containing the primitives specified by the values in
1253  /// the @c pickedstring. The primitives are selected from the @c
1254  /// srcrange in the given @c gdp.
1255  static GA_Range getPickedRangeUsingPathAttribute(
1256  const GU_Detail &gdp,
1257  const GA_Range &srcrange,
1258  const char *pickedstring,
1259  const char *path_attrib="path",
1260  bool use_packed_names=true);
1261 
1262  /// WARNING: The groups returned are const and should not be modified
1263  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator or other version of function and dont cast away const on input geo)
1264  int parseGroups(const char *pattern,
1265  GU_Detail *gdp,
1266  const GA_PrimitiveGroup *&prim,
1267  const GA_PointGroup *&points,
1268  bool strict = false);
1269 
1270  SYS_DEPRECATED_HDK_REPLACE(15.0,GroupCreator or other version of function and dont cast away const on input geo)
1271  int parseGroupsCopy(const char *pattern,
1272  GU_Detail *gdp,
1273  GA_PrimitiveGroup *&prim,
1274  GA_PointGroup *&points,
1275  GA_EdgeGroup *&edges,
1276  int unify,
1277  bool strict = false,
1278  GA_GroupType numeric_type
1279  = GA_GROUP_PRIMITIVE);
1280 
1281 public:
1282  /// Method to help fill in the menu entries representing attributes
1283  /// It will iterate though the attributes of the 'dictionary' supplied
1284  /// from the input 'input_index'. The 'approve' filter callback is applied
1285  /// (if present) and if it returns ture for an attribute, this attribute
1286  /// is appended to the 'menu_entries'. If not present, all attributes
1287  /// are appended. The number of entries appended does not exceed
1288  /// 'max_menu_size' (including the terminating sentinel). 'menu_entries' are
1289  /// sorted alphabetically and the function returns the number of entries
1290  /// appended (excluding the terminating sentinel).
1291  int fillAttribNameMenu(PRM_Name *menu_entries,
1292  int max_menu_size,
1293  GA_AttributeOwner dictionary,
1294  int input_index,
1295  bool (*approve)(const GA_Attribute*,void*)=NULL,
1296  void *approve_data = NULL);
1297 
1298  /// utility method for pruning the duplicate entries in a sorted menu
1299  static void removeMenuDuplicates(PRM_Name *menuEntries, int size);
1300 
1301  /// Obtains pointers to the vertex, point, and primitive vector attributes.
1302  /// Only vector attributes are considered.
1303  /// NB: it needs access to the gdp, so use it only in the cook methods
1304  void getVectorAttribs( const char * attrib_names,
1305  UT_Array<GA_Attribute *> &vertex_attribs,
1306  UT_Array<GA_Attribute *> &point_attribs,
1307  UT_Array<GA_Attribute *> &prim_attribs);
1308  static void getVectorAttribs( GU_Detail *gdp,
1309  const char * attrib_names,
1310  UT_Array<GA_Attribute *> &vertex_attribs,
1311  UT_Array<GA_Attribute *> &point_attribs,
1312  UT_Array<GA_Attribute *> &prim_attribs);
1313 
1314  /// parses the vector attrib parameter and fills attribs array
1315  static void getVectorAttribs(const GA_AttributeDict &dict,
1316  const char * attrib_string,
1317  UT_Array<GA_Attribute *> &attribs,
1318  UT_String &bad_attribs);
1319 
1320 protected:
1321 
1322  /// Drag-n-drop receiver functions
1323 
1324  virtual int acceptDragDrop(DD_Source &src,
1325  const char *l) override;
1326  virtual int testDragDrop(DD_Source &src) override;
1327  virtual void getDragDropChoice(DD_Source &src,
1328  DD_ChoiceList &choices) override;
1329 
1330  typedef void (SOP_Node::*GroupOperation)(const GA_Group *, void *);
1331 
1332  /// Perform an operation on each group matching the specified mask.
1333  int forEachGroupMatchingMask(
1334  const char *pattern,
1335  GroupOperation operation,
1336  void *data,
1337  GA_GroupType grpType,
1338  const GEO_Detail *pgdp=nullptr,
1339  bool maintainorder=false);
1340 public:
1341  static int invokeForEachGroupMatchingMask(
1342  const GU_Detail *gdp,
1343  const char *pattern,
1344  GA_GroupType grpType,
1345  const std::function<void(const GA_Group *)> &operation,
1346  bool maintainorder);
1347 protected:
1348 
1349  /// Take an optional group and subdivide it into smaller groups as
1350  /// input to operation
1351 
1352 public:
1353  static void invokeForSubdivisionOfPrimitiveGroup(
1354  const std::function<void(const GA_Group *)> &operation,
1355  const GA_PrimitiveGroup *group,
1356  int optype,
1357  int opstep, const char *oplabel,
1358  const GU_Detail *gdp);
1359 
1360 protected:
1361  void subdividePrimitiveGroup(
1362  GroupOperation operation,
1363  const GA_PrimitiveGroup *group,
1364  void *data, int optype,
1365  int opstep, const char *oplabel,
1366  const GU_Detail *gdp=0);
1367  void subdivideMixPrimitiveGroup(
1368  GroupOperation operation,
1369  const GA_PrimitiveGroup *group,
1370  void *data, int optype,
1371  int opstep, const char *oplabel,
1372  GU_Detail *gdp=0);
1373  void subdividePointGroup(
1374  GroupOperation operation,
1375  const GA_PointGroup *group,
1376  void *data, int optype,
1377  int opstep, const char *oplabel,
1378  GU_Detail *gdp=0);
1379 
1380 
1381  /// Create an adhoc (internal) group and add it to the list of adhoc groups.
1382  /// The group will be deleted for you after cooking.
1384  const char *p="adhoc")
1385  { return myGroupParse.createPrimitiveGroup(geo, p); }
1387  const char *p="adhoc")
1388  { return myGroupParse.createPointGroup(geo, p); }
1390  const char *p="adhoc")
1391  { return myGroupParse.createEdgeGroup(geo, p); }
1393  const char *p="adhoc")
1394  { return myGroupParse.createVertexGroup(geo, p); }
1396  {
1398  myGroupParse.appendAdhocGroup(group, true);
1399  return group;
1400  }
1402  {
1403  GA_PointGroup *group = geo.newDetachedPointGroup();
1404  myGroupParse.appendAdhocGroup(group, true);
1405  return group;
1406  }
1408  {
1409  GA_EdgeGroup *group = geo.newDetachedEdgeGroup();
1410  myGroupParse.appendAdhocGroup(group, true);
1411  return group;
1412  }
1414  {
1415  GA_VertexGroup *group = geo.newDetachedVertexGroup();
1416  myGroupParse.appendAdhocGroup(group, true);
1417  return group;
1418  }
1420  {
1421  return myGroupParse.createBreakpointGroup(geo);
1422  }
1423 
1424  /// This is only called when the instance flag is set.
1425  /// The gdp will be modified shortly after this function is called. After
1426  /// the return, the gdp member data should contain an empty (or full)
1427  /// GU_Detail. Setting the duplicate flag will duplicate the current gdp
1428  /// in the new one.
1429  /// This used to require one to derive from it to clear references
1430  /// to myInstanceOp. This is now handled at this level.
1431  void clearInstance(int duplicate = 0);
1432  /// True if another SOP has an instance of our geometry.
1433  bool hasInstances();
1434  /// Counts the number SOPs that are descended instances of our geometry.
1435  int countInstances();
1436  /// Clears SOPs with descended instances of our geometry.
1437  void clearAllInstances();
1438 
1439  /// In between cooks, the gdp pointer might be reset by the cooking engine
1440  /// (eg. if its gdp was instanced by some other SOP). If this function
1441  /// returns true, then it will be reset to an empty gdp. If this function
1442  /// returns false, then the contents of the old gdp will be duplicated into
1443  /// the new gdp. SOPs performing simulation which rely on the cooked
1444  /// contents of its gdp from the last frame should override this to return
1445  /// false.
1446  virtual bool shouldResetGeoToEmpty() const { return true; }
1447 
1448  /// The duplicate*Source methods take a context parameter but do not
1449  /// use it for anything.
1450  /// The specified input must already be locked. The context used to
1451  /// lock the input is the context used for duplication.
1452  OP_ERROR duplicateSource(unsigned index, OP_Context &context,
1453  GU_Detail *gdp, bool clean=true);
1455  {
1456  return duplicateSource(index, context, gdp, true);
1457  }
1458 
1459  /// Only duplicates the source if the source has changed. Otherwise,
1460  /// it copies the points from the source to our gdp. It's meant to be
1461  /// used by most deformer SOPs, which simply transform the points and
1462  /// or the primitives. If wattrib is true, we check if any transforming
1463  /// primitive or vertex attributes are present and if any point attribs
1464  /// exist, and copy those too.
1465  ///
1466  /// NOTE: Do not use this if you are creating or destroying point
1467  /// attributes.
1468  ///
1469  /// NOTE: While this takes a gdp to operate on, if it is not the SOP's
1470  /// own gdp, it will just do a duplicateSource.
1471  OP_ERROR duplicatePointSource(unsigned index, OP_Context &ctx,
1472  GU_Detail *gdp, bool clean = true,
1473  bool wattrib = true,
1474  bool *fully = 0);
1476  {
1477  return duplicatePointSource(index, ctx, gdp, 1,
1478  true, 0);
1479  }
1480 
1481  /// This copies all the point positions from the given input gdp into
1482  /// the current one.
1483  /// @pre input_i has already been locked via lockInput
1484  bool copyPointPosFromSource(
1485  unsigned input_i, OP_Context &ctx);
1486 
1487  /// @brief Only duplicates the source if the source has changed since the
1488  /// last call to this method.
1489  OP_ERROR duplicateChangedSource(unsigned idx, OP_Context &ctx,
1490  int *changed = 0, bool force=false);
1491 
1492  /// Only duplicates primitives in primgroup from src_gdp to dest_gdp
1493  OP_ERROR duplicateSourceGroup(const GU_Detail *src_gdp,
1494  const GA_PrimitiveGroup *primgroup,
1495  GU_Detail *dest_gdp=0);
1496 
1497  /// Forces duplicateChangedSource() to do the duplication on its next call.
1498  void resetChangedSourceFlags();
1499 
1500  /// @brief Checks if a duplication will occur on the next call to
1501  /// duplicateChangedSource().
1502  ///
1503  /// Similar to useInputSource() except it doesn't affect the flags. It's
1504  /// used to simply query whether the given input has changed. Returns false
1505  /// if there's errors on the input. Upon return, @c changed is updated.
1506  OP_ERROR checkChangedSourceFlags(unsigned idx, OP_Context &ctx,
1507  int *changed);
1508 
1509  /// @brief Mark the given input as used for cooking by this node.
1510  ///
1511  /// This updates source flags to mark the input as now clean, returning
1512  /// whether the input has changed since the last time this function was
1513  /// called. If force is true, then we treat the input as always dirty.
1514  /// Returns false if the input has errors.
1515  /// @note duplicateChangedSource() calls this function.
1516  bool useInputSource(unsigned idx, bool &changed, bool force)
1517  {
1518  return myInputChangeHelper.useInput(
1519  *this, idx, changed, force);
1520  }
1521 
1522  virtual void deleteCookedData() override;
1523  virtual int deleteNodeData(void *) override;
1524 
1525  /// Convenience wrappers for several common pasting operations. The last
1526  /// method destroys both groups:
1528  {
1529  return gdp->getPastedSurfaces("_sop_all_pasted_");
1530  }
1532  {
1533  return gdp->getPastedSurfaces(used,
1534  "_sop_all_pasted_",
1535  "_sop_used_pasted_");
1536  }
1538  const GA_PrimitiveGroup *all,
1539  GA_PrimitiveGroup *used)
1540  {
1541  gdp->updatePastedDisplacement(ptoff, all, used);
1542  }
1544  {
1545  // return 1 if pasted surfaces found
1546  return gdp->updatePastedDisplacements();
1547  }
1549  GA_PrimitiveGroup *used)
1550  {
1551  // all and used are deleted if they exist
1552  return gdp->updatePastedDependents(all, used);
1553  }
1554 
1555  /// Methods for dealing with group centroid
1556  void convertPivotAboutGroupCentroid(
1557  PRM_Parm &grppivot_parm,
1558  int pivot_parm_idx,
1559  const UT_Vector3 *centroid = 0);
1560  void convertPivotAboutGroupCentroid(
1561  PRM_Parm &grppivot_parm,
1562  const char *pivot_parm_name,
1563  const UT_Vector3 *centroid = 0);
1564 
1565 
1566  /// subclasses override this to return the group centroid if they support
1567  /// it.
1568  virtual bool getGroupCentroid(OP_Context & /*context*/,
1569  UT_Vector3 & /*centroid*/)
1570  { return false; }
1571 
1572  //
1573  // I/O methods
1574  //
1575  virtual OP_ERROR save(std::ostream &os, const OP_SaveFlags &flags,
1576  const char *pathPrefix,
1577  const UT_String &name_override = UT_String()) override;
1578  virtual bool load(UT_IStream &is, const char *extension,
1579  const char *path=0) override;
1580 
1581  void refreshGdp();
1582 
1583 
1584  //
1585  // Data for the SOP class
1586  //
1587 
1588  /// The gdp handle provides a indirect reference to the current
1589  /// gdp of this SOP.
1591 
1592  /// During cooks, myGdpHandle is writelocked and stored in the
1593  /// gdp variable. This is to provide backwards compatibility.
1594  /// The gdp variable should not be trusted or accessed elsewhere.
1596  SOP_Guide *myGuide1; // primary guide geometry
1597  SOP_Guide *myGuide2; // secondary guide geometry
1599 
1600 private:
1601  //
1602  // These virtuals are methods that nobody should override...
1603  //
1604  // I/O methods
1605  //
1606  virtual OP_ERROR saveIntrinsic(std::ostream &os,
1607  const OP_SaveFlags &flags) override;
1608 
1609  virtual bool loadPacket(UT_IStream &is,
1610  short class_id, short sig,
1611  const char *path=0) override;
1612  virtual bool loadPacket(UT_IStream &is, const char *token,
1613  const char *path=0) override;
1614 
1615  virtual void clearAndDestroy() override;
1616 
1617  virtual int saveCookedData(const char *,
1618  OP_Context &) override;
1619  virtual int saveCookedData(std::ostream &os,
1620  OP_Context &,
1621  int binary = 0) override;
1622  virtual bool loadCookedData(UT_IStream &is,
1623  const char *path=0) override;
1624 
1625  /// loadHardCookedData is just like loadCookedData, except it doesn't
1626  /// check if this SOP is softlocked. Use it only if you know you are
1627  /// loading hardlocked data (as in SOP_UndoModel)
1628  bool loadHardCookedData(UT_IStream &is, const char *path=0);
1629 
1630  virtual const char *getFileExtension(int binary) const override;
1631 
1632  int softLockable(const GU_Detail &unmodelled_gdp,
1633  const GU_Detail &modelled_gdp) const;
1634  /// take a snapshot of the current gdp and stores the soft lock data.
1635  /// copies the previous slock data to the given reference (so caller
1636  /// can use it for undo)
1637  /// returns 1 on success, 0 otherwise
1638  int storeSoftLockData(OP_Context &context, int prev_lock,
1639  SOP_SoftLockData *old_slockdata=0);
1640 
1641  sopVisualizeCallback *myVisualizeCallback;
1642  void *myVisualizeCallbackData;
1643 
1644 public:
1645 
1646  // compact the weight data of an index pair attribute
1647  static void compactIndexPair(GA_Attribute *attrib);
1648 
1649 public:
1650  /// Do not use this function! Using it will likely cause crashes.
1651  virtual void unloadDataHack();
1652 
1653  virtual bool unloadData() override;
1654 
1655  /// Returns the amount of memory owned by this node, *NOT* including
1656  /// any cooked geometry.
1657  virtual int64 getMemoryUsage(bool inclusive) const override;
1658 
1659  /// Returns the amount of memory used by this SOP, that will
1660  /// be unloaded by an unload call. Baseclass defaults to
1661  /// returning the GDP's data.
1662  virtual int64 getLoadedMemoryUsage() const;
1663 
1664  /// Returns whether this node currently has cooked data or not.
1665  bool isLoaded() const override;
1666 
1667  /// Returns if the sop cache manager will allow unloading.
1668  bool shouldUnload() const;
1669 
1670  /// Convenience method to prepare newly allocated GU_Detail objects to
1671  /// act as the output.
1672  /// Note that this returns the passed in gdp pointer.
1673  static GU_Detail *prepNewDetail(GU_Detail *gdp);
1674 
1675  /// This method is automatically called at the conclusion of cooking to
1676  /// notify the gdp that it's data has changed. By default, this will call:
1677  /// @code
1678  /// if (bumpalldataid)
1679  /// gdp->bumpAllDataIds();
1680  /// gdp->defragment();
1681  /// gdp->edgeGroups().makeAllEdgesValid();
1682  /// gdp->incrementMetaCacheCount();
1683  /// @endcode
1684  static void markDetailDirty(GU_Detail *dirtygdp,
1685  bool bumpalldataid);
1686 
1687  /// All SOP nodes can be a selection owner.
1688  /// This replaces the previous inheritance from SOP_SelectionOwner.
1689  virtual bool isSelectionOwnerType() const final
1690  { return true; }
1691 
1692 private:
1693  OP_InputChangeHelper myInputChangeHelper;
1694 
1695  /// We store all locked inputs in this list. We can then allow
1696  /// the same source node to be cooked with different contexts
1697  /// and let copy on write semantics avoid problems.
1698  /// Any non-null handle here has PreserveRequest set and should
1699  /// have it removed before removing.
1700  UT_ValArray<GU_DetailHandle *> myInputGeoHandles;
1701 
1702  GOP_Manager myGroupParse;
1703 
1704  friend class SOP_UndoModel; // needs access to gdp
1705  friend class SOP_CacheManager; // needs access to handle.
1706  friend class SOP_CacheData; // needs access to handle.
1707  friend class sop_AttributeEvaluator; // needs access to local var info
1708 
1709  //
1710  // Private data
1711  //
1712  SOP_SoftLockData *mySoftLockData;
1713 
1714  bool myHasCookedSelection;
1715 
1716  /// the capture override flag is used to indicate wheter the SOPs should
1717  /// use their capture parameters or cook capture geometry. (e.g.,
1718  /// SOP_CaptureRegion). This flag is mirrored from OBJ_Bone, which
1719  /// allows to view bones and capture region in their capture configuration
1720  static bool theGlobalCaptOverride;
1721 
1722  UT_Lock myInstancingOpsLock;
1723  UT_Set<int> myInstancingOps;
1724  int myInstanceOp; // Which op we are instancing.
1725 
1726 public:
1727  // This method needs to be public so HOM can flag an expression as needing
1728  // corresponding to local variables.
1730  { myUsesSOPLocalVar = true; }
1731 
1732  sop_AttributeEvaluator *createAttributeEvaluator(const char *attribname);
1733 protected:
1734  /// Local variable items:
1738 
1739  /// Tracks if any expression has triggered a local variable,
1740  /// like $PT, etc. If this is false, it is safe to only
1741  /// evaluate the parm once for all subtypes.
1742  /// The higher level code is expected to clear this flag, evaluate their
1743  /// relevant parms, and then test this flag.
1745 private:
1746  // myFlagUnused used to be myLocalVarActive, which has been moved down to
1747  // OP_Node. It's still here to avoid breaking HDK binary compatibility.
1748  bool myFlagUnused;
1749  const GU_Detail *myCurGdp[2];
1750  GU_DetailHandle myCurGdh[2];
1751 
1752  /// This is the selection set we use when the footprint flag is on.
1753  GU_SelectionSetHandle myFootprintSelectionSet;
1754 
1755  /// This is a complete override for all selection sets. Used temporarily
1756  /// by selectors.
1757  GU_SelectionSetHandle mySelectionSetOverride;
1758 
1759 protected:
1760  GA_Offset myCurVtxOff[2];
1761  int myCurVtxNum[2];
1762  GA_Offset myCurPtOff[2];
1763  GA_Offset myCurPrimOff[2];
1764  int myCurBuiltPtBox[2];
1765  UT_BoundingBox myCurPtBox[2];
1766  int myCurBuiltPrimBox[2];
1767  UT_BoundingBox myCurPrimBox[2];
1768 
1769  int myCurGdpVal; // Which gdp is being traversed
1770 
1771  /// Cached values so we can tell if we have to rebuild.
1774  /// This is all the old attribute information, one for each of the
1775  /// dictionary types... If this (including the order) matches the
1776  /// new attribute data, no offsets will have changed.
1777  UT_Array<sop_attribRef> myAttribCache[2][4];
1778  UT_String myVarMapCache[2];
1779  int myAttribCacheOffsetGdpId[2];
1780  int myAttribCacheOffsetMetaCacheCount[2];
1781  unsigned int myAttribCacheTotalDictSize[2];
1782  /// Stores the @ cache lookups generated JIT.
1784 
1785  /// Stores the parms & cache for old-style node cooking of verb
1786  /// based nodes.
1789  friend class SOP_NodeVerb;
1790  friend class SOP_NodeParms;
1791  friend class sop_NodeInputs;
1792 };
1793 
1794 /// Function to get a list of template arrays containing parm names that must
1795 /// be reserved when compiling VEX SOPs.
1796 SOP_API extern void
1798 
1799 #endif
static PRM_ChoiceList primGroupMenu
Definition: SOP_Node.h:1164
virtual bool usesFootprint() const override
Definition: SOP_Node.h:161
GA_VertexGroup * parseVertexGroupsCopy(const char *pattern)
Definition: SOP_Node.h:632
GA_PointGroup * newDetachedPointGroup() const
Definition: GA_Detail.h:1270
GT_API const UT_StringHolder selection
int curVertexNum(int index) const
Definition: SOP_Node.h:340
Definition of a geometry attribute.
Definition: GA_Attribute.h:190
GA_VertexGroup * createAdhocVertexGroup(GU_Detail &geo, const char *p="adhoc")
Definition: SOP_Node.h:1392
GA_PrimitiveGroup * getPastedSurfaces()
Definition: SOP_Node.h:1527
static PRM_ChoiceList allGroupMenu
Definition: SOP_Node.h:1162
static PRM_ChoiceList vertexTextureCoordMenu
Definition: SOP_Node.h:1185
static PRM_SpareData theFourthInput
Definition: SOP_Node.h:864
GLenum GLint * range
Definition: glcorearb.h:1924
virtual const SOP_NodeVerb * cookVerb() const
Definition: SOP_Node.h:886
#define SOP_Guide
Definition: SOP_Guide.h:17
#define SYS_DEPRECATED(__V__)
GA_StorageClass myStorageClass
Definition: SOP_Node.h:90
GA_ROAttributeRef myOffset
Definition: SOP_Node.h:86
const GA_Group * parseAllGroups(const char *pattern)
Definition: SOP_Node.h:647
GA_Offset curVertex(int local_var_gdp_index) const
Definition: SOP_Node.h:346
GA_PointGroup * createAdhocPointGroup(const GEO_Detail &geo)
Definition: SOP_Node.h:1401
static PRM_ChoiceList namedPrimsMenu
Definition: SOP_Node.h:1173
static PRM_ChoiceList namedVolumesGlobMenu
Definition: SOP_Node.h:1176
Class which stores the default values for a GA_Attribute.
Definition: GA_Defaults.h:35
#define SYS_VISIBILITY_EXPORT
GA_StorageClass
Definition: GA_Types.h:68
UT_StringMap< sop_AttributeEvaluator * > myAttributeEvaluatorCache
Stores the @ cache lookups generated JIT.
Definition: SOP_Node.h:1783
GT_API const UT_StringHolder time
#define SYS_DEPRECATED_PUSH_DISABLE()
const GA_PrimitiveGroup * parsePrimitiveGroups(const char *pattern)
Definition: SOP_Node.h:551
static PRM_ChoiceList allAttribMenu
Definition: SOP_Node.h:1178
GA_AttributeOwner myDictionary
Definition: SOP_Node.h:91
#define SYS_DEPRECATED_POP_DISABLE()
GLuint start
Definition: glcorearb.h:474
GLuint color
Definition: glcorearb.h:1260
virtual OP_OpTypeId getOpTypeID() const =0
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GroupSelectAsOrdered
Definition: SOP_Node.h:1203
#define SYS_DEPRECATED_HDK_REPLACE(__V__, __R__)
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
void destroyAdhocGroups(const GU_Detail *g)
Definition: SOP_Node.h:675
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
void updatePastedDisplacement(GA_Offset ptoff, const GA_PrimitiveGroup *all, GA_PrimitiveGroup *used)
static PRM_ChoiceList breakpointGroupMenu
Definition: SOP_Node.h:1168
int removeAdhocGroup(const GA_Group *group)
Definition: SOP_Node.h:903
void addSystemError(const char *msg=0)
Definition: SOP_Node.h:1145
static PRM_ChoiceList pointAttribMenu
Definition: SOP_Node.h:1181
bool useInputSource(unsigned idx, bool &changed, bool force)
Mark the given input as used for cooking by this node.
Definition: SOP_Node.h:1516
GLboolean GLboolean g
Definition: glcorearb.h:1221
void addMessage(SOP_ErrorCodes code, const char *msg=0)
Definition: SOP_Node.h:1136
GLint level
Definition: glcorearb.h:107
void updatePastedDisplacement(GA_Offset ptoff, const GA_PrimitiveGroup *all, GA_PrimitiveGroup *used)
Definition: SOP_Node.h:1537
SOP_UIChangeType
Definition: SOP_Node.h:57
GLint GLuint mask
Definition: glcorearb.h:123
UT_ErrorSeverity
Definition: UT_Error.h:25
void addCommonError(UT_CommonErrorCode what, const char *msg=0)
Definition: SOP_Node.h:1147
GLbitfield flags
Definition: glcorearb.h:1595
static PRM_ChoiceList primNamedGroupMenu
Definition: SOP_Node.h:1169
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
CH_LocalVariable myVar
Definition: SOP_Node.h:83
fpreal(SOP_Node::* SOP_LocalVarFunc)(sopVarInfo *varinfo)
Definition: SOP_Node.h:78
static PRM_SpareData theSecondElseFirstInput
Definition: SOP_Node.h:867
UT_SharedPtr< GU_SelectionSet > GU_SelectionSetHandle
GU_DetailHandle myGdpHandle
Definition: SOP_Node.h:1590
SOP_ErrorCodes
Definition: SOP_Error.h:16
const GEO_Primitive * curPrim(int index) const
Definition: SOP_Node.h:354
SOP_Guide * myGuide1
Definition: SOP_Node.h:1596
3D Vector class.
const GA_PointGroup * parsePointGroups(const char *pattern)
Definition: SOP_Node.h:581
static PRM_ChoiceList pointGroupMenu
Definition: SOP_Node.h:1165
OP_Network * getCreator() const
virtual void setForceCapture(int)
Definition: SOP_Node.h:833
void addError(int code, const char *msg=0)
Definition: SOP_Node.h:1133
fpreal myDefault
Definition: SOP_Node.h:89
bool hasCookedSelection() const
Definition: SOP_Node.h:770
GLsizeiptr size
Definition: glcorearb.h:663
int myLocalVarOrder
Definition: SOP_Node.h:1737
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
static PRM_ChoiceList pointNamedGroupMenu
Definition: SOP_Node.h:1170
int myCurGdpVal
Definition: SOP_Node.h:1769
virtual const CH_LocalVariable * resolveExtraVariableForSyntaxHighlight(const char *name)
A range of elements in an index-map.
Definition: GA_Range.h:42
GA_EdgeGroup * parseEdgeGroupsCopy(const char *pattern)
Definition: SOP_Node.h:608
A string map of attributes to ease backward compatibility In the GB/GEO/GU library code would often p...
GA_Offset curPoint(int index) const
Definition: SOP_Node.h:351
#define SYS_DEPRECATED_REPLACE(__V__, __R__)
GA_Size GA_Offset
Definition: GA_Types.h:617
virtual void opChanged(OP_EventType reason, void *data=0)
SYS_VISIBILITY_EXPORT void newSopOperator(OP_OperatorTable *table)
Definition: SOP_Euclid.C:44
long long int64
Definition: SYS_Types.h:107
const GU_DetailHandle & curGdh(int index) const
Definition: SOP_Node.h:334
static PRM_SpareData theFirstInput
Definition: SOP_Node.h:861
GLfloat f
Definition: glcorearb.h:1925
virtual const char * getOpType() const =0
static PRM_ChoiceList edgePointGroupMenu
Definition: SOP_Node.h:1167
static PRM_ChoiceList vertexNamedGroupMenu
Definition: SOP_Node.h:1172
PRM_UVGroupType
Definition: PRM_Shared.h:34
int myLocalVarOrderCache
Cached values so we can tell if we have to rebuild.
Definition: SOP_Node.h:1772
UT_String myName
Definition: SOP_Node.h:71
static PRM_ChoiceList namedVolumesMenu
Definition: SOP_Node.h:1175
int updatePastedDependents(GA_PrimitiveGroup *all, GA_PrimitiveGroup *used)
void expandGroupMask(const char *pattern, UT_String &outNames, GA_GroupType type)
Definition: SOP_Node.h:530
void destroyAdhocGroups()
Definition: SOP_Node.h:673
const GU_Detail * inputGeo(int index, OP_Context &)
Definition: SOP_Node.h:1122
This class provides a way to manage a reference to an attribute permitting Read-Only access...
GOP_Manager::GroupCreator GroupCreator
Typedef to help make use of GroupCreator less verbose.
Definition: SOP_Node.h:536
void addWarning(SOP_ErrorCodes code, const char *msg=0)
Definition: SOP_Node.h:1139
static PRM_ChoiceList namedPrimsGlobMenu
Definition: SOP_Node.h:1174
int64 exint
Definition: SYS_Types.h:116
GA_VertexGroup * createAdhocVertexGroup(const GEO_Detail &geo)
Definition: SOP_Node.h:1413
bool myUsesSOPLocalVar
Definition: SOP_Node.h:1744
SOP_NodeCache * myNodeVerbCache
Definition: SOP_Node.h:1787
SOP_Guide * myGuide2
Definition: SOP_Node.h:1597
static bool getCaptureOverrideFlag()
Definition: SOP_Node.h:190
virtual int isCookingRender() const override
Definition: SOP_Node.h:120
GA_PrimitiveGroup * newDetachedPrimitiveGroup() const
Definition: GA_Detail.h:1274
UT_ValArray< sopVarInfo * > myLocalVarArray
Definition: SOP_Node.h:1736
GA_EdgeGroup * createAdhocEdgeGroup(GU_Detail &geo, const char *p="adhoc")
Definition: SOP_Node.h:1389
UT_String myAttribName
Definition: SOP_Node.h:85
void removeAdhocGroups()
Definition: SOP_Node.h:905
GLintptr offset
Definition: glcorearb.h:664
virtual GOP_GuideListType getGuideListType() const
Definition: SOP_Node.h:496
virtual bool addOrMoveVisualizerToOutput(int outputidx)
Definition: OP_Node.h:2980
UT_BoundingBox curPointBBox(int index)
Definition: SOP_Node.h:358
int myTupleIndex
Definition: SOP_Node.h:88
sopVarInfo * mySecondaryVariable
Definition: SOP_Node.h:87
int updatePastedDisplacements()
Definition: SOP_Node.h:1543
SOP_NodeFlags mySopFlags
Definition: SOP_Node.h:1598
GA_EdgeGroup * newDetachedEdgeGroup() const
Definition: GA_Detail.h:1282
GA_PointGroup * parsePointGroupsCopy(const char *pattern)
Definition: SOP_Node.h:595
OP_OpTypeId
Definition: OP_OpTypeId.h:15
GLenum GLenum severity
Definition: glcorearb.h:2538
GLboolean * data
Definition: glcorearb.h:130
GA_Storage myStorage
Definition: SOP_Node.h:73
GA_PrimitiveGroup * getPastedSurfaces(GA_PrimitiveGroup *&used)
Definition: SOP_Node.h:1531
SOP_API void SOPfillMetaKernelMenu(void *, PRM_Name *names, int size, const PRM_SpareData *, const PRM_Parm *)
GLuint const GLchar * name
Definition: glcorearb.h:785
int destroyAdhocGroup(const GA_Group *group)
Definition: SOP_Node.h:671
virtual const CH_LocalVariable * resolveVariable(const char *name)
GA_BreakpointGroup * parseBreakpointGroupsCopy(const char *pattern)
Definition: SOP_Node.h:620
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:611
virtual bool getGroupCentroid(OP_Context &, UT_Vector3 &)
Definition: SOP_Node.h:1568
GA_PrimitiveGroup * createAdhocPrimGroup(GU_Detail &geo, const char *p="adhoc")
Definition: SOP_Node.h:1383
UT_SharedPtr< GU_Selection > GU_SelectionHandle
const GA_VertexGroup * parseVertexGroups(const char *pattern)
Definition: SOP_Node.h:627
static PRM_ChoiceList groupMenu
Definition: SOP_Node.h:1163
#define SOP_OPTYPE_NAME
Definition: OP_Node.h:245
GU_SelectionType
Definition: GU_SelectType.h:29
GU_Detail * gdp
Definition: SOP_Node.h:1595
SOP_API void SOPgetVexReservedTemplateLists(UT_ValArray< PRM_Template * > &tplatelists)
GT_API const UT_StringHolder version
static PRM_ChoiceList edgeGroupMenu
Definition: SOP_Node.h:1166
void setUsesSOPLocalVar()
Definition: SOP_Node.h:1729
const GU_Detail * curGdp(int index) const
Definition: SOP_Node.h:343
UT_CommonErrorCode
Definition: UT_Error.h:42
static PRM_ChoiceList vertexAttribMenu
Definition: SOP_Node.h:1182
const SOP_NodeFlags & getFlags() const
Definition: SOP_Node.h:117
virtual const char * getChildType() const
void addFatal(SOP_ErrorCodes code, const char *msg=0)
Definition: SOP_Node.h:1142
virtual bool shouldResetGeoToEmpty() const
Definition: SOP_Node.h:1446
GLsizei const GLfloat * value
Definition: glcorearb.h:823
GA_VertexGroup * newDetachedVertexGroup() const
Definition: GA_Detail.h:1278
GA_AttributeOwner
Definition: GA_Types.h:33
double fpreal
Definition: SYS_Types.h:270
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
static PRM_ChoiceList primAttribMenu
Definition: SOP_Node.h:1180
void sopVisualizeCallback(void *, SOP_Node *, OP_Context &, GU_Detail *)
Definition: SOP_Node.h:105
static void setCaptureOverrideFlag(bool flag)
Definition: SOP_Node.h:186
void addCommonWarning(UT_CommonErrorCode what, const char *msg=0)
Definition: SOP_Node.h:1150
typedef int
Definition: png.h:1175
static PRM_ChoiceList edgeNamedGroupMenu
Definition: SOP_Node.h:1171
int updatePastedDisplacements(void)
SOP_LocalVarFunc myCallback
Definition: SOP_Node.h:93
GA_Group * parseAllGroupsCopy(const char *pattern)
Definition: SOP_Node.h:662
GA_PrimitiveGroup * getPastedSurfaces(const char *n="__gu_all_pasted__")
GA_GroupType
An ordinal enum for the different types of groups in GA.
Definition: GA_Types.h:138
const GA_BreakpointGroup * parseBreakpointGroups(const char *pattern)
Definition: SOP_Node.h:615
GLuint index
Definition: glcorearb.h:785
GA_PrimitiveGroup * parsePrimitiveGroupsCopy(const char *pattern)
Definition: SOP_Node.h:565
SOP_NodeParms * myNodeVerbParms
Definition: SOP_Node.h:1788
GLuint GLfloat * val
Definition: glcorearb.h:1607
UT_SymbolMap< sopVarInfo * > myLocalVarTable
Local variable items:
Definition: SOP_Node.h:1735
OP_EventType
Definition: OP_Value.h:22
A global error manager scope.
static PRM_ChoiceList detailAttribMenu
Definition: SOP_Node.h:1179
#define SOP_API
Definition: SOP_API.h:10
GA_PrimitiveGroup * createAdhocPrimGroup(const GEO_Detail &geo)
Definition: SOP_Node.h:1395
virtual bool isSelectionOwnerType() const final
Definition: SOP_Node.h:1689
OP_DataType
Definition: OP_DataTypes.h:28
virtual OP_OpTypeId getChildTypeID() const =0
virtual void setVisualization(int)
Definition: SOP_Node.h:832
static PRM_SpareData theThirdInput
Definition: SOP_Node.h:863
GA_PointGroup * createAdhocPointGroup(GU_Detail &geo, const char *p="adhoc")
Definition: SOP_Node.h:1386
virtual bool evalVariableValue(UT_String &val, int index, int thread)
int myVaridx
Definition: SOP_Node.h:92
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
OP_ERROR duplicatePointSource(unsigned index, OP_Context &ctx)
Definition: SOP_Node.h:1475
getOption("OpenEXR.storage") storage
Definition: HDK_Image.dox:276
GOP_GuideListType
Definition: GOP_Guide.h:24
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:126
GA_GroupMaskType
Definition: GA_Types.h:151
virtual int isCookingRender() const
Definition: OP_Node.h:2380
#define const
Definition: zconf.h:214
static PRM_SpareData theSecondInput
Definition: SOP_Node.h:862
png_infop png_uint_32 flag
Definition: png.h:2242
UT_BoundingBox curPrimBBox(int index)
Definition: SOP_Node.h:366
const GA_EdgeGroup * parseEdgeGroups(const char *pattern)
Definition: SOP_Node.h:603
GEO_Standard_Attributes
Definition: GEO_Detail.h:150
int myCurrentLayerCache
Definition: SOP_Node.h:1773
PRM_GroupType
Definition: PRM_Shared.h:23
GA_BreakpointGroup * createAdhocBreakpointGroup(const GEO_Detail &geo)
Definition: SOP_Node.h:1419
GA_Storage
Definition: GA_Types.h:48
OP_ERROR duplicateSource(unsigned index, OP_Context &context)
Definition: SOP_Node.h:1454
static PRM_ChoiceList allTextureCoordMenu
Definition: SOP_Node.h:1184
GA_EdgeGroup * createAdhocEdgeGroup(const GEO_Detail &geo)
Definition: SOP_Node.h:1407
int updatePastedDependents(GA_PrimitiveGroup *all, GA_PrimitiveGroup *used)
Definition: SOP_Node.h:1548
virtual void clearCache()
static const char * theChildTableName
Definition: SOP_Node.h:113
GLenum src
Definition: glcorearb.h:1792
int myTable
Definition: SOP_Node.h:84