HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PRM_SpareData.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: PRM_SpareData.h ( PRM Library, C++)
7  *
8  * COMMENTS: This class is used to add additional token/value pairs to a
9  * parameter.
10  */
11 
12 #ifndef __PRM_SpareData__
13 #define __PRM_SpareData__
14 
15 #include "PRM_API.h"
16 #include "PRM_Type.h"
17 
18 #include <CH/CH_ExprLanguage.h>
19 #include <UT/UT_ArrayStringMap.h>
20 #include <UT/UT_Color.h>
21 #include <UT/UT_Variadic.h>
22 
23 #include <SYS/SYS_Types.h>
24 
25 #include <utility>
26 
27 
28 // Namespace to use for built-in parameter tags.
29 // Note that we cannot add the namespace to old built-in tags
30 // for compatibility reasons.
31 #define PRM_SPARE_BUILTIN_NAMESPACE "sidefx::"
32 
33 //
34 // Declarations of built-in parm spare data tokens (tag names).
35 // The entries in this list must be included in `theBuiltInTokenMap`
36 // (see PRM_SpareData.C).
37 //
38 // NOTE: You *must* include the SideFX namespace in the token
39 // when adding a new spare data token.
40 //
41 #define PRM_SPARE_KEY_VALUE_DICT_KEY_LABEL_TOKEN \
42  PRM_SPARE_BUILTIN_NAMESPACE "key_value_dict_key_label"
43 #define PRM_SPARE_KEY_VALUE_DICT_VALUE_LABEL_TOKEN \
44  PRM_SPARE_BUILTIN_NAMESPACE "key_value_dict_value_label"
45 #define PRM_SPARE_KEY_VALUE_DICT_USE_CHOOSER_TOKEN \
46  PRM_SPARE_BUILTIN_NAMESPACE "key_value_dict_use_chooser"
47 #define PRM_SPARE_KEY_VALUE_DICT_CHOOSER_LABEL_TOKEN \
48  PRM_SPARE_BUILTIN_NAMESPACE "key_value_dict_chooser_label"
49 #define PRM_SPARE_KEY_VALUE_DICT_CHOOSER_CALLBACK_TOKEN \
50  PRM_SPARE_BUILTIN_NAMESPACE "key_value_dict_chooser_callback"
51 #define PRM_SPARE_ATTRIB_ACCESS_TOKEN \
52  PRM_SPARE_BUILTIN_NAMESPACE "attrib_access"
53 #define PRM_SPARE_CONNECTOR_KIND \
54  PRM_SPARE_BUILTIN_NAMESPACE "connector_kind"
55 #define PRM_SPARE_CONNECTOR_TYPE \
56  PRM_SPARE_BUILTIN_NAMESPACE "connector_type"
57 #define PRM_SPARE_USDPATHTYPE_TOKEN \
58  PRM_SPARE_BUILTIN_NAMESPACE "usdpathtype"
59 #define PRM_SPARE_USDPATHINPUT_TOKEN \
60  PRM_SPARE_BUILTIN_NAMESPACE "usdpathinput"
61 #define PRM_SPARE_IS_SHADER_PARM_TOKEN \
62  PRM_SPARE_BUILTIN_NAMESPACE "shader_isparm"
63 #define PRM_SPARE_FORCE_SHADER_PARM_VAL_TOKEN \
64  PRM_SPARE_BUILTIN_NAMESPACE "shader_forceparmval"
65 #define PRM_SPARE_SHADER_PARM_TYPE_TOKEN \
66  PRM_SPARE_BUILTIN_NAMESPACE "shader_parmtype"
67 #define PRM_SPARE_SHADER_PARM_NAME_TOKEN \
68  PRM_SPARE_BUILTIN_NAMESPACE "shader_parmname"
69 #define PRM_SPARE_SAVE_VALUE_TOKEN \
70  PRM_SPARE_BUILTIN_NAMESPACE "save_value"
71 #define PRM_SPARE_MAYA_COMPONENT_SELECTION_TYPE_TOKEN \
72  PRM_SPARE_BUILTIN_NAMESPACE "maya_component_selection_type"
73 #define PRM_SPARE_LOOK_TOKEN \
74  PRM_SPARE_BUILTIN_NAMESPACE "look"
75 #define PRM_SPARE_LAYOUT_HEIGHT_TOKEN \
76  PRM_SPARE_BUILTIN_NAMESPACE "layout_height"
77 #define PRM_SPARE_HEADER_TOGGLE_TOKEN \
78  PRM_SPARE_BUILTIN_NAMESPACE "header_toggle"
79 #define PRM_SPARE_HEADER_PARM_TOKEN \
80  PRM_SPARE_BUILTIN_NAMESPACE "header_parm"
81 #define PRM_SPARE_SLIDER_TOKEN \
82  PRM_SPARE_BUILTIN_NAMESPACE "slider"
83 
84 // When you add a tag above, make sure to add it to $SHS/properties/other/standardparmtags.ds
85 
86 //
87 // Declarations of *old*, built-in parm spare data tokens (tag names).
88 // WARNING: Do not add new spare data tokens to this list!!!
89 // Add the tokens to the new list above and include the SideFX
90 // namespace in the tokens.
91 //
92 #define PRM_SPARE_AUTOSCOPE_TOKEN "autoscope"
93 #define PRM_SPARE_BUTTON_ICON_TOKEN "button_icon"
94 #define PRM_SPARE_CODE_GENERATION_TOKEN "code_generation"
95 #define PRM_SPARE_COLOR_DYN_TOKEN "colordyn"
96 #define PRM_SPARE_COLOR_TYPE_TOKEN "colortype"
97 #define PRM_SPARE_COLOR_WHEEL_TOKEN "colorwheel"
98 #define PRM_SPARE_COOK_DEPENDENT_TOKEN "cook_dependent"
99 #define PRM_SPARE_EDITOR_LANG_TOKEN "editorlang"
100 #define PRM_SPARE_EDITOR_LINES_TOKEN "editorlines"
101 #define PRM_SPARE_EDITOR_TOKEN "editor"
102 #define PRM_SPARE_FILE_CHOOSER_MODE_TOKEN "filechooser_mode"
103 #define PRM_SPARE_FILE_CHOOSER_PATTERN_TOKEN "filechooser_pattern"
104 #define PRM_SPARE_GROUP_TYPE_TOKEN "group_type"
105 #define PRM_SPARE_GROUP_DEFAULT_TOKEN "group_default"
106 #define PRM_SPARE_MULTI_START_OFFSET_TOKEN "multistartoffset"
107 #define PRM_SPARE_NETREF_TOKEN "netref"
108 #define PRM_SPARE_OPFILTER_TOKEN "opfilter"
109 #define PRM_SPARE_OPPATH_KEYWORDS_TOKEN "oppathkeywords"
110 #define PRM_SPARE_OPRELATIVE_TOKEN "oprelative"
111 #define PRM_SPARE_PARM_VOP_TOKEN "parmvop"
112 #define PRM_SPARE_RAMP_BASIS_DEFAULT_TOKEN "rampbasisdefault"
113 #define PRM_SPARE_RAMP_BASIS_TOKEN "rampbasis"
114 #define PRM_SPARE_RAMP_BASIS_VAR_TOKEN "rampbasis_var"
115 #define PRM_SPARE_RAMP_COLOR_DEFAULT_TOKEN "rampcolordefault"
116 #define PRM_SPARE_RAMP_COLOR_TYPE_TOKEN "rampcolortype"
117 #define PRM_SPARE_RAMP_FLOAT_DEFAULT_TOKEN "rampfloatdefault"
118 #define PRM_SPARE_RAMP_KEYS_TOKEN "rampkeys"
119 #define PRM_SPARE_RAMP_KEYS_VAR_TOKEN "rampkeys_var"
120 #define PRM_SPARE_RAMP_SHOW_CONTROLS_DEFAULT_TOKEN "rampshowcontrolsdefault"
121 #define PRM_SPARE_RAMP_VALUES_TOKEN "rampvalues"
122 #define PRM_SPARE_RAMP_VALUES_VAR_TOKEN "rampvalues_var"
123 #define PRM_SPARE_SCRIPT_ACTION_HELP_TOKEN "script_action_help"
124 #define PRM_SPARE_SCRIPT_ACTION_ICON_TOKEN "script_action_icon"
125 #define PRM_SPARE_SCRIPT_ACTION_TOKEN "script_action"
126 #define PRM_SPARE_SCRIPT_CALLBACK_TOKEN "script_callback"
127 #define PRM_SPARE_SCRIPT_CALLBACK_LANGUAGE_TOKEN "script_callback_language"
128 #define PRM_SPARE_SCRIPT_RITYPE_TOKEN "script_ritype"
129 #define PRM_SPARE_SCRIPT_UNQUOTED_TOKEN "script_unquoted"
130 #define PRM_SPARE_SHADER_PARM_CONTEXTS_TOKEN "shaderparmcontexts"
131 #define PRM_SPARE_UNITS_TOKEN "units"
132 #define PRM_SPARE_XCF_MODE_TOKEN "xcfmode"
133 #define PRM_SPARE_VARYING_DEFAULT_TOKEN "varying_default"
134 
135 class UT_BitArray;
136 class UT_StringArray;
137 class UT_StringHolder;
138 class UT_StringRef;
139 class PRM_Parm;
140 class prm_SharedString;
141 
142 typedef int (*PRM_SpareCallback)(const char *token, const char *value);
143 typedef int (*PRM_SpareCallbackWithData)(const char *token,
144  const char *value, void *data);
145 
146 typedef std::pair<const char *, const char *> PRM_SpareToken;
148 
150 {
151 public:
152  /// The constructor for the PRM_SpareData should takes a variadic number of
153  /// token/value pairs. For example:
154  /// static PRM_SpareData(PRM_SpareArgs()
155  /// << PRM_SpareToken("token1", "value1")
156  /// << PRM_SpareToken("token2", "value2")
157  /// ...);
158  explicit PRM_SpareData(const PRM_SpareArgs &args);
159 
160  /// A single token value pair
161  explicit PRM_SpareData(const PRM_SpareToken &pair);
162  PRM_SpareData();
163  ~PRM_SpareData();
164 
166  PRM_SpareData &operator=(const PRM_SpareData &copy);
167 
168  uint entries() const;
169 
170  void clear();
171  void mergeFrom(const PRM_SpareData &ref);
172  void copyFrom(const PRM_SpareData &ref);
173 
174  bool containsAny(const PRM_SpareData &ref) const;
175  bool containsAll(const PRM_SpareData &ref) const;
176 
177  // The the value associated with a particular token.
178  const char *getValue(const UT_StringRef &token) const;
179 
180  // Because these are traverseConst functions, we can't remove any items
181  // from the table in the traversal functions.
182  void traverseConst(PRM_SpareCallback f) const;
183  void traverseConst(PRM_SpareCallbackWithData f, void *data) const;
184 
185 
186  // NOTE: When addTokenValue is called with a null pointer for the value,
187  // the token is deleted from the spare data.
188  void addTokenValue(const UT_StringHolder &token, const char *value);
189  void deleteTokenValue(const UT_StringRef &token);
190 
191  // For backward compatibility with the ScriptParmSpareData class, we have
192  // these functions.
193  static const char *getScriptCallbackToken()
195  void setCallbackData(const char *str)
196  { addTokenValue(getScriptCallbackToken(), str); }
197  const char *getCallbackData() const
198  { return getValue(getScriptCallbackToken()); }
199 
200  static const char *getScriptCallbackLanguageToken()
202  void setCallbackLanguage(CH_ScriptLanguage language);
203  CH_ScriptLanguage getCallbackLanguage() const;
204 
205  void setRenderManType(const char *str)
206  { addTokenValue(PRM_SPARE_SCRIPT_RITYPE_TOKEN, str); }
207  const char *getRenderManType() const
208  { return getValue(PRM_SPARE_SCRIPT_RITYPE_TOKEN); }
209 
210  void setOpFilter(const char *str)
211  { addTokenValue(PRM_SPARE_OPFILTER_TOKEN, str); }
212  const char *getOpFilter() const
213  { return getValue(PRM_SPARE_OPFILTER_TOKEN); }
214 
215  void setOpRelative(const char *str)
216  { addTokenValue(PRM_SPARE_OPRELATIVE_TOKEN, str); }
217  const char *getOpRelative() const
218  { return getValue(PRM_SPARE_OPRELATIVE_TOKEN); }
219 
220  static const char * getUnquotedStateToken()
223  { addTokenValue(getUnquotedStateToken(), "1"); }
224  bool getUnquotedState() const
225  { return getValue(getUnquotedStateToken()) != 0; }
226 
227  void setMultiStartOffset(int value);
228  int getMultiStartOffset() const;
229 
230  void setVisibleTabs(const UT_BitArray &values);
231  void getVisibleTabs(UT_BitArray &values) const;
232  bool getVisibleTab(int tabidx) const;
233 
234  // Ramp
235  static const char * getRampBasisDefaultToken()
237  void setRampBasisDefault(const char *value)
238  { addTokenValue(getRampBasisDefaultToken(),value); }
239  const char * getRampBasisDefault() const
240  { return getValue(getRampBasisDefaultToken()); }
241 
242  static const char * getRampShowControlsDefaultToken()
244  void setRampShowControlsDefault(bool value)
245  {
246  addTokenValue(getRampShowControlsDefaultToken(),
247  value ? "1" : "0");
248  }
250  {
251  const char *n, *v;
252  n = getRampShowControlsDefaultToken();
253  v = getValue(n);
254  if (!v)
255  return true;
256  else
257  return *v != '0';
258  }
259 
260  static const char * getRampColorTypeToken()
262  static const char * getRampColorTypeValueToken(UT_ColorType color_type);
263  void setRampColorType(UT_ColorType color_type);
264  UT_ColorType getRampColorType() const;
265 
266  static const char * getRampBasisVarToken()
268  static const char * getRampKeysVarToken()
270  static const char * getRampValuesVarToken()
272 
273  void setRampBasisVar(const char *value)
274  { addTokenValue(getRampBasisVarToken(), value); }
275  const char * getRampBasisVar() const
276  { return getValue(getRampBasisVarToken()); }
277  void setRampKeysVar(const char *value)
278  { addTokenValue(getRampKeysVarToken(), value); }
279  const char * getRampKeysVar() const
280  { return getValue(getRampKeysVarToken()); }
281  void setRampValuesVar(const char *value)
282  { addTokenValue(getRampValuesVarToken(), value); }
283  const char * getRampValuesVar() const
284  { return getValue(getRampValuesVarToken()); }
285 
286  static const char * getColorRampDefaultToken()
288  const char * getColorRampDefaultValue() const
289  { return getValue(getColorRampDefaultToken()); }
290  static const char * getFloatRampDefaultToken()
292  const char * getFloatRampDefaultValue() const
293  { return getValue(getFloatRampDefaultToken()); }
294  void setRampDefaultFromParm(const PRM_Parm &ramp_parm);
295  void getRampDefaultToParm(PRM_Parm &ramp_parm) const;
296 
297  // Color UI Mode, Wheel flag and Dynamic flag
298  static const char * getColorTypeToken()
299  { return PRM_SPARE_COLOR_TYPE_TOKEN; }
300  static const char * getColorTypeValueToken(PRM_ColorType color_type);
301  void setColorType(PRM_ColorType color_type);
302  PRM_ColorType getColorType() const;
303 
304  static const char * getColorWheelToken()
305  { return PRM_SPARE_COLOR_WHEEL_TOKEN; }
306  void setColorWheel(bool value);
307  bool getColorWheel() const;
308 
309  static const char * getColorDynamicToken()
310  { return PRM_SPARE_COLOR_DYN_TOKEN; }
311  void setColorDynamic(bool value);
312  bool getColorDynamic() const;
313 
314  static const char * getKeyValueDictKeyLabelToken()
316  void setKeyValueDictKeyLabel(const char *label);
317  const char *getKeyValueDictKeyLabel() const;
318  static const char * getKeyValueDictValueLabelToken()
320  void setKeyValueDictValueLabel(const char *label);
321  const char *getKeyValueDictValueLabel() const;
322  static const char * getKeyValueDictUseChooserToken()
324  void setKeyValueDictUseChooser(bool use_chooser);
325  bool getKeyValueDictUseChooser() const;
326  static const char * getKeyValueDictChooserLabelToken()
328  void setKeyValueDictChooserLabel(const char *label);
329  const char *getKeyValueDictChooserLabel() const;
332  void setKeyValueDictChooserCallback(const char *label);
333  const char *getKeyValueDictChooserCallback() const;
334 
335  void setXCFMode(const char *value)
336  { return addTokenValue(PRM_SPARE_XCF_MODE_TOKEN, value); }
337  const char *getXCFMode() const
338  { return getValue(PRM_SPARE_XCF_MODE_TOKEN); }
339 
340  const char *getScriptAction() const;
341  const char *getScriptActionHelp() const;
342  const char *getScriptActionIcon() const;
343  const char *getButtonIcon() const;
344 
345  bool getUseEditor() const;
346  const char *getEditorLanguage() const
347  { return getValue(PRM_SPARE_EDITOR_LANG_TOKEN); }
348  void getEditorLinesRange(int &lines_min, int &lines_max) const;
349  static inline int getEditorLinesRangeDefaultMin() { return 8; }
350  static inline int getEditorLinesRangeDefaultMax() { return 40; }
351 
352  static const char *getXCFModeFloatValToken() { return "float"; }
353 
354  // Token for whether the template will be used for cooking
355  static const char * getCookDependentToken()
357  // Get state of cook_dependent flag.
358  // This is only used for SPARE parameters, which if this tag doesn't exist,
359  // the spare parm defaults to false for cook dependent.
360  bool getCookDependent() const;
361  // Set state of cook_dependent flag.
362  // This is only used for SPARE parameters, which if this tag doesn't exist,
363  // the spare parm defaults to false for cook dependent.
364  void setCookDependent(bool flag);
365 
366  // Token for whether the parm on the VOP should regenerate code
367  static const char *getCodeGenDependentToken()
369  // Get the state of the code_generation flag
370  // This is only used for SPARE parameters, which if this tag doesn't exist,
371  // the spare parm defaults to true for code generation
372  bool getCodeGenDependent() const;
373  // Set state of code_generation flag.
374  // This is only used for SPARE parameters, which if this tag doesn't exist,
375  // the spare parm defaults to true for code generation
376  void setCodeGenDependent(bool flag);
377 
378  int64 getMemoryUsage(bool inclusive) const;
379 
380  static const char *getOpFilterKeyFromName(const char *name);
381  static const char *getOpFilterKeyFromLabel(const char *name);
382  static const char *getOpFilterNameFromKey(const char *key);
383  static const char *getOpFilterLabelFromKey(const char *key);
384  // End of backward compatibility
385 
386  // Convenience spare data you might want to use
387  static PRM_SpareData objNetRef; // /obj
388  static PRM_SpareData chNetRef; // /ch
389  static PRM_SpareData ropNetRef; // /out
390 
391  static PRM_SpareData objPath; // !!OBJ!!
392  static PRM_SpareData objGeometryPath; // !!OBJ/GEOMETRY!!
393  static PRM_SpareData objLightPath; // !!OBJ/LIGHT!!
394  static PRM_SpareData objBonePath; // !!OBJ/BONE!!
395  static PRM_SpareData objMusclePath; // !!OBJ/MUSCLE!!
396  static PRM_SpareData objCameraPath; // !!OBJ/CAMERA!!
397  static PRM_SpareData dopPath; // !!DOP!!
398  static PRM_SpareData sopPath; // !!SOP!!
399  static PRM_SpareData popPath; // !!POP!!
400  static PRM_SpareData ropPath; // !!ROP!!
401  static PRM_SpareData cop2Path; // !!COP2!!
402  static PRM_SpareData chopPath; // !!CHOP!!
403  static PRM_SpareData constraintsPath; // !!CHOP!!
404  static PRM_SpareData shopPath; // !!SHOP!!
405  static PRM_SpareData shopProperties; // !!SHOP/PROPERTIES!!
406  static PRM_SpareData shopMaterial; // !!SHOP/MATERIAL!!
407  static PRM_SpareData shopSurface; // !!SHOP/SURFACE!!
408  static PRM_SpareData shopDisplacement; // !!SHOP/DISPLACEMENT!!
409  static PRM_SpareData shopSurfaceShadow; // !!SHOP/SURFACE_SHADOW!!
410  static PRM_SpareData shopBackground; // !!SHOP/BACKGROUND!!
411  static PRM_SpareData shopGeometry; // !!SHOP/GEOMETRY!!
412  static PRM_SpareData shopAtmosphere; // !!SHOP/ATMOSPHERE!!
413  static PRM_SpareData shopPhoton; // !!SHOP/PHOTON!!
414  static PRM_SpareData shopPhotonVolume; // !!SHOP/PHOTONVOLUME!!
415  static PRM_SpareData shopContour; // !!SHOP/CONTOUR!!
416  static PRM_SpareData shopLight; // !!SHOP/LIGHT!!
417  static PRM_SpareData shopEmitter; // !!SHOP/EMITTER!!
418  static PRM_SpareData shopLightShadow; // !!SHOP/LIGHT_SHADOW!!
419  static PRM_SpareData shopLens; // !!SHOP/LENS!!
420  static PRM_SpareData shopOutput; // !!SHOP/OUTPUT!!
421  static PRM_SpareData shopContourStore; // !!SHOP/CONTOUR_STORE!!
422  static PRM_SpareData shopContourContrast; // !!SHOP/CONTOUR_CONTRAST!!
423  static PRM_SpareData shopImage3d; // !!SHOP/IMAGE3D!!
424  static PRM_SpareData shopCVEX; // !!SHOP/CVEX!!
425  static PRM_SpareData shopCoShader; // !!SHOP/COSHADER!!
426  static PRM_SpareData vopPath; // !!VOP!!
427  static PRM_SpareData lopPath; // !!LOP!!
428  static PRM_SpareData topPath; // !!TOP!!
429  static PRM_SpareData topSchedulerPath; // !!TOP/SCHEDULER!!
430  static PRM_SpareData topProcessorPath; // !!TOP/PROCESSOR!!
431  static PRM_SpareData topPartitionerPath; // !!TOP/PARTITIONER!!
432  static PRM_SpareData topMapperPath; // !!TOP/MAPPER!!
433  static PRM_SpareData filterMaterial; // !!CUSTOM/MATERIAL!!
434 
435  static PRM_SpareData autoScope; // autoscope
436 
437  static PRM_SpareData multiStartOffsetZero; // multistart offset of zero
438  static PRM_SpareData multiStartOffsetOne; // multistart offset of one
439 
443  static PRM_SpareData unitsMass; // kg1
444  static PRM_SpareData unitsPerMass; // kg-1
445  static PRM_SpareData unitsTime; // s1
448  static PRM_SpareData unitsVelocity; // m1s-1
452  static PRM_SpareData unitsForce; // kg1m1s-2
453  static PRM_SpareData unitsForceDensity; // kg1m-2s-2
454  static PRM_SpareData unitsImpulse; // kg1m1s-1
455  static PRM_SpareData unitsTorque; // kg1m2s-2
456  static PRM_SpareData unitsDrag; // kg1s-1
457  static PRM_SpareData unitsAngDrag; // kg1m2s-1
458  static PRM_SpareData unitsPressure; // kg1m-1s-2
463  static PRM_SpareData unitsAreaDensity; // kg1m-2
466  static PRM_SpareData unitsDensity; // kg1m-3
467  static PRM_SpareData unitsDensityPerTime; // kg1m-3s-1
469  static PRM_SpareData unitsNone; // ""
470 
471  static PRM_SpareData rampBasisDefault; // rampbasis "ramp_basis"
472  static PRM_SpareData rampKeysDefault; // rampkeys "ramp_keys"
473  static PRM_SpareData rampValuesDefault; // rampvalues "ramp_values"
474 
475  static PRM_SpareData attribAccessR; // "sidefx::attrib_access" "read"
476  static PRM_SpareData attribAccessW; // "sidefx::attrib_access" "write"
477  static PRM_SpareData attribAccessRW; // "sidefx::attrib_access" "readwrite"
478 
479  static PRM_SpareData connectorKindNone; // "sidefx::connector_kind" "none"
480  static PRM_SpareData connectorKindIn; // "sidefx::connector_kind" "in"
481  static PRM_SpareData connectorKindOut; // "sidefx::connector_kind" "out"
482  static PRM_SpareData connectorKindInOut;// "sidefx::connector_kind" "inout"
483 
484  static PRM_SpareData shaderIsShaderParm; // "sidefx::shader_isparm" "1"
485  static PRM_SpareData shaderIsNotShaderParm; // "sidefx::shader_isparm" "0"
486 
487  /// Used to set a space- or comma-separated list of globs to use as
488  /// file filter for parameters of type @c PRM_FILE (e.g. "*.txt *.log").
489  static const char *getFileChooserPatternToken()
491 
492  static const char *getFileChooserModeToken()
494  static const char *getFileChooserModeValRead()
495  { return "read"; }
496  static const char *getFileChooserModeValWrite()
497  { return "write"; }
498  static const char *getFileChooserModeValReadAndWrite()
499  { return "read_and_write"; }
500 
501  static PRM_SpareData fileChooserModeRead; // filechooser_mode "read"
502  static PRM_SpareData fileChooserModeWrite; // filechooser_mode "write"
503  static PRM_SpareData fileChooserModeReadAndWrite; // ... "read_and_write"
504 
505  static PRM_SpareData stringFloatXCF; // float XCF in string field
506 
507  static const char *getScriptActionToken()
509  static const char *getScriptActionHelpToken()
511  static const char *getScriptActionIconToken()
513  static const char *getButtonIconToken()
514  { return PRM_SPARE_BUTTON_ICON_TOKEN; }
515 
516  static const char *getEditorToken()
517  { return PRM_SPARE_EDITOR_TOKEN; }
518  static PRM_SpareData stringEditor; // Use a text editor for strings
519 
520  static const char *getEditorLanguageToken()
521  { return PRM_SPARE_EDITOR_LANG_TOKEN; }
526 
527  /// Number of lines to show by default. This value can be set as either
528  /// a single number or a range, e.g. '10-50'. The minimum number is what
529  /// the editor will originally show up as, but will attempt to expand up to
530  /// the maximum.
531  static const char *getEditorLinesRangeToken()
532  { return PRM_SPARE_EDITOR_LINES_TOKEN; }
533 
534  // token indicating the parameter comes from a Parameter VOP (ie it is a
535  // shader parameter)
536  static const char * getParmVopVarToken()
537  { return PRM_SPARE_PARM_VOP_TOKEN; }
538 
539  // space-separated list of shading contexts, which a material parameter
540  // belongs to, ie, shaders for each of these contexts actually have
541  // this parameter as an argument, since material may contain other shaders
542  // for other contexts to which a parameter does not apply
543  static const char * getShaderParmContextsToken()
545 
546  // token specifying special keywords that are legal in an oppath parameter
547  // (in addition to the node path itself)
548  static const char * getOpPathKeywordsToken()
550 
551  // token for unit specification
552  static const char * getUnitsToken()
553  { return PRM_SPARE_UNITS_TOKEN; }
554 
555  // token for group specialization (simple/collapsible/toggle groups).
556  static const char *getGroupTypeToken()
557  { return PRM_SPARE_GROUP_TYPE_TOKEN; }
561  static const char *getGroupDefaultToken()
563 
564  // Marks parameter has having varying default values
565  // Defaults to "0"
566  static const char *getVaryingDefaultToken()
569  bool getHasVaryingDefault() const;
570  void setHasVaryingDefault(bool f);
571 
572  // Gets information about whether this parm accepts one or more USD
573  // primitive paths, and/or USD collections.
574  static const char *getUsdPathTypeToken()
575  { return PRM_SPARE_USDPATHTYPE_TOKEN; }
578  const char *getUsdPathType() const;
579 
580  // Gets a value that describes which input's stage is the source for
581  // the primitive(s) in this parameter. This string is evaluated by the
582  // CH_Manager, so it can be a constant (0, 1, or 2) or an expression
583  // that looks at other parameter values.
584  static const char *getUsdPathInputToken()
585  { return PRM_SPARE_USDPATHINPUT_TOKEN; }
588  const char *getUsdPathInput() const;
589 
590  // Identifies the node parameter as shader parameter.
591  static const char *getIsShaderParmToken()
593 
594  // Forces the translation of shader parameter even if it's at default value.
595  static const char *getForceParmValueToken()
597 
598  // Marks a data parm for whether or not it should be saved to disk
599  static const char *getSaveValueToken()
600  { return PRM_SPARE_SAVE_VALUE_TOKEN; }
601  static PRM_SpareData saveValueAlways; // "sidefx::save_value" "1"
602  static PRM_SpareData saveValueNever; // "sidefx::save_value" "0"
603  const char *getSaveValue() const;
604  void setSaveValue(bool flag);
605 
606  // Houdini Engine for Maya: Informs Maya that this parameter should be able
607  // to be set by component selection.
614 
615  // Changes the look of the parm. Used to switch between separator and spacer
616  // Height is used to adjust the dimension of the parameter (value * 0.1 inches)
617  static const char *getLookToken()
618  { return PRM_SPARE_LOOK_TOKEN; }
619  static const char *getLayoutHeightToken()
621  const char *getLookValue() const;
622  void setLookValue(const char *value);
623  const char *getLayoutHeightValue() const;
624  void setLayoutHeightValue(const char *value);
625  static PRM_SpareData lookBlank; // "sidefx::look" "blank"
626  static PRM_SpareData lookClassic; // "sidefx::look" "classic"
627  static PRM_SpareData lookIcon; // "sidefx::look" "icon"
628  static PRM_SpareData lookHeading; // "sidefx::look" "heading"
629  static PRM_SpareData lookBlock; // "sidefx::look" "block"
630  static PRM_SpareData layoutHeightSmall; // "sidefx::layout_height" "small"
631  static PRM_SpareData layoutHeightMedium; // "sidefx::layout_height" "medium"
632  static PRM_SpareData layoutHeightLarge; // "sidefx::layout_height" "large"
633 
634  // Header toggle reference for the collapsible folder
635  static const char *getHeaderToggleToken()
637 
638  // Header parm reference for the collapsible folder
639  static const char *getHeaderParmToken()
640  { return PRM_SPARE_HEADER_PARM_TOKEN; }
641 
642  // Slider options. Snap or non-snap
643  static const char *getSliderToken()
644  { return PRM_SPARE_SLIDER_TOKEN; }
645  static PRM_SpareData sliderSnapToInt; // "sidefx::slider" "snap_to_int"
646 
647  /// Return true if the given token is a built-in (internally used) spare
648  /// data token.
649  static bool isBuiltInToken(const UT_StringRef &token);
650 
651  /// Return a range of the built-in tags names.
652  static void builtInTokens(UT_StringArray &tokens);
653 
654 private:
656 };
657 
658 #endif
static PRM_SpareData mayaComponentSelectionTypeFace
static PRM_SpareData objLightPath
static PRM_SpareData objMusclePath
static PRM_SpareData shopOutput
GLint ref
Definition: glcorearb.h:123
static const char * getVaryingDefaultToken()
static PRM_SpareData shopEmitter
static PRM_SpareData stringEditorLangPython
static const char * getColorWheelToken()
static PRM_SpareData rampValuesDefault
#define PRM_SPARE_OPRELATIVE_TOKEN
static PRM_SpareData unitsTime
const char * getXCFMode() const
#define PRM_SPARE_SCRIPT_ACTION_HELP_TOKEN
static PRM_SpareData shopCVEX
#define PRM_SPARE_COLOR_TYPE_TOKEN
Definition: PRM_SpareData.h:96
#define PRM_SPARE_CODE_GENERATION_TOKEN
Definition: PRM_SpareData.h:94
#define PRM_SPARE_MAYA_COMPONENT_SELECTION_TYPE_TOKEN
Definition: PRM_SpareData.h:71
static PRM_SpareData unitsLinearDensity
static PRM_SpareData topSchedulerPath
static const char * getEditorLanguageToken()
static const char * getRampColorTypeToken()
static const char * getXCFModeFloatValToken()
static PRM_SpareData vopPath
static PRM_SpareData ropPath
static PRM_SpareData connectorKindIn
const char * getEditorLanguage() const
const char * getOpFilter() const
static PRM_SpareData sliderSnapToInt
static const char * getLookToken()
#define PRM_SPARE_USDPATHINPUT_TOKEN
Definition: PRM_SpareData.h:59
void setCallbackData(const char *str)
static PRM_SpareData shopPath
static PRM_SpareData dopPath
static PRM_SpareData unitsImpulse
static PRM_SpareData shopDisplacement
static PRM_SpareData connectorKindNone
static PRM_SpareData fileChooserModeReadAndWrite
static const char * getCookDependentToken()
#define PRM_SPARE_XCF_MODE_TOKEN
void setXCFMode(const char *value)
#define PRM_SPARE_RAMP_BASIS_DEFAULT_TOKEN
static const char * getRampKeysVarToken()
#define PRM_SPARE_RAMP_BASIS_VAR_TOKEN
static PRM_SpareData shaderIsShaderParm
#define PRM_SPARE_SCRIPT_CALLBACK_LANGUAGE_TOKEN
static const char * getScriptCallbackLanguageToken()
static const char * getParmVopVarToken()
#define PRM_SPARE_SCRIPT_ACTION_ICON_TOKEN
static PRM_SpareData stringFloatXCF
#define PRM_SPARE_SLIDER_TOKEN
Definition: PRM_SpareData.h:81
static PRM_SpareData unitsPerMass
static PRM_SpareData stringEditorLangExpr
static const char * getButtonIconToken()
#define PRM_SPARE_LOOK_TOKEN
Definition: PRM_SpareData.h:73
static PRM_SpareData shopSurface
static const char * getScriptCallbackToken()
static PRM_SpareData objGeometryPath
bool getUnquotedState() const
static const char * getRampBasisDefaultToken()
static PRM_SpareData unitsPressure
static PRM_SpareData topProcessorPath
#define PRM_SPARE_SCRIPT_RITYPE_TOKEN
#define PRM_SPARE_RAMP_FLOAT_DEFAULT_TOKEN
const char * getRampBasisDefault() const
static const char * getHeaderParmToken()
static const char * getKeyValueDictChooserLabelToken()
static PRM_SpareToken usdPathTypePrim
static PRM_SpareData layoutHeightMedium
static const char * getGroupTypeToken()
#define PRM_SPARE_KEY_VALUE_DICT_CHOOSER_CALLBACK_TOKEN
Definition: PRM_SpareData.h:49
static PRM_SpareData stringEditor
GLuint const GLchar * name
Definition: glcorearb.h:785
static PRM_SpareData shopPhoton
static PRM_SpareData groupTypeCollapsibleExpanded
static PRM_SpareData unitsPerSquareTime
void setUnquotedState()
std::pair< const char *, const char * > PRM_SpareToken
UT_VariadicT< PRM_SpareToken > PRM_SpareArgs
#define PRM_SPARE_SAVE_VALUE_TOKEN
Definition: PRM_SpareData.h:69
static const char * getFileChooserPatternToken()
static PRM_SpareData unitsPerLength
#define PRM_SPARE_IS_SHADER_PARM_TOKEN
Definition: PRM_SpareData.h:61
static PRM_SpareData attribAccessW
#define PRM_SPARE_RAMP_VALUES_VAR_TOKEN
static PRM_SpareData shopContourContrast
static PRM_SpareData attribAccessRW
static PRM_SpareData topPath
#define PRM_SPARE_UNITS_TOKEN
static const char * getHeaderToggleToken()
#define PRM_SPARE_OPPATH_KEYWORDS_TOKEN
static const char * getIsShaderParmToken()
#define PRM_SPARE_HEADER_TOGGLE_TOKEN
Definition: PRM_SpareData.h:77
static PRM_SpareData multiStartOffsetOne
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1601
static PRM_SpareData unitsAngVelocity
static PRM_SpareData cop2Path
static const char * getSliderToken()
#define PRM_SPARE_KEY_VALUE_DICT_USE_CHOOSER_TOKEN
Definition: PRM_SpareData.h:45
static const char * getKeyValueDictUseChooserToken()
static PRM_SpareData groupTypeCollapsible
#define PRM_SPARE_GROUP_DEFAULT_TOKEN
#define PRM_SPARE_SCRIPT_CALLBACK_TOKEN
static PRM_SpareData shopAtmosphere
#define PRM_SPARE_KEY_VALUE_DICT_VALUE_LABEL_TOKEN
Definition: PRM_SpareData.h:43
static PRM_SpareData unitsAreaDensity
static PRM_SpareData unitsLinearDensityPerSquareTime
static const char * getUnitsToken()
#define PRM_SPARE_FILE_CHOOSER_MODE_TOKEN
static PRM_SpareData chNetRef
const char * getCallbackData() const
static int getEditorLinesRangeDefaultMin()
static PRM_SpareData unitsMass
static PRM_SpareData rampBasisDefault
static PRM_SpareData unitsDrag
static PRM_SpareData objNetRef
static const char * getKeyValueDictKeyLabelToken()
#define PRM_SPARE_EDITOR_LINES_TOKEN
static PRM_SpareData sopPath
static PRM_SpareData topMapperPath
static const char * getScriptActionIconToken()
static PRM_SpareData connectorKindInOut
static PRM_SpareData filterMaterial
static PRM_SpareToken usdPathInputFirst
static PRM_SpareData varyingDefault
static PRM_SpareData unitsLength
const GLdouble * v
Definition: glcorearb.h:836
const char * getFloatRampDefaultValue() const
static const char * getOpPathKeywordsToken()
static PRM_SpareData unitsAngDrag
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
#define PRM_SPARE_COLOR_WHEEL_TOKEN
Definition: PRM_SpareData.h:97
#define PRM_SPARE_VARYING_DEFAULT_TOKEN
static PRM_SpareData saveValueAlways
static PRM_SpareData topPartitionerPath
static PRM_SpareData shopContour
const char * getOpRelative() const
static const char * getKeyValueDictChooserCallbackToken()
static PRM_SpareData unitsTorque
static const char * getEditorLinesRangeToken()
#define PRM_SPARE_RAMP_COLOR_DEFAULT_TOKEN
long long int64
Definition: SYS_Types.h:116
static const char * getCodeGenDependentToken()
static PRM_SpareData unitsLinearDensityPerTime
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
static PRM_SpareData rampKeysDefault
bool getRampShowControlsDefault() const
static PRM_SpareData shopBackground
static const char * getKeyValueDictValueLabelToken()
static PRM_SpareData shopContourStore
static const char * getColorDynamicToken()
static PRM_SpareData unitsForce
static const char * getColorRampDefaultToken()
static PRM_SpareData saveValueNever
#define PRM_SPARE_LAYOUT_HEIGHT_TOKEN
Definition: PRM_SpareData.h:75
static PRM_SpareData multiStartOffsetZero
static PRM_SpareData shopProperties
static const char * getUsdPathTypeToken()
const char * getRampBasisVar() const
static PRM_SpareData constraintsPath
static const char * getRampValuesVarToken()
static const char * getGroupDefaultToken()
#define PRM_SPARE_COOK_DEPENDENT_TOKEN
Definition: PRM_SpareData.h:98
GLdouble n
Definition: glcorearb.h:2007
static PRM_SpareData layoutHeightSmall
static PRM_SpareData shaderIsNotShaderParm
GLboolean * data
Definition: glcorearb.h:130
static PRM_SpareData unitsNone
static const char * getRampShowControlsDefaultToken()
void setOpFilter(const char *str)
#define PRM_SPARE_KEY_VALUE_DICT_CHOOSER_LABEL_TOKEN
Definition: PRM_SpareData.h:47
static const char * getShaderParmContextsToken()
#define PRM_SPARE_RAMP_COLOR_TYPE_TOKEN
static const char * getMayaComponentSelectionTypeToken()
static PRM_SpareData ropNetRef
#define PRM_SPARE_KEY_VALUE_DICT_KEY_LABEL_TOKEN
Definition: PRM_SpareData.h:41
static PRM_SpareData unitsAcceleration
static PRM_SpareData shopGeometry
static const char * getFileChooserModeToken()
PRM_ColorType
Definition: PRM_Type.h:434
static PRM_SpareData unitsAreaDensityPerSquareTime
static PRM_SpareData shopMaterial
static PRM_SpareData chopPath
UT_ColorType
Definition: UT_Color.h:24
const char * getColorRampDefaultValue() const
void setRampBasisDefault(const char *value)
#define PRM_SPARE_PARM_VOP_TOKEN
#define PRM_SPARE_SCRIPT_ACTION_TOKEN
#define PRM_SPARE_SCRIPT_UNQUOTED_TOKEN
void setRampKeysVar(const char *value)
static PRM_SpareData objCameraPath
static PRM_SpareData groupTypeSimple
void setRenderManType(const char *str)
#define PRM_SPARE_OPFILTER_TOKEN
static PRM_SpareData shopLightShadow
static PRM_SpareData fileChooserModeWrite
#define PRM_SPARE_RAMP_SHOW_CONTROLS_DEFAULT_TOKEN
const char * getRampValuesVar() const
const char * getRampKeysVar() const
static PRM_SpareData stringEditorLangHScript
static const char * getFloatRampDefaultToken()
static PRM_SpareData unitsDensityPerSquareTime
#define PRM_SPARE_EDITOR_LANG_TOKEN
Definition: PRM_SpareData.h:99
#define PRM_SPARE_FORCE_SHADER_PARM_VAL_TOKEN
Definition: PRM_SpareData.h:63
static PRM_SpareData unitsAngAcceleration
static PRM_SpareData shopImage3d
static PRM_SpareData stringEditorLangVex
static PRM_SpareData connectorKindOut
static int getEditorLinesRangeDefaultMax()
const char * getRenderManType() const
#define PRM_SPARE_BUTTON_ICON_TOKEN
Definition: PRM_SpareData.h:93
OIIO_API bool copy(string_view from, string_view to, std::string &err)
#define PRM_SPARE_HEADER_PARM_TOKEN
Definition: PRM_SpareData.h:79
static PRM_SpareData lookHeading
static const char * getColorTypeToken()
static PRM_SpareData mayaComponentSelectionTypeVertex
#define PRM_SPARE_RAMP_KEYS_VAR_TOKEN
GLsizei const GLfloat * value
Definition: glcorearb.h:823
static const char * getFileChooserModeValRead()
GLfloat f
Definition: glcorearb.h:1925
**If you just want to fire and args
Definition: thread.h:615
static PRM_SpareData objBonePath
void setRampShowControlsDefault(bool value)
static PRM_SpareData shopPhotonVolume
static PRM_SpareData unitsDensity
static PRM_SpareToken usdPathInputSecond
static const char * getUsdPathInputToken()
static PRM_SpareData mayaComponentSelectionTypeUV
static PRM_SpareData lookBlock
static PRM_SpareData mayaComponentSelectionTypeEdge
static const char * getScriptActionHelpToken()
static PRM_SpareData autoScope
static PRM_SpareData shopLens
static const char * getUnquotedStateToken()
static const char * getSaveValueToken()
static PRM_SpareData shopLight
static PRM_SpareData unitsPerArea
static const char * getEditorToken()
static PRM_SpareData unitsSpringConstant
void setOpRelative(const char *str)
static PRM_SpareData lopPath
static PRM_SpareData unitsDensityPerTime
static PRM_SpareData unitsForceDensity
#define PRM_SPARE_SHADER_PARM_CONTEXTS_TOKEN
static const char * getScriptActionToken()
static const char * getRampBasisVarToken()
static PRM_SpareData shopSurfaceShadow
static const char * getFileChooserModeValWrite()
void setRampBasisVar(const char *value)
static const char * getForceParmValueToken()
#define PRM_API
Definition: PRM_API.h:10
static PRM_SpareData unitsAreaDensityPerTime
#define PRM_SPARE_COLOR_DYN_TOKEN
Definition: PRM_SpareData.h:95
unsigned int uint
Definition: SYS_Types.h:45
static PRM_SpareData shopCoShader
int(* PRM_SpareCallbackWithData)(const char *token, const char *value, void *data)
void setRampValuesVar(const char *value)
static PRM_SpareData lookIcon
#define PRM_SPARE_USDPATHTYPE_TOKEN
Definition: PRM_SpareData.h:57
static PRM_SpareData layoutHeightLarge
static PRM_SpareData popPath
static PRM_SpareData lookBlank
static PRM_SpareData unitsPerTime
static PRM_SpareData lookClassic
static PRM_SpareData objPath
CH_ScriptLanguage
#define PRM_SPARE_GROUP_TYPE_TOKEN
static const char * getLayoutHeightToken()
static PRM_SpareData unitsVelocity
static PRM_SpareData attribAccessR
int(* PRM_SpareCallback)(const char *token, const char *value)
static PRM_SpareToken usdPathTypePrimList
#define PRM_SPARE_FILE_CHOOSER_PATTERN_TOKEN
static PRM_SpareData fileChooserModeRead
static const char * getFileChooserModeValReadAndWrite()
#define PRM_SPARE_EDITOR_TOKEN