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 void _coloreditorUnbind(int64 token) = 0;
349 
350  virtual std::vector<std::string> _loadImagesFile(const char *file) = 0;
351  virtual void _saveImagesFile(const char *file,
352  const std::vector<std::string> &images) = 0;
353 
354  SWIGOUT(%ignore _openValueLadder;)
355  SWIGOUT(%kwargs _openValueLadder;)
356  virtual void _openValueLadder(
357  float initial_value, void *value_changed_callback,
358  HOM_EnumValue &type=HOM_valueLadderType::Generic,
360  virtual void updateValueLadder(
361  int cursor_x, int cursor_y, bool alt_key, bool shift_key) = 0;
362  virtual void closeValueLadder() = 0;
363 
364  SWIGOUT(%kwargs displayFileDependencyDialog;)
365  virtual UT_Tuple<bool,
366  std::vector<std::pair<HOM_ElemPtr<HOM_Parm>, std::string> > >
367  displayFileDependencyDialog(
368  HOM_Node *rop_node = NULL,
369  const std::vector<std::string> &uploaded_files =
370  std::vector<std::string>(),
371  const std::vector<std::string> &forced_unselected_patterns =
372  std::vector<std::string>(),
373  const char *project_dir_variable="HIP",
374  bool is_standalone=true) = 0;
375 
376  virtual void displayNodeHelp(HOM_NodeType &node_type) = 0;
377  virtual void _openTypePropertiesDialogForNode(
378  HOM_Node &node, bool promote_spare_parms,
379  bool immediately_save) = 0;
380  virtual void _openTypePropertiesDialogForNodeType(
381  HOM_NodeType &node_type, bool promote_spare_parms,
382  bool immediately_save) = 0;
383 
384  virtual void openRenderDialog(HOM_RopNode &rop) = 0;
385 
386  virtual void openRenameSelectedDialog(HOM_Node &network) = 0;
387 
388  SWIGOUT(%kwargs openParameterInterfaceDialog;)
389  virtual void openParameterInterfaceDialog(HOM_Node &node,
390  HOM_EnumValue *open_tab = nullptr,
391  const char *open_tab_tree_path = nullptr) = 0;
392 
393  virtual HOM_EnumValue &updateMode() = 0;
394  SWIGOUT(%ignore addOpaqueTriggerUpdateCallback;)
395  virtual void addOpaqueTriggerUpdateCallback(void *py_callback) = 0;
396  SWIGOUT(%ignore removeOpaqueTriggerUpdateCallback;)
397  virtual void removeOpaqueTriggerUpdateCallback(void *py_callback) = 0;
398 
399  virtual void setUpdateMode(HOM_EnumValue &mode) = 0;
400  virtual void triggerUpdate() = 0;
401  virtual void reloadViewportColorSchemes() = 0;
402  virtual void reloadColorScheme() = 0;
403  virtual std::string currentColorScheme() = 0;
404 
405  virtual bool isAutoKey() = 0;
406 
407  virtual std::vector<int> _getTabMenuIconSize() = 0;
408 
409  SWIGOUT(%ignore addOpaqueSelectionCallback;)
410  virtual void addOpaqueSelectionCallback(void *py_callback) = 0;
411  SWIGOUT(%ignore removeOpaqueSelectionCallback;)
412  virtual void removeOpaqueSelectionCallback(void *py_callback) = 0;
413  virtual void removeAllSelectionCallbacks() = 0;
414  SWIGOUT(%ignore opaqueSelectionCallbacks;)
415  virtual std::vector<void *> opaqueSelectionCallbacks() = 0;
416 
417  SWIGOUT(%ignore addOpaqueEventLoopCallback;)
418  virtual void addOpaqueEventLoopCallback(void *callback) = 0;
419  SWIGOUT(%ignore removeOpaqueEventLoopCallback;)
420  virtual void removeOpaqueEventLoopCallback(void *callback) = 0;
421  SWIGOUT(%ignore opaqueEventLoopCallbacks;)
422  virtual std::vector<void *> opaqueEventLoopCallbacks() = 0;
423  SWIGOUT(%ignore postOpaqueEventCallback;)
424  virtual void postOpaqueEventCallback(void *callback) = 0;
425  SWIGOUT(%ignore removePostedOpaqueEventCallback;)
426  virtual void removePostedOpaqueEventCallback(void *callback) = 0;
427 
428  virtual void postRedrawFence() = 0;
429 
430  SWIGOUT(%newobject createDialog;)
431  virtual HOM_Dialog *createDialog(const char *ui_file_name) = 0;
432  SWIGOUT(%newobject findDialog;)
433  virtual HOM_Dialog *findDialog(const char *ui_file_name) = 0;
434  virtual std::vector<HOM_ElemPtr<HOM_Dialog> > dialogs() = 0;
435 
436  SWIGOUT(%ignore opaqueWaitUntil;)
437  virtual void opaqueWaitUntil(void *condition_callback) = 0;
438 
439  SWIGOUT(%kwargs writePythonShellHistoryFile;)
440  virtual void writePythonShellHistoryFile(const char *filename=NULL) = 0;
441 
442  SWIGOUT(%kwargs readPythonShellHistoryFile;)
443  virtual void readPythonShellHistoryFile(const char *filename=NULL) = 0;
444 
445  SWIGOUT(%kwargs setStatusMessage;)
446  virtual void setStatusMessage(
447  const char *message,
448  HOM_EnumValue &severity=HOM_severityType::Message) = 0;
449  virtual std::pair<std::string, HOM_EnumValue *> statusMessage() = 0;
450 
451  virtual bool _processEvents() = 0;
452 
453  virtual void openAssetUploadDialog(
454  HOM_Node *uploading_node, const char *session_key,
455  HOM_Node *containing_node) = 0;
456 
457  virtual void openAssetDependenciesDialog(
458  const std::vector<HOM_Node *> &uploading_nodes,
459  const std::vector<HOM_Node *> &uploaded_nodes,
460  const char *session_key,
461  HOM_Node *containing_node) = 0;
462 
463  virtual bool hasDragSourceData(const char *label) = 0;
464  SWIGOUT(%kwargs getDragSourceData;)
465  virtual HOM_DDSourceAny getDragSourceData(const char *label, int index=0) = 0;
466 
467  virtual std::string resourceValueFromName(const char *name) = 0;
468  virtual HOM_Color colorFromName(const char *name) = 0;
469 
470  virtual double globalScaleFactor() = 0;
471  virtual int scaledSize(int size) = 0;
472 
473  virtual double inchesToPixels(double inches) = 0;
474  virtual double pixelsToInches(double pixels) = 0;
475 
476  virtual void copyTextToClipboard(const char *text) = 0;
477  virtual std::string getTextFromClipboard() = 0;
478 
479  virtual std::vector<std::string> hotkeys(const char *hotkey_symbol) = 0;
480  virtual std::string hotkeyDescription(const char *hotkey_symbol) = 0;
481  virtual bool isKeyMatch(const char *key, const char *hotkey_symbol) = 0;
482 
483  virtual std::string _geoSpreadsheetCellText(int sheet_id, int row, int col) = 0;
484  virtual void openCaptureWeightSpreadsheet(HOM_Node *node,
485  const char *pattern = NULL) = 0;
486  virtual std::string _openCaptureWeightSpreadsheet2(HOM_Node* node) = 0;
487 
488  virtual void _closeCaptureWeightSpreadsheet(const std::string &identifier) = 0;
489 
490  virtual void registerViewerState(HOM_ViewerStateTemplate& vs_templ) = 0;
491  virtual void registerViewerStateFile(std::string const& state_file) = 0;
492  virtual void registerViewerStates() = 0;
493  virtual void unregisterViewerState(std::string const& state_typename) = 0;
494  virtual void unregisterViewerStateFile(std::string const& state_file) = 0;
495  virtual bool isRegisteredViewerState(std::string const& state_name) = 0;
496  virtual void reloadViewerState(std::string const& state_typename) = 0;
497  SWIGOUT(%kwargs reloadViewerStates;)
498  virtual void reloadViewerStates(std::vector<std::string> const& state_names=std::vector<std::string>()) = 0;
499 
500  SWIGOUT(%kwargs viewerStateInfo;)
501  virtual std::string viewerStateInfo(std::vector<std::string> const& state_names=std::vector<std::string>()) = 0;
502  virtual UT_Tuple<std::string, std::string> viewerStateInfoFromFile(std::string const& state_file) = 0;
503 
504  SWIGOUT(%kwargs viewerHandleInfo;)
505  virtual std::string viewerHandleInfo(std::vector<std::string> const& handle_names=std::vector<std::string>()) = 0;
506 
507  SWIGOUT(%kwargs printResourceMessage;)
508  virtual void printResourceMessage(
509  HOM_EnumValue &resource_type,
510  std::string const &message,
511  HOM_EnumValue &message_type = HOM_severityType::Message) = 0;
512  SWIGOUT(%kwargs fireResourceCustomEvent;)
513  virtual void fireResourceCustomEvent(
514  HOM_EnumValue &resource_type,
515  std::map<std::string, hboost::any> const &user_data,
516  bool queue = true) = 0;
517 
518  SWIGOUT(%ignore _openViewerStateCodeGenDialog;)
519  SWIGOUT(%kwargs _openViewerStateCodeGenDialog;)
520  virtual void _openViewerStateCodeGenDialog(
521  HOM_NodeTypeCategory const &category,
522  void *action_callback,
523  std::string const &op_name = std::string()) = 0;
524 
525  SWIGOUT(%ignore addOpaqueResourceEventCallback;)
526  virtual void addOpaqueResourceEventCallback(void *py_callback) = 0;
527  SWIGOUT(%ignore removeOpaqueResourceEventCallback;)
528  virtual void removeOpaqueResourceEventCallback(void *py_callback) = 0;
529 
530  SWIGOUT(%ignore _openFileEditor;)
531  SWIGOUT(%kwargs _openFileEditor;)
532  virtual void _openFileEditor(
533  std::string const &title,
534  std::string const &file_path,
535  void *action_callback = nullptr,
536  std::map<std::string, hboost::any> const &params =
537  std::map<std::string, hboost::any>()) = 0;
538 
539  virtual void showInFileBrowser(const char *file_path) = 0;
540 
541  SWIGOUT(%newobject showFloatingParameterEditor;)
542  virtual HOM_ParameterEditor* showFloatingParameterEditor(HOM_Node *node, bool reuse=true ) = 0;
543 
544  virtual void openParameterExpressionEditor(HOM_Parm *parm) = 0;
545  virtual void openPreferences(const char *page, const char *label) = 0;
546 
547  virtual bool hideAllMinimizedStowbars() = 0;
548  virtual void setHideAllMinimizedStowbars(bool hide) = 0;
549 
550  virtual void setFullscreen(bool fullscreen) = 0;
551  virtual bool isFullscreen() = 0;
552  virtual void toggleFullscreen() = 0;
553 
554  // Viewer Handles
555  virtual void registerViewerHandle(HOM_ViewerHandleTemplate& tmpl) = 0;
556  virtual void registerViewerHandles() = 0;
557  virtual void registerViewerHandleFile(std::string const& handle_file) = 0;
558  virtual void unregisterViewerHandle(std::string const& handle_name) = 0;
559  virtual void unregisterViewerHandleFile(std::string const& handle_file) = 0;
560  virtual bool isRegisteredViewerHandle(std::string const& handle_name) = 0;
561  virtual void reloadViewerHandle(std::string const& handle_name) = 0;
562 
563  virtual void loadPackage(std::string const& package_filepath) = 0;
564  SWIGOUT(%kwargs loadPackageArchive;)
565  virtual std::vector<std::string> loadPackageArchive(std::string const& filepath, std::string const& extract_path=std::string()) = 0;
566  SWIGOUT(%kwargs unloadPackage;)
567  virtual void unloadPackage(std::string const& package_filepath, bool force_unload=false) = 0;
568  virtual void reloadPackage(std::string const& package_filepath) = 0;
569  virtual void activatePackage(std::string const& package_filepath) = 0;
570  virtual void deactivatePackage(std::string const& package_filepath) = 0;
571  virtual std::string packageInfo(std::vector<std::string> const& package_filepaths=std::vector<std::string>()) = 0;
572 
573  SWIGOUT(%ignore _openViewerHandleCodeGenDialog;)
574  SWIGOUT(%kwargs _openViewerHandleCodeGenDialog;)
575  virtual void _openViewerHandleCodeGenDialog(
576  HOM_NodeTypeCategory const &category, void *action_callback) = 0;
577 
578  // Asset catalog global methods.
579  SWIGOUT(%newobject sharedAssetGalleryDataSource;)
580  virtual HOM_AssetGalleryDataSource *sharedAssetGalleryDataSource(const char *gallery_name) = 0;
581  virtual void setSharedAssetGalleryDataSource(
582  HOM_AssetGalleryDataSource *data_source,
583  const char *gallery_name)
584  = 0;
585  virtual void reloadSharedAssetGalleryDataSource(const char *gallery_name) = 0;
586  virtual std::vector<HOM_ElemPtr<HOM_Tool>> _toolsWithFilter(const char *filter) = 0;
587 
588 #ifdef SWIG
589 %extend
590 {
591  SWIGOUT(%kwargs _selectNodeData;)
592  std::vector<std::string> _selectNodeData(
593  const char *title = NULL,
594  const char *message = NULL,
595  int width = 0,
596  int height = 0,
597  const std::vector<std::string> &
598  initial_selection = std::vector<std::string>(),
599  HOM_EnumValue *node_type_filter = nullptr,
600  bool multiple_select = false,
601  bool include_data_type_headers = true,
602  bool include_parms=true,
603  bool include_object_transforms=true,
604  bool include_geometry_bounding_boxes=true,
605  bool include_geometry_attributes=true,
606  bool expand_components=true,
607  InterpreterObject custom_data_callback=nullptr,
608  InterpreterObject custom_node_filter_callback=nullptr,
609  const char *help_url=nullptr)
610  {
611  if (custom_data_callback && custom_data_callback == Py_None)
612  custom_data_callback = nullptr;
613 
614  if (custom_node_filter_callback && custom_node_filter_callback == Py_None)
615  custom_node_filter_callback = nullptr;
616 
617  return self->_selectNodeDataInternal(
618  title,
619  message,
620  width,
621  height,
622  initial_selection,
623  node_type_filter,
624  multiple_select,
625  include_data_type_headers,
626  include_parms,
627  include_object_transforms,
628  include_geometry_bounding_boxes,
629  include_geometry_attributes,
630  expand_components,
631  custom_data_callback,
632  custom_node_filter_callback,
633  help_url
634  );
635  }
636 
637  SWIGOUT(%kwargs _selectNode;)
638  std::vector<std::string> _selectNode(
639  HOM_Node *relative_to_node = NULL,
640  HOM_Node *initial_node = NULL,
641  HOM_EnumValue *node_type_filter = NULL,
642  const char *title = NULL,
643  int width = 0,
644  int height = 0,
645  bool multiple_select = false,
646  InterpreterObject custom_node_filter_callback = nullptr)
647  {
648  if (custom_node_filter_callback && custom_node_filter_callback == Py_None)
649  custom_node_filter_callback = nullptr;
650 
651  return self->_selectNodeInternal(
652  relative_to_node,
653  initial_node,
654  node_type_filter,
655  title,
656  width,
657  height,
658  multiple_select,
659  custom_node_filter_callback
660  );
661  }
662 
663  // This method is deprecated. Use selectNode() instead.
664  SWIGOUT(%kwargs selectMultipleNodes;)
665  std::vector<std::string> selectMultipleNodes(
666  HOM_Node *relative_to_node = NULL,
667  HOM_Node *initial_node = NULL,
668  HOM_EnumValue *node_type_filter = NULL,
669  const char *title = NULL,
670  int width = 0,
671  int height = 0,
672  InterpreterObject custom_node_filter_callback = nullptr)
673  {
674  if (custom_node_filter_callback && custom_node_filter_callback == Py_None)
675  custom_node_filter_callback = nullptr;
676 
677  return self->_selectMultipleNodes(
678  relative_to_node,
679  initial_node,
680  node_type_filter,
681  title,
682  width,
683  height,
684  custom_node_filter_callback
685  );
686  }
687 
688  SWIGOUT(%kwargs openBookmarkEditor;)
689  void openBookmarkEditor(HOM_Bookmark *bookmark=nullptr)
690  { self->_openBookmarkEditor(bookmark); }
691 
692  SWIGOUT(%kwargs openColorEditor;)
693  void openColorEditor(
694  InterpreterObject color_changed_callback,
695  bool include_alpha=false,
696  HOM_Color *initial_color=nullptr,
697  float initial_alpha=1.0f,
698  std::map<std::string, hboost::any> const& options =
699  std::map<std::string, hboost::any>()
700  )
701  {
702  self->_openColorEditor(
703  color_changed_callback,
704  include_alpha,
705  initial_color,
706  initial_alpha,
707  options);
708  }
709 
710  SWIGOUT(%kwargs openColorEditor;)
711  void openRawColorEditor(
712  InterpreterObject color_changed_callback,
713  bool include_alpha=false,
714  HOM_Color *initial_color=nullptr,
715  float initial_alpha=1.0f
716  )
717  {
718  std::map<std::string, hboost::any> options;
719  options["ocio_pick_raw"] = true;
720  options["ocio_show_info"] = false;
721  options["apply_color_correction"] = false;
722 
723  self->_openColorEditor(
724  color_changed_callback,
725  include_alpha,
726  initial_color,
727  initial_alpha,
728  options);
729  }
730 
731  SWIGOUT(%kwargs openValueLadder;)
732  void openValueLadder(
733  float initial_value,
734  InterpreterObject value_changed_callback,
735  HOM_EnumValue &type=HOM_valueLadderType::Generic,
737  { self->_openValueLadder(
738  initial_value, value_changed_callback, type, data_type); }
739 
740  void addEventLoopCallback(InterpreterObject callback)
741  { self->addOpaqueEventLoopCallback(callback); }
742 
743  void removeEventLoopCallback(InterpreterObject callback)
744  { self->removeOpaqueEventLoopCallback(callback); }
745 
746  void postEventCallback(InterpreterObject callback)
747  { self->postOpaqueEventCallback(callback); }
748  void removePostedEventCallback(InterpreterObject callback)
749  { self->removePostedOpaqueEventCallback(callback); }
750 
751  // Note that we return a vector of borrowed references because swig
752  // will increment the reference counts.
753  std::vector<InterpreterObject> eventLoopCallbacks()
754  {
755  std::vector<void *> opaque_callbacks(self->opaqueEventLoopCallbacks());
756 
757  std::vector<InterpreterObject> callbacks;
758  for (int i=0; i< opaque_callbacks.size(); ++i)
759  callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
760  return callbacks;
761  }
762 
763  void waitUntil(InterpreterObject callback)
764  { self->opaqueWaitUntil(callback); }
765 
766  void addTriggerUpdateCallback(InterpreterObject callback)
767  { self->addOpaqueTriggerUpdateCallback(callback); }
768 
769  void removeTriggerUpdateCallback(InterpreterObject callback)
770  { self->removeOpaqueTriggerUpdateCallback(callback); }
771 
772  void addSelectionCallback(InterpreterObject callback)
773  { self->addOpaqueSelectionCallback(callback); }
774 
775  void removeSelectionCallback(InterpreterObject callback)
776  { self->removeOpaqueSelectionCallback(callback); }
777 
778  std::vector<InterpreterObject> selectionCallbacks()
779  {
780  std::vector<void *> opaque_callbacks = self->opaqueSelectionCallbacks();
781  std::vector<InterpreterObject> callbacks;
782 
783  for (int i = 0, n = opaque_callbacks.size(); i < n; i++)
784  callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
785 
786  return callbacks;
787  }
788 
789  // viewer state events
790  void addResourceEventCallback(InterpreterObject callback)
791  {
792  self->addOpaqueResourceEventCallback(callback);
793  }
794 
795  void removeResourceEventCallback(InterpreterObject callback)
796  {
797  self->removeOpaqueResourceEventCallback(callback);
798  }
799 
800  SWIGOUT(%kwargs openFileEditor;)
801  void openFileEditor(
802  std::string const & title,
803  std::string const & file_path,
804  InterpreterObject action_callback = nullptr,
805  std::map<std::string, hboost::any> const& params =
806  std::map<std::string, hboost::any>() )
807  {
808  self->_openFileEditor(title, file_path, action_callback, params);
809  }
810 
811  SWIGOUT(%kwargs openViewerStateCodeGenDialog;)
812  void openViewerStateCodeGenDialog(
813  HOM_NodeTypeCategory const & category,
814  InterpreterObject action_callback,
815  std::string const & op_name = std::string())
816  {
817  self->_openViewerStateCodeGenDialog(category, action_callback, op_name);
818  }
819 
820  SWIGOUT(%kwargs openViewerHandleCodeGenDialog;)
821  void openViewerHandleCodeGenDialog(
822  HOM_NodeTypeCategory const & category,
823  InterpreterObject action_callback )
824  {
825  self->_openViewerHandleCodeGenDialog(category, action_callback);
826  }
827 
828 }
829 #endif
830 
831 };
832 
833 #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