17 #ifndef __PRM_Template__
18 #define __PRM_Template__
33 #define PRM_TYPE_IS_SWITCHER(type) (type.isSwitcher())
34 #define PRM_IS_JOIN(parm) ((parm).getTypeExtended() == PRM_TYPE_TOGGLE_JOIN || \
35 (parm).getTypeExtended() == PRM_TYPE_JOIN_PAIR || \
36 (parm).getTypeExtended() == PRM_TYPE_MENU_JOIN)
76 int thevectorsize = 1,
84 const char *thehelptext = 0,
89 PRM_Export theexportlevel,
90 int thevectorsize = 1,
98 const char *thehelptext = 0,
104 int thevectorsize = 1,
111 int theparmgroup = 1,
112 const char *thehelptext = 0,
118 PRM_Export theexportlevel,
119 int thevectorsize = 1,
126 int theparmgroup = 1,
127 const char *thehelptext = 0,
147 PRM_Export theexportlevel,
153 const char *thehelptext = 0,
164 const char *thehelptext = 0,
171 int64 getMemoryUsage(
bool inclusive)
const;
177 PRM_Export theexportlevel,
186 const char *thehelptext,
191 PRM_Export theexportlevel,
198 const char *thehelptext,
208 bool isMultiType()
const;
209 bool isRampType()
const;
210 bool isRampTypeColor()
const;
221 { mySparePtr = spare; }
225 {
return myConditionalPtr; }
227 {
return myConditionalPtr; }
229 { myConditionalPtr = conditional;
return *
this; }
238 if (!myChoiceListPtr &&
243 list = myChoiceListPtr;
249 if (myChoiceListPtr ==
nullptr
250 && myType.isOrdinalType()
251 && myType.hasOrdinalType(
255 list = myChoiceListPtr;
260 myChoiceListPtr = list;
266 { myCallbackFunc = callback; }
270 if (myAutoScopeField & (1<<(
unsigned)myVectorSize))
272 return myAutoScopeField;
276 {
return myMultiParmTemplate; }
278 {
return myMultiParmTemplate; }
282 myMultiParmTemplate = tplate;
284 int getMultiStartOffset()
const;
295 static bool matchMultiInstance(
const char *
name,
296 const char *multi_name,
304 && index >= 0 && index < myVectorSize)
305 ? myDefaults[
index].get() :
nullptr;
310 && index >= 0 && index < myVectorSize)
311 ? myDefaults[
index].get() :
nullptr;
315 return myFactoryDefaults;
319 myFactoryDefaults = defaults;
321 void restoreFactoryDefaults();
323 void setOrdinalDefault(
int index,
int v);
324 void setStringDefault(
int index,
const char *
v);
333 void setNoResim(
bool noresim);
334 void setNoCook(
bool nocook);
341 void setBaseParm(
bool baseparm);
342 void setInvisible(
bool invisible);
345 void setJoinNext(
bool joinnext);
348 void setLabelNone(
bool labelnone);
353 { myTypeExtended = type_ext; }
358 { myExportLevel = (
unsigned char)level; }
367 for (
int i = 0; i < myVectorSize; i++)
369 if (myChannelNames[i] == thechannelname)
379 return myChannelNames.get();
386 if (vi >= 0 && vi < myVectorSize)
388 s = myChannelNames[vi].
buffer();
402 if (vi >= 0 && vi < myVectorSize)
403 return myChannelNames[vi];
411 if (!myDecodedChannelNames)
412 buildChannelNames(
true);
414 if (vi >= 0 && vi < myVectorSize)
415 return myDecodedChannelNames[vi];
427 return myChannelNames[vi] ==
s;
429 void getChannelLabel(
UT_String &thestrref,
433 thestrref = myNamePtr->getToken();
437 thestrref = myNamePtr->getLabel();
442 return myNamePtr->getExpressionFlag();
449 return myNamePtr->getToken();
453 return myNamePtr->getTokenRef();
457 return myNamePtr->getLabel();
461 return myNamePtr->getHash();
471 static int countTemplates(
473 bool for_switcher =
false,
474 bool for_joins =
false,
475 bool for_rows =
false);
478 static int getTemplateIndexByToken(
489 static int getEndOfSwitcher(
491 &templates,
int switcher_index);
495 static void getSwitcherStats(
500 static bool getEnclosingSwitcherFolder(
503 int &switcher,
int &folder);
506 static PRM_Export getHighestExportLevel(
511 bool isAutomaticallyGeneratedChoiceList()
const;
515 int findSwitcherFolderWithLabel(
516 const char *
label)
const;
520 if (myAutoSelectField & (1<<(
unsigned)myVectorSize))
521 setAutoSelectField();
522 return myAutoSelectField;
526 void buildChannelNames(
bool decoded=
false)
const;
527 void setAutoScopeField();
528 void setAutoSelectField();
544 unsigned char myExportLevel;
545 unsigned char myParmGroup;
546 unsigned char myChoiceListOwnedByMe;
547 unsigned int myAutoScopeField;
548 unsigned int myAutoSelectField;
556 myDecodedChannelNames;
PRM_Default * getFactoryDefaults() const
const char * getToken() const
PRM_ChoiceList * getChoiceListPtr()
PRM_Default * getDefault(int index)
PRM_Template * getMultiParmTemplate()
const PRM_Type & getType() const
unsigned getTokenHash() const
GLuint GLsizei const GLchar * label
#define SYS_DEPRECATED(__V__)
bool hasChannelToken(const UT_StringRef &s, int vi) const
PRM_Callback getCallback() const
const UT_StringRef & getTokenRef() const
PRM_SpareData * getSparePtr()
const PRM_Template * getMultiParmTemplate() const
void setNamePtr(PRM_Name *name)
PRM_Template & setConditionalBasePtr(PRM_ConditionalBase *conditional)
const PRM_Conditional * getDisablePtr() const
unsigned int getAutoSelectField()
void setExportLevel(PRM_Export level)
PRM_API const PRM_Type PRM_TYPE_TOGGLE
void setCallback(PRM_Callback callback)
const UT_StringHolder & getChannelToken(int vi) const
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
const UT_StringHolder & getDecodedChannelToken(int vi) const
PRM_Range * getRangePtr()
const char * buffer() const
void setSparePtr(PRM_SpareData *spare)
const UT_StringHolder & getHelpText() const
int getExpressionFlag() const
void getChannelToken(UT_String &s, int vi) const
const PRM_Range * getRangePtr() const
unsigned int getAutoScopeField()
static const UT_StringHolder theEmptyString
bool getInvisible() const
const char * getLabel() const
bool getLabelNone() const
GLuint const GLchar * name
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
PRM_API const PRM_Type PRM_TYPE_LABEL_NONE
void getToken(UT_String &thestrref) const
void setFactoryDefaults(PRM_Default *defaults)
PRM_MultiType getMultiType() const
int getVectorSize() const
PRM_TypeExtended getTypeExtended() const
PRM_Conditional * getDisablePtr()
const PRM_ConditionalBase * getConditionalBasePtr() const
PRM_API const PRM_Type PRM_LIST_TERMINATOR
int findSubIndex(const UT_StringRef &thechannelname) const
const PRM_Name * getNamePtr() const
SIM_API const UT_StringHolder force
fpreal getMultiSize() const
PRM_Export exportLevel() const
PRM_API const PRM_Type PRM_TYPE_JOIN_NEXT
void setChoiceListPtr(PRM_ChoiceList *list)
LeafData & operator=(const LeafData &)=delete
PRM_API const PRM_Type PRM_TYPE_ORDINAL
void setMultiParmTemplate(PRM_Template *tplate)
const UT_StringHolder * getChannelTokens() const
const PRM_ChoiceList * getChoiceListPtr() const
const PRM_SpareData * getSparePtr() const
PRM_API const PRM_Type PRM_TYPE_INVISIBLE
PRM_ConditionalBase * getConditionalBasePtr()
void setTypeExtended(PRM_TypeExtended type_ext)
void getLabel(UT_String &thestrref) const
PRM_API PRM_ChoiceList PRMtoggleMenu
PRM_MultiType
This type enum defines the different types of multi (dynamic) parameters.
const PRM_Default * getDefault(int index) const