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