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);
274 bool getRampGrayscaleDefault()
const;
275 void setRampGrayscaleDefault(
bool value);
277 void clearRampDefaults();
278 bool hasRampDefaultValue()
const;
279 void setRampDefaultFromParm(
const PRM_Parm &ramp_parm);
281 const char *getFileChooserMode()
const;
282 void setFileChooserMode(
const char *
value);
285 const char *getFileChooserPattern()
const;
286 void setFileChooserPattern(
const char *
value);
289 const char *getButtonIcon()
const;
290 void setButtonIcon(
const char *
value);
292 const char *getScriptAction()
const;
293 void setScriptAction(
const char *
value);
294 const char *getScriptActionHelp()
const;
295 void setScriptActionHelp(
const char *
value);
296 const char *getScriptActionIcon()
const;
297 void setScriptActionIcon(
const char *
value);
300 static const char *getScriptType(
const PRM_Type &ptype,
304 static bool parmTypeUsesOpFilter(
const char *
type);
305 static bool parmTypeUsesFileChooser(
const char *
type);
307 static const char *getExportDisableToken();
308 static bool isSwitcherLevelSpareToken(
const char *token);
372 void rebuildChannelNameCache(
374 int parmtypeidx)
const;
382 mutable int myCachedTypeIndex;
389 mutable int myChannelCacheTypeIndex;
412 bool add_reserved_parms,
413 bool init_auto_links,
414 bool skip_parm_vops =
false,
415 bool allow_switch_rename =
true);
422 bool add_reserved_parms,
423 bool spareparms=
false,
424 bool skip_parm_vops=
false);
429 bool add_reserved_parms,
430 bool skip_parm_vops=
false);
438 bool init_auto_links,
439 bool fix_invalid_joins);
447 bool init_auto_links);
464 int save(std::ostream &os,
UT_String &warnings,
465 bool validate_joins);
468 void dump(std::ostream &os);
476 PI_EditScriptedParmArray &
getParms() {
return myParms; }
477 int getNParms()
const;
483 int getFolderIndexWithLabel(
485 int getFolderIndexWithName(
494 void removeEmptyFolders();
498 int getNestedFolderIndex(
503 void getContainingFolders(
509 const char *nodepath,
510 int *linkedsubidx = 0);
514 int getMatchingGroupParm(
int parm)
const;
518 bool getIsFirstPage(
int parm)
const;
522 int getParentGroupParm(
int parm);
525 int getNMenu(
int parm);
527 const char *getMenuScript(
int parm);
538 bool remove_invalid_groups=
true);
539 void moveParms(
const UT_IntArray &movingparms,
int destpos,
540 bool remove_invalid_groups=
true);
545 void insertMultiParmTemplates(
const PRM_Template *tplate,
546 const char *parentparmname,
548 const char *nameprefix,
549 const char *labelprefix,
551 bool include_invisible_parms);
563 void permuteParms(
int first,
570 bool remove_invalid_joins=
true);
574 void removeInvalidJoins();
577 void copyDefaultsFromNode(
OP_Node *node);
579 int checkReservedName(
const char *
name)
const;
580 bool containsReservedParm()
const;
582 void initializeReserveFlags();
583 void clearReserveNamesAndFlags();
587 bool checkexistingparms);
591 bool checkexistingparms);
595 void setAutolinksToCurrentLinks();
604 const char *nodepath,
606 PI_EditScriptedParmArray &changedparms,
612 void fixParmNamesForInstanceLevel();
616 void findMisplacedReservedParms(
629 void updateNodesFromApplyAutoLinks(
636 bool updateAutoLinksForNameChange(
648 static void buildMultiparmInfo(
OP_Node *refnode);
649 static void clearMultiparmInfo();
650 static void lockMultiparmInfo();
651 static void releaseMultiparmInfo();
657 static void addRampAutoLinks(
660 const char *dstchannel,
661 const char *srcrelpath,
662 const char *srcchannel,
666 static void deleteRampAutoLinks(
669 const char *dstchannel,
672 bool also_revert =
false);
681 const PRM_Template *getBaseParmTemplate(
const char *parmname)
const;
691 int getMultiParmInstanceLevel(
703 void createImportGroups(
int offset,
707 void createImportGroupsBeforeGroupEnd(
709 int switcher_index,
int folder,
715 bool init_auto_links =
true,
716 bool skip_parm_vops =
false,
717 bool allow_switch_rename =
true);
721 bool init_auto_links =
true,
722 bool skip_parm_vops =
false,
723 bool allow_switch_rename =
true);
724 void removeInvalidGroups(
int startpos);
726 void saveGroupHeader(std::ostream &os,
int index,
730 bool &in_import_block);
731 void saveGroupFooter(std::ostream &os,
int index,
734 bool &in_import_block);
735 void saveImportHeader(std::ostream &os,
int index,
738 bool &in_import_block);
739 void saveImportFooter(std::ostream &os,
int index,
742 bool &in_import_block);
743 void saveMultiParmHeader(std::ostream &os,
int index,
746 bool &in_import_block);
747 void saveMultiParmFooter(std::ostream &os,
int index,
750 bool &in_import_block);
752 PI_EditScriptedParmArray myParms;
756 bool myIsEditingSpareParms;
757 bool myIsEditingOverrideParms;
774 int getNParms()
const;
776 OP_Node * getNode(
int parm_idx);
777 int getMatchingGroupParm(
int parm_idx)
const;
778 int removeParms(
int first_parm_idx,
int last_parm_idx);
789 void appendToAggregate(
795 int getParmIndex(
int node_idx,
int parm_sub_idx )
const;
796 void getNodeAndParmIndices(
int &node_idx,
int &parm_sub_idx,
797 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
__hostdev__ uint64_t last(uint32_t i) const
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)