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