9 #ifndef __HOM_SceneViewer_h__
10 #define __HOM_SceneViewer_h__
42 typedef std::vector< std::pair<std::string, std::string> >
Bindings;
65 virtual std::vector<HOM_ElemPtr<HOM_GeometryViewport> > viewports() = 0;
66 SWIGOUT(%newobject findViewport;)
68 SWIGOUT(%newobject curViewport;)
72 virtual std::string currentState() = 0;
73 virtual void enterViewState(
bool wait_for_exit =
false) = 0;
74 virtual void enterCurrentNodeState(
bool wait_for_exit =
false) = 0;
75 virtual void enterTranslateToolState(
bool wait_for_exit =
false) = 0;
76 virtual void enterRotateToolState(
bool wait_for_exit =
false) = 0;
77 virtual void enterScaleToolState(
bool wait_for_exit =
false) = 0;
78 SWIGOUT(%kwargs setCurrentState;)
79 virtual void setCurrentState(
const char *
state,
bool wait_for_exit =
false,
81 HOM_stateGenerateMode::Insert,
82 bool request_new_on_generate =
false,
83 bool ex_situ_generate =
false) = 0;
84 virtual void _waitForStateExit(
const char *
state=NULL) = 0;
85 virtual std::string _currentBaseState() = 0;
87 virtual std::vector<std::string> _getCurrentStateParmNames() = 0;
88 virtual std::string _evalCurrentStateParm(
const char *
name) = 0;
89 virtual bool _setCurrentStateParm(
const char *
name,
const char*
value) =0;
90 virtual bool _pressCurrentStateButton(
const char *
name)=0;
92 virtual bool isCreateInContext() = 0;
93 virtual bool isWorldSpaceLocal() = 0;
96 virtual void setViewportLayout(
HOM_EnumValue &layout,
int single = -1) = 0;
101 const char *prompt =
"Select objects",
103 bool allow_drag =
false,
104 bool quick_select =
false,
105 bool use_existing_selection =
true,
106 bool allow_multisel =
true,
107 const std::vector<std::string> &allowed_types =
108 std::vector<std::string>(1,
"*"),
109 const char *
icon = NULL,
110 const char *
label = NULL,
111 const std::vector<std::string> &prior_selection_paths =
112 std::vector<std::string>(),
113 const std::vector<std::string> &prior_selection_ids =
114 std::vector<std::string>(),
115 const std::vector<HOM_Selection *> &prior_selections =
116 std::vector<HOM_Selection *>(),
119 bool confirm_existing =
false,
120 const char *select_parm =
nullptr
123 SWIGOUT(%newobject selectGeometry;)
124 SWIGOUT(%kwargs selectGeometry;)
127 const char *prompt =
"Select geometry",
129 bool allow_drag =
false,
130 bool quick_select =
false,
131 bool use_existing_selection =
true,
132 const char *initial_selection = NULL,
134 bool ordered =
false,
135 const std::vector<HOM_EnumValue *> geometry_types =
136 std::vector<HOM_EnumValue *>(),
137 const std::vector<HOM_EnumValue *> primitive_types =
138 std::vector<HOM_EnumValue *>(),
139 bool allow_obj_sel =
true,
140 const char *
icon = NULL,
141 const char *
label = NULL,
142 const std::vector<std::string> &prior_selection_paths =
143 std::vector<std::string>(),
144 const std::vector<std::string> &prior_selection_ids =
145 std::vector<std::string>(),
146 const std::vector<HOM_Selection *> &prior_selections =
147 std::vector<HOM_Selection *>(),
148 bool allow_other_sops =
true,
149 bool consume_selections =
true,
152 bool confirm_existing =
false,
153 bool pick_at_obj_level =
false,
154 const char *select_parm =
nullptr
157 SWIGOUT(%kwargs selectDynamics;)
160 const char *prompt =
"Select dynamics objects",
162 bool allow_objects =
true,
163 bool allow_modifiers =
false,
164 bool quick_select =
false,
165 bool use_existing_selection =
true,
166 bool allow_multisel =
true,
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 *>(),
177 const char *select_parm =
nullptr
180 SWIGOUT(%kwargs selectDynamicsPoints;)
183 selectDynamicsPoints(
184 const char *prompt =
"Select dynamics points",
186 bool quick_select =
false,
187 bool use_existing_selection =
true,
188 bool allow_multisel =
true,
189 bool only_select_points =
true,
190 bool object_based_point_selection =
false,
191 bool use_last_selected_object =
false,
192 const char *
icon = NULL,
193 const char *
label = NULL,
194 const std::vector<std::string> &prior_selection_paths =
195 std::vector<std::string>(),
196 const std::vector<std::string> &prior_selection_ids =
197 std::vector<std::string>(),
198 const std::vector<HOM_Selection *> &prior_selections =
199 std::vector<HOM_Selection *>(),
202 const char *select_parm =
nullptr
205 SWIGOUT(%kwargs selectDynamicsPolygons;)
208 selectDynamicsPolygons(
209 const char *prompt =
"Select dynamics polygons",
211 bool quick_select =
false,
212 bool use_existing_selection =
true,
213 bool object_based_point_selection =
false,
214 bool use_last_selected_object =
false,
215 const char *
icon = NULL,
216 const char *
label = NULL,
217 const std::vector<std::string> &prior_selection_paths =
218 std::vector<std::string>(),
219 const std::vector<std::string> &prior_selection_ids =
220 std::vector<std::string>(),
221 const std::vector<HOM_Selection *> &prior_selections =
222 std::vector<HOM_Selection *>(),
225 const char *select_parm =
nullptr
228 SWIGOUT(%kwargs selectSceneGraph;)
229 virtual std::vector<std::string>
231 const char *prompt =
"Select primitives",
232 const std::vector<std::string> &preselection =
233 std::vector<std::string>(),
234 const HOM_EnumValue &prim_mask= HOM_scenePrimMask::ViewerSetting,
235 bool quick_select =
false,
236 bool use_existing_selection =
true,
237 bool confirm_existing =
false,
238 bool allow_multisel =
true,
239 bool allow_drag =
true,
240 bool allow_selection_type_changes =
false,
241 bool propagate_selection =
true,
242 const char *path_prefix_mask =
nullptr,
243 const char *prim_kind =
nullptr,
244 HOM_Node *validate_selection_for_node =
nullptr,
245 const char *select_parm =
nullptr,
247 HOM_optionalBool::NoOpinion,
249 HOM_optionalBool::NoOpinion,
250 bool fix_preselection_paths =
true
253 SWIGOUT(%kwargs selectSceneGraphInstances;)
254 virtual std::vector<std::string>
255 selectSceneGraphInstances(
256 const char *prompt =
"Select point instances",
257 const std::vector<std::string> &preselection =
258 std::vector<std::string>(),
259 bool quick_select =
false,
260 bool use_existing_selection =
true,
261 bool confirm_existing =
false,
262 bool allow_multisel =
true,
263 bool allow_drag =
true,
264 bool allow_selection_type_changes =
false,
265 const char *path_prefix_mask =
nullptr,
266 int instance_level = 0,
267 bool instance_indices_only =
false,
268 HOM_Node *validate_selection_for_node =
nullptr,
269 const char *select_parm =
nullptr
273 SWIGOUT(%newobject selectPositions;)
274 SWIGOUT(%kwargs selectPositions;)
277 const char *prompt =
"Click to specify a position",
278 int number_of_positions = 1,
279 int min_number_of_positions = -1,
280 bool connect_positions =
true,
281 bool show_coordinates =
true,
284 const char *
icon = NULL,
285 const char *
label = NULL,
288 const char *select_parm =
nullptr
291 SWIGOUT(%kwargs selectOrientedPositions;)
294 selectOrientedPositions(
295 const char *prompt =
"Click to specify a position",
296 int number_of_positions = 1,
297 int min_number_of_positions = -1,
298 bool connect_positions =
true,
299 bool show_coordinates =
true,
302 const char *
icon = NULL,
303 const char *
label = NULL,
306 const char *select_parm =
nullptr
310 SWIGOUT(%kwargs _selectDrawableGeometry;)
311 virtual void _selectDrawableGeometry(
void* drawable_selection,
HOM_EnumValue & selection_modifier) = 0;
315 SWIGOUT(%kwargs selectDrawableGeometry;)
316 virtual void selectDrawableGeometry(InterpreterObject drawable_selection,
317 HOM_EnumValue & selection_modifier=HOM_pickModifier::Replace)
319 self->_selectDrawableGeometry(drawable_selection, selection_modifier);
325 SWIGOUT(%newobject currentGeometrySelection;)
327 virtual std::string currentGeometrySelectionParm() =0;
329 virtual void setCurrentGeometrySelection(
331 const std::vector<HOM_Node *> &nodes,
332 const std::vector<HOM_Selection *> &selections) = 0;
334 virtual std::vector<std::string> currentSceneGraphSelection() = 0;
335 virtual void setCurrentSceneGraphSelection(
336 const std::vector<std::string> &
selection,
337 bool fix_selection_paths =
true) = 0;
339 virtual std::vector<std::string> sceneGraphHighlight() = 0;
340 virtual void setSceneGraphHighlight(
const std::vector<std::string> &highlight) = 0;
345 HOM_scenePrimMask::ViewerSetting) = 0;
347 virtual bool sceneGraphStageLocked() = 0;
348 virtual void setSceneGraphStageLocked(
bool locked) = 0;
352 virtual void setSnappingMode(
HOM_EnumValue &snapping_mode) = 0;
354 virtual bool isSnappingToCurrentGeometry() = 0;
355 virtual void setSnapToCurrentGeometry(
bool on) = 0;
357 virtual bool isSnappingToTemplates() = 0;
358 virtual void setSnapToTemplates(
bool on) = 0;
360 virtual bool isSnappingToOtherObjects() = 0;
361 virtual void setSnapToOtherObjects(
bool on) = 0;
363 virtual bool isSnappingToGuides() = 0;
364 virtual void setSnapToGuides(
bool on) = 0;
366 virtual bool isSnappingToDrawables() = 0;
367 virtual void setSnapToDrawables(
bool on) = 0;
369 virtual bool isDepthSnapping() = 0;
370 virtual void setDepthSnapping(
bool on) = 0;
372 virtual bool isOrientingOnSnap() = 0;
373 virtual void setOrientOnSnap(
bool on) = 0;
375 virtual float snappingGravity() = 0;
376 virtual std::vector<HOM_EnumValue*> snappingPriorities() = 0;
379 virtual bool isPickingVisibleGeometry() = 0;
380 virtual void setPickingVisibleGeometry(
bool on) = 0;
382 virtual bool isPickingContainedGeometry() = 0;
383 virtual void setPickingContainedGeometry(
bool on) = 0;
385 virtual bool isGroupPicking() = 0;
386 virtual void setGroupPicking(
bool on) = 0;
388 virtual bool isWholeGeometryPicking() = 0;
389 virtual void setWholeGeometryPicking(
bool on) = 0;
391 virtual bool isSecureSelection() = 0;
392 virtual void setSecureSelection(
bool on) = 0;
394 virtual bool isPickingCurrentNode() = 0;
395 virtual void setPickingCurrentNode(
bool on) = 0;
398 virtual void setPickGeometryType(
HOM_EnumValue &geometry_type) = 0;
410 virtual void setDefaultPickModifier(
HOM_EnumValue &modifier) = 0;
418 virtual bool isGroupListVisible() = 0;
419 virtual void setGroupListVisible(
bool on) = 0;
421 virtual bool isGroupListColoringGeometry() = 0;
422 virtual void setGroupListColoringGeometry(
bool on) = 0;
424 virtual bool isGroupListShowingEmptyGroups() = 0;
425 virtual void setGroupListShowingEmptyGroups(
bool on) = 0;
427 virtual bool isGroupListShowingOnlyPreSelectedGroups() = 0;
428 virtual void setGroupListShowingOnlyPreSelectedGroups(
bool on) = 0;
430 virtual bool isGroupListCondensingPathHierarchies() = 0;
431 virtual void setGroupListCondensingPathHierarchies(
bool on) = 0;
434 virtual void setGroupListSize(
double width,
double height) = 0;
437 virtual void setGroupListType(
HOM_EnumValue &group_list_type) = 0;
439 virtual std::string groupListMask() = 0;
440 virtual void setGroupListMask(
const char *
mask) = 0;
443 SWIGOUT(%newobject constructionPlane;)
447 SWIGOUT(%newobject referencePlane;)
450 SWIGOUT(%newobject flipbookSettings;)
456 bool open_dialog =
false) = 0;
458 virtual void runShelfTool(
const char *tool_name) = 0;
460 virtual void beginStateUndo(
const char *
label) = 0;
461 virtual void endStateUndo() = 0;
463 virtual void setPromptMessage(
464 std::string
const & msg,
465 HOM_EnumValue const & msg_type = HOM_promptMessageType::Prompt) = 0;
466 virtual void clearPromptMessage() = 0;
469 virtual void flashMessage(
470 std::string
const &
image,
471 std::string
const &msg,
472 float duration = 1.0,
475 virtual std::vector<std::vector<std::string> >
476 hotkeyAssignments(
const std::vector<std::string> &hotkey_symbols) = 0;
478 virtual void showHandle( std::string
const&
name,
bool value ) = 0;
482 virtual void openOptionDialog(
const char *
path,
const char *
label) = 0;
484 SWIGOUT(%kwargs triggerStateSelector;)
485 virtual void triggerStateSelector(
487 std::string
const &
name=std::string()) = 0;
488 virtual std::string currentStateSelector() = 0;
491 SWIGOUT(%kwargs _runStateCommand;)
492 virtual void _runStateCommand(std::string
const &
name,
void*
args=
nullptr) = 0;
494 virtual void showCurrentSopGeometry(
bool value) = 0;
495 virtual bool isShowingCurrentSopGeometry()
const = 0;
497 virtual bool toggleStateDialogWindow() = 0;
499 virtual void showOperationBar(
bool on) = 0 ;
500 virtual bool isShowingOperationBar() = 0 ;
502 virtual void showColorCorrectionBar(
bool on) = 0 ;
503 virtual bool isShowingColorCorrectionBar() = 0 ;
505 virtual void showMemoryBar(
bool on) = 0 ;
506 virtual bool isShowingMemoryBar() = 0 ;
508 virtual void showDisplayOptionsBar(
bool on) = 0 ;
509 virtual bool isShowingDisplayOptionsBar() = 0 ;
511 virtual void showSelectionBar(
bool on) = 0 ;
512 virtual bool isShowingSelectionBar() = 0 ;
514 virtual void setIncludeColorCorrectionBar(
bool on) = 0 ;
515 virtual bool includeColorCorrectionBar() = 0 ;
517 virtual void setIncludeMemoryBar(
bool on) = 0 ;
518 virtual bool includeMemoryBar() = 0 ;
520 virtual void setGeometryVisibility(
HOM_OpNode &
op,
bool on ) = 0;
523 virtual bool usingOCIO() = 0;
524 virtual void setUsingOCIO(
bool enable) = 0;
526 SWIGOUT(%kwargs setOCIODisplayView;)
527 virtual void setOCIODisplayView(
const char *display =
nullptr,
528 const char *view =
nullptr) = 0;
529 virtual std::string getOCIODisplay() = 0;
530 virtual std::string getOCIOView() = 0;
532 virtual std::vector<int> geometry() = 0;
534 SWIGOUT(%newobject createFloatingViewport;)
536 std::vector<int> pos)=0;
541 SWIGOUT(%kwargs runStateCommand;)
542 virtual void runStateCommand(std::string
const &
name, InterpreterObject
args=
nullptr)
544 self->_runStateCommand(name,
args);
550 virtual bool isViewingSceneGraph() = 0;
555 InterpreterObject stage()
556 {
return HOMincRef((InterpreterObject)self->opaqueStage()); }
560 virtual void *opaqueStage() = 0;
561 virtual int stageSerial() = 0;
562 virtual void setShowGeometry(
bool show) = 0;
563 virtual bool showGeometry() = 0;
564 virtual void setShowCameras(
bool show) = 0;
565 virtual bool showCameras() = 0;
566 virtual void setShowLights(
bool show) = 0;
567 virtual bool showLights() = 0;
568 virtual void setShowSelection(
bool show) = 0;
569 virtual bool showSelection() = 0;
570 virtual void setShowRenderTime(
bool show) = 0;
571 virtual bool showRenderTime() = 0;
572 virtual void setShowRenderStats(
bool show) = 0;
573 virtual bool showRenderStats() = 0;
575 virtual void setSelectionKind(
const char *kind) = 0;
576 virtual void setSelectionPointInstances(
bool topmost) = 0;
577 virtual std::string selectionKind() = 0;
578 virtual bool isSelectingPointInstances() = 0;
579 virtual bool isSelectingTopmostInstance() = 0;
580 virtual void setSelectionAllowKindMismatch(
bool allow) = 0;
581 virtual bool selectionAllowKindMismatch() = 0;
582 virtual void setSelectionAllowInstanceProxies(
bool allow) = 0;
583 virtual bool selectionAllowInstanceProxies() = 0;
584 virtual void setSelectionAllowHiddenPrims(
bool allow) = 0;
585 virtual bool selectionAllowHiddenPrims() = 0;
587 virtual void setStageControlsPlaybar(
bool controls_playbar) = 0;
588 virtual bool stageControlsPlaybar() = 0;
590 virtual std::vector<std::string> hydraRenderers() = 0;
591 virtual void setHydraRenderer(
const std::string &ren_name) = 0;
592 virtual std::string currentHydraRenderer() = 0;
593 virtual bool isRendererPaused() = 0;
594 virtual void setRendererPaused(
bool paused) = 0;
595 virtual void restartRenderer() = 0;
596 virtual void resetViewportCamera() = 0;
598 SWIGOUT(%kwargs showProxyPurpose;)
599 virtual void showProxyPurpose(
bool enable,
600 const char *renderer =
nullptr) = 0;
601 SWIGOUT(%kwargs showGuidePurpose;)
602 virtual void showGuidePurpose(
bool enable,
603 const char *renderer =
nullptr) = 0;
604 SWIGOUT(%kwargs showRenderPurpose;)
605 virtual void showRenderPurpose(
bool enable,
606 const char *renderer =
nullptr) = 0;
607 SWIGOUT(%kwargs useViewportOverrides;)
608 virtual void useViewportOverrides(
bool enable,
609 const char *renderer =
nullptr) = 0;
610 SWIGOUT(%kwargs useViewportLoadMasks;)
611 virtual void useViewportLoadMasks(
bool enable,
612 const char *renderer =
nullptr) = 0;
613 SWIGOUT(%kwargs usePostLayers;)
614 virtual void usePostLayers(
bool enable,
615 const char *renderer =
nullptr) = 0;
616 SWIGOUT(%kwargs showMaterials;)
617 virtual void showMaterials(
bool enable,
618 const char *renderer =
nullptr) = 0;
619 SWIGOUT(%kwargs showHydraProcedurals;)
620 virtual void showHydraProcedurals(
bool enable,
621 const char *renderer =
nullptr) = 0;
622 SWIGOUT(%kwargs showingProxyPurpose;)
623 virtual bool showingProxyPurpose(
const char *renderer =
nullptr) = 0;
624 SWIGOUT(%kwargs showingGuidePurpose;)
625 virtual bool showingGuidePurpose(
const char *renderer =
nullptr) = 0;
626 SWIGOUT(%kwargs showingRenderPurpose;)
627 virtual bool showingRenderPurpose(
const char *renderer =
nullptr) = 0;
628 SWIGOUT(%kwargs usingViewportOverrides;)
629 virtual bool usingViewportOverrides(
const char *renderer =
nullptr) = 0;
630 SWIGOUT(%kwargs usingViewportLoadMasks;)
631 virtual bool usingViewportLoadMasks(
const char *renderer =
nullptr) = 0;
632 SWIGOUT(%kwargs usingPostLayers;)
633 virtual bool usingPostLayers(
const char *renderer =
nullptr) = 0;
634 SWIGOUT(%kwargs showingMaterials;)
635 virtual bool showingMaterials(
const char *renderer =
nullptr) = 0;
636 SWIGOUT(%kwargs showingHydraProcedurals;)
637 virtual bool showingHydraProcedurals(
const char *renderer =
nullptr) = 0;
640 virtual void addOpaqueEventCallback(
void *callback) = 0;
642 virtual void removeOpaqueEventCallback(
void *callback) = 0;
644 virtual std::vector<void *> opaqueEventCallbacks() = 0;
646 virtual void clearOpaqueEventCallbacks() = 0;
648 virtual void setExtraCameras(
const std::vector<std::string> &cam_names) = 0;
649 virtual std::vector<std::string> extraCameras() = 0;
651 static void pinCamera(
const std::string &cam_name,
bool pin)
652 { pinCameraFunc(cam_name, pin); }
661 void addEventCallback(InterpreterObject callback)
663 self->addOpaqueEventCallback(callback);
666 void removeEventCallback(InterpreterObject callback)
668 self->removeOpaqueEventCallback(callback);
671 void clearEventCallbacks()
673 self->clearOpaqueEventCallbacks();
676 std::vector<InterpreterObject> eventCallbacks()
678 std::vector<void *> opaque_callbacks(self->opaqueEventCallbacks());
680 std::vector<InterpreterObject> callbacks;
681 for (
int i = 0; i< opaque_callbacks.size(); ++i)
682 callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
691 InterpreterObject qtWindow()
693 return (InterpreterObject)
self->opaqueQtWindow();
699 virtual void *opaqueQtWindow() = 0;
706 void _hudInfo(
int show=-1,
bool terminate=
false,
int update_texture=0,
708 InterpreterObject hud_template=
nullptr,
709 InterpreterObject hud_values=
nullptr,
711 bool update_hotkey_bindings=
false)
713 self->hudInfoInternal(hud_state, show, terminate, update_texture,
714 hud_template, hud_values, hud_panel,
715 update_hotkey_bindings);
720 virtual void hudInfoInternal(
const HOM_EnumValue &hud_state,
int show,
721 bool terminate,
int update_texture,
722 void* hud_template,
void* hud_values,
724 bool update_hotkey_bindings) = 0;
726 SWIGOUT(%kwargs bindViewerHandle;)
727 virtual void bindViewerHandle(
728 std::string
const& handle_type,
729 std::string
const& handle_instance_name,
730 std::string
const& settings=std::string(),
731 bool cache_previous_parms =
false,
732 HandleParmNames
const& handle_parms = HandleParmNames()) = 0;
734 SWIGOUT(%kwargs bindViewerHandleStatic;)
735 virtual void bindViewerHandleStatic(
736 std::string
const& handle_type,
737 std::string
const& handle_instance_name,
738 Bindings
const & bindings,
739 std::string
const& settings=std::string() ) = 0;
741 virtual void unbindViewerHandle(std::string
const& handle_instance_name) = 0;
743 virtual std::string fullName() = 0;
745 virtual void _setSlapComp(
HOM_Node *node) = 0;
747 virtual void _updateApexAnimateSceneIndex(
748 const std::string &scene_prim_path,
749 const std::map<std::string, HOM_Geometry *> &graph_outputs) = 0;
GT_API const UT_StringHolder selection
#define HOM_DESTRUCT_OBJECT(pointer)
GLuint GLsizei const GLchar * label
GLsizei const GLfloat * value
GLsizei const GLchar *const * path
string __repr__(VtArray< T > const &self)
GLenum GLenum GLsizei void * image
std::tuple< Types...> UT_Tuple
GLint GLsizei GLsizei height
void ignore(T const &) VULKAN_HPP_NOEXCEPT
#define HOM_CONSTRUCT_OBJECT(pointer)
virtual std::string icon()=0
GLuint const GLchar * name
std::vector< std::string > HandleParmNames
HOM_SceneViewer(const HOM_SceneViewer &pane)
static void pinCamera(const std::string &cam_name, bool pin)
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
~HOM_SceneViewer() override
**If you just want to fire and args
std::vector< std::pair< std::string, std::string > > Bindings