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,
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);
195 bool keep_existing =
false);
202 const char *getSpareValue(
const char *token)
const;
203 void setSpareValue(
const char *token,
const char *
value);
204 void copySpareValue(
const char *token,
207 const char *getCallbackData()
const;
208 void setCallbackData(
const char *
value);
212 const char *getOpFilter()
const;
213 void setOpFilter(
const char *
value);
215 const char *getRManType()
const;
216 void setRManType(
const char *
value);
217 int getMultiStartOffset()
const;
218 void setMultiStartOffset(
int value);
221 const char *getRampBasisVar()
const;
222 void setRampBasisVar(
const char *
value);
223 const char *getRampKeysVar()
const;
224 void setRampKeysVar(
const char *
value);
225 const char *getRampValuesVar()
const;
226 void setRampValuesVar(
const char *
value);
227 const char *getImportSource()
const;
228 void setImportSource(
const char *
value);
229 const char *getImportToken()
const;
230 void setImportToken(
const char *
value);
231 const char *getImportMask()
const;
232 void setImportMask(
const char *
value);
233 bool getImportEnable()
const;
234 void setImportEnable(
bool value);
235 bool getExportDisable()
const;
236 void setExportDisable(
bool value);
237 bool getUnquotedFlag()
const;
238 void setUnquotedFlag(
bool value);
239 bool getIsGroupStart()
const;
240 bool getIsGroupEnd()
const;
241 bool getIsGroupParm()
const;
242 bool getIsMultiParm()
const;
243 bool getIsRampParm()
const;
244 bool getIsRampParmColor()
const;
245 bool getIsRampParmFloat()
const;
246 bool getIsFileParm()
const;
247 bool getIsBasicStringParm()
const;
248 bool getIsButtonParm()
const;
249 bool getIsLabelParm()
const;
251 bool getIsColorParm()
const;
254 bool getColorWheel()
const;
255 void setColorWheel(
bool value);
256 bool getColorDynamic()
const;
257 void setColorDynamic(
bool value);
259 bool getIsKeyValueDictParm()
const;
260 const char *getKeyValueDictKeyLabel()
const;
261 void setKeyValueDictKeyLabel(
const char *
label);
262 const char *getKeyValueDictValueLabel()
const;
263 void setKeyValueDictValueLabel(
const char *
label);
264 bool getKeyValueDictUseChooser()
const;
265 void setKeyValueDictUseChooser(
bool use_chooser);
266 const char *getKeyValueDictChooserLabel()
const;
267 void setKeyValueDictChooserLabel(
const char *
label);
268 const char *getKeyValueDictChooserCallback()
const;
269 void setKeyValueDictChooserCallback(
const char *callback);
271 const char *getRampBasisDefault()
const;
272 void setRampBasisDefault(
const char *
value);
273 bool getRampShowControlsDefault()
const;
274 void setRampShowControlsDefault(
bool value);
275 bool getRampGrayscaleDefault()
const;
276 void setRampGrayscaleDefault(
bool value);
278 void clearRampDefaults();
279 bool hasRampDefaultValue()
const;
280 void setRampDefaultFromParm(
const PRM_Parm &ramp_parm);
282 const char *getFileChooserMode()
const;
283 void setFileChooserMode(
const char *
value);
286 const char *getFileChooserPattern()
const;
287 void setFileChooserPattern(
const char *
value);
290 const char *getButtonIcon()
const;
291 void setButtonIcon(
const char *
value);
293 const char *getScriptAction()
const;
294 void setScriptAction(
const char *
value);
295 const char *getScriptActionHelp()
const;
296 void setScriptActionHelp(
const char *
value);
297 const char *getScriptActionIcon()
const;
298 void setScriptActionIcon(
const char *
value);
301 static const char *getScriptType(
const PRM_Type &ptype,
305 static bool parmTypeUsesOpFilter(
const char *
type);
306 static bool parmTypeUsesFileChooser(
const char *
type);
308 static const char *getExportDisableToken();
309 static bool isSwitcherLevelSpareToken(
const char *token);
373 void rebuildChannelNameCache(
375 int parmtypeidx)
const;
383 mutable int myCachedTypeIndex;
390 mutable int myChannelCacheTypeIndex;
413 bool add_reserved_parms,
414 bool init_auto_links,
415 bool skip_parm_vops =
false,
416 bool allow_switch_rename =
true);
423 bool add_reserved_parms,
424 bool spareparms=
false,
425 bool skip_parm_vops=
false);
430 bool add_reserved_parms,
431 bool skip_parm_vops=
false);
439 bool init_auto_links,
440 bool fix_invalid_joins);
448 bool init_auto_links);
465 int save(std::ostream &os,
UT_String &warnings,
466 bool validate_joins);
469 void dump(std::ostream &os);
477 PI_EditScriptedParmArray &
getParms() {
return myParms; }
478 int getNParms()
const;
484 int getFolderIndexWithLabel(
486 int getFolderIndexWithName(
495 void removeEmptyFolders();
499 int getNestedFolderIndex(
504 void getContainingFolders(
510 const char *nodepath,
511 int *linkedsubidx = 0);
515 int getMatchingGroupParm(
int parm)
const;
519 bool getIsFirstPage(
int parm)
const;
523 int getParentGroupParm(
int parm);
526 int getNMenu(
int parm);
528 const char *getMenuScript(
int parm);
539 bool remove_invalid_groups=
true);
540 void moveParms(
const UT_IntArray &movingparms,
int destpos,
541 bool remove_invalid_groups=
true);
546 void insertMultiParmTemplates(
const PRM_Template *tplate,
547 const char *parentparmname,
549 const char *nameprefix,
550 const char *labelprefix,
552 bool include_invisible_parms);
564 void permuteParms(
int first,
571 bool remove_invalid_joins=
true);
575 void removeInvalidJoins();
578 void copyDefaultsFromNode(
OP_Node *node);
580 int checkReservedName(
const char *
name)
const;
581 bool containsReservedParm()
const;
583 void initializeReserveFlags();
584 void clearReserveNamesAndFlags();
588 bool checkexistingparms);
592 bool checkexistingparms);
596 void setAutolinksToCurrentLinks();
605 const char *nodepath,
607 PI_EditScriptedParmArray &changedparms,
613 void fixParmNamesForInstanceLevel();
617 void findMisplacedReservedParms(
630 void updateNodesFromApplyAutoLinks(
637 bool updateAutoLinksForNameChange(
649 static void buildMultiparmInfo(
OP_Node *refnode);
650 static void clearMultiparmInfo();
651 static void lockMultiparmInfo();
652 static void releaseMultiparmInfo();
662 const PRM_Template *getBaseParmTemplate(
const char *parmname)
const;
672 int getMultiParmInstanceLevel(
684 void createImportGroups(
int offset,
688 void createImportGroupsBeforeGroupEnd(
690 int switcher_index,
int folder,
696 bool init_auto_links =
true,
697 bool skip_parm_vops =
false,
698 bool allow_switch_rename =
true);
702 bool init_auto_links =
true,
703 bool skip_parm_vops =
false,
704 bool allow_switch_rename =
true);
705 void removeInvalidGroups(
int startpos);
707 void saveGroupHeader(std::ostream &os,
int index,
711 bool &in_import_block);
712 void saveGroupFooter(std::ostream &os,
int index,
715 bool &in_import_block);
716 void saveImportHeader(std::ostream &os,
int index,
719 bool &in_import_block);
720 void saveImportFooter(std::ostream &os,
int index,
723 bool &in_import_block);
724 void saveMultiParmHeader(std::ostream &os,
int index,
727 bool &in_import_block);
728 void saveMultiParmFooter(std::ostream &os,
int index,
731 bool &in_import_block);
733 PI_EditScriptedParmArray myParms;
737 bool myIsEditingSpareParms;
738 bool myIsEditingOverrideParms;
755 int getNParms()
const;
757 OP_Node * getNode(
int parm_idx);
758 int getMatchingGroupParm(
int parm_idx)
const;
759 int removeParms(
int first_parm_idx,
int last_parm_idx);
770 void appendToAggregate(
776 int getParmIndex(
int node_idx,
int parm_sub_idx )
const;
777 void getNodeAndParmIndices(
int &node_idx,
int &parm_sub_idx,
778 int parm_idx )
const;
UT_StringHolder myHelpText
PI_EditScriptedParmMenuEnable
#define PI_MAX_SCRIPT_PARM_SIZE
GLuint GLsizei const GLchar * label
GLsizei const GLfloat * value
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
GLint GLint GLsizei GLint GLenum GLenum type
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
__hostdev__ uint64_t last(uint32_t i) const
GA_API const UT_StringHolder parms
void setType(const UT_StringHolder &type)
LeafData & operator=(const LeafData &)=delete
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)