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 
67  virtual void setLocatingEnabled(bool enabled) = 0;
68  virtual bool locatingEnabled() = 0;
69 
70  virtual float lengthToScreen(float len) = 0;
71  virtual float lengthFromScreen(float len) = 0;
72 
73  virtual HOM_Vector2 sizeToScreen(const HOM_Vector2 &size) = 0;
74  virtual HOM_Vector2 sizeFromScreen(const HOM_Vector2 &size) = 0;
75 
76  virtual HOM_Vector2 posToScreen(const HOM_Vector2 &pos) = 0;
77  virtual HOM_Vector2 posFromScreen(const HOM_Vector2 &pos) = 0;
78 
79  virtual HOM_Vector2 overviewPosToScreen(const HOM_Vector2 &pos) = 0;
80  virtual HOM_Vector2 overviewPosFromScreen(const HOM_Vector2 &pos) = 0;
81  virtual bool overviewVisible() = 0;
82  virtual bool overviewVisibleIfAutomatic() = 0;
83 
84  SWIGOUT(%kwargs networkItemsInBox;)
85  virtual std::vector<UT_Tuple<HOM_ElemPtr<HOM_NetworkItem>,
87  int> >
88  networkItemsInBox(const HOM_Vector2 &pos1, const HOM_Vector2 &pos2,
89  bool for_drop = false, bool for_select = false) = 0;
90  virtual void setDropTargetItem(
91  HOM_NetworkItem *item, const char *name, int index) = 0;
93  dropTargetItem() = 0;
94  virtual void setDecoratedItem(HOM_NetworkItem *item, bool interactive) = 0;
95  SWIGOUT(%newobject decoratedItem;)
96  virtual HOM_NetworkItem *decoratedItem() = 0;
97  virtual bool decorationInteractive() = 0;
98 
99  virtual void setPreSelectedItems(
100  const std::vector<HOM_NetworkItem *> &items) = 0;
101  virtual std::vector<HOM_ElemPtr<HOM_NetworkItem> > preSelectedItems() = 0;
102 
103  virtual void setNetworkBoxPendingRemovals(
104  const std::vector<HOM_NetworkMovableItem *> &items) = 0;
105  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> >
106  networkBoxPendingRemovals() = 0;
107 
108  virtual void setFootprints(
109  const std::vector<HOM_NetworkFootprint> &footprints) = 0;
110  virtual std::vector<HOM_NetworkFootprint> footprints() = 0;
111 
112  virtual void setCursorMap(
113  std::map<std::pair<std::string, int>, std::string> cursors) = 0;
114  virtual std::map<std::pair<std::string, int>, std::string> cursorMap() = 0;
115  virtual void setDefaultCursor(const char *cursor_name) = 0;
116  virtual std::string defaultCursor() = 0;
117 
118  virtual void setBackgroundImages(
119  const std::vector<HOM_NetworkImage> &images) = 0;
120  virtual std::vector<HOM_NetworkImage> backgroundImages() = 0;
121 
122  virtual HOM_BoundingRect itemRect(
123  HOM_NetworkMovableItem *item, bool adjusted=true) = 0;
124  virtual HOM_Vector2 itemInputPos(
125  HOM_NetworkMovableItem *item, int input_index, bool adjusted=true) = 0;
126  virtual HOM_Vector2 itemInputDir(
127  HOM_NetworkMovableItem *item, int input_index) = 0;
128  virtual HOM_Vector2 itemOutputPos(
129  HOM_NetworkMovableItem *item, int output_index, bool adjusted=true) = 0;
130  virtual HOM_Vector2 itemOutputDir(
131  HOM_NetworkMovableItem *item, int output_index) = 0;
132  virtual std::vector<std::pair<HOM_ElemPtr<HOM_NetworkMovableItem>,
133  HOM_BoundingRect> > allVisibleRects(
134  const std::vector<HOM_NetworkMovableItem *> &ignore_items,
135  bool adjusted = true) = 0;
136 
137  SWIGOUT(%kwargs setAdjustments;)
138  virtual void setAdjustments(
139  const std::vector<HOM_NetworkItem *> &items,
140  const std::vector<HOM_NetworkAnimValue> &adjustments,
141  bool auto_remove = false) = 0;
142  virtual void setShapes(
143  const std::vector<HOM_NetworkShape *> &shapes) = 0;
144  virtual void setOverlayShapes(
145  const std::vector<HOM_NetworkShape *> &shapes) = 0;
146 
147  virtual void setTooltip(const char *tooltip) = 0;
148  virtual std::string tooltip() = 0;
149  virtual void setPrompt(const char *prompt) = 0;
150  virtual std::string prompt() = 0;
151  virtual void flashMessage(const char *image,
152  const char *message, float duration) = 0;
153 
154  SWIGOUT(%kwargs openTabMenu;)
155  virtual void openTabMenu(const char *key = NULL,
156  bool auto_place = false,
157  bool branch = false,
158  HOM_NetworkMovableItem *src_item = NULL,
159  int src_connector_index = -1,
160  HOM_NetworkMovableItem *dest_item = NULL,
161  int dest_connector_index = -1,
162  HOM_Vector2 *node_position = NULL,
163  const std::vector<HOM_NetworkMovableItem *> &src_items =
164  std::vector<HOM_NetworkMovableItem *>(),
165  const std::vector<int> &src_connector_indexes =
166  std::vector<int>(),
167  const std::vector<HOM_NetworkMovableItem *> &dest_items =
168  std::vector<HOM_NetworkMovableItem *>(),
169  const std::vector<int> &dest_connector_indexes =
170  std::vector<int>()) = 0;
171  SWIGOUT(%kwargs openNodeMenu;)
172  virtual void openNodeMenu(HOM_Node *node = NULL,
173  const std::vector<HOM_NetworkMovableItem *> &items =
174  std::vector<HOM_NetworkMovableItem *>()) = 0;
175  virtual void openVopEffectsMenu(HOM_VopNode *node, int input_index) = 0;
176  virtual void openVopOutputInfoMenu(HOM_VopNode *node, int output_index) = 0;
177 
178  virtual int openNameEditor(HOM_NetworkMovableItem *item,
179  bool select_all = false) = 0;
180  virtual int openCommentEditor(HOM_NetworkMovableItem *item,
181  bool select_all = false) = 0;
182  virtual int openNoteEditor(HOM_StickyNote *stickynote,
183  bool select_all = false) = 0;
184  SWIGOUT(%kwargs closeTextEditor;)
185  virtual void closeTextEditor(int id, bool apply_changes = true) = 0;
186  virtual void runShelfTool(const char *tool_name) = 0;
187 
188  virtual int scheduleTimerEvent(float seconds) = 0;
189  virtual void handleCurrentKeyboardEvent(bool resend = false) = 0;
190  virtual void setVolatileKeys(const std::vector<std::string> &keys) = 0;
191  virtual bool isVolatileKeyDown(const char *key) = 0;
192 
193  virtual void setPref(const char *pref, const char *value) = 0;
194  virtual std::string getPref(const char *pref) = 0;
195  virtual void setPrefs(const std::map<std::string, std::string> &prefs) = 0;
196  virtual std::map<std::string, std::string> getPrefs() = 0;
197  virtual void registerPref(const char *pref, const char *value, bool global) = 0;
198  virtual std::vector<std::vector<std::string> > badges() = 0;
199  virtual std::vector<std::vector<std::string> > textBadges() = 0;
200 
201  virtual std::vector<std::string> nodeShapes() = 0;
202  virtual std::vector<std::string> reloadNodeShapes() = 0;
203  virtual void redraw() = 0;
204 
205  virtual void setDragSourceData(
206  const std::vector<HOM_NetworkMovableItem *> &items) = 0;
207  virtual void setDragSourceWorkItem(int item_id) = 0;
208 
209  SWIGOUT(%ignore pushOpaqueEventContext);
210  virtual bool pushOpaqueEventContext(const char *module, void *data) = 0;
211  virtual void popEventContext() = 0;
212  SWIGOUT(%ignore opaqueEventContextData);
213  virtual void *opaqueEventContextData() = 0;
214 
215  virtual HOM_Vector2 parmScrollPosition() = 0;
216  virtual void setParmScrollPosition( HOM_Vector2 &position ) = 0;
217 
218  virtual void setParmFilterEnabled( bool on ) = 0;
219  virtual bool parmFilterEnabled() = 0;
220 
221  virtual void setParmFilterExactMatch( bool on ) = 0;
222  virtual bool parmFilterExactMatch() = 0;
223 
224  virtual void setParmFilterPattern( const char* filter ) = 0;
225  virtual std::string parmFilterPattern() = 0;
226 
227  virtual void setParmFilterMode( HOM_EnumValue &mode=HOM_parmFilterMode::AllParms) = 0;
228  virtual HOM_EnumValue &parmFilterMode() = 0;
229 
230  virtual void setParmFilterCriteria( HOM_EnumValue &criteria=HOM_parmFilterCriteria::NameOrLabel ) = 0;
231  virtual HOM_EnumValue &parmFilterCriteria() = 0;
232 
233  // Shared Methods by ParameterEditor and NetworkEditor
234  virtual void _scrollToParms( const char *parms ) = 0;
235  virtual void _filterParms( const char* parms) = 0;
236 
237 #ifdef SWIG
238 %extend
239 {
240  virtual bool pushEventContext(const char *module, InterpreterObject data)
241  { return self->pushOpaqueEventContext(module, data); }
242  virtual InterpreterObject eventContextData()
243  { return HOMincRef((InterpreterObject)self->opaqueEventContextData()); }
244 }
245 #endif
246 };
247 
248 #endif
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2542
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1222
virtual HOM_Vector2 position()=0
virtual std::vector< HOM_ElemPtr< HOM_NetworkMovableItem > > items(const std::vector< std::string > &item_paths)=0
OIIO_API bool rename(string_view from, string_view to, std::string &err)
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
GLenum GLsizei GLenum GLenum const void * image
Definition: glew.h:4973
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:353
~HOM_NetworkEditor() override
std::tuple< Types...> UT_Tuple
Definition: UT_Tuple.h:53
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2538
GLuint const GLchar * name
Definition: glcorearb.h:785
GLsizeiptr size
Definition: glcorearb.h:663
#define HOM_API
Definition: HOM_API.h:13
GLenum GLsizei len
Definition: glew.h:7782
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1221
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
virtual HOM_Node * node(const char *node_path)=0
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1296
virtual HOM_NetworkMovableItem * item(const char *item_path)=0
GLenum mode
Definition: glcorearb.h:98
GLboolean * data
Definition: glcorearb.h:130
virtual std::vector< HOM_ElemPtr< HOM_Parm > > parms()=0
GLuint index
Definition: glcorearb.h:785
GLsizei const GLfloat * value
Definition: glcorearb.h:823
GLfloat seconds
Definition: wglew.h:950
HOM_NetworkEditor(const HOM_NetworkEditor &pane)