Classes | |
| struct | UiEntry |
| struct | UiValueInt |
| struct | UiValueReal |
| struct | UiValueString |
| struct | UiValueUint |
| class | Viewer |
| GLFW-based mesh viewer. More... | |
| struct | ViewerLaunchParams |
| This struct contains rules for viewer launch. More... | |
| struct | ViewerSetup |
| class | Viewport |
| struct | ViewportFitDataParams |
Enumerations | |
| enum class | UiEntryType { button , group , valueInt , valueUint , valueReal , valueString } |
| UI entry type enum. More... | |
| enum class | ViewerLaunchParamsMode { Show , HideInit , Hide , TryHidden , NoWindow } |
| enum class | MouseButton { Left , Right , Middle } |
| enum class | KeyMod { Empty = 0 , Ctrl = 0x0002 , Super = 0x0008 , Shift = 0x0001 , Alt = 0x0004 } |
| enum class | ViewportFitMode { Visible , SelectedPrimitives , SelectedObjects } |
| Fit mode ( types of objects for which the fit is applied ) More... | |
Functions | |
| void | addMeshToScene (const Mesh &mesh, const std::string &name) |
| Add given mesh to scene tree. | |
| void | addPointCloudToScene (const PointCloud &points, const std::string &name) |
| Add given point cloud to scene tree. | |
| void | addLinesToScene (const Polyline3 &lines, const std::string &name) |
| Add given lines to scene tree. | |
| void | addDistanceMapToScene (const DistanceMap &distancemap, const std::string &name, const AffineXf3f &dmap_to_local_xf) |
| Add given distance map to scene tree. | |
| void | modifySelectedMesh (const Mesh &mesh) |
| Assign a new mesh to the selected mesh object. Exactly one object must be selected. | |
| std::vector< FaceBitSet > | getSelectedMeshFaces () |
| Get selected face bitsets of the selected mesh objects. | |
| std::vector< UndirectedEdgeBitSet > | getSelectedMeshEdges () |
| Get selected edge bitsets of the selected mesh objects. | |
| std::vector< VertBitSet > | getSelectedPointCloudPoints () |
| Get selected point bitsets of the selected point cloud objects. | |
| void | setSelectedMeshFaces (const std::vector< FaceBitSet > &bitsets) |
| Set selected face bitsets of the selected mesh objects. | |
| void | setSelectedMeshEdges (const std::vector< UndirectedEdgeBitSet > &bitsets) |
| Set selected edge bitsets of the selected mesh objects. | |
| void | setSelectedPointCloudPoints (const std::vector< VertBitSet > &bitsets) |
| Set selected point bitsets of the selected point cloud objects. | |
| void | clearScene () |
| remove all objects from scene tree | |
| void | selectByName (const std::string &objectName) |
| select objects in scene tree with given name, unselect others | |
| void | selectByType (const std::string &typeName) |
| void | unselectAll () |
| unselect all objects in scene tree | |
| std::vector< std::shared_ptr< Object > > | getSelectedObjects () |
| std::vector< Mesh > | getSelectedMeshes () |
| Get copies of all selected meshes in the scene. | |
| std::vector< PointCloud > | getSelectedPointClouds () |
| Get copies of all selected point clouds in the scene. | |
| std::vector< Polyline3 > | getSelectedPolylines () |
| Get copies of all selected polylines in the scene. | |
| std::vector< DistanceMap > | getSelectedDistanceMaps () |
| Get copies of all selected voxel grids in the scene. | |
| void | addVoxelsToScene (const VdbVolume &voxels, const std::string &name) |
| Add given voxels to scene tree. | |
| std::vector< VdbVolume > | getSelectedVoxels () |
| Get copies of all selected voxel grids in the scene. | |
| std::vector< UiEntry > | _uiListEntries (const std::vector< std::string > &path) |
| python_viewer.py wraps the functions with a leading underscore, to return lists and tuples. | |
| std::vector< std::pair< std::vector< std::string >, UiEntry > > | _uiListAllEntries (const std::vector< std::string > &rootPath) |
| void | uiPressButton (const std::vector< std::string > &path) |
| Simulate a button click. Use uiListEntries() to find button names. | |
| UiValueInt | uiReadValueInt (const std::vector< std::string > &path) |
| Read a value from a drag/slider widget. This function is for signed integers. | |
| UiValueUint | uiReadValueUint (const std::vector< std::string > &path) |
| Read a value from a drag/slider widget. This function is for unsigned integers. | |
| UiValueReal | uiReadValueReal (const std::vector< std::string > &path) |
| Read a value from a drag/slider widget. This function is for real numbers. | |
| UiValueString | uiReadValueString (const std::vector< std::string > &path) |
| Read a value from a drag/slider widget. This function is for strings. | |
| void | uiWriteValue (const std::vector< std::string > &path, std::int64_t value) |
| Write a value to a drag/slider widget. This overload is for signed integers. | |
| void | uiWriteValue (const std::vector< std::string > &path, std::uint64_t value) |
| Write a value to a drag/slider widget. This overload is for unsigned integers. | |
| void | uiWriteValue (const std::vector< std::string > &path, double value) |
| Write a value to a drag/slider widget. This overload is for real numbers. | |
| void | uiWriteValue (const std::vector< std::string > &path, const std::string &value) |
| Write a value to a drag/slider widget. This overload is for strings. | |
| KeyMod | getPrimaryCtrlKeyMod () |
| Returns the main control modifier of this platform: KeyMod.Super (Cmd) on macOS, KeyMod.Ctrl otherwise. | |
| void | launch (const ViewerLaunchParams ¶ms={}, const ViewerSetup &setup={}) |
| void | showViewer () |
| void | runFromGUIThread (const std::function< void()> &lambda) |
| Executes given function from GUI thread, and returns after it is done. | |
| void | shutViewerAtExit () |
| Registered with atexit by the module, and removed from it: closes the viewer the way a closed window would, if it's still up. | |
The API of the mrviewerpy Python module, generated from this header over the C bindings (scripts/mrbind/generate.mk). The calls wait for the viewer's GUI thread, so the module releases the GIL around every call (--release-gil).
|
strong |
|
strong |
|
strong |
UI entry type enum.
| Enumerator | |
|---|---|
| button | |
| group | |
| valueInt | |
| valueUint | |
| valueReal | |
| valueString | |
|
strong |
|
strong |
|
nodiscard |
|
nodiscard |
python_viewer.py wraps the functions with a leading underscore, to return lists and tuples.
List existing UI entries at the specified path. Pass an empty list to see top-level groups. Add group name to the end of the vector to see its contents. When you find the button you need, pass it to uiPressButton().
| void MR::PythonViewer::addDistanceMapToScene | ( | const DistanceMap & | distancemap, |
| const std::string & | name, | ||
| const AffineXf3f & | dmap_to_local_xf ) |
Add given distance map to scene tree.
| void MR::PythonViewer::addLinesToScene | ( | const Polyline3 & | lines, |
| const std::string & | name ) |
Add given lines to scene tree.
| void MR::PythonViewer::addMeshToScene | ( | const Mesh & | mesh, |
| const std::string & | name ) |
Add given mesh to scene tree.
| void MR::PythonViewer::addPointCloudToScene | ( | const PointCloud & | points, |
| const std::string & | name ) |
Add given point cloud to scene tree.
| void MR::PythonViewer::addVoxelsToScene | ( | const VdbVolume & | voxels, |
| const std::string & | name ) |
Add given voxels to scene tree.
| void MR::PythonViewer::clearScene | ( | ) |
remove all objects from scene tree
|
nodiscard |
Returns the main control modifier of this platform: KeyMod.Super (Cmd) on macOS, KeyMod.Ctrl otherwise.
|
nodiscard |
Get copies of all selected voxel grids in the scene.
|
nodiscard |
Get selected edge bitsets of the selected mesh objects.
|
nodiscard |
Get copies of all selected meshes in the scene.
|
nodiscard |
Get selected face bitsets of the selected mesh objects.
|
nodiscard |
|
nodiscard |
Get selected point bitsets of the selected point cloud objects.
|
nodiscard |
Get copies of all selected point clouds in the scene.
|
nodiscard |
Get copies of all selected polylines in the scene.
|
nodiscard |
Get copies of all selected voxel grids in the scene.
| void MR::PythonViewer::launch | ( | const ViewerLaunchParams & | params = {}, |
| const ViewerSetup & | setup = {} ) |
Starts the viewer with the given params and setup, and returns once it is up and accepts calls. On Windows and Linux the window opens here, and the script keeps running alongside it. On macOS the viewer runs on the calling thread, which must be the main one: the window opens in showViewer(), or at the interactive prompt, where it stays live while the interpreter waits for input, in input() too. Raises RuntimeError if the viewer could not start (no display, or already launched once in this process).
| void MR::PythonViewer::modifySelectedMesh | ( | const Mesh & | mesh | ) |
Assign a new mesh to the selected mesh object. Exactly one object must be selected.
| void MR::PythonViewer::runFromGUIThread | ( | const std::function< void()> & | lambda | ) |
Executes given function from GUI thread, and returns after it is done.
| void MR::PythonViewer::selectByName | ( | const std::string & | objectName | ) |
select objects in scene tree with given name, unselect others
| void MR::PythonViewer::selectByType | ( | const std::string & | typeName | ) |
string typeName: {"Meshes", "Points", "Voxels"} objects in scene tree with given type, unselect others
| void MR::PythonViewer::setSelectedMeshEdges | ( | const std::vector< UndirectedEdgeBitSet > & | bitsets | ) |
Set selected edge bitsets of the selected mesh objects.
| void MR::PythonViewer::setSelectedMeshFaces | ( | const std::vector< FaceBitSet > & | bitsets | ) |
Set selected face bitsets of the selected mesh objects.
| void MR::PythonViewer::setSelectedPointCloudPoints | ( | const std::vector< VertBitSet > & | bitsets | ) |
Set selected point bitsets of the selected point cloud objects.
| void MR::PythonViewer::showViewer | ( | ) |
Keeps the window open until the user closes it or shutdown() is called from another thread. On macOS the window opens here, so this call is required there; make it from the main thread. After it returns the viewer is closed for good, and further viewer calls raise RuntimeError.
| void MR::PythonViewer::shutViewerAtExit | ( | ) |
Registered with atexit by the module, and removed from it: closes the viewer the way a closed window would, if it's still up.
| void MR::PythonViewer::uiPressButton | ( | const std::vector< std::string > & | path | ) |
Simulate a button click. Use uiListEntries() to find button names.
|
nodiscard |
Read a value from a drag/slider widget. This function is for signed integers.
|
nodiscard |
Read a value from a drag/slider widget. This function is for real numbers.
|
nodiscard |
Read a value from a drag/slider widget. This function is for strings.
|
nodiscard |
Read a value from a drag/slider widget. This function is for unsigned integers.
| void MR::PythonViewer::uiWriteValue | ( | const std::vector< std::string > & | path, |
| const std::string & | value ) |
Write a value to a drag/slider widget. This overload is for strings.
| void MR::PythonViewer::uiWriteValue | ( | const std::vector< std::string > & | path, |
| double | value ) |
Write a value to a drag/slider widget. This overload is for real numbers.
| void MR::PythonViewer::uiWriteValue | ( | const std::vector< std::string > & | path, |
| std::int64_t | value ) |
Write a value to a drag/slider widget. This overload is for signed integers.
| void MR::PythonViewer::uiWriteValue | ( | const std::vector< std::string > & | path, |
| std::uint64_t | value ) |
Write a value to a drag/slider widget. This overload is for unsigned integers.
| void MR::PythonViewer::unselectAll | ( | ) |
unselect all objects in scene tree