HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_SceneViewer.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_SceneViewer_h__
10 #define __HOM_SceneViewer_h__
11 
12 #include "HOM_PathBasedPaneTab.h"
13 #include "HOM_EnumModules.h"
14 #include "HOM_BoundingBox.h"
15 #include "HOM_Vector3.h"
16 #include "HOM_Vector2.h"
17 #include "HOM_Matrix3.h"
18 #include <vector>
19 
21 class HOM_ReferencePlane;
22 class HOM_DopData;
26 class HOM_Selection;
28 
29 SWIGOUT(%rename(SceneViewer) HOM_SceneViewer;)
30 
32 {
33 public:
35  { HOM_CONSTRUCT_OBJECT(this) }
36 
37  // Because the lowermost base classes initialize the virtual bases
38  // before any non-virtual bases, the correct thing to do here is
39  // explicitly call the constructor for HOM_PaneTab.
41  : HOM_PaneTab(pane), HOM_PathBasedPaneTab(pane)
42  { HOM_CONSTRUCT_OBJECT(this) }
43 
44  virtual ~HOM_SceneViewer()
45  { HOM_DESTRUCT_OBJECT(this) }
46 
47  // Let swig know we're overriding __repr__ for this class so it doesn't
48  // provide its own __repr__.
49  SWIGOUT(virtual std::string __repr__() = 0;)
50 
51  // returns a stateViewerType enum, either Scene or SceneGraph.
52  virtual HOM_EnumValue &viewerType() = 0;
53 
54  virtual std::vector<HOM_ElemPtr<HOM_GeometryViewport> > viewports() = 0;
55  SWIGOUT(%newobject findViewport;)
56  virtual HOM_GeometryViewport *findViewport(const char *name) = 0;
57  virtual HOM_GeometryViewport *curViewport() = 0;
58 
59  virtual std::string currentState() = 0;
60  virtual void enterViewState(bool wait_for_exit = false) = 0;
61  virtual void enterCurrentNodeState(bool wait_for_exit = false) = 0;
62  virtual void enterTranslateToolState(bool wait_for_exit = false) = 0;
63  virtual void enterRotateToolState(bool wait_for_exit = false) = 0;
64  virtual void enterScaleToolState(bool wait_for_exit = false) = 0;
65  SWIGOUT(%kwargs setCurrentState;)
66  virtual void setCurrentState(const char *state, bool wait_for_exit = false,
67  const HOM_EnumValue &generate =
68  HOM_stateGenerateMode::Insert,
69  bool request_new_on_generate = false) = 0;
70 
71  virtual std::vector<std::string> _getCurrentStateParmNames() = 0;
72  virtual std::string _evalCurrentStateParm(const char *name) = 0;
73  virtual bool _setCurrentStateParm(const char *name, const char* value) =0;
74  virtual bool _pressCurrentStateButton(const char *name)=0;
75 
76  virtual bool isCreateInContext() = 0;
77 
78  virtual HOM_EnumValue& viewportLayout() = 0;
79  virtual void setViewportLayout(HOM_EnumValue &layout, int single = -1) = 0;
80 
81  SWIGOUT(%kwargs selectObjects;)
82  virtual std::vector<HOM_ElemPtr<HOM_Node> > selectObjects(
83  const char *prompt = "Select objects",
84  int sel_index = 0,
85  bool allow_drag = false,
86  bool quick_select = false,
87  bool use_existing_selection = true,
88  bool allow_multisel = true,
89  const std::vector<std::string> &allowed_types =
90  std::vector<std::string>(1, "*"),
91  const char *icon = NULL,
92  const char *label = NULL,
93  const std::vector<std::string> &prior_selection_paths =
94  std::vector<std::string>(),
95  const std::vector<std::string> &prior_selection_ids =
96  std::vector<std::string>(),
97  const std::vector<HOM_Selection *> &prior_selections =
98  std::vector<HOM_Selection *>(),
99  HOM_ParmTemplateGroup *toolbox_templategroup = nullptr,
100  HOM_ParmTemplateGroup *toolbox1_templategroup = nullptr,
101  bool confirm_existing = false
102  ) = 0;
103 
104  SWIGOUT(%newobject selectGeometry;)
105  SWIGOUT(%kwargs selectGeometry;)
106  virtual HOM_GeometrySelection *selectGeometry(
107  const char *prompt = "Select geometry",
108  int sel_index = 0,
109  bool allow_drag = false,
110  bool quick_select = false,
111  bool use_existing_selection = true,
112  const char *initial_selection = NULL,
113  HOM_EnumValue *initial_selection_type = NULL,
114  bool ordered = false,
115  const std::vector<HOM_EnumValue *> geometry_types =
116  std::vector<HOM_EnumValue *>(),
117  const std::vector<HOM_EnumValue *> primitive_types =
118  std::vector<HOM_EnumValue *>(),
119  bool allow_obj_sel = true,
120  const char *icon = NULL,
121  const char *label = NULL,
122  const std::vector<std::string> &prior_selection_paths =
123  std::vector<std::string>(),
124  const std::vector<std::string> &prior_selection_ids =
125  std::vector<std::string>(),
126  const std::vector<HOM_Selection *> &prior_selections =
127  std::vector<HOM_Selection *>(),
128  bool allow_other_sops = true,
129  bool consume_selections = true,
130  HOM_ParmTemplateGroup *toolbox_templategroup = nullptr,
131  HOM_ParmTemplateGroup *toolbox1_templategroup = nullptr,
132  bool confirm_existing = false,
133  bool pick_at_obj_level = false
134  ) = 0;
135 
136  SWIGOUT(%kwargs selectDynamics;)
137  virtual std::vector<HOM_ElemPtr<HOM_DopData> > selectDynamics(
138  const char *prompt = "Select dynamics objects",
139  int sel_index = 0,
140  bool allow_objects = true,
141  bool allow_modifiers = false,
142  bool quick_select = false,
143  bool use_existing_selection = true,
144  bool allow_multisel = true,
145  const char *icon = NULL,
146  const char *label = NULL,
147  const std::vector<std::string> &prior_selection_paths =
148  std::vector<std::string>(),
149  const std::vector<std::string> &prior_selection_ids =
150  std::vector<std::string>(),
151  const std::vector<HOM_Selection *> &prior_selections =
152  std::vector<HOM_Selection *>(),
153  HOM_ParmTemplateGroup *toolbox_templategroup = nullptr,
154  HOM_ParmTemplateGroup *toolbox1_templategroup = nullptr
155  ) = 0;
156 
157  SWIGOUT(%kwargs selectDynamicsPoints;)
158  virtual std::vector<std::pair<HOM_ElemPtr<HOM_DopData>, HOM_ElemPtr<HOM_GeometrySelection> > > selectDynamicsPoints(
159  const char *prompt = "Select dynamics points",
160  int sel_index = 0,
161  bool quick_select = false,
162  bool use_existing_selection = true,
163  bool allow_multisel = true,
164  bool only_select_points = true,
165  bool object_based_point_selection = false,
166  bool use_last_selected_object = false,
167  const char *icon = NULL,
168  const char *label = NULL,
169  const std::vector<std::string> &prior_selection_paths =
170  std::vector<std::string>(),
171  const std::vector<std::string> &prior_selection_ids =
172  std::vector<std::string>(),
173  const std::vector<HOM_Selection *> &prior_selections =
174  std::vector<HOM_Selection *>(),
175  HOM_ParmTemplateGroup *toolbox_templategroup = nullptr,
176  HOM_ParmTemplateGroup *toolbox1_templategroup = nullptr
177  )= 0;
178 
179  SWIGOUT(%kwargs selectDynamicsPolygons;)
180  virtual std::vector<std::pair<HOM_ElemPtr<HOM_DopData>, HOM_ElemPtr<HOM_GeometrySelection> > > selectDynamicsPolygons(
181  const char *prompt = "Select dynamics polygons",
182  int sel_index = 0,
183  bool quick_select = false,
184  bool use_existing_selection = true,
185  bool object_based_point_selection = false,
186  bool use_last_selected_object = false,
187  const char *icon = NULL,
188  const char *label = NULL,
189  const std::vector<std::string> &prior_selection_paths =
190  std::vector<std::string>(),
191  const std::vector<std::string> &prior_selection_ids =
192  std::vector<std::string>(),
193  const std::vector<HOM_Selection *> &prior_selections =
194  std::vector<HOM_Selection *>(),
195  HOM_ParmTemplateGroup *toolbox_templategroup = nullptr,
196  HOM_ParmTemplateGroup *toolbox1_templategroup = nullptr
197  ) = 0;
198 
199  SWIGOUT(%kwargs selectSceneGraph;)
200  virtual std::vector<std::string> selectSceneGraph(
201  const char *prompt = "Select scene graph items",
202  const std::vector<std::string> &preselection =
203  std::vector<std::string>(),
204  const HOM_EnumValue &prim_mask= HOM_scenePrimMask::ViewerSetting,
205  bool quick_select = false,
206  bool use_existing_selection = true,
207  bool confirm_existing = false,
208  bool allow_multisel = true,
209  bool allow_drag = true,
210  const char *path_prefix_mask = nullptr,
211  const char *prim_kind = nullptr) = 0;
212 
213 
214  SWIGOUT(%newobject selectPositions;)
215  SWIGOUT(%kwargs selectPositions;)
216  virtual std::vector<HOM_ElemPtr<HOM_Vector3> > selectPositions(
217  const char *prompt = "Click to specify a position",
218  int number_of_positions = 1,
219  bool connect_positions = true,
220  bool show_coordinates = true,
221  const HOM_BoundingBox &bbox = HOM_BoundingBox(),
222  HOM_EnumValue &position_type = HOM_positionType::WorldSpace,
223  const char *icon = NULL,
224  const char *label = NULL,
225  HOM_ParmTemplateGroup *toolbox_templategroup = nullptr,
226  HOM_ParmTemplateGroup *toolbox1_templategroup = nullptr
227  ) = 0;
228 
229  SWIGOUT(%kwargs selectOrientedPositions;)
230  virtual std::vector<std::pair<HOM_ElemPtr<HOM_Vector3>, HOM_ElemPtr<HOM_Matrix3> > > selectOrientedPositions(
231  const char *prompt = "Click to specify a position",
232  int number_of_positions = 1,
233  bool connect_positions = true,
234  bool show_coordinates = true,
235  const HOM_Matrix3 &base_orientation = HOM_Matrix3(1.0),
236  const HOM_BoundingBox &bbox = HOM_BoundingBox(),
237  const char *icon = NULL,
238  const char *label = NULL,
239  HOM_ParmTemplateGroup *toolbox_templategroup = nullptr,
240  HOM_ParmTemplateGroup *toolbox1_templategroup = nullptr
241  ) = 0;
242 
243  SWIGOUT(%newobject currentGeometrySelection;)
244  virtual HOM_GeometrySelection *currentGeometrySelection() = 0;
245 
246  virtual void setCurrentGeometrySelection(
247  HOM_EnumValue &geometry_type,
248  const std::vector<HOM_Node *> &nodes,
249  const std::vector<HOM_Selection *> &selections) = 0;
250 
251  virtual std::vector<std::string> currentSceneGraphSelection() = 0;
252  virtual void setCurrentSceneGraphSelection(
253  const std::vector<std::string> &selection) = 0;
254 
255  // Snapping control
256  virtual HOM_EnumValue &snappingMode() = 0;
257  virtual void setSnappingMode(HOM_EnumValue &snapping_mode) = 0;
258 
259  virtual bool isSnappingToTemplates() = 0;
260  virtual void setSnapToTemplates(bool on) = 0;
261 
262  virtual bool isSnappingToOtherObjects() = 0;
263  virtual void setSnapToOtherObjects(bool on) = 0;
264 
265  virtual bool isDepthSnapping() = 0;
266  virtual void setDepthSnapping(bool on) = 0;
267 
268  virtual bool isOrientingOnSnap() = 0;
269  virtual void setOrientOnSnap(bool on) = 0;
270 
271  // Selection control
272  virtual bool isPickingVisibleGeometry() = 0;
273  virtual void setPickingVisibleGeometry(bool on) = 0;
274 
275  virtual bool isPickingContainedGeometry() = 0;
276  virtual void setPickingContainedGeometry(bool on) = 0;
277 
278  virtual bool isGroupPicking() = 0;
279  virtual void setGroupPicking(bool on) = 0;
280 
281  virtual bool isWholeGeometryPicking() = 0;
282  virtual void setWholeGeometryPicking(bool on) = 0;
283 
284  virtual bool isSecureSelection() = 0;
285  virtual void setSecureSelection(bool on) = 0;
286 
287  virtual bool isPickingCurrentNode() = 0;
288  virtual void setPickingCurrentNode(bool on) = 0;
289 
290  virtual HOM_EnumValue &pickGeometryType() = 0;
291  virtual void setPickGeometryType(HOM_EnumValue &geometry_type) = 0;
292 
293  virtual HOM_EnumValue &selectionMode() = 0;
294  virtual void setSelectionMode(HOM_EnumValue &style) = 0;
295 
296  virtual HOM_EnumValue &pickStyle() = 0;
297  virtual void setPickStyle(HOM_EnumValue &style) = 0;
298 
299  virtual HOM_EnumValue &pickModifier() = 0;
300  virtual void setPickModifier(HOM_EnumValue &modifier) = 0;
301 
302  virtual HOM_EnumValue &defaultPickModifier() = 0;
303  virtual void setDefaultPickModifier(HOM_EnumValue &modifier) = 0;
304 
305  virtual HOM_EnumValue &pickFacing() = 0;
306  virtual void setPickFacing(HOM_EnumValue &facing) = 0;
307 
308  // Group list control
309  virtual bool isGroupListVisible() = 0;
310  virtual void setGroupListVisible(bool on) = 0;
311 
312  virtual bool isGroupListColoringGeometry() = 0;
313  virtual void setGroupListColoringGeometry(bool on) = 0;
314 
315  virtual bool isGroupListShowingEmptyGroups() = 0;
316  virtual void setGroupListShowingEmptyGroups(bool on) = 0;
317 
318  virtual bool isGroupListShowingOnlyPreSelectedGroups() = 0;
319  virtual void setGroupListShowingOnlyPreSelectedGroups(bool on) = 0;
320 
321  virtual bool isGroupListCondensingPathHierarchies() = 0;
322  virtual void setGroupListCondensingPathHierarchies(bool on) = 0;
323 
324  virtual HOM_Vector2 *groupListSize() = 0;
325  virtual void setGroupListSize(double width, double height) = 0;
326 
327  virtual HOM_EnumValue &groupListType() = 0;
328  virtual void setGroupListType(HOM_EnumValue &group_list_type) = 0;
329 
330  virtual std::string groupListMask() = 0;
331  virtual void setGroupListMask(const char *mask) = 0;
332 
333  // Construction plane access
334  SWIGOUT(%newobject constructionPlane;)
335  virtual HOM_ConstructionPlane *constructionPlane() = 0;
336 
337  // Reference plane access
338  SWIGOUT(%newobject referencePlane;)
339  virtual HOM_ReferencePlane *referencePlane() = 0;
340 
341  SWIGOUT(%newobject flipbookSettings;)
342  virtual HOM_FlipbookSettings *flipbookSettings() = 0;
343 
344  SWIGOUT(%kwargs flipbook;)
345  virtual void flipbook(HOM_GeometryViewport *viewport = NULL,
346  HOM_FlipbookSettings *settings = NULL,
347  bool open_dialog = false) = 0;
348 
349  virtual void runShelfTool(const char *tool_name) = 0;
350 
351  virtual void displayRadialMenu(const std::string &name) = 0;
352 
353  virtual void beginStateUndo(const char *label) = 0;
354  virtual void endStateUndo() = 0;
355 
356  virtual void setPromptMessage(
357  std::string const & msg,
358  HOM_EnumValue const & msg_type = HOM_promptMessageType::Prompt) = 0;
359  virtual void clearPromptMessage() = 0;
360 
361  virtual void showHandle( std::string const& name, bool value ) = 0;
362  // Scene graph-specific
363 #ifdef SWIG
364 %extend
365 {
366  SWIGOUT(%kwargs stage;)
367  InterpreterObject stage()
368  { return HOMincRef((InterpreterObject)self->opaqueStage()); }
369 }
370 #endif
371  SWIGOUT(%ignore opaqueStage;)
372  virtual void *opaqueStage() = 0;
373 
374  virtual int stageSerial() = 0;
375 
376  virtual void setShowGeometry(bool show) = 0;
377  virtual bool showGeometry() = 0;
378  virtual void setShowCameras(bool show) = 0;
379  virtual bool showCameras() = 0;
380  virtual void setShowLights(bool show) = 0;
381  virtual bool showLights() = 0;
382  virtual void setShowSelection(bool show) = 0;
383  virtual bool showSelection() = 0;
384  virtual void setDenoise(bool show) = 0;
385  virtual bool denoise() = 0;
386 
387  virtual std::vector<std::string> hydraRenderers() = 0;
388  virtual void setHydraRenderer(const std::string &ren_name) = 0;
389  virtual std::string currentHydraRenderer() = 0;
390 };
391 
392 #endif
GT_API const UT_StringHolder selection
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1053
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
GLint GLuint mask
Definition: glcorearb.h:123
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:344
GLint GLsizei width
Definition: glcorearb.h:102
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1052
GLuint const GLchar * name
Definition: glcorearb.h:785
HOM_SceneViewer(const HOM_SceneViewer &pane)
GLint GLsizei GLsizei height
Definition: glcorearb.h:102
GLsizei const GLfloat * value
Definition: glcorearb.h:823
virtual ~HOM_SceneViewer()