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_Pair.h>
22 #include <UT/UT_Variadic.h>
23 
24 #include <SYS/SYS_Types.h>
25 
26 
27 // Namespace to use for built-in parameter tags.
28 // Note that we cannot add the namespace to old built-in tags
29 // for compatibility reasons.
30 #define PRM_SPARE_BUILTIN_NAMESPACE "sidefx::"
31 
32 //
33 // Declarations of built-in parm spare data tokens (tag names).
34 // The entries in this list must be included in `theBuiltInTokenMap`
35 // (see PRM_SpareData.C).
36 //
37 // NOTE: You *must* include the SideFX namespace in the token
38 // when adding a new spare data token.
39 //
40 #define PRM_SPARE_KEY_VALUE_DICT_KEY_LABEL_TOKEN \
41  PRM_SPARE_BUILTIN_NAMESPACE "key_value_dict_key_label"
42 #define PRM_SPARE_KEY_VALUE_DICT_VALUE_LABEL_TOKEN \
43  PRM_SPARE_BUILTIN_NAMESPACE "key_value_dict_value_label"
44 #define PRM_SPARE_KEY_VALUE_DICT_USE_CHOOSER_TOKEN \
45  PRM_SPARE_BUILTIN_NAMESPACE "key_value_dict_use_chooser"
46 #define PRM_SPARE_KEY_VALUE_DICT_CHOOSER_LABEL_TOKEN \
47  PRM_SPARE_BUILTIN_NAMESPACE "key_value_dict_chooser_label"
48 #define PRM_SPARE_KEY_VALUE_DICT_CHOOSER_CALLBACK_TOKEN \
49  PRM_SPARE_BUILTIN_NAMESPACE "key_value_dict_chooser_callback"
50 #define PRM_SPARE_ATTRIB_ACCESS_TOKEN \
51  PRM_SPARE_BUILTIN_NAMESPACE "attrib_access"
52 #define PRM_SPARE_CONNECTOR_KIND \
53  PRM_SPARE_BUILTIN_NAMESPACE "connector_kind"
54 #define PRM_SPARE_CONNECTOR_TYPE \
55  PRM_SPARE_BUILTIN_NAMESPACE "connector_type"
56 #define PRM_SPARE_USDPATHTYPE_TOKEN \
57  PRM_SPARE_BUILTIN_NAMESPACE "usdpathtype"
58 #define PRM_SPARE_USDPATHINPUT_TOKEN \
59  PRM_SPARE_BUILTIN_NAMESPACE "usdpathinput"
60 #define PRM_SPARE_IS_SHADER_PARM_TOKEN \
61  PRM_SPARE_BUILTIN_NAMESPACE "shader_isparm"
62 #define PRM_SPARE_FORCE_SHADER_PARM_VAL_TOKEN \
63  PRM_SPARE_BUILTIN_NAMESPACE "shader_forceparmval"
64 #define PRM_SPARE_SHADER_PARM_TYPE_TOKEN \
65  PRM_SPARE_BUILTIN_NAMESPACE "shader_parmtype"
66 #define PRM_SPARE_SHADER_PARM_NAME_TOKEN \
67  PRM_SPARE_BUILTIN_NAMESPACE "shader_parmname"
68 #define PRM_SPARE_SAVE_VALUE_TOKEN \
69  PRM_SPARE_BUILTIN_NAMESPACE "save_value"
70 #define PRM_SPARE_MAYA_COMPONENT_SELECTION_TYPE_TOKEN \
71  PRM_SPARE_BUILTIN_NAMESPACE "maya_component_selection_type"
72 
73 //
74 // Declarations of *old*, built-in parm spare data tokens (tag names).
75 // WARNING: Do not add new spare data tokens to this list!!!
76 // Add the tokens to the new list above and include the SideFX
77 // namespace in the tokens.
78 //
79 #define PRM_SPARE_AUTOSCOPE_TOKEN "autoscope"
80 #define PRM_SPARE_BUTTON_ICON_TOKEN "button_icon"
81 #define PRM_SPARE_CODE_GENERATION_TOKEN "code_generation"
82 #define PRM_SPARE_COLOR_DYN_TOKEN "colordyn"
83 #define PRM_SPARE_COLOR_TYPE_TOKEN "colortype"
84 #define PRM_SPARE_COLOR_WHEEL_TOKEN "colorwheel"
85 #define PRM_SPARE_COOK_DEPENDENT_TOKEN "cook_dependent"
86 #define PRM_SPARE_EDITOR_LANG_TOKEN "editorlang"
87 #define PRM_SPARE_EDITOR_LINES_TOKEN "editorlines"
88 #define PRM_SPARE_EDITOR_TOKEN "editor"
89 #define PRM_SPARE_FILE_CHOOSER_MODE_TOKEN "filechooser_mode"
90 #define PRM_SPARE_FILE_CHOOSER_PATTERN_TOKEN "filechooser_pattern"
91 #define PRM_SPARE_GROUP_TYPE_TOKEN "group_type"
92 #define PRM_SPARE_GROUP_DEFAULT_TOKEN "group_default"
93 #define PRM_SPARE_MULTI_START_OFFSET_TOKEN "multistartoffset"
94 #define PRM_SPARE_NETREF_TOKEN "netref"
95 #define PRM_SPARE_OPFILTER_TOKEN "opfilter"
96 #define PRM_SPARE_OPPATH_KEYWORDS_TOKEN "oppathkeywords"
97 #define PRM_SPARE_OPRELATIVE_TOKEN "oprelative"
98 #define PRM_SPARE_PARM_VOP_TOKEN "parmvop"
99 #define PRM_SPARE_RAMP_BASIS_DEFAULT_TOKEN "rampbasisdefault"
100 #define PRM_SPARE_RAMP_BASIS_TOKEN "rampbasis"
101 #define PRM_SPARE_RAMP_BASIS_VAR_TOKEN "rampbasis_var"
102 #define PRM_SPARE_RAMP_COLOR_DEFAULT_TOKEN "rampcolordefault"
103 #define PRM_SPARE_RAMP_COLOR_TYPE_TOKEN "rampcolortype"
104 #define PRM_SPARE_RAMP_FLOAT_DEFAULT_TOKEN "rampfloatdefault"
105 #define PRM_SPARE_RAMP_KEYS_TOKEN "rampkeys"
106 #define PRM_SPARE_RAMP_KEYS_VAR_TOKEN "rampkeys_var"
107 #define PRM_SPARE_RAMP_SHOW_CONTROLS_DEFAULT_TOKEN "rampshowcontrolsdefault"
108 #define PRM_SPARE_RAMP_VALUES_TOKEN "rampvalues"
109 #define PRM_SPARE_RAMP_VALUES_VAR_TOKEN "rampvalues_var"
110 #define PRM_SPARE_SCRIPT_ACTION_HELP_TOKEN "script_action_help"
111 #define PRM_SPARE_SCRIPT_ACTION_ICON_TOKEN "script_action_icon"
112 #define PRM_SPARE_SCRIPT_ACTION_TOKEN "script_action"
113 #define PRM_SPARE_SCRIPT_CALLBACK_TOKEN "script_callback"
114 #define PRM_SPARE_SCRIPT_CALLBACK_LANGUAGE_TOKEN "script_callback_language"
115 #define PRM_SPARE_SCRIPT_RITYPE_TOKEN "script_ritype"
116 #define PRM_SPARE_SCRIPT_UNQUOTED_TOKEN "script_unquoted"
117 #define PRM_SPARE_SHADER_PARM_CONTEXTS_TOKEN "shaderparmcontexts"
118 #define PRM_SPARE_UNITS_TOKEN "units"
119 #define PRM_SPARE_XCF_MODE_TOKEN "xcfmode"
120 #define PRM_SPARE_VARYING_DEFAULT_TOKEN "varying_default"
121 
122 class UT_BitArray;
123 class UT_StringArray;
124 class UT_StringHolder;
125 class UT_StringRef;
126 class PRM_Parm;
127 class prm_SharedString;
128 
129 typedef int (*PRM_SpareCallback)(const char *token, const char *value);
130 typedef int (*PRM_SpareCallbackWithData)(const char *token,
131  const char *value, void *data);
132 
135 
137 {
138 public:
139  /// The constructor for the PRM_SpareData should takes a variadic number of
140  /// token/value pairs. For example:
141  /// static PRM_SpareData(PRM_SpareArgs()
142  /// << PRM_SpareToken("token1", "value1")
143  /// << PRM_SpareToken("token2", "value2")
144  /// ...);
145  explicit PRM_SpareData(const PRM_SpareArgs &args);
146 
147  /// A single token value pair
148  explicit PRM_SpareData(const PRM_SpareToken &pair);
149  PRM_SpareData();
150  ~PRM_SpareData();
151 
153  PRM_SpareData &operator=(const PRM_SpareData &copy);
154 
155  uint entries() const;
156 
157  void clear();
158  void mergeFrom(const PRM_SpareData &ref);
159  void copyFrom(const PRM_SpareData &ref);
160 
161  bool containsAny(const PRM_SpareData &ref) const;
162  bool containsAll(const PRM_SpareData &ref) const;
163 
164  // The the value associated with a particular token.
165  const char *getValue(const UT_StringRef &token) const;
166 
167  // Because these are traverseConst functions, we can't remove any items
168  // from the table in the traversal functions.
169  void traverseConst(PRM_SpareCallback f) const;
170  void traverseConst(PRM_SpareCallbackWithData f, void *data) const;
171 
172 
173  // NOTE: When addTokenValue is called with a null pointer for the value,
174  // the token is deleted from the spare data.
175  void addTokenValue(const UT_StringHolder &token, const char *value);
176  void deleteTokenValue(const UT_StringRef &token);
177 
178  // For backward compatibility with the ScriptParmSpareData class, we have
179  // these functions.
180  static const char *getScriptCallbackToken()
182  void setCallbackData(const char *str)
183  { addTokenValue(getScriptCallbackToken(), str); }
184  const char *getCallbackData() const
185  { return getValue(getScriptCallbackToken()); }
186 
187  static const char *getScriptCallbackLanguageToken()
189  void setCallbackLanguage(CH_ScriptLanguage language);
190  CH_ScriptLanguage getCallbackLanguage() const;
191 
192  void setRenderManType(const char *str)
193  { addTokenValue(PRM_SPARE_SCRIPT_RITYPE_TOKEN, str); }
194  const char *getRenderManType() const
195  { return getValue(PRM_SPARE_SCRIPT_RITYPE_TOKEN); }
196 
197  void setOpFilter(const char *str)
198  { addTokenValue(PRM_SPARE_OPFILTER_TOKEN, str); }
199  const char *getOpFilter() const
200  { return getValue(PRM_SPARE_OPFILTER_TOKEN); }
201 
202  void setOpRelative(const char *str)
203  { addTokenValue(PRM_SPARE_OPRELATIVE_TOKEN, str); }
204  const char *getOpRelative() const
205  { return getValue(PRM_SPARE_OPRELATIVE_TOKEN); }
206 
207  static const char * getUnquotedStateToken()
210  { addTokenValue(getUnquotedStateToken(), "1"); }
211  bool getUnquotedState() const
212  { return getValue(getUnquotedStateToken()) != 0; }
213 
214  void setMultiStartOffset(int value);
215  int getMultiStartOffset() const;
216 
217  void setVisibleTabs(const UT_BitArray &values);
218  void getVisibleTabs(UT_BitArray &values) const;
219  bool getVisibleTab(int tabidx) const;
220 
221  // Ramp
222  static const char * getRampBasisDefaultToken()
224  void setRampBasisDefault(const char *value)
225  { addTokenValue(getRampBasisDefaultToken(),value); }
226  const char * getRampBasisDefault() const
227  { return getValue(getRampBasisDefaultToken()); }
228 
229  static const char * getRampShowControlsDefaultToken()
231  void setRampShowControlsDefault(bool value)
232  {
233  addTokenValue(getRampShowControlsDefaultToken(),
234  value ? "1" : "0");
235  }
237  {
238  const char *n, *v;
239  n = getRampShowControlsDefaultToken();
240  v = getValue(n);
241  if (!v)
242  return true;
243  else
244  return *v != '0';
245  }
246 
247  static const char * getRampColorTypeToken()
249  static const char * getRampColorTypeValueToken(UT_ColorType color_type);
250  void setRampColorType(UT_ColorType color_type);
251  UT_ColorType getRampColorType() const;
252 
253  static const char * getRampBasisVarToken()
255  static const char * getRampKeysVarToken()
257  static const char * getRampValuesVarToken()
259 
260  void setRampBasisVar(const char *value)
261  { addTokenValue(getRampBasisVarToken(), value); }
262  const char * getRampBasisVar() const
263  { return getValue(getRampBasisVarToken()); }
264  void setRampKeysVar(const char *value)
265  { addTokenValue(getRampKeysVarToken(), value); }
266  const char * getRampKeysVar() const
267  { return getValue(getRampKeysVarToken()); }
268  void setRampValuesVar(const char *value)
269  { addTokenValue(getRampValuesVarToken(), value); }
270  const char * getRampValuesVar() const
271  { return getValue(getRampValuesVarToken()); }
272 
273  static const char * getColorRampDefaultToken()
275  const char * getColorRampDefaultValue() const
276  { return getValue(getColorRampDefaultToken()); }
277  static const char * getFloatRampDefaultToken()
279  const char * getFloatRampDefaultValue() const
280  { return getValue(getFloatRampDefaultToken()); }
281  void setRampDefaultFromParm(const PRM_Parm &ramp_parm);
282  void getRampDefaultToParm(PRM_Parm &ramp_parm) const;
283 
284  // Color UI Mode, Wheel flag and Dynamic flag
285  static const char * getColorTypeToken()
286  { return PRM_SPARE_COLOR_TYPE_TOKEN; }
287  static const char * getColorTypeValueToken(PRM_ColorType color_type);
288  void setColorType(PRM_ColorType color_type);
289  PRM_ColorType getColorType() const;
290 
291  static const char * getColorWheelToken()
292  { return PRM_SPARE_COLOR_WHEEL_TOKEN; }
293  void setColorWheel(bool value);
294  bool getColorWheel() const;
295 
296  static const char * getColorDynamicToken()
297  { return PRM_SPARE_COLOR_DYN_TOKEN; }
298  void setColorDynamic(bool value);
299  bool getColorDynamic() const;
300 
301  static const char * getKeyValueDictKeyLabelToken()
303  void setKeyValueDictKeyLabel(const char *label);
304  const char *getKeyValueDictKeyLabel() const;
305  static const char * getKeyValueDictValueLabelToken()
307  void setKeyValueDictValueLabel(const char *label);
308  const char *getKeyValueDictValueLabel() const;
309  static const char * getKeyValueDictUseChooserToken()
311  void setKeyValueDictUseChooser(bool use_chooser);
312  bool getKeyValueDictUseChooser() const;
313  static const char * getKeyValueDictChooserLabelToken()
315  void setKeyValueDictChooserLabel(const char *label);
316  const char *getKeyValueDictChooserLabel() const;
319  void setKeyValueDictChooserCallback(const char *label);
320  const char *getKeyValueDictChooserCallback() const;
321 
322  void setXCFMode(const char *value)
323  { return addTokenValue(PRM_SPARE_XCF_MODE_TOKEN, value); }
324  const char *getXCFMode() const
325  { return getValue(PRM_SPARE_XCF_MODE_TOKEN); }
326 
327  const char *getScriptAction() const;
328  const char *getScriptActionHelp() const;
329  const char *getScriptActionIcon() const;
330  const char *getButtonIcon() const;
331 
332  bool getUseEditor() const;
333  const char *getEditorLanguage() const
334  { return getValue(PRM_SPARE_EDITOR_LANG_TOKEN); }
335  void getEditorLinesRange(int &lines_min, int &lines_max) const;
336  static inline int getEditorLinesRangeDefaultMin() { return 8; }
337  static inline int getEditorLinesRangeDefaultMax() { return 40; }
338 
339  static const char *getXCFModeFloatValToken() { return "float"; }
340 
341  // Token for whether the template will be used for cooking
342  static const char * getCookDependentToken()
344  // Get state of cook_dependent flag.
345  // This is only used for SPARE parameters, which if this tag doesn't exist,
346  // the spare parm defaults to false for cook dependent.
347  bool getCookDependent() const;
348  // Set state of cook_dependent flag.
349  // This is only used for SPARE parameters, which if this tag doesn't exist,
350  // the spare parm defaults to false for cook dependent.
351  void setCookDependent(bool flag);
352 
353  // Token for whether the parm on the VOP should regenerate code
354  static const char *getCodeGenDependentToken()
356  // Get the state of the code_generation flag
357  // This is only used for SPARE parameters, which if this tag doesn't exist,
358  // the spare parm defaults to true for code generation
359  bool getCodeGenDependent() const;
360  // Set state of code_generation flag.
361  // This is only used for SPARE parameters, which if this tag doesn't exist,
362  // the spare parm defaults to true for code generation
363  void setCodeGenDependent(bool flag);
364 
365  int64 getMemoryUsage(bool inclusive) const;
366 
367  static const char *getOpFilterKeyFromName(const char *name);
368  static const char *getOpFilterKeyFromLabel(const char *name);
369  static const char *getOpFilterNameFromKey(const char *key);
370  static const char *getOpFilterLabelFromKey(const char *key);
371  // End of backward compatibility
372 
373  // Convenience spare data you might want to use
374  static PRM_SpareData objNetRef; // /obj
375  static PRM_SpareData chNetRef; // /ch
376  static PRM_SpareData ropNetRef; // /out
377 
378  static PRM_SpareData objPath; // !!OBJ!!
379  static PRM_SpareData objGeometryPath; // !!OBJ/GEOMETRY!!
380  static PRM_SpareData objLightPath; // !!OBJ/LIGHT!!
381  static PRM_SpareData objBonePath; // !!OBJ/BONE!!
382  static PRM_SpareData objMusclePath; // !!OBJ/MUSCLE!!
383  static PRM_SpareData objCameraPath; // !!OBJ/CAMERA!!
384  static PRM_SpareData dopPath; // !!DOP!!
385  static PRM_SpareData sopPath; // !!SOP!!
386  static PRM_SpareData popPath; // !!POP!!
387  static PRM_SpareData ropPath; // !!ROP!!
388  static PRM_SpareData cop2Path; // !!COP2!!
389  static PRM_SpareData chopPath; // !!CHOP!!
390  static PRM_SpareData constraintsPath; // !!CHOP!!
391  static PRM_SpareData shopPath; // !!SHOP!!
392  static PRM_SpareData shopProperties; // !!SHOP/PROPERTIES!!
393  static PRM_SpareData shopMaterial; // !!SHOP/MATERIAL!!
394  static PRM_SpareData shopSurface; // !!SHOP/SURFACE!!
395  static PRM_SpareData shopDisplacement; // !!SHOP/DISPLACEMENT!!
396  static PRM_SpareData shopSurfaceShadow; // !!SHOP/SURFACE_SHADOW!!
397  static PRM_SpareData shopBackground; // !!SHOP/BACKGROUND!!
398  static PRM_SpareData shopGeometry; // !!SHOP/GEOMETRY!!
399  static PRM_SpareData shopAtmosphere; // !!SHOP/ATMOSPHERE!!
400  static PRM_SpareData shopPhoton; // !!SHOP/PHOTON!!
401  static PRM_SpareData shopPhotonVolume; // !!SHOP/PHOTONVOLUME!!
402  static PRM_SpareData shopContour; // !!SHOP/CONTOUR!!
403  static PRM_SpareData shopLight; // !!SHOP/LIGHT!!
404  static PRM_SpareData shopEmitter; // !!SHOP/EMITTER!!
405  static PRM_SpareData shopLightShadow; // !!SHOP/LIGHT_SHADOW!!
406  static PRM_SpareData shopLens; // !!SHOP/LENS!!
407  static PRM_SpareData shopOutput; // !!SHOP/OUTPUT!!
408  static PRM_SpareData shopContourStore; // !!SHOP/CONTOUR_STORE!!
409  static PRM_SpareData shopContourContrast; // !!SHOP/CONTOUR_CONTRAST!!
410  static PRM_SpareData shopImage3d; // !!SHOP/IMAGE3D!!
411  static PRM_SpareData shopCVEX; // !!SHOP/CVEX!!
412  static PRM_SpareData shopCoShader; // !!SHOP/COSHADER!!
413  static PRM_SpareData vopPath; // !!VOP!!
414  static PRM_SpareData lopPath; // !!LOP!!
415  static PRM_SpareData topPath; // !!TOP!!
416  static PRM_SpareData filterMaterial; // !!CUSTOM/MATERIAL!!
417 
418  static PRM_SpareData autoScope; // autoscope
419 
420  static PRM_SpareData multiStartOffsetZero; // multistart offset of zero
421  static PRM_SpareData multiStartOffsetOne; // multistart offset of one
422 
426  static PRM_SpareData unitsMass; // kg1
427  static PRM_SpareData unitsPerMass; // kg-1
428  static PRM_SpareData unitsTime; // s1
431  static PRM_SpareData unitsVelocity; // m1s-1
435  static PRM_SpareData unitsForce; // kg1m1s-2
436  static PRM_SpareData unitsForceDensity; // kg1m-2s-2
437  static PRM_SpareData unitsImpulse; // kg1m1s-1
438  static PRM_SpareData unitsTorque; // kg1m2s-2
439  static PRM_SpareData unitsDrag; // kg1s-1
440  static PRM_SpareData unitsAngDrag; // kg1m2s-1
441  static PRM_SpareData unitsPressure; // kg1m-1s-2
446  static PRM_SpareData unitsAreaDensity; // kg1m-2
449  static PRM_SpareData unitsDensity; // kg1m-3
450  static PRM_SpareData unitsDensityPerTime; // kg1m-3s-1
452  static PRM_SpareData unitsNone; // ""
453 
454  static PRM_SpareData rampBasisDefault; // rampbasis "ramp_basis"
455  static PRM_SpareData rampKeysDefault; // rampkeys "ramp_keys"
456  static PRM_SpareData rampValuesDefault; // rampvalues "ramp_values"
457 
458  static PRM_SpareData attribAccessR; // "sidefx::attrib_access" "read"
459  static PRM_SpareData attribAccessW; // "sidefx::attrib_access" "write"
460  static PRM_SpareData attribAccessRW; // "sidefx::attrib_access" "readwrite"
461 
462  static PRM_SpareData connectorKindNone; // "sidefx::connector_kind" "none"
463  static PRM_SpareData connectorKindIn; // "sidefx::connector_kind" "in"
464  static PRM_SpareData connectorKindOut; // "sidefx::connector_kind" "out"
465  static PRM_SpareData connectorKindInOut;// "sidefx::connector_kind" "inout"
466 
467  static PRM_SpareData shaderIsShaderParm; // "sidefx::shader_isparm" "1"
468  static PRM_SpareData shaderIsNotShaderParm; // "sidefx::shader_isparm" "0"
469 
470  /// Used to set a space- or comma-separated list of globs to use as
471  /// file filter for parameters of type @c PRM_FILE (e.g. "*.txt *.log").
472  static const char *getFileChooserPatternToken()
474 
475  static const char *getFileChooserModeToken()
477  static const char *getFileChooserModeValRead()
478  { return "read"; }
479  static const char *getFileChooserModeValWrite()
480  { return "write"; }
481  static const char *getFileChooserModeValReadAndWrite()
482  { return "read_and_write"; }
483 
484  static PRM_SpareData fileChooserModeRead; // filechooser_mode "read"
485  static PRM_SpareData fileChooserModeWrite; // filechooser_mode "write"
486  static PRM_SpareData fileChooserModeReadAndWrite; // ... "read_and_write"
487 
488  static PRM_SpareData stringFloatXCF; // float XCF in string field
489 
490  static const char *getScriptActionToken()
492  static const char *getScriptActionHelpToken()
494  static const char *getScriptActionIconToken()
496  static const char *getButtonIconToken()
497  { return PRM_SPARE_BUTTON_ICON_TOKEN; }
498 
499  static const char *getEditorToken()
500  { return PRM_SPARE_EDITOR_TOKEN; }
501  static PRM_SpareData stringEditor; // Use a text editor for strings
502 
503  static const char *getEditorLanguageToken()
504  { return PRM_SPARE_EDITOR_LANG_TOKEN; }
509 
510  /// Number of lines to show by default. This value can be set as either
511  /// a single number or a range, e.g. '10-50'. The minimum number is what
512  /// the editor will originally show up as, but will attempt to expand up to
513  /// the maximum.
514  static const char *getEditorLinesRangeToken()
515  { return PRM_SPARE_EDITOR_LINES_TOKEN; }
516 
517  // token indicating the parameter comes from a Parameter VOP (ie it is a
518  // shader parameter)
519  static const char * getParmVopVarToken()
520  { return PRM_SPARE_PARM_VOP_TOKEN; }
521 
522  // space-separated list of shading contexts, which a material parameter
523  // belongs to, ie, shaders for each of these contexts actually have
524  // this parameter as an argument, since material may contain other shaders
525  // for other contexts to which a parameter does not apply
526  static const char * getShaderParmContextsToken()
528 
529  // token specifying special keywords that are legal in an oppath parameter
530  // (in addition to the node path itself)
531  static const char * getOpPathKeywordsToken()
533 
534  // token for unit specification
535  static const char * getUnitsToken()
536  { return PRM_SPARE_UNITS_TOKEN; }
537 
538  // token for group specialization (simple/collapsible/toggle groups).
539  static const char *getGroupTypeToken()
540  { return PRM_SPARE_GROUP_TYPE_TOKEN; }
544  static const char *getGroupDefaultToken()
546 
547  // Marks parameter has having varying default values
548  // Defaults to "0"
549  static const char *getVaryingDefaultToken()
552  bool getHasVaryingDefault() const;
553  void setHasVaryingDefault(bool f);
554 
555  // Gets information about whether this parm accepts one or more USD
556  // primitive paths, and/or USD collections.
557  static const char *getUsdPathTypeToken()
558  { return PRM_SPARE_USDPATHTYPE_TOKEN; }
561  const char *getUsdPathType() const;
562 
563  // Gets a value that describes which input's stage is the source for
564  // the primitive(s) in this parameter. This string is evaluated by the
565  // CH_Manager, so it can be a constant (0, 1, or 2) or an expression
566  // that looks at other parameter values.
567  static const char *getUsdPathInputToken()
568  { return PRM_SPARE_USDPATHINPUT_TOKEN; }
571  const char *getUsdPathInput() const;
572 
573  // Identifies the node parameter as shader parameter.
574  static const char *getIsShaderParmToken()
576 
577  // Forces the translation of shader parameter even if it's at default value.
578  static const char *getForceParmValueToken()
580 
581  // Marks a data parm for whether or not it should be saved to disk
582  static const char *getSaveValueToken()
583  { return PRM_SPARE_SAVE_VALUE_TOKEN; }
584  static PRM_SpareData saveValueAlways; // "sidefx::save_value" "1"
585  static PRM_SpareData saveValueNever; // "sidefx::save_value" "0"
586  const char *getSaveValue() const;
587  void setSaveValue(bool flag);
588 
589  // Houdini Engine for Maya: Informs Maya that this parameter should be able
590  // to be set by component selection.
597 
598  /// Return true if the given token is a built-in (internally used) spare
599  /// data token.
600  static bool isBuiltInToken(const UT_StringRef &token);
601 
602  /// Return a range of the built-in tags names.
603  static void builtInTokens(UT_StringArray &tokens);
604 
605 private:
607 };
608 
609 #endif
static PRM_SpareData mayaComponentSelectionTypeFace
static PRM_SpareData objLightPath
static PRM_SpareData objMusclePath
static PRM_SpareData shopOutput
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
Definition: PRM_SpareData.h:97
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:83
#define PRM_SPARE_CODE_GENERATION_TOKEN
Definition: PRM_SpareData.h:81
#define PRM_SPARE_MAYA_COMPONENT_SELECTION_TYPE_TOKEN
Definition: PRM_SpareData.h:70
static PRM_SpareData unitsLinearDensity
static const char * getEditorLanguageToken()
static const char * getRampColorTypeToken()
static const char * getXCFModeFloatValToken()
static PRM_SpareData vopPath
static PRM_SpareData ropPath
GLenum GLint ref
Definition: glew.h:1845
static PRM_SpareData connectorKindIn
GLuint const GLchar * name
Definition: glew.h:1814
const char * getEditorLanguage() const
const char * getOpFilter() const
#define PRM_SPARE_USDPATHINPUT_TOKEN
Definition: PRM_SpareData.h:58
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
const Args & args
Definition: printf.h:628
static const char * getCookDependentToken()
#define PRM_SPARE_XCF_MODE_TOKEN
void setXCFMode(const char *value)
#define PRM_SPARE_RAMP_BASIS_DEFAULT_TOKEN
Definition: PRM_SpareData.h:99
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
GLint GLsizei const GLuint64 * values
Definition: glew.h:3612
static PRM_SpareData stringFloatXCF
static PRM_SpareData unitsPerMass
static PRM_SpareData stringEditorLangExpr
static const char * getButtonIconToken()
static PRM_SpareData shopSurface
static const char * getScriptCallbackToken()
static PRM_SpareData objGeometryPath
bool getUnquotedState() const
static const char * getRampBasisDefaultToken()
static PRM_SpareData unitsPressure
#define PRM_SPARE_SCRIPT_RITYPE_TOKEN
#define PRM_SPARE_RAMP_FLOAT_DEFAULT_TOKEN
const char * getRampBasisDefault() const
static const char * getKeyValueDictChooserLabelToken()
static PRM_SpareToken usdPathTypePrim
static const char * getGroupTypeToken()
#define PRM_SPARE_KEY_VALUE_DICT_CHOOSER_CALLBACK_TOKEN
Definition: PRM_SpareData.h:48
const GLdouble * v
Definition: glew.h:1391
static PRM_SpareData stringEditor
static PRM_SpareData shopPhoton
static PRM_SpareData groupTypeCollapsibleExpanded
static PRM_SpareData unitsPerSquareTime
void setUnquotedState()
UT_VariadicT< PRM_SpareToken > PRM_SpareArgs
#define PRM_SPARE_SAVE_VALUE_TOKEN
Definition: PRM_SpareData.h:68
static const char * getFileChooserPatternToken()
static PRM_SpareData unitsPerLength
#define PRM_SPARE_IS_SHADER_PARM_TOKEN
Definition: PRM_SpareData.h:60
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
#define PRM_SPARE_OPPATH_KEYWORDS_TOKEN
Definition: PRM_SpareData.h:96
static const char * getIsShaderParmToken()
static PRM_SpareData multiStartOffsetOne
static PRM_SpareData unitsAngVelocity
static PRM_SpareData cop2Path
#define PRM_SPARE_KEY_VALUE_DICT_USE_CHOOSER_TOKEN
Definition: PRM_SpareData.h:44
static const char * getKeyValueDictUseChooserToken()
static PRM_SpareData groupTypeCollapsible
long long int64
Definition: SYS_Types.h:111
#define PRM_SPARE_GROUP_DEFAULT_TOKEN
Definition: PRM_SpareData.h:92
#define PRM_SPARE_SCRIPT_CALLBACK_TOKEN
static PRM_SpareData shopAtmosphere
#define PRM_SPARE_KEY_VALUE_DICT_VALUE_LABEL_TOKEN
Definition: PRM_SpareData.h:42
static PRM_SpareData unitsAreaDensity
static PRM_SpareData unitsLinearDensityPerSquareTime
static const char * getUnitsToken()
#define PRM_SPARE_FILE_CHOOSER_MODE_TOKEN
Definition: PRM_SpareData.h:89
static PRM_SpareData chNetRef
const char * getCallbackData() const
static int getEditorLinesRangeDefaultMin()
static PRM_SpareData unitsMass
static PRM_SpareData rampBasisDefault
GLclampf f
Definition: glew.h:3499
static PRM_SpareData unitsDrag
static PRM_SpareData objNetRef
static const char * getKeyValueDictKeyLabelToken()
#define PRM_SPARE_EDITOR_LINES_TOKEN
Definition: PRM_SpareData.h:87
static PRM_SpareData sopPath
static const char * getScriptActionIconToken()
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
static PRM_SpareData connectorKindInOut
static PRM_SpareData filterMaterial
static PRM_SpareToken usdPathInputFirst
static PRM_SpareData varyingDefault
static PRM_SpareData unitsLength
const char * getFloatRampDefaultValue() const
static const char * getOpPathKeywordsToken()
static PRM_SpareData unitsAngDrag
#define PRM_SPARE_COLOR_WHEEL_TOKEN
Definition: PRM_SpareData.h:84
#define PRM_SPARE_VARYING_DEFAULT_TOKEN
GLsizei n
Definition: glew.h:4040
static PRM_SpareData saveValueAlways
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
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
UT_Pair< const char *, const char * > PRM_SpareToken
static PRM_SpareData multiStartOffsetZero
static PRM_SpareData shopProperties
static const char * getUsdPathTypeToken()
const char * getRampBasisVar() const
static PRM_SpareData constraintsPath
unsigned int uint
Definition: SYS_Types.h:44
static const char * getRampValuesVarToken()
GLuint GLsizei GLsizei GLchar * label
Definition: glew.h:8986
static const char * getGroupDefaultToken()
#define PRM_SPARE_COOK_DEPENDENT_TOKEN
Definition: PRM_SpareData.h:85
static PRM_SpareData shaderIsNotShaderParm
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:46
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:40
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
Definition: PRM_SpareData.h:98
#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
Definition: PRM_SpareData.h:95
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:86
#define PRM_SPARE_FORCE_SHADER_PARM_VAL_TOKEN
Definition: PRM_SpareData.h:62
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:80
OIIO_API bool copy(string_view from, string_view to, std::string &err)
static const char * getColorTypeToken()
static PRM_SpareData mayaComponentSelectionTypeVertex
#define PRM_SPARE_RAMP_KEYS_VAR_TOKEN
static const char * getFileChooserModeValRead()
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 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
GLsizei const GLfloat * value
Definition: glew.h:1849
static PRM_SpareData unitsAreaDensityPerTime
#define PRM_SPARE_COLOR_DYN_TOKEN
Definition: PRM_SpareData.h:82
static PRM_SpareData shopCoShader
int(* PRM_SpareCallbackWithData)(const char *token, const char *value, void *data)
void setRampValuesVar(const char *value)
#define PRM_SPARE_USDPATHTYPE_TOKEN
Definition: PRM_SpareData.h:56
static PRM_SpareData popPath
static PRM_SpareData unitsPerTime
static PRM_SpareData objPath
CH_ScriptLanguage
#define PRM_SPARE_GROUP_TYPE_TOKEN
Definition: PRM_SpareData.h:91
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
Definition: PRM_SpareData.h:90
static PRM_SpareData fileChooserModeRead
static const char * getFileChooserModeValReadAndWrite()
#define PRM_SPARE_EDITOR_TOKEN
Definition: PRM_SpareData.h:88