Struct Viz3d

Source
pub struct Viz3d { /* private fields */ }
Expand description

The Viz3d class represents a 3D visualizer window. This class is implicitly shared.

Implementations§

Source§

impl Viz3d

Source

pub fn new(window_name: &str) -> Result<Viz3d>

The constructors.

§Parameters
  • window_name: Name of the window.
§C++ default parameters
  • window_name: String()
Source

pub fn new_def() -> Result<Viz3d>

The constructors.

§Parameters
  • window_name: Name of the window.
§Note

This alternative version of [new] function uses the following default values for its arguments:

  • window_name: String()
Source

pub fn copy(unnamed: &impl Viz3dTraitConst) -> Result<Viz3d>

Trait Implementations§

Source§

impl Boxed for Viz3d

Source§

unsafe fn from_raw(ptr: <Viz3d as OpenCVFromExtern>::ExternReceive) -> Self

Wrap the specified raw pointer Read more
Source§

fn into_raw(self) -> <Viz3d as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying raw pointer while consuming this wrapper. Read more
Source§

fn as_raw(&self) -> <Viz3d as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
Source§

fn as_raw_mut(&mut self) -> <Viz3d as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
Source§

impl Debug for Viz3d

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Viz3d

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Viz3dTrait for Viz3d

Source§

fn as_raw_mut_Viz3d(&mut self) -> *mut c_void

Source§

fn set(&mut self, unnamed: &impl Viz3dTraitConst) -> Result<()>

Source§

fn show_widget( &mut self, id: &str, widget: &impl WidgetTraitConst, pose: Affine3d, ) -> Result<()>

Shows a widget in the window. Read more
Source§

fn show_widget_def( &mut self, id: &str, widget: &impl WidgetTraitConst, ) -> Result<()>

Shows a widget in the window. Read more
Source§

fn remove_widget(&mut self, id: &str) -> Result<()>

Removes a widget from the window. Read more
Source§

fn remove_all_widgets(&mut self) -> Result<()>

Removes all widgets from the window.
Source§

fn show_image( &mut self, image: &impl ToInputArray, window_size: Size, ) -> Result<()>

Removed all widgets and displays image scaled to whole window area. Read more
Source§

fn show_image_def(&mut self, image: &impl ToInputArray) -> Result<()>

Removed all widgets and displays image scaled to whole window area. Read more
Source§

fn set_widget_pose(&mut self, id: &str, pose: Affine3d) -> Result<()>

Sets pose of a widget in the window. Read more
Source§

fn update_widget_pose(&mut self, id: &str, pose: Affine3d) -> Result<()>

Updates pose of a widget in the window by pre-multiplying its current pose. Read more
Source§

fn set_camera(&mut self, camera: &impl CameraTraitConst) -> Result<()>

Sets the intrinsic parameters of the viewer using Camera. Read more
Source§

fn set_viewer_pose(&mut self, pose: Affine3d) -> Result<()>

Sets pose of the viewer. Read more
Source§

fn reset_camera_viewpoint(&mut self, id: &str) -> Result<()>

Resets camera viewpoint to a 3D widget in the scene. Read more
Source§

fn reset_camera(&mut self) -> Result<()>

Resets camera.
Source§

fn convert_to_window_coordinates( &mut self, pt: Point3d, window_coord: &mut Point3d, ) -> Result<()>

Transforms a point in world coordinate system to window coordinate system. Read more
Source§

fn conver_to_3d_ray( &mut self, window_coord: Point3d, origin: &mut Point3d, direction: &mut Vec3d, ) -> Result<()>

Transforms a point in window coordinate system to a 3D ray in world coordinate system. Read more
Source§

fn set_window_size(&mut self, window_size: Size) -> Result<()>

Sets the size of the window. Read more
Source§

fn save_screenshot(&mut self, file: &str) -> Result<()>

Saves screenshot of the current scene. Read more
Source§

fn set_window_position(&mut self, window_position: Point) -> Result<()>

Sets the position of the window in the screen. Read more
Source§

fn set_full_screen(&mut self, mode: bool) -> Result<()>

Sets or unsets full-screen rendering mode. Read more
Source§

fn set_full_screen_def(&mut self) -> Result<()>

Sets or unsets full-screen rendering mode. Read more
Source§

fn set_background_color( &mut self, color: &impl ColorTraitConst, color2: &impl ColorTraitConst, ) -> Result<()>

Sets background color. Read more
Source§

fn set_background_color_def(&mut self) -> Result<()>

Sets background color. Read more
Source§

fn set_background_texture(&mut self, image: &impl ToInputArray) -> Result<()>

C++ default parameters Read more
Source§

fn set_background_texture_def(&mut self) -> Result<()>

Source§

fn set_background_mesh_lab(&mut self) -> Result<()>

Source§

fn spin(&mut self) -> Result<()>

The window renders and starts the event loop.
Source§

fn spin_once(&mut self, time: i32, force_redraw: bool) -> Result<()>

Starts the event loop for a given time. Read more
Source§

fn spin_once_def(&mut self) -> Result<()>

Starts the event loop for a given time. Read more
Source§

fn set_off_screen_rendering(&mut self) -> Result<()>

Create a window in memory instead of on the screen.
Source§

fn remove_all_lights(&mut self) -> Result<()>

Remove all lights from the current scene.
Source§

fn add_light( &mut self, position: Vec3d, focal_point: Vec3d, color: &impl ColorTraitConst, diffuse_color: &impl ColorTraitConst, ambient_color: &impl ColorTraitConst, specular_color: &impl ColorTraitConst, ) -> Result<()>

Add a light in the scene. Read more
Source§

fn add_light_def(&mut self, position: Vec3d) -> Result<()>

Add a light in the scene. Read more
Source§

fn close(&mut self) -> Result<()>

Source§

fn register_keyboard_callback( &mut self, callback: Viz3d_KeyboardCallback, ) -> Result<()>

Sets keyboard handler. Read more
Source§

fn register_mouse_callback( &mut self, callback: Viz3d_MouseCallback, ) -> Result<()>

Sets mouse handler. Read more
Source§

fn set_rendering_property( &mut self, id: &str, property: i32, value: f64, ) -> Result<()>

Sets rendering property of a widget. Read more
Source§

fn get_rendering_property(&mut self, id: &str, property: i32) -> Result<f64>

Returns rendering property of a widget. Read more
Source§

fn set_representation(&mut self, representation: i32) -> Result<()>

Sets geometry representation of the widgets to surface, wireframe or points. Read more
Source§

fn set_global_warnings(&mut self, enabled: bool) -> Result<()>

C++ default parameters Read more
Source§

fn set_global_warnings_def(&mut self) -> Result<()>

Source§

impl Viz3dTraitConst for Viz3d

Source§

fn as_raw_Viz3d(&self) -> *const c_void

Source§

fn get_widget(&self, id: &str) -> Result<Widget>

Retrieves a widget from the window. Read more
Source§

fn get_widget_pose(&self, id: &str) -> Result<Affine3d>

Returns the current pose of a widget in the window. Read more
Source§

fn get_camera(&self) -> Result<Camera>

Returns a camera object that contains intrinsic parameters of the current viewer.
Source§

fn get_viewer_pose(&self) -> Result<Affine3d>

Returns the current pose of the viewer.
Source§

fn get_window_size(&self) -> Result<Size>

Returns the current size of the window.
Source§

fn get_window_name(&self) -> Result<String>

Returns the name of the window which has been set in the constructor. Viz - is prepended to the name if necessary.
Source§

fn get_screenshot(&self) -> Result<Mat>

Returns the Mat screenshot of the current scene.
Source§

fn was_stopped(&self) -> Result<bool>

Returns whether the event loop has been stopped.
Source§

impl Send for Viz3d

Auto Trait Implementations§

§

impl Freeze for Viz3d

§

impl RefUnwindSafe for Viz3d

§

impl !Sync for Viz3d

§

impl Unpin for Viz3d

§

impl UnwindSafe for Viz3d

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Mat> ModifyInplace for Mat
where Mat: Boxed,

Source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a Mat or another similar object. By passing a mutable reference to the Mat to this function your closure will get called with the read reference and a write references to the same Mat. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data, but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.