HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_NetworkEditor.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_NetworkEditor_h__
10 #define __HOM_NetworkEditor_h__
11 
12 #include "HOM_PathBasedPaneTab.h"
13 #include "HOM_NetworkAnimValue.h"
14 #include "HOM_NetworkFootprint.h"
15 #include "HOM_NetworkImage.h"
16 #include "HOM_NetworkShape.h"
17 #include <UT/UT_Tuple.h>
18 #include <vector>
19 
20 class HOM_BoundingRect;
21 class HOM_NetworkItem;
23 class HOM_Node;
24 class HOM_Parm;
25 class HOM_ParmTuple;
26 class HOM_StickyNote;
28 class HOM_Vector2;
29 class HOM_VopNode;
30 
31 SWIGOUT(%rename(NetworkEditor) HOM_NetworkEditor;)
32 
34 {
35 public:
37  { HOM_CONSTRUCT_OBJECT(this) }
38  // Because the lowermost base classes initialize the virtual bases
39  // before any non-virtual bases, the correct thing to do here is
40  // explicitly call the constructor for HOM_PaneTab.
42  : HOM_PaneTab(pane), HOM_PathBasedPaneTab(pane)
43  { HOM_CONSTRUCT_OBJECT(this) }
44 
45  ~HOM_NetworkEditor() override
46  { HOM_DESTRUCT_OBJECT(this) }
47 
48  // Let swig know we're overriding __repr__ for this class so it doesn't
49  // provide its own __repr__.
50  SWIGOUT(virtual std::string __repr__() = 0);
51 
52  virtual bool isShowingConnectors() = 0;
53  virtual bool isUnderCursor() = 0;
54  virtual bool isPosInside(
55  const HOM_Vector2 &pos,
56  bool ignore_floating_windows=true) = 0;
57  virtual void setCursorPosition(const HOM_Vector2 &pos) = 0;
58  virtual HOM_Vector2 cursorPosition(bool confine_to_view = true) = 0;
59  virtual HOM_BoundingRect screenBounds() = 0;
60  virtual HOM_BoundingRect visibleBounds() = 0;
61  SWIGOUT(%kwargs setVisibleBounds;)
62  virtual void setVisibleBounds(const HOM_BoundingRect &bounds,
63  float transition_time = 0.0,
64  float max_scale = 0.0,
65  bool set_center_when_scale_rejected = false) = 0;
66  virtual void requestZoomReset() = 0;
67  virtual void _requestZoomReset(const std::vector<HOM_NetworkItem *> &items) = 0;
68  virtual bool isZoomResetRequested() = 0;
69  virtual void _requestGraphUpdate() = 0;
70 
71  virtual void setLocatingEnabled(bool enabled) = 0;
72  virtual bool locatingEnabled() = 0;
73 
74  virtual float lengthToScreen(float len) = 0;
75  virtual float lengthFromScreen(float len) = 0;
76 
77  virtual HOM_Vector2 sizeToScreen(const HOM_Vector2 &size) = 0;
78  virtual HOM_Vector2 sizeFromScreen(const HOM_Vector2 &size) = 0;
79 
80  virtual HOM_Vector2 posToScreen(const HOM_Vector2 &pos) = 0;
81  virtual HOM_Vector2 posFromScreen(const HOM_Vector2 &pos) = 0;
82 
83  virtual HOM_Vector2 overviewPosToScreen(const HOM_Vector2 &pos) = 0;
84  virtual HOM_Vector2 overviewPosFromScreen(const HOM_Vector2 &pos) = 0;
85  virtual bool overviewVisible() = 0;
86  virtual bool overviewVisibleIfAutomatic() = 0;
87 
88  SWIGOUT(%kwargs networkItemsInBox;)
89  virtual std::vector<UT_Tuple<HOM_ElemPtr<HOM_NetworkItem>,
91  int> >
92  networkItemsInBox(const HOM_Vector2 &pos1, const HOM_Vector2 &pos2,
93  bool for_drop = false, bool for_select = false) = 0;
94  virtual void setDropTargetItem(
95  HOM_NetworkItem *item, const char *name, int index) = 0;
97  dropTargetItem() = 0;
98  virtual void setDecoratedItem(HOM_NetworkItem *item, bool interactive) = 0;
99  SWIGOUT(%newobject decoratedItem;)
100  virtual HOM_NetworkItem *decoratedItem() = 0;
101  virtual bool decorationInteractive() = 0;
102 
103  virtual void setPreSelectedItems(
104  const std::vector<HOM_NetworkItem *> &items) = 0;
105  virtual std::vector<HOM_ElemPtr<HOM_NetworkItem> > preSelectedItems() = 0;
106  virtual std::vector<HOM_ElemPtr<HOM_NodeConnection> >
107  selectedConnections() = 0;
108  virtual void clearAllSelected() = 0;
109 
110  virtual void setNetworkBoxPendingRemovals(
111  const std::vector<HOM_NetworkMovableItem *> &items) = 0;
112  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> >
113  networkBoxPendingRemovals() = 0;
114 
115  virtual void setFootprints(
116  const std::vector<HOM_NetworkFootprint> &footprints) = 0;
117  virtual std::vector<HOM_NetworkFootprint> footprints() = 0;
118 
119  virtual void setCursorMap(
120  std::map<std::pair<std::string, int>, std::string> cursors) = 0;
121  virtual std::map<std::pair<std::string, int>, std::string> cursorMap() = 0;
122  virtual void setDefaultCursor(const char *cursor_name) = 0;
123  virtual std::string defaultCursor() = 0;
124 
125  virtual void setBackgroundImages(
126  const std::vector<HOM_NetworkImage> &images) = 0;
127  virtual std::vector<HOM_NetworkImage> backgroundImages() = 0;
128 
129  virtual HOM_BoundingRect itemRect(
130  HOM_NetworkMovableItem *item, bool adjusted=true) = 0;
131  virtual HOM_Vector2 itemInputPos(
132  HOM_NetworkMovableItem *item, int input_index, bool adjusted=true) = 0;
133  virtual HOM_Vector2 itemInputDir(
134  HOM_NetworkMovableItem *item, int input_index) = 0;
135  virtual HOM_Vector2 itemOutputPos(
136  HOM_NetworkMovableItem *item, int output_index, bool adjusted=true) = 0;
137  virtual HOM_Vector2 itemOutputDir(
138  HOM_NetworkMovableItem *item, int output_index) = 0;
139  virtual std::vector<std::pair<HOM_ElemPtr<HOM_NetworkMovableItem>,
140  HOM_BoundingRect> > allVisibleRects(
141  const std::vector<HOM_NetworkMovableItem *> &ignore_items,
142  bool adjusted = true) = 0;
143 
144  SWIGOUT(%kwargs setAdjustments;)
145  virtual void setAdjustments(
146  const std::vector<HOM_NetworkItem *> &items,
147  const std::vector<HOM_NetworkAnimValue> &adjustments,
148  bool auto_remove = false) = 0;
149  virtual void setShapes(
150  const std::vector<HOM_NetworkShape *> &shapes) = 0;
151  virtual void setOverlayShapes(
152  const std::vector<HOM_NetworkShape *> &shapes) = 0;
153 
154  virtual void setTooltip(const char *tooltip) = 0;
155  virtual std::string tooltip() = 0;
156  virtual void setPrompt(const char *prompt) = 0;
157  virtual std::string prompt() = 0;
158  virtual void flashMessage(const char *image,
159  const char *message, float duration) = 0;
160 
161  SWIGOUT(%kwargs openTabMenu;)
162  virtual void openTabMenu(const char *key = NULL,
163  bool auto_place = false,
164  bool branch = false,
165  HOM_NetworkMovableItem *src_item = NULL,
166  int src_connector_index = -1,
167  HOM_NetworkMovableItem *dest_item = NULL,
168  int dest_connector_index = -1,
169  HOM_Vector2 *node_position = NULL,
170  const std::vector<HOM_NetworkMovableItem *> &src_items =
171  std::vector<HOM_NetworkMovableItem *>(),
172  const std::vector<int> &src_connector_indexes =
173  std::vector<int>(),
174  const std::vector<HOM_NetworkMovableItem *> &dest_items =
175  std::vector<HOM_NetworkMovableItem *>(),
176  const std::vector<int> &dest_connector_indexes =
177  std::vector<int>()) = 0;
178  SWIGOUT(%kwargs openNodeMenu;)
179  virtual void openNodeMenu(HOM_Node *node = NULL,
180  const std::vector<HOM_NetworkMovableItem *> &items =
181  std::vector<HOM_NetworkMovableItem *>()) = 0;
182  virtual void openVopEffectsMenu(HOM_VopNode *node, int input_index) = 0;
183  virtual void openVopOutputInfoMenu(HOM_VopNode *node, int output_index) = 0;
184  virtual void openFloatingParameterEditor(HOM_Node *node) = 0;
185 
186  virtual int openNameEditor(HOM_NetworkMovableItem *item,
187  bool select_all = false) = 0;
188  virtual int openCommentEditor(HOM_NetworkMovableItem *item,
189  bool select_all = false) = 0;
190  virtual int openNoteEditor(HOM_StickyNote *stickynote,
191  bool select_all = false) = 0;
192  SWIGOUT(%kwargs closeTextEditor;)
193  virtual void closeTextEditor(int id, bool apply_changes = true) = 0;
194  virtual void runShelfTool(const char *tool_name) = 0;
195 
196  virtual int scheduleTimerEvent(float seconds) = 0;
197  virtual void handleCurrentKeyboardEvent(bool resend = false) = 0;
198  virtual void setVolatileHotkeys(
199  const std::vector<std::string> &hotkey_symbols) = 0;
200  virtual bool isVolatileHotkeyDown(const char *hotkey_symbol) = 0;
201 
202  virtual std::vector<std::vector<std::string> >
203  hotkeyAssignments(const std::vector<std::string> &hotkey_symbols) = 0;
204 
205  virtual void setPref(const char *pref, const char *value) = 0;
206  virtual std::string getPref(const char *pref) = 0;
207  virtual void setPrefs(const std::map<std::string, std::string> &prefs) = 0;
208  virtual std::map<std::string, std::string> getPrefs() = 0;
209  virtual void registerPref(const char *pref, const char *value, bool global) = 0;
210  virtual std::vector<std::vector<std::string> > badges() = 0;
211  virtual std::vector<std::vector<std::string> > textBadges() = 0;
212 
213  virtual std::vector<std::string> nodeShapes() = 0;
214  virtual std::vector<std::string> reloadNodeShapes() = 0;
215  virtual void redraw() = 0;
216 
217  virtual void setDragSourceData(
218  const std::vector<HOM_NetworkMovableItem *> &items) = 0;
219  virtual void setDragSourceWorkItem(int item_id) = 0;
220 
221  SWIGOUT(%ignore pushOpaqueEventContext);
222  virtual bool pushOpaqueEventContext(const char *module, void *data) = 0;
223  virtual void popEventContext() = 0;
224  SWIGOUT(%ignore opaqueEventContextData);
225  virtual void *opaqueEventContextData() = 0;
226 
227  virtual HOM_Vector2 parmScrollPosition() = 0;
228  virtual void setParmScrollPosition( HOM_Vector2 &position ) = 0;
229 
230  virtual void setParmFilterEnabled( bool on ) = 0;
231  virtual bool parmFilterEnabled() = 0;
232 
233  virtual void setParmFilterExactMatch( bool on ) = 0;
234  virtual bool parmFilterExactMatch() = 0;
235 
236  virtual void setParmFilterPattern( const char* filter ) = 0;
237  virtual std::string parmFilterPattern() = 0;
238 
239  virtual void setParmFilterMode( HOM_EnumValue &mode=HOM_parmFilterMode::AllParms) = 0;
240  virtual HOM_EnumValue &parmFilterMode() = 0;
241 
242  virtual void setParmFilterCriteria( HOM_EnumValue &criteria=HOM_parmFilterCriteria::NameOrLabel ) = 0;
243  virtual HOM_EnumValue &parmFilterCriteria() = 0;
244 
245  // Shared Methods by ParameterEditor and NetworkEditor
246  virtual void _scrollToParms( const char *parms ) = 0;
247  virtual void _filterParms( const char* parms) = 0;
248 
249  // These methods are used to properly close & cleanup radial menu
250  virtual void _startModalUI( const char *name ) = 0;
251  virtual void _endModalUI() = 0;
252 
253 #ifdef SWIG
254 %extend
255 {
256  virtual bool pushEventContext(const char *module, InterpreterObject data)
257  { return self->pushOpaqueEventContext(module, data); }
258  virtual InterpreterObject eventContextData()
259  { return HOMincRef((InterpreterObject)self->opaqueEventContextData()); }
260 }
261 #endif
262 };
263 
264 #endif
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
virtual std::vector< HOM_ElemPtr< HOM_NetworkMovableItem > > items(const std::vector< std::string > &item_paths)=0
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
~HOM_NetworkEditor() override
GLenum GLenum GLsizei void * image
Definition: glad.h:5132
std::tuple< Types...> UT_Tuple
Definition: UT_Tuple.h:53
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2539
virtual std::vector< HOM_ElemPtr< HOM_Parm > > parms()=0
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1302
virtual HOM_Node * node(const char *node_path)=0
virtual HOM_NetworkMovableItem * item(const char *item_path)=0
GLuint const GLchar * name
Definition: glcorearb.h:786
GLenum mode
Definition: glcorearb.h:99
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
SIM_API const UT_StringHolder position
Definition: core.h:1131
HOM_NetworkEditor(const HOM_NetworkEditor &pane)
Definition: format.h:895
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297