HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PI_EditScriptedParms.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: PI_EditScriptedParms.h ( OP Library, C++)
7  *
8  * COMMENTS: Provides a data structure for holding all the information
9  * required to edit the parameters of a PI_ScriptOperator.
10  */
11 
12 #ifndef __PI_EditScriptedParms__
13 #define __PI_EditScriptedParms__
14 
15 #include "PI_API.h"
16 #include <UT/UT_Color.h>
17 #include <UT/UT_String.h>
18 #include <UT/UT_StringArray.h>
19 #include <UT/UT_StringHolder.h>
20 #include <UT/UT_ValArray.h>
21 #include <CH/CH_ExprLanguage.h>
22 #include <PRM/PRM_Type.h>
23 #include <OP/OP_Node.h>
24 #include <iosfwd>
25 
26 class PRM_Template;
27 class PRM_SpareData;
28 class PRM_Parm;
29 class PRM_Range;
30 class PRM_ChoiceList;
31 class PRM_ScriptImports;
32 class OP_Operator;
34 class pi_GroupData;
35 
36 #define PI_MAX_SCRIPT_PARM_SIZE 16
37 #define PI_FOLDER_DEFAULTNAME "folder0"
38 
39 typedef enum {
46 
47 typedef enum {
52 
53 typedef enum {
65 
67 
69 {
70 public:
71  bool isValidChoice() const
72  {
73  return myToken.isstring() || myLabel.isstring();
74  }
75 
78 };
79 
81 {
82 public:
84  PI_EditScriptedParm(const PRM_Template &tplate, OP_Node *node,
85  bool init_auto_links=true);
89 
90  /// Assignment operator.
91  const PI_EditScriptedParm & operator=(const PI_EditScriptedParm &src);
92 
94  {
95  myType = type;
96  myCachedTypeIndex = -2;
97  }
98  const UT_StringHolder &getType() const { return myType; }
99 
100  void changeTypeToRampColor();
101  void changeTypeToRampFloat();
102 
103  // Copy default parm values from the current values on the given parameter
104  // starting at the specified subindex on that parameter (mapping it to 0
105  // on this parameter).
106  void copyDefaultValuesFromParm(PRM_Parm *parm, int subidx);
107 
108  // Resets the autolink values from one or more channels of this parm
109  // to the set of currently existing links. Setting subidx to -1 causes
110  // all channels to reset their autolinks.
111  void setAutolinksToCurrentLinks(OP_Node *node, int subidx);
112 
113  // Take the incoming list of parm or channel names and add those parms
114  // or channels to our autolink values in an intelligent way. The
115  // links array will be filled with the name of the parameter each of the
116  // parms was linked to (or an emtpy string if no link was made for that
117  // parm).
118  void addParametersToAutolink(const UT_StringArray &parms,
119  const char *nodepath,
120  bool linkinvisibles,
121  PI_EditScriptedParms *owner,
122  UT_StringArray &errors);
123 
124  void setRange(const PRM_Range &range);
125 
126  int save(std::ostream &os, int indent, OP_Operator *op,
127  bool validate_join,
128  const PI_EditScriptedParm *nextparm,
129  bool in_import_block);
130  int saveSelectors(std::ostream &os, const char *tokeni,
131  OP_Operator *op);
132  void saveSpareData(std::ostream &os,
133  const char *tokeni,
134  bool skip_import_data,
135  bool first_group_page);
136  void saveSpareValue(std::ostream &os, const char *tokeni,
137  const char *spare_token);
138  void saveConditional(std::ostream &os, int indent,
139  const char *name,
140  UT_StringHolder &conditional);
141  // Debug dump of data
142  void dump(std::ostream &os);
143 
144  int getNMenu() const { return myMenu.entries(); }
145  void addMenu(
146  const UT_StringHolder &token = UT_StringHolder(),
148  void moveMenu(int idx);
149  void destroyMenu(int idx);
150  int checkNullMenu();
151  void clearMenuItems();
152  void clearCachedChannels();
153 
154  void setMenu(const PRM_ChoiceList *menu,
155  PRM_TypeExtended extended_menu_type);
156 
157  // Get our parm type index from our string type for use when building
158  // channels, or applying autolinks. It will return -1 for import blocks
159  // and tab folder which do not allow any of this sort of activity.
160  // The return value can be used to interface to theParmTypes array ONLY!
161  int getParmTypeIdxForChannels() const;
162  // Set the parameter size in a safe way.
163  void setSize(int size);
164 
165  // Accessor to get the list of channel names. This method
166  // updates the channel name cache, if necessary, and returns a constant
167  // reference directly to the cache in an attempt to avoid the overhead of
168  // building a UT_StringArray.
169  const UT_StringArray &getChannelNames() const;
170 
171  // Get list of channel names for particular potential new parm name, using
172  // the internal channel token cache.
173  const UT_StringArray &getChannelNames(const UT_StringRef &new_parm) const;
174 
175  // Copy all the spare data for the specified folder index from the given
176  // reference data. The index is the vector index of this folder in the
177  // corresponding switcher parameter.
178  void extractGroupSpareData(const PRM_SpareData *ref,
179  int index);
180 
181  // Merges the provided spare data into our spare data.
182  void mergeSpareData(const PRM_SpareData *srcsparedata);
183 
184  const char *getSpareValue(const char *token) const;
185  void setSpareValue(const char *token, const char *value);
186  void copySpareValue(const char *token,
187  const PRM_SpareData &ref);
188 
189  const char *getCallbackData() const;
190  void setCallbackData(const char *value);
191  CH_ScriptLanguage getCallbackLanguage() const;
192  void setCallbackLanguage(CH_ScriptLanguage language);
193 
194  const char *getOpFilter() const;
195  void setOpFilter(const char *value);
196  void setOpFilter(const PRM_SpareData *spareptr);
197  const char *getRManType() const;
198  void setRManType(const char *value);
199  int getMultiStartOffset() const;
200  void setMultiStartOffset(int value);
201  void setRampColorType(UT_ColorType color_type);
202  UT_ColorType getRampColorType() const;
203  const char *getRampBasisVar() const;
204  void setRampBasisVar(const char *value);
205  const char *getRampKeysVar() const;
206  void setRampKeysVar(const char *value);
207  const char *getRampValuesVar() const;
208  void setRampValuesVar(const char *value);
209  const char *getImportSource() const;
210  void setImportSource(const char *value);
211  const char *getImportToken() const;
212  void setImportToken(const char *value);
213  const char *getImportMask() const;
214  void setImportMask(const char *value);
215  bool getImportEnable() const;
216  void setImportEnable(bool value);
217  bool getExportDisable() const;
218  void setExportDisable(bool value);
219  bool getUnquotedFlag() const;
220  void setUnquotedFlag(bool value);
221  bool getIsGroupStart() const;
222  bool getIsGroupEnd() const;
223  bool getIsGroupParm() const;
224  bool getIsMultiParm() const;
225  bool getIsRampParm() const;
226  bool getIsRampParmColor() const;
227  bool getIsRampParmFloat() const;
228  bool getIsFileParm() const;
229  bool getIsBasicStringParm() const;
230  bool getIsButtonParm() const;
231 
232  bool getIsColorParm() const;
233  PRM_ColorType getColorType() const;
234  void setColorType(PRM_ColorType color_type);
235  bool getColorWheel() const;
236  void setColorWheel(bool value);
237  bool getColorDynamic() const;
238  void setColorDynamic(bool value);
239 
240  bool getIsKeyValueDictParm() const;
241  const char *getKeyValueDictKeyLabel() const;
242  void setKeyValueDictKeyLabel(const char *label);
243  const char *getKeyValueDictValueLabel() const;
244  void setKeyValueDictValueLabel(const char *label);
245  bool getKeyValueDictUseChooser() const;
246  void setKeyValueDictUseChooser(bool use_chooser);
247  const char *getKeyValueDictChooserLabel() const;
248  void setKeyValueDictChooserLabel(const char *label);
249  const char *getKeyValueDictChooserCallback() const;
250  void setKeyValueDictChooserCallback(const char *callback);
251 
252  const char *getRampBasisDefault() const;
253  void setRampBasisDefault(const char *value);
254  bool getRampShowControlsDefault() const;
255  void setRampShowControlsDefault(bool value);
256 
257  void clearRampDefaults();
258  bool hasRampDefaultValue() const;
259  void setRampDefaultFromParm(const PRM_Parm &ramp_parm);
260 
261  const char *getFileChooserMode() const;
262  void setFileChooserMode(const char *value);
263 
264  const char *getFileChooserPattern() const;
265  void setFileChooserPattern(const char *value);
266 
267  const char *getButtonIcon() const;
268  void setButtonIcon(const char *value);
269 
270  const char *getScriptAction() const;
271  void setScriptAction(const char *value);
272  const char *getScriptActionHelp() const;
273  void setScriptActionHelp(const char *value);
274  const char *getScriptActionIcon() const;
275  void setScriptActionIcon(const char *value);
276 
277  // This utility method returns string constants.
278  static const char *getScriptType(const PRM_Type &ptype,
279  PRM_TypeExtended etype,
280  PRM_MultiType mtype, int size);
281 
282  static bool parmTypeUsesOpFilter(const char *type);
283 
284  static const char *getExportDisableToken();
285  static bool isSwitcherLevelSpareToken(const char *token);
286 
287  static PI_EditScriptedParmFolderType getSwitcherFolderType(
288  const PRM_Template &tplate);
289  static PI_EditScriptedParmFolderType getSwitcherFolderType(
290  const PRM_Type &type,
291  const PRM_SpareData *spare);
292 
300  int myExport;
301  int mySize;
303  CH_StringMeaning myDefaultsStringMeaning[
306  float myRange[2];
307  bool myRangeLock[2];
314  int myDoAutolink[PI_MAX_SCRIPT_PARM_SIZE];
325 
327  public:
328  const char *myLabel;
329  const char *myDSToken;
330  const PRM_Type &myType;
331  const char *myIcon;
332  int myExport;
333  int mySize;
334  int myMenu;
335  int myString;
336  int myRange;
337  float myMin, myMax;
338  const char *myDefault;
339  const char *mySuffix[PI_MAX_SCRIPT_PARM_SIZE];
341  };
342  static PI_ParmType theParmTypes[];
343 
344 private:
345  void defaultInit();
346  void initMenu(const PRM_ChoiceList *menu,
347  PRM_TypeExtended extended_menu_type);
348 
349  void rebuildChannelNameCache(
350  const UT_StringRef &parm_name,
351  int parmtypeidx) const;
352 
353  UT_StringHolder myType;
354  mutable int myCachedTypeIndex;
355 
356  // A mutable cache for the channel names last built for this parameter,
357  // along with the settings last used to build it.
358  mutable UT_StringArray myCachedChannelNames;
359  mutable UT_StringHolder myChannelCacheToken;
360  mutable int myChannelCacheTypeIndex;
361 
362 };
363 
365 
367 {
368 public:
370  // Use this constructor to edit spare parameters.
371  // If skip_parm_vops is true, then the parameters
372  // coming from Parameter VOPs (ramp, etc) will
373  // not be included in the list, otherwise they will be.
374  // If allow_switch_rename is true then the
375  // switcher (folder) names will be changed to a uniuqe
376  // name, so that they are not marked as reserved,
377  // otherwise, if false, such names will remain
378  // unchanged (usually renaming is desirable, because
379  // having reserved switchers confuses things and
380  // makes them uneditable, but other times all
381  // parameters should keep their original names).
383  bool add_reserved_parms,
384  bool init_auto_links,
385  bool skip_parm_vops = false,
386  bool allow_switch_rename = true);
387  // Use this constructor to edit DA parameters.
388  // You can optionally include spare parameters
389  // anyway but with this constructor, DA parameters
390  // are not treated as reserved parameters.
392  OP_Node *node,
393  bool add_reserved_parms,
394  bool spareparms=false,
395  bool skip_parm_vops=false);
396  // Use this constructor to edit optype override
397  // parameters. Base and DA parameters are treated as
398  // reserved parameters.
400  bool add_reserved_parms,
401  bool skip_parm_vops=false);
402  // Get parameters from a dialog script.
403  // The node is just a reference used to determine
404  // what parameters should be reserved.
406  UT_IStream &is,
407  bool spareparms,
408  bool skip_reserved,
409  bool init_auto_links,
410  bool fix_invalid_joins);
411  // Get parameters from a array of parm templates.
412  // The node is just a reference used to determine
413  // what parameters should be reserved.
415  const PRM_Template *tplate,
416  bool spareparms,
417  bool skip_reserved,
418  bool init_auto_links);
419  // Copy constructor.
422 
423  // Merge the contents of another PI_EditScriptedParms into this one.
424  // The only change to the parms being merged is to resolve conflicts
425  // with existing parm names, and ensure no reserved parm names are used.
426  // The new parms are always added to the end of the current parms. The
427  // reserved flag from the source parms is preserved, so be careful when
428  // merging parameters from different sources.
429  void mergeParms(const PI_EditScriptedParms &src);
430 
431  // Remove all our parameters.
432  void clearParms();
433 
434  // Save the parms in dialog script format.
435  int save(std::ostream &os, UT_String &warnings,
436  bool validate_joins);
437 
438  // Dump the parameters, in a meaningless format, but useful for debugging.
439  void dump(std::ostream &os);
440 
441  // Compile these parameters, which means eliminating all information
442  // about the parameters that is not absolutely required for proper
443  // functioning.
444  void compile();
445 
446  // Get our individual parms.
447  PI_EditScriptedParmArray &getParms() { return myParms; }
448  int getNParms() const;
449  PI_EditScriptedParm *getParm(int i);
450  int getParmIndexWithName(const UT_StringRef &name);
451  PI_EditScriptedParm *getParmWithName(const UT_StringRef &name);
452  int getParmIndex(PI_EditScriptedParm *p);
453  int getFolderIndexWithLabel(
454  const UT_StringRef &label);
455  int getFolderIndexWithName(
456  const UT_StringRef &name);
457  PI_EditScriptedParm *getFolderWithLabel(
458  const UT_StringRef &label);
459  PI_EditScriptedParm *getFolderWithName(
460  const UT_StringRef &name);
461 
462  // Remove all folder group parameters that do not contain any
463  // regular parameters (not folder groups and not separators).
464  void removeEmptyFolders();
465 
466  // Given a list of folder names, return the index of the start of the
467  // innermost folder, or -1 if there is no such folder.
468  int getNestedFolderIndex(
469  const UT_StringArray &folder_labels);
470 
471  // Given the index of a parameter, return the parms corresponding to the
472  // containing folders.
473  void getContainingFolders(
474  int parm_index,
476 
477  // Find a parm that already has a particular autolink.
478  PI_EditScriptedParm *getParmWithAutolink(const char *channelpath,
479  const char *nodepath,
480  int *linkedsubidx = 0);
481 
482  // For a group start parm or group end parm, find the opposite end of
483  // that group. Otherwise return -1.
484  int getMatchingGroupParm(int parm) const;
485 
486  // Returns true if the group parameter specified is the first page
487  // in a series of folders.
488  bool getIsFirstPage(int parm) const;
489 
490  // Returns the position of the group parameter that contains the specified
491  // parameter. If there is no parent group parameter, -1 is returned.
492  int getParentGroupParm(int parm);
493 
494  // Get information about the menu associated with a particular parameter.
495  int getNMenu(int parm);
496  PI_EditScriptedParmMenu *getMenu(int parm, int i);
497  const char *getMenuScript(int parm);
498 
499  // Test if a parameter can be moved from srcidx to dstidx. For example,
500  // a folder start token is not allowed to be moved beyond a corresponding
501  // end token. Returns true if parm move is allowed, false otherwise.
502  bool isParmMoveAllowed(int first, int last, int offset);
503 
504  // Add, remove, and reorder parameters.
505  bool updateNode();
506  void addParm(PI_EditScriptedParm *parm);
507  bool moveParms(int first, int last, int offset,
508  bool remove_invalid_groups=true);
509  void moveParms(const UT_IntArray &movingparms, int destpos,
510  bool remove_invalid_groups=true);
511 
512  // Adds parms for the multiparm templates attached to the specified
513  // parm. This function works recursively if the multiparm templates
514  // contain other multiparms.
515  void insertMultiParmTemplates(const PRM_Template *tplate,
516  const char *parentparmname,
517  const OP_Node *linktonode,
518  const char *nameprefix,
519  const char *labelprefix,
520  int insertat);
521 
522  // Apply a permutation to a block of parameters. This method only does
523  // sanity checking on the permutation itself, and not on the parameters
524  // themselves, so use it with caution. For example, don't screw up the
525  // order of group begin and end entries.
526  //
527  // The permutation array must consist of a permutation of the indicies
528  // [first..(first + permutation.entries() - 1)].
529  //
530  // The operation applied is basically:
531  // new_parms(first+i) = old_parms(permutation(i))
532  void permuteParms(int first,
533  const UT_IntArray &permutation);
534 
535  // If we are told to remove a group start or end parm, we automatically
536  // remove the opposite end of that group. Returns the number of parms
537  // removed.
538  int removeParms(int first, int last, bool remove_invalid_joins=true);
539 
540  // joins cannot occur over folder boundaries, or at the end of the parm
541  // list.
542  void removeInvalidJoins();
543 
544  // Copy default parm values from the current values on the specified node.
545  void copyDefaultsFromNode(OP_Node *node);
546 
547  int checkReservedName(const char *name) const;
548  bool containsReservedParm() const;
549  void initializeReserveNames(OP_Parameters *node);
550  void initializeReserveFlags();
551  void clearReserveNamesAndFlags();
552  bool makeSafeParmName(PI_EditScriptedParm *parm,
553  UT_String &parmname,
554  const UT_StringSet *extrareserved,
555  bool checkexistingparms);
556  bool makeSafeParmName(PI_EditScriptedParm *parm,
557  UT_StringHolder &parmname,
558  const UT_StringSet *extrareserved,
559  bool checkexistingparms);
560 
561  // Set all autolink values for all parameters to the current set of
562  // links.
563  void setAutolinksToCurrentLinks();
564 
565  // Take the list of parm or channel names and add those parms or channels
566  // to the autolink fields of the appropriate PI_EditScriptedParm. The
567  // links array will be filled with the name of the parameter each of the
568  // parms was linked to (or an emtpy string if no link was made for that
569  // parm).
570  void addParametersToAutolinks(PI_EditScriptedParm &destparm,
571  const UT_StringArray &parms,
572  const char *nodepath,
573  bool linkinvisibles,
574  PI_EditScriptedParmArray &changedparms,
575  UT_StringArray &errors);
576 
577  // Makes sure that none of our parm names contain too many hashes for
578  // the multiparm instance level they are at. This is called right before
579  // saving. Extra hashes are converted to underscores.
580  void fixParmNamesForInstanceLevel();
581 
582  // Turn the auto link values from all our parms into channel references
583  // on the appropriate nodes. The function is not const because it actually
584  // changes the auto link values.
585  void applyAutoLinks(UT_StringArray &errors,
586  OP_NodeList &changednodes,
587  UT_IntArray &changedparms);
588 
589  // The applyAutoLinks call happens before the node's templates are
590  // updated. So after updating the templates, we need to force any
591  // changed nodes to rebuild their dependencies and recook.
592  void updateNodesFromApplyAutoLinks(
593  OP_NodeList &changednodes,
594  UT_IntArray &changedparms);
595 
596  // This function is called whenever a node's name is changed. It goes
597  // through all our parm's auto links and changes any references from the
598  // old node name to the new node name.
599  bool updateAutoLinksForNameChange(
600  const UT_String &refnodepath,
601  const UT_String &oldpath,
602  const UT_String &newpath);
603 
604  // Gets the node that is associated with these parms. This value is
605  // used for finding and setting parameter links, and detecting parm
606  // name conflicts.
607  OP_Node *getNode() const;
608 
609  // These functions are used to control the table of multiparm link
610  // information used by piGetCurrentLinks.
611  static void buildMultiparmInfo(OP_Node *refnode);
612  static void clearMultiparmInfo();
613  static void lockMultiparmInfo();
614  static void releaseMultiparmInfo();
615  static const PI_BuiltMultiParmInfo &getBuiltMultiparmInfo();
616 
617  // Adds additional links so that dstparm has the additional links to the
618  // srcchannel. They must be both ramp parameters of the same type
619  // designated by is_color_ramp.
620  static void addRampAutoLinks(
621  OP_Node *dstnode,
622  PRM_Parm *dstparm,
623  const char *dstchannel,
624  const char *srcrelpath,
625  const char *srcchannel,
626  bool is_color_ramp,
627  UT_String &error);
628  /// Deletes ramp references added via addRampAutoLinks()
629  static void deleteRampAutoLinks(
630  OP_Node *dstnode,
631  PRM_Parm *dstparm,
632  const char *dstchannel,
633  bool is_color_ramp,
634  UT_String &error,
635  bool also_revert = false);
636 
637 private:
638  // Returns a pointer to the base parm templates, which is the myBase
639  // member if editing HDA parms, or the operator templates if editing
640  // spare parameters.
641  const PRM_Template *getBaseParmTemplates() const;
642  // Returns a pointer to the base parm template (if any) that matches
643  // the supplied parameter name.
644  const PRM_Template *getBaseParmTemplate(const char *parmname) const;
645 
646  // This utility function helps makeSafeParmName generate a list of all
647  // multiparm instance parms in this PI_EditScriptedParms.
648  void buildMParmInst(PI_EditScriptedParm *skipparm,
649  UT_StringArray &mparminst,
650  UT_IntArray &mparmlvl) const;
651 
652  // This utility function figures out the depth of multiparm nesting
653  // for the specified parm.
654  int getMultiParmInstanceLevel(
655  PI_EditScriptedParm *parm) const;
656 
657  // Utility function for makeSafeParmName which recursively checks a
658  // PRM_Template array (and any multiparm templates in that array) for
659  // conflicting parm names.
660  bool conflictsWithTemplate(const PRM_Template *tplate,
661  const UT_StringArray &mparmtplates,
662  const UT_StringArray &channels,
663  const UT_StringArray &mparminst,
664  const UT_IntArray &mparmlvl) const;
665 
666  void createImportGroups(int offset,
667  UT_Array<pi_GroupData> &gstack,
668  const PRM_ScriptImports *imports,
669  int &import_index);
670  void createImportGroupsBeforeGroupEnd(
671  int offset, int depth,
672  int switcher_index, int folder,
673  const PRM_ScriptImports *imports,
674  int &import_index);
675  void createParms(const PRM_Template *tplates,
676  const PRM_ScriptImports *imports,
677  bool skip_reserved,
678  bool init_auto_links = true,
679  bool skip_parm_vops = false,
680  bool allow_switch_rename = true);
681  void createParms(UT_ValArray<const PRM_Template *> &tplates,
682  const PRM_ScriptImports *imports,
683  bool skip_reserved,
684  bool init_auto_links = true,
685  bool skip_parm_vops = false,
686  bool allow_switch_rename = true);
687  void removeInvalidGroups(int startpos);
688 
689  void saveGroupHeader(std::ostream &os, int index,
690  bool first_page,
691  int &glevel,
692  int &import_depth,
693  bool &in_import_block);
694  void saveGroupFooter(std::ostream &os, int index,
695  int &glevel,
696  int &import_depth,
697  bool &in_import_block);
698  void saveImportHeader(std::ostream &os, int index,
699  int &glevel,
700  int &import_depth,
701  bool &in_import_block);
702  void saveImportFooter(std::ostream &os, int index,
703  int &glevel,
704  int &import_depth,
705  bool &in_import_block);
706  void saveMultiParmHeader(std::ostream &os, int index,
707  int &glevel,
708  int &import_depth,
709  bool &in_import_block);
710  void saveMultiParmFooter(std::ostream &os, int index,
711  int &glevel,
712  int &import_depth,
713  bool &in_import_block);
714 
715  PI_EditScriptedParmArray myParms;
716  UT_StringSet myReservedParmNames;
717  OP_Operator *myOp;
718  int myNodeId;
719  bool myIsEditingSpareParms;
720  bool myIsEditingOverrideParms;
721 };
722 
723 
724 // ============================================================================
725 // Abstracts edited parameters that may come from different nodes.
727 {
728 public:
731 
732  /// @{ Methods corresponding to the PI_EditScriptedParms class.
733  int getNParms() const;
734  PI_EditScriptedParm * getParm(int parm_idx);
735  OP_Node * getNode(int parm_idx);
736  int getMatchingGroupParm(int parm_idx) const;
737  int removeParms(int first_parm_idx, int last_parm_idx);
738  /// @}
739 
740  /// Gets list containing i-th parameter.
741  PRM_ParmList * getParmList(int parm_idx);
742 
743  /// Copies the member parameters to the given parms.
744  void copyToParms( PI_EditScriptedParms &parms ) const;
745 
746 protected:
747  /// @{ Node and parm management methods for subclasses.
748  void appendToAggregate(OP_Node *node, PI_EditScriptedParms* parms);
749  int getAggregateCount() const;
750  OP_Node * getAggregateNode(int src_idx ) const;
751  PI_EditScriptedParms* getAggregateParms(int src_idx ) const;
752  /// @}
753 
754 private:
755  int getParmIndex( int node_idx, int parm_sub_idx ) const;
756  void getNodeAndParmIndices( int &node_idx, int &parm_sub_idx,
757  int parm_idx ) const;
758 
759 private:
760  // Nodes the parameters come from.
761  UT_ValArray<OP_Node *> mySrcNodes;
762 
763  /// Each entry contains parms from a corresponding OP in mySrcNodes list.
765 };
766 
767 #endif
768 
UT_StringHolder myHelpText
GLint first
Definition: glcorearb.h:404
PI_EditScriptedParmMenuEnable
#define PI_MAX_SCRIPT_PARM_SIZE
GLenum GLint * range
Definition: glcorearb.h:1924
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
CH_StringMeaning
PI_EditScriptedParmFolderType
UT_ValArray< PI_EditScriptedParm * > PI_EditScriptedParmArray
#define PI_API
Definition: PI_API.h:10
png_uint_32 i
Definition: png.h:2877
PI_EditScriptedParmMenuType
GLsizeiptr size
Definition: glcorearb.h:663
PI_EditScriptedParmMenuType myMenuType
GLint GLint GLsizei GLsizei GLsizei depth
Definition: glcorearb.h:475
GLint ref
Definition: glcorearb.h:123
PI_EditScriptedParmArray & getParms()
GLintptr offset
Definition: glcorearb.h:664
UT_StringHolder myMenuScript
GLuint const GLchar * name
Definition: glcorearb.h:785
PRM_SpareData * mySpareData
PI_EditScriptedParmFolderType myFolderType
UT_SymbolMap< UT_StringArray * > PI_BuiltMultiParmInfo
PRM_ColorType
Definition: PRM_Type.h:434
GLsizei const GLfloat * value
Definition: glcorearb.h:823
UT_ColorType
Definition: UT_Color.h:24
PRM_TypeExtended
Definition: PRM_Type.h:506
void setType(const UT_StringHolder &type)
png_infop png_uint_32 png_uint_32 int int * color_type
Definition: png.h:2394
GLuint index
Definition: glcorearb.h:785
const UT_StringHolder & getType() const
CH_ScriptLanguage myMenuScriptLanguage
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
UT_StringHolder myCategory
UT_ValArray< PI_EditScriptedParmMenu > myMenu
PI_EditScriptedParmMenuEnable myMenuEnable
PRM_MultiType
This type enum defines the different types of multi (dynamic) parameters.
Definition: PRM_Type.h:417
CH_ScriptLanguage
GLenum src
Definition: glcorearb.h:1792