HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_ui.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  * COMMENTS:
7  */
8 
9 #ifndef __HOM_ui_h__
10 #define __HOM_ui_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Module.h"
15 #include "HOM_Attrib.h"
16 #include "HOM_EnumValue.h"
17 #include "HOM_EnumModules.h"
18 #include "HOM_Color.h"
19 #include "HOM_Errors.h"
20 #include <PY/PY_Callback.h>
21 #include <PY/PY_Python.h>
22 #include <UT/UT_StringHolder.h>
23 #include <UT/UT_Tuple.h>
24 #include <vector>
25 
26 class HOM_Desktop;
27 class HOM_Dialog;
28 class HOM_FloatingPanel;
29 class HOM_Node;
30 class HOM_NodeType;
31 class HOM_Pane;
32 class HOM_PaneTab;
34 class HOM_RadialItem;
35 class HOM_RadialMenu;
37 class HOM_RopNode;
38 class HOM_ShellIO;
39 class HOM_SopNodeType;
42 
43 SWIGOUT(%rename(ui) HOM_ui;)
45 {
46 public:
47  virtual ~HOM_ui()
48  {}
49 
50  virtual std::string __repr__() = 0;
51 
52  virtual HOM_ShellIO &shellIO() = 0;
53 
54  SWIGOUT(%newobject curDesktop;)
55  virtual HOM_Desktop* curDesktop() = 0;
56  SWIGOUT(%newobject desktop;)
57  virtual HOM_Desktop* desktop(const char *name) = 0;
58 
59  virtual std::vector<HOM_ElemPtr<HOM_Desktop> > desktops() = 0;
60 
61  virtual HOM_RadialMenu* radialMenu(const std::string &name) = 0;
62  virtual std::vector<HOM_ElemPtr<HOM_RadialMenu> > radialMenus() = 0;
63  virtual HOM_RadialMenu* createRadialMenu(
64  const std::string &name,
65  const char *label) = 0;
66 
67  SWIGOUT(%kwargs createRadialItem;)
68  SWIGOUT(%newobject createRadialItem;)
69  virtual HOM_RadialScriptItem* createRadialItem(
70  bool submenu=false,
71  bool callback=false) = 0;
72 
73  virtual void injectRadialItem(int location, HOM_RadialItem* item) = 0;
74  virtual void injectRadialMenu(const std::string &name) = 0;
75 
76  virtual std::string _getActiveRadialMenu() = 0;
77  virtual void _setActiveRadialMenu(const std::string &name) = 0;
78 
79  virtual void updateMainMenuBar() = 0;
80  virtual std::vector<HOM_ElemPtr<HOM_Pane> > panes() = 0;
81  virtual std::vector<HOM_ElemPtr<HOM_PaneTab> > paneTabs() = 0;
82 
83  virtual std::vector<HOM_ElemPtr<HOM_PaneTab> > currentPaneTabs() = 0;
84 
85  SWIGOUT(%newobject paneTabOfType;)
86  virtual HOM_PaneTab *paneTabOfType(HOM_EnumValue &type, int index=0) = 0;
87 
88  SWIGOUT(%newobject findPane;)
89  virtual HOM_Pane *findPane(int pane_id) = 0;
90 
91  SWIGOUT(%newobject findPaneTab;)
92  virtual HOM_PaneTab *findPaneTab(const char *name) = 0;
93 
94  virtual std::vector<HOM_ElemPtr<HOM_PaneTab> > floatingPaneTabs() = 0;
95 
96  virtual std::vector<HOM_ElemPtr<HOM_FloatingPanel> > floatingPanels() = 0;
97 
98  SWIGOUT(%newobject paneUnderCursor;)
99  virtual HOM_Pane *paneUnderCursor() = 0;
100  SWIGOUT(%newobject paneTabUnderCursor;)
101  virtual HOM_PaneTab *paneTabUnderCursor() = 0;
102 
103  virtual bool isUserInteracting() = 0;
104  virtual void setUserInteracting(bool interacting) = 0;
105 
106  virtual HOM_EnumValue &orientationUpAxis() = 0;
107  virtual HOM_EnumValue &handleOrientToNormalAxis() = 0;
108 
109  SWIGOUT(%kwargs displayConfirmation;)
110  virtual bool displayConfirmation(
111  const char *text,
112  HOM_EnumValue &severity = HOM_severityType::Message,
113  const char *help = NULL,
114  const char *title = NULL,
115  const char *details = NULL,
116  const char *details_label = NULL,
117  HOM_EnumValue &suppress = HOM_confirmType::OverwriteFile) = 0;
118 
119  SWIGOUT(%kwargs displayCustomConfirmation;)
120  virtual int displayCustomConfirmation(
121  const char *text,
122  const std::vector<std::string> &buttons =
123  std::vector<std::string>(),
124  HOM_EnumValue &severity = HOM_severityType::Message,
125  int default_choice = 0,
126  int close_choice = -1,
127  const char *help = NULL,
128  const char *title = NULL,
129  const char *details = NULL,
130  const char *details_label = NULL,
131  HOM_EnumValue &suppress = HOM_confirmType::OverwriteFile) = 0;
132 
133  SWIGOUT(%kwargs displayMessage;)
134  virtual int displayMessage(
135  const char *text,
136  const std::vector<std::string> &buttons =
137  std::vector<std::string>(1, "OK"),
138  HOM_EnumValue &severity = HOM_severityType::Message,
139  int default_choice = 0,
140  int close_choice = -1,
141  const char *help = NULL,
142  const char *title = NULL,
143  const char *details = NULL,
144  const char *details_label = NULL,
145  bool details_expanded = false) = 0;
146 
147  SWIGOUT(%kwargs readInput;)
148  virtual std::pair<int, std::string> readInput(
149  const char *message,
150  const std::vector<std::string> &buttons =
151  std::vector<std::string>(1, "OK"),
152  HOM_EnumValue &severity = HOM_severityType::Message,
153  int default_choice = 0,
154  int close_choice = -1,
155  const char *help = NULL,
156  const char *title = NULL,
157  const char *initial_contents = NULL) = 0;
158 
159  SWIGOUT(%kwargs readMultiInput;)
160  virtual std::pair<int, std::vector<std::string> > readMultiInput(
161  const char *message,
162  const std::vector<std::string> &input_labels,
163  const std::vector<int> &password_input_indices = std::vector<int>(),
164  const std::vector<std::string> &buttons =
165  std::vector<std::string>(1, "OK"),
166  HOM_EnumValue &severity = HOM_severityType::Message,
167  int default_choice = 0,
168  int close_choice = -1,
169  const char *help = NULL,
170  const char *title = NULL,
171  const std::vector<std::string> &initial_contents =
172  std::vector<std::string>() ) = 0;
173 
174  SWIGOUT(%kwargs selectFromList;)
175  virtual std::vector<int> selectFromList(
176  const std::vector<std::string> &choices,
177  const std::vector<int> &default_choices = std::vector<int>(),
178  bool exclusive = false,
179  const char *message = NULL,
180  const char *title = NULL,
181  const char *column_header = "Choices",
182  int num_visible_rows = 10,
183  bool clear_on_cancel = false,
184  int width = 0,
185  int height = 0) = 0;
186 
187  SWIGOUT(%kwargs selectFromTree;)
188  virtual std::vector<std::string> selectFromTree(
189  const std::vector<std::string> &choices,
190  const std::vector<std::string> &picked = std::vector<std::string>(),
191  bool exclusive = false,
192  const char *message = NULL,
193  const char *title = NULL,
194  bool clear_on_cancel = false,
195  int width = 0,
196  int height = 0) = 0;
197 
198  SWIGOUT(%kwargs _selectFile;)
199  virtual std::string _selectFile(
200  const char *start_directory = NULL,
201  const char *title = NULL,
202  bool collapse_sequences = false,
203  HOM_EnumValue &file_type = HOM_fileType::Any,
204  const char *pattern = NULL,
205  const char *default_value = NULL,
206  bool multiple_select = false,
207  bool image_chooser = false,
208  bool ignore_preferences = false,
209  HOM_EnumValue &chooser_mode = HOM_fileChooserMode::ReadAndWrite,
210  int width = 0,
211  int height = 0) = 0;
212 
213  SWIGOUT(%ignore _selectNodeInternal;)
214  virtual std::vector<std::string> _selectNodeInternal(
215  HOM_Node *relative_to_node = NULL,
216  HOM_Node *initial_node = NULL,
217  HOM_EnumValue *node_type_filter = NULL,
218  const char *title = NULL,
219  int width = 0,
220  int height = 0,
221  bool multiple_select = false,
222  void *custom_node_filter_callback = nullptr) = 0;
223 
224  // This method is deprecated. Use selectNode() instead.
225  SWIGOUT(%ignore _selectMultipleNodes;)
226  virtual std::vector<std::string> _selectMultipleNodes(
227  HOM_Node *relative_to_node = NULL,
228  HOM_Node *initial_node = NULL,
229  HOM_EnumValue *node_type_filter = NULL,
230  const char *title = NULL,
231  int width = 0,
232  int height = 0,
233  void *custom_node_filter_callback = nullptr) = 0;
234 
235  SWIGOUT(%ignore _selectNodeDataInternal;)
236  virtual std::vector<std::string> _selectNodeDataInternal(
237  const char *title = NULL,
238  const char *message = NULL,
239  int width = 0,
240  int height = 0,
241  const std::vector<std::string> &
242  initial_selection = std::vector<std::string>(),
243  HOM_EnumValue *node_type_filter = nullptr,
244  bool multiple_select = false,
245  bool include_data_type_headers = true,
246  bool include_parms=true,
247  bool include_object_transforms=true,
248  bool include_geometry_bounding_boxes=true,
249  bool include_geometry_attributes=true,
250  bool expand_components=true,
251  void *custom_data_callback=nullptr,
252  void *custom_node_filter_callback = nullptr,
253  const char *help_url=nullptr) = 0;
254 
255  SWIGOUT(%kwargs selectParmTag;)
256  virtual std::vector<std::string> selectParmTag(
257  int width = 0,
258  int height = 0) = 0;
259 
260  SWIGOUT(%kwargs selectParm;)
261  virtual std::vector<std::string> selectParm(
262  HOM_NodeTypeCategory *category = NULL,
263  bool bound_parms_only = false,
264  HOM_Node *relative_to_node = NULL,
265  const char *message = NULL,
266  const char *title = NULL,
267  const std::vector<std::string> &
268  initial_parms = std::vector<std::string>(),
269  bool multiple_select = true,
270  int width = 0,
271  int height = 0) = 0;
272 
273  SWIGOUT(%kwargs selectParmTuple;)
274  virtual std::vector<std::string> selectParmTuple(
275  HOM_NodeTypeCategory *category = NULL,
276  bool bound_parms_only = false,
277  HOM_Node *relative_to_node = NULL,
278  const char *message = NULL,
279  const char *title = NULL,
280  const std::vector<std::string> &
281  initial_parm_tuples = std::vector<std::string>(),
282  bool multiple_select = true,
283  int width = 0,
284  int height = 0) = 0;
285 
286  SWIGOUT(%kwargs selectColor;)
287  SWIGOUT(%newobject selectColor;)
288  virtual HOM_Color *selectColor(HOM_Color *initial_color = NULL) = 0;
289 
290  SWIGOUT(%kwargs _openColorEditor;)
291  virtual void _openColorEditor(
292  void *color_changed_callback, bool include_alpha=false,
293  HOM_Color *initial_color=nullptr, float initial_alpha=1.0f) = 0;
294 
295  virtual std::vector<HOM_Color> loadPaletteFile(const char *file) = 0;
296  virtual void savePaletteFile(const char *file,
297  const std::vector<HOM_Color> &colors) = 0;
298 
299  SWIGOUT(%ignore _openValueLadder;)
300  SWIGOUT(%kwargs _openValueLadder;)
301  virtual void _openValueLadder(
302  float initial_value, void *value_changed_callback,
303  HOM_EnumValue &type=HOM_valueLadderType::Generic,
304  HOM_EnumValue &data_type=HOM_valueLadderDataType::Float) = 0;
305  virtual void updateValueLadder(
306  int cursor_x, int cursor_y, bool alt_key, bool shift_key) = 0;
307  virtual void closeValueLadder() = 0;
308 
309  SWIGOUT(%kwargs displayFileDependencyDialog;)
310  virtual UT_Tuple<bool,
311  std::vector<std::pair<HOM_ElemPtr<HOM_Parm>, std::string> > >
312  displayFileDependencyDialog(
313  HOM_Node *rop_node = NULL,
314  const std::vector<std::string> &uploaded_files =
315  std::vector<std::string>(),
316  const std::vector<std::string> &forced_unselected_patterns =
317  std::vector<std::string>(),
318  const char *project_dir_variable="HIP",
319  bool is_standalone=true) = 0;
320 
321  virtual void displayNodeHelp(HOM_NodeType &node_type) = 0;
322  virtual void openTypePropertiesDialog(
323  HOM_Node &node, bool promote_spare_parms=false,
324  bool immediately_save=false) = 0;
325  virtual void openTypePropertiesDialog(
326  HOM_NodeType &node_type, bool promote_spare_parms=false,
327  bool immediately_save=false) = 0;
328 
329  virtual void openRenderDialog(HOM_RopNode &rop) = 0;
330 
331  virtual void openRenameSelectedDialog(HOM_Node &network) = 0;
332 
333  SWIGOUT(%kwargs openParameterInterfaceDialog;)
334  virtual void openParameterInterfaceDialog(HOM_Node &node,
335  HOM_EnumValue *open_tab = nullptr,
336  const char *open_tab_tree_path = nullptr) = 0;
337 
338  virtual HOM_EnumValue &updateMode() = 0;
339  SWIGOUT(%ignore addOpaqueTriggerUpdateCallback;)
340  virtual void addOpaqueTriggerUpdateCallback(void *py_callback) = 0;
341  SWIGOUT(%ignore removeOpaqueTriggerUpdateCallback;)
342  virtual void removeOpaqueTriggerUpdateCallback(void *py_callback) = 0;
343 
344  virtual void setUpdateMode(HOM_EnumValue &mode) = 0;
345  virtual void triggerUpdate() = 0;
346  virtual void reloadViewportColorSchemes() = 0;
347 
348  virtual bool isAutoKey() = 0;
349 
350  virtual std::vector<int> _getTabMenuIconSize() = 0;
351 
352  SWIGOUT(%ignore addOpaqueSelectionCallback;)
353  virtual void addOpaqueSelectionCallback(void *py_callback) = 0;
354  SWIGOUT(%ignore removeOpaqueSelectionCallback;)
355  virtual void removeOpaqueSelectionCallback(void *py_callback) = 0;
356  virtual void removeAllSelectionCallbacks() = 0;
357  SWIGOUT(%ignore opaqueSelectionCallbacks;)
358  virtual std::vector<void *> opaqueSelectionCallbacks() = 0;
359 
360  SWIGOUT(%ignore addOpaqueEventLoopCallback;)
361  virtual void addOpaqueEventLoopCallback(void *callback) = 0;
362  SWIGOUT(%ignore removeOpaqueEventLoopCallback;)
363  virtual void removeOpaqueEventLoopCallback(void *callback) = 0;
364  SWIGOUT(%ignore opaqueEventLoopCallbacks;)
365  virtual std::vector<void *> opaqueEventLoopCallbacks() = 0;
366  SWIGOUT(%ignore postOpaqueEventCallback;)
367  virtual void postOpaqueEventCallback(void *callback) = 0;
368  SWIGOUT(%ignore removePostedOpaqueEventCallback;)
369  virtual void removePostedOpaqueEventCallback(void *callback) = 0;
370 
371  SWIGOUT(%newobject createDialog;)
372  virtual HOM_Dialog *createDialog(const char *ui_file_name) = 0;
373  SWIGOUT(%newobject findDialog;)
374  virtual HOM_Dialog *findDialog(const char *ui_file_name) = 0;
375  virtual std::vector<HOM_ElemPtr<HOM_Dialog> > dialogs() = 0;
376 
377  SWIGOUT(%ignore opaqueWaitUntil;)
378  virtual void opaqueWaitUntil(void *condition_callback) = 0;
379 
380  SWIGOUT(%kwargs writePythonShellHistoryFile;)
381  virtual void writePythonShellHistoryFile(const char *filename=NULL) = 0;
382 
383  SWIGOUT(%kwargs readPythonShellHistoryFile;)
384  virtual void readPythonShellHistoryFile(const char *filename=NULL) = 0;
385 
386  SWIGOUT(%kwargs setStatusMessage;)
387  virtual void setStatusMessage(
388  const char *message,
389  HOM_EnumValue &severity=HOM_severityType::Message) = 0;
390  virtual std::pair<std::string, HOM_EnumValue *> statusMessage() = 0;
391 
392  virtual void openAssetUploadDialog(
393  HOM_Node *uploading_node, const char *session_key,
394  HOM_Node *containing_node) = 0;
395 
396  virtual void openAssetDependenciesDialog(
397  const std::vector<HOM_Node *> &uploading_nodes,
398  const std::vector<HOM_Node *> &uploaded_nodes,
399  const char *session_key,
400  HOM_Node *containing_node) = 0;
401 
402  virtual bool hasDragSourceData(const char *label) = 0;
403  SWIGOUT(%kwargs getDragSourceData;)
404  virtual HOM_DDSourceAny getDragSourceData(const char *label, int index=0) = 0;
405 
406  virtual std::string resourceValueFromName(const char *name) = 0;
407  virtual HOM_Color colorFromName(const char *name) = 0;
408 
409  virtual double globalScaleFactor() = 0;
410  virtual int scaledSize(int size) = 0;
411 
412  virtual double inchesToPixels(double inches) = 0;
413  virtual double pixelsToInches(double pixels) = 0;
414 
415  virtual void copyTextToClipboard(const char *text) = 0;
416  virtual std::string getTextFromClipboard() = 0;
417 
418  virtual std::vector<std::string> hotkeys(const char *hotkey_symbol) = 0;
419  virtual std::string hotkeyDescription(const char *hotkey_symbol) = 0;
420  virtual bool isKeyMatch(const char *key, const char *hotkey_symbol) = 0;
421 
422  virtual std::string _geoSpreadsheetCellText(int sheet_id, int row, int col) = 0;
423  virtual void openCaptureWeightSpreadsheet(HOM_Node *node,
424  const char *pattern = NULL) = 0;
425 
426  virtual void registerViewerState(HOM_ViewerStateTemplate& vs_templ) = 0;
427  virtual void registerViewerStateFile(std::string const& state_file) = 0;
428  virtual void registerViewerStates() = 0;
429  virtual void unregisterViewerState(std::string const& state_typename) = 0;
430  virtual void unregisterViewerStateFile(std::string const& state_file) = 0;
431  virtual bool isRegisteredViewerState(std::string const& state_name) = 0;
432  virtual void reloadViewerState(std::string const& state_typename) = 0;
433  SWIGOUT(%kwargs reloadViewerStates;)
434  virtual void reloadViewerStates(std::vector<std::string> const& state_names=std::vector<std::string>()) = 0;
435 
436  SWIGOUT(%kwargs viewerStateInfo;)
437  virtual std::string viewerStateInfo(std::vector<std::string> const& state_names=std::vector<std::string>()) = 0;
438  virtual UT_Tuple<std::string, std::string> viewerStateInfoFromFile(std::string const& state_file) = 0;
439 
440  SWIGOUT(%kwargs viewerHandleInfo;)
441  virtual std::string viewerHandleInfo(std::vector<std::string> const& handle_names=std::vector<std::string>()) = 0;
442 
443  SWIGOUT(%kwargs printResourceMessage;)
444  virtual void printResourceMessage(
445  HOM_EnumValue & resource_type,
446  std::string const& message,
447  HOM_EnumValue & message_type = HOM_severityType::Message) = 0;
448  SWIGOUT(%kwargs fireResourceCustomEvent;)
449  virtual void fireResourceCustomEvent(
450  HOM_EnumValue & resource_type,
451  std::map<std::string, hboost::any> const & user_data,
452  bool queue = true) = 0;
453 
454  SWIGOUT(%ignore _openViewerStateCodeGenDialog;)
455  SWIGOUT(%kwargs _openViewerStateCodeGenDialog;)
456  virtual void _openViewerStateCodeGenDialog(
457  HOM_NodeTypeCategory const & category,
458  void* action_callback,
459  std::string const & op_name = std::string()) = 0;
460 
461  SWIGOUT(%ignore addOpaqueResourceEventCallback;)
462  virtual void addOpaqueResourceEventCallback(void *py_callback) = 0;
463  SWIGOUT(%ignore removeOpaqueResourceEventCallback;)
464  virtual void removeOpaqueResourceEventCallback(void *py_callback) = 0;
465 
466  SWIGOUT(%ignore _openFileEditor;)
467  SWIGOUT(%kwargs _openFileEditor;)
468  virtual void _openFileEditor(
469  std::string const & title,
470  std::string const & file_path,
471  void* action_callback = nullptr,
472  std::map<std::string, hboost::any> const& params =
473  std::map<std::string, hboost::any>() ) = 0;
474 
475  virtual void showInFileBrowser(const char *file_path) = 0;
476 
477  SWIGOUT(%newobject showFloatingParameterEditor;)
478  virtual HOM_ParameterEditor* showFloatingParameterEditor(HOM_Node *node, bool reuse=true ) = 0;
479 
480  virtual void openParameterExpressionEditor(HOM_Parm *parm) = 0;
481 
482  virtual bool hideAllMinimizedStowbars() = 0;
483  virtual void setHideAllMinimizedStowbars(bool hide) = 0;
484 
485  // Viewer Handles
486  virtual void registerViewerHandle(HOM_ViewerHandleTemplate& tmpl) = 0;
487  virtual void registerViewerHandles() = 0;
488  virtual void registerViewerHandleFile(std::string const& handle_file) = 0;
489  virtual void unregisterViewerHandle(std::string const& handle_name) = 0;
490  virtual void unregisterViewerHandleFile(std::string const& handle_file) = 0;
491  virtual bool isRegisteredViewerHandle(std::string const& handle_name) = 0;
492  virtual void reloadViewerHandle(std::string const& handle_name) = 0;
493 
494  virtual void loadPackage(std::string const& package_filepath) = 0;
495  SWIGOUT(%kwargs loadPackageArchive;)
496  virtual std::vector<std::string> loadPackageArchive(std::string const& filepath, std::string const& extract_path=std::string()) = 0;
497  virtual void unloadPackage(std::string const& package_filepath) = 0;
498  virtual void reloadPackage(std::string const& package_filepath) = 0;
499  virtual std::string packageInfo(std::vector<std::string> const& package_filepaths=std::vector<std::string>()) = 0;
500 
501  SWIGOUT(%ignore _openViewerHandleCodeGenDialog;)
502  SWIGOUT(%kwargs _openViewerHandleCodeGenDialog;)
503  virtual void _openViewerHandleCodeGenDialog(
504  HOM_NodeTypeCategory const & category,
505  void* action_callback ) = 0;
506 
507 #ifdef SWIG
508 %extend
509 {
510  SWIGOUT(%kwargs _selectNodeData;)
511  std::vector<std::string> _selectNodeData(
512  const char *title = NULL,
513  const char *message = NULL,
514  int width = 0,
515  int height = 0,
516  const std::vector<std::string> &
517  initial_selection = std::vector<std::string>(),
518  HOM_EnumValue *node_type_filter = nullptr,
519  bool multiple_select = false,
520  bool include_data_type_headers = true,
521  bool include_parms=true,
522  bool include_object_transforms=true,
523  bool include_geometry_bounding_boxes=true,
524  bool include_geometry_attributes=true,
525  bool expand_components=true,
526  InterpreterObject custom_data_callback=nullptr,
527  InterpreterObject custom_node_filter_callback=nullptr,
528  const char *help_url=nullptr)
529  {
530  if (custom_data_callback && custom_data_callback == Py_None)
531  custom_data_callback = nullptr;
532 
533  if (custom_node_filter_callback && custom_node_filter_callback == Py_None)
534  custom_node_filter_callback = nullptr;
535 
536  return self->_selectNodeDataInternal(
537  title,
538  message,
539  width,
540  height,
541  initial_selection,
542  node_type_filter,
543  multiple_select,
544  include_data_type_headers,
545  include_parms,
546  include_object_transforms,
547  include_geometry_bounding_boxes,
548  include_geometry_attributes,
549  expand_components,
550  custom_data_callback,
551  custom_node_filter_callback,
552  help_url
553  );
554  }
555 
556  SWIGOUT(%kwargs _selectNode;)
557  std::vector<std::string> _selectNode(
558  HOM_Node *relative_to_node = NULL,
559  HOM_Node *initial_node = NULL,
560  HOM_EnumValue *node_type_filter = NULL,
561  const char *title = NULL,
562  int width = 0,
563  int height = 0,
564  bool multiple_select = false,
565  InterpreterObject custom_node_filter_callback = nullptr)
566  {
567  if (custom_node_filter_callback && custom_node_filter_callback == Py_None)
568  custom_node_filter_callback = nullptr;
569 
570  return self->_selectNodeInternal(
571  relative_to_node,
572  initial_node,
573  node_type_filter,
574  title,
575  width,
576  height,
577  multiple_select,
578  custom_node_filter_callback
579  );
580  }
581 
582  // This method is deprecated. Use selectNode() instead.
583  SWIGOUT(%kwargs selectMultipleNodes;)
584  std::vector<std::string> selectMultipleNodes(
585  HOM_Node *relative_to_node = NULL,
586  HOM_Node *initial_node = NULL,
587  HOM_EnumValue *node_type_filter = NULL,
588  const char *title = NULL,
589  int width = 0,
590  int height = 0,
591  InterpreterObject custom_node_filter_callback = nullptr)
592  {
593  if (custom_node_filter_callback && custom_node_filter_callback == Py_None)
594  custom_node_filter_callback = nullptr;
595 
596  return self->_selectMultipleNodes(
597  relative_to_node,
598  initial_node,
599  node_type_filter,
600  title,
601  width,
602  height,
603  custom_node_filter_callback
604  );
605  }
606 
607  SWIGOUT(%kwargs openColorEditor;)
608  void openColorEditor(
609  InterpreterObject color_changed_callback,
610  bool include_alpha=false,
611  HOM_Color *initial_color=nullptr, float initial_alpha=1.0f)
612  { self->_openColorEditor(
613  color_changed_callback, include_alpha, initial_color, initial_alpha); }
614 
615  SWIGOUT(%kwargs openValueLadder;)
616  void openValueLadder(
617  float initial_value,
618  InterpreterObject value_changed_callback,
619  HOM_EnumValue &type=HOM_valueLadderType::Generic,
620  HOM_EnumValue &data_type=HOM_valueLadderDataType::Float)
621  { self->_openValueLadder(
622  initial_value, value_changed_callback, type, data_type); }
623 
624  void addEventLoopCallback(InterpreterObject callback)
625  { self->addOpaqueEventLoopCallback(callback); }
626 
627  void removeEventLoopCallback(InterpreterObject callback)
628  { self->removeOpaqueEventLoopCallback(callback); }
629 
630  void postEventCallback(InterpreterObject callback)
631  { self->postOpaqueEventCallback(callback); }
632  void removePostedEventCallback(InterpreterObject callback)
633  { self->removePostedOpaqueEventCallback(callback); }
634 
635  // Note that we return a vector of borrowed references because swig
636  // will increment the reference counts.
637  std::vector<InterpreterObject> eventLoopCallbacks()
638  {
639  std::vector<void *> opaque_callbacks(self->opaqueEventLoopCallbacks());
640 
641  std::vector<InterpreterObject> callbacks;
642  for (int i=0; i< opaque_callbacks.size(); ++i)
643  callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
644  return callbacks;
645  }
646 
647  void waitUntil(InterpreterObject callback)
648  { self->opaqueWaitUntil(callback); }
649 
650  void addTriggerUpdateCallback(InterpreterObject callback)
651  { self->addOpaqueTriggerUpdateCallback(callback); }
652 
653  void removeTriggerUpdateCallback(InterpreterObject callback)
654  { self->removeOpaqueTriggerUpdateCallback(callback); }
655 
656  void addSelectionCallback(InterpreterObject callback)
657  { self->addOpaqueSelectionCallback(callback); }
658 
659  void removeSelectionCallback(InterpreterObject callback)
660  { self->removeOpaqueSelectionCallback(callback); }
661 
662  std::vector<InterpreterObject> selectionCallbacks()
663  {
664  std::vector<void *> opaque_callbacks = self->opaqueSelectionCallbacks();
665  std::vector<InterpreterObject> callbacks;
666 
667  for (int i = 0, n = opaque_callbacks.size(); i < n; i++)
668  callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
669 
670  return callbacks;
671  }
672 
673  // viewer state events
674  void addResourceEventCallback(InterpreterObject callback)
675  {
676  self->addOpaqueResourceEventCallback(callback);
677  }
678 
679  void removeResourceEventCallback(InterpreterObject callback)
680  {
681  self->removeOpaqueResourceEventCallback(callback);
682  }
683 
684  SWIGOUT(%kwargs openFileEditor;)
685  void openFileEditor(
686  std::string const & title,
687  std::string const & file_path,
688  InterpreterObject action_callback = nullptr,
689  std::map<std::string, hboost::any> const& params =
690  std::map<std::string, hboost::any>() )
691  {
692  self->_openFileEditor(title, file_path, action_callback, params);
693  }
694 
695  SWIGOUT(%kwargs openViewerStateCodeGenDialog;)
696  void openViewerStateCodeGenDialog(
697  HOM_NodeTypeCategory const & category,
698  InterpreterObject action_callback,
699  std::string const & op_name = std::string())
700  {
701  self->_openViewerStateCodeGenDialog(category, action_callback, op_name);
702  }
703 
704  SWIGOUT(%kwargs openViewerHandleCodeGenDialog;)
705  void openViewerHandleCodeGenDialog(
706  HOM_NodeTypeCategory const & category,
707  InterpreterObject action_callback )
708  {
709  self->_openViewerHandleCodeGenDialog(category, action_callback);
710  }
711 
712 }
713 #endif
714 
715 };
716 
717 #endif
virtual ~HOM_ui()
Definition: HOM_ui.h:47
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2542
GLint location
Definition: glcorearb.h:804
GT_API const UT_StringHolder filename
OIIO_API bool rename(string_view from, string_view to, std::string &err)
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:353
std::tuple< Types...> UT_Tuple
Definition: UT_Tuple.h:53
GLuint const GLchar * name
Definition: glcorearb.h:785
GLsizeiptr size
Definition: glcorearb.h:663
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
#define HOM_API
Definition: HOM_API.h:13
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
Definition: HOM_ui.h:44
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the queue
Definition: thread.h:629
GLenum GLenum severity
Definition: glcorearb.h:2538
GLint GLsizei width
Definition: glcorearb.h:102
GLint GLsizei GLsizei height
Definition: glcorearb.h:102
GLenum mode
Definition: glcorearb.h:98
GLdouble n
Definition: glcorearb.h:2007
GLubyte * pattern
Definition: glew.h:5741
hboost::any HOM_DDSourceAny
Definition: HOM_Defines.h:42
GLuint index
Definition: glcorearb.h:785
GLenum GLenum void * row
Definition: glew.h:4995
GLfloat f
Definition: glcorearb.h:1925
GLenum const GLfloat * params
Definition: glcorearb.h:104
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
Definition: glcorearb.h:107