12 #ifndef __PI_EditScriptedParms__
13 #define __PI_EditScriptedParms__
40 #define PI_MAX_SCRIPT_PARM_SIZE 16
41 #define PI_FOLDER_DEFAULTNAME "folder0"
42 #define PI_PARM_DEFAULTNAME "newparameter"
78 return myToken.isstring() || myLabel.isstring();
90 bool init_auto_links=
true);
101 myCachedTypeIndex = -2;
105 void changeTypeToRampColor();
106 void changeTypeToRampFloat();
111 void copyDefaultValuesFromParm(
PRM_Parm *parm,
int subidx);
116 void setAutolinksToCurrentLinks(
OP_Node *node,
int subidx);
124 const char *nodepath,
131 int save(std::ostream &os,
int indent,
OP_Operator *op,
134 bool in_import_block);
135 int saveSelectors(std::ostream &os,
const char *tokeni,
137 void saveSpareData(std::ostream &os,
139 bool skip_import_data,
140 bool first_group_page);
141 void saveSpareValue(std::ostream &os,
const char *tokeni,
142 const char *spare_token);
143 void saveConditional(std::ostream &os,
int indent,
147 void dump(std::ostream &os);
153 void moveMenu(
int idx);
154 void destroyMenu(
int idx);
156 void clearMenuItems();
157 void clearCachedChannels();
166 int getParmTypeIdxForChannels()
const;
168 void setSize(
int size);
201 const char *getSpareValue(
const char *token)
const;
202 void setSpareValue(
const char *token,
const char *
value);
203 void copySpareValue(
const char *token,
206 const char *getCallbackData()
const;
207 void setCallbackData(
const char *
value);
211 const char *getOpFilter()
const;
212 void setOpFilter(
const char *
value);
214 const char *getRManType()
const;
215 void setRManType(
const char *
value);
216 int getMultiStartOffset()
const;
217 void setMultiStartOffset(
int value);
220 const char *getRampBasisVar()
const;
221 void setRampBasisVar(
const char *
value);
222 const char *getRampKeysVar()
const;
223 void setRampKeysVar(
const char *
value);
224 const char *getRampValuesVar()
const;
225 void setRampValuesVar(
const char *
value);
226 const char *getImportSource()
const;
227 void setImportSource(
const char *
value);
228 const char *getImportToken()
const;
229 void setImportToken(
const char *
value);
230 const char *getImportMask()
const;
231 void setImportMask(
const char *
value);
232 bool getImportEnable()
const;
233 void setImportEnable(
bool value);
234 bool getExportDisable()
const;
235 void setExportDisable(
bool value);
236 bool getUnquotedFlag()
const;
237 void setUnquotedFlag(
bool value);
238 bool getIsGroupStart()
const;
239 bool getIsGroupEnd()
const;
240 bool getIsGroupParm()
const;
241 bool getIsMultiParm()
const;
242 bool getIsRampParm()
const;
243 bool getIsRampParmColor()
const;
244 bool getIsRampParmFloat()
const;
245 bool getIsFileParm()
const;
246 bool getIsBasicStringParm()
const;
247 bool getIsButtonParm()
const;
248 bool getIsLabelParm()
const;
250 bool getIsColorParm()
const;
253 bool getColorWheel()
const;
254 void setColorWheel(
bool value);
255 bool getColorDynamic()
const;
256 void setColorDynamic(
bool value);
258 bool getIsKeyValueDictParm()
const;
259 const char *getKeyValueDictKeyLabel()
const;
260 void setKeyValueDictKeyLabel(
const char *
label);
261 const char *getKeyValueDictValueLabel()
const;
262 void setKeyValueDictValueLabel(
const char *
label);
263 bool getKeyValueDictUseChooser()
const;
264 void setKeyValueDictUseChooser(
bool use_chooser);
265 const char *getKeyValueDictChooserLabel()
const;
266 void setKeyValueDictChooserLabel(
const char *
label);
267 const char *getKeyValueDictChooserCallback()
const;
268 void setKeyValueDictChooserCallback(
const char *callback);
270 const char *getRampBasisDefault()
const;
271 void setRampBasisDefault(
const char *
value);
272 bool getRampShowControlsDefault()
const;
273 void setRampShowControlsDefault(
bool value);
275 void clearRampDefaults();
276 bool hasRampDefaultValue()
const;
277 void setRampDefaultFromParm(
const PRM_Parm &ramp_parm);
279 const char *getFileChooserMode()
const;
280 void setFileChooserMode(
const char *
value);
283 const char *getFileChooserPattern()
const;
284 void setFileChooserPattern(
const char *
value);
287 const char *getButtonIcon()
const;
288 void setButtonIcon(
const char *
value);
290 const char *getScriptAction()
const;
291 void setScriptAction(
const char *
value);
292 const char *getScriptActionHelp()
const;
293 void setScriptActionHelp(
const char *
value);
294 const char *getScriptActionIcon()
const;
295 void setScriptActionIcon(
const char *
value);
298 static const char *getScriptType(
const PRM_Type &ptype,
302 static bool parmTypeUsesOpFilter(
const char *
type);
303 static bool parmTypeUsesFileChooser(
const char *
type);
305 static const char *getExportDisableToken();
306 static bool isSwitcherLevelSpareToken(
const char *token);
370 void rebuildChannelNameCache(
372 int parmtypeidx)
const;
380 mutable int myCachedTypeIndex;
387 mutable int myChannelCacheTypeIndex;
410 bool add_reserved_parms,
411 bool init_auto_links,
412 bool skip_parm_vops =
false,
413 bool allow_switch_rename =
true);
420 bool add_reserved_parms,
421 bool spareparms=
false,
422 bool skip_parm_vops=
false);
427 bool add_reserved_parms,
428 bool skip_parm_vops=
false);
436 bool init_auto_links,
437 bool fix_invalid_joins);
445 bool init_auto_links);
462 int save(std::ostream &os,
UT_String &warnings,
463 bool validate_joins);
466 void dump(std::ostream &os);
474 PI_EditScriptedParmArray &
getParms() {
return myParms; }
475 int getNParms()
const;
481 int getFolderIndexWithLabel(
483 int getFolderIndexWithName(
492 void removeEmptyFolders();
496 int getNestedFolderIndex(
501 void getContainingFolders(
507 const char *nodepath,
508 int *linkedsubidx = 0);
512 int getMatchingGroupParm(
int parm)
const;
516 bool getIsFirstPage(
int parm)
const;
520 int getParentGroupParm(
int parm);
523 int getNMenu(
int parm);
525 const char *getMenuScript(
int parm);
530 bool isParmMoveAllowed(
int first,
int last,
int offset);
536 bool remove_invalid_groups=
true);
537 void moveParms(
const UT_IntArray &movingparms,
int destpos,
538 bool remove_invalid_groups=
true);
543 void insertMultiParmTemplates(
const PRM_Template *tplate,
544 const char *parentparmname,
546 const char *nameprefix,
547 const char *labelprefix,
549 bool include_invisible_parms);
561 void permuteParms(
int first,
567 int removeParms(
int first,
int last,
568 bool remove_invalid_joins=
true);
572 void removeInvalidJoins();
575 void copyDefaultsFromNode(
OP_Node *node);
577 int checkReservedName(
const char *
name)
const;
578 bool containsReservedParm()
const;
580 void initializeReserveFlags();
581 void clearReserveNamesAndFlags();
585 bool checkexistingparms);
589 bool checkexistingparms);
593 void setAutolinksToCurrentLinks();
602 const char *nodepath,
604 PI_EditScriptedParmArray &changedparms,
610 void fixParmNamesForInstanceLevel();
614 void findMisplacedReservedParms(
627 void updateNodesFromApplyAutoLinks(
634 bool updateAutoLinksForNameChange(
646 static void buildMultiparmInfo(
OP_Node *refnode);
647 static void clearMultiparmInfo();
648 static void lockMultiparmInfo();
649 static void releaseMultiparmInfo();
655 static void addRampAutoLinks(
658 const char *dstchannel,
659 const char *srcrelpath,
660 const char *srcchannel,
664 static void deleteRampAutoLinks(
667 const char *dstchannel,
670 bool also_revert =
false);
679 const PRM_Template *getBaseParmTemplate(
const char *parmname)
const;
689 int getMultiParmInstanceLevel(
701 void createImportGroups(
int offset,
705 void createImportGroupsBeforeGroupEnd(
707 int switcher_index,
int folder,
713 bool init_auto_links =
true,
714 bool skip_parm_vops =
false,
715 bool allow_switch_rename =
true);
719 bool init_auto_links =
true,
720 bool skip_parm_vops =
false,
721 bool allow_switch_rename =
true);
722 void removeInvalidGroups(
int startpos);
724 void saveGroupHeader(std::ostream &os,
int index,
728 bool &in_import_block);
729 void saveGroupFooter(std::ostream &os,
int index,
732 bool &in_import_block);
733 void saveImportHeader(std::ostream &os,
int index,
736 bool &in_import_block);
737 void saveImportFooter(std::ostream &os,
int index,
740 bool &in_import_block);
741 void saveMultiParmHeader(std::ostream &os,
int index,
744 bool &in_import_block);
745 void saveMultiParmFooter(std::ostream &os,
int index,
748 bool &in_import_block);
750 PI_EditScriptedParmArray myParms;
754 bool myIsEditingSpareParms;
755 bool myIsEditingOverrideParms;
772 int getNParms()
const;
774 OP_Node * getNode(
int parm_idx);
775 int getMatchingGroupParm(
int parm_idx)
const;
776 int removeParms(
int first_parm_idx,
int last_parm_idx);
787 void appendToAggregate(
793 int getParmIndex(
int node_idx,
int parm_sub_idx )
const;
794 void getNodeAndParmIndices(
int &node_idx,
int &parm_sub_idx,
795 int parm_idx )
const;
UT_StringHolder myHelpText
PI_EditScriptedParmMenuEnable
#define PI_MAX_SCRIPT_PARM_SIZE
GLuint GLsizei const GLchar * label
PI_EditScriptedParmFolderType
UT_ValArray< PI_EditScriptedParm * > PI_EditScriptedParmArray
**But if you need a result
PI_EditScriptedParmMenuType
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
PI_EditScriptedParmMenuType myMenuType
PI_EditScriptedParmArray & getParms()
UT_StringHolder myMenuScript
GLuint const GLchar * name
PRM_SpareData * mySpareData
PI_EditScriptedParmFolderType myFolderType
UT_SymbolMap< UT_StringArray * > PI_BuiltMultiParmInfo
GLint GLint GLsizei GLsizei GLsizei depth
void setType(const UT_StringHolder &type)
const UT_StringHolder & getType() const
CH_ScriptLanguage myMenuScriptLanguage
UT_StringHolder myCategory
UT_ValArray< PI_EditScriptedParmMenu > myMenu
PI_EditScriptedParmMenuEnable myMenuEnable
PRM_MultiType
This type enum defines the different types of multi (dynamic) parameters.
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)