pub trait Viz3dTrait: Viz3dTraitConst {
Show 41 methods
// Required method
fn as_raw_mut_Viz3d(&mut self) -> *mut c_void;
// Provided methods
fn set(&mut self, unnamed: &impl Viz3dTraitConst) -> Result<()> { ... }
fn show_widget(
&mut self,
id: &str,
widget: &impl WidgetTraitConst,
pose: Affine3d,
) -> Result<()> { ... }
fn show_widget_def(
&mut self,
id: &str,
widget: &impl WidgetTraitConst,
) -> Result<()> { ... }
fn remove_widget(&mut self, id: &str) -> Result<()> { ... }
fn remove_all_widgets(&mut self) -> Result<()> { ... }
fn show_image(
&mut self,
image: &impl ToInputArray,
window_size: Size,
) -> Result<()> { ... }
fn show_image_def(&mut self, image: &impl ToInputArray) -> Result<()> { ... }
fn set_widget_pose(&mut self, id: &str, pose: Affine3d) -> Result<()> { ... }
fn update_widget_pose(&mut self, id: &str, pose: Affine3d) -> Result<()> { ... }
fn set_camera(&mut self, camera: &impl CameraTraitConst) -> Result<()> { ... }
fn set_viewer_pose(&mut self, pose: Affine3d) -> Result<()> { ... }
fn reset_camera_viewpoint(&mut self, id: &str) -> Result<()> { ... }
fn reset_camera(&mut self) -> Result<()> { ... }
fn convert_to_window_coordinates(
&mut self,
pt: Point3d,
window_coord: &mut Point3d,
) -> Result<()> { ... }
fn conver_to_3d_ray(
&mut self,
window_coord: Point3d,
origin: &mut Point3d,
direction: &mut Vec3d,
) -> Result<()> { ... }
fn set_window_size(&mut self, window_size: Size) -> Result<()> { ... }
fn save_screenshot(&mut self, file: &str) -> Result<()> { ... }
fn set_window_position(&mut self, window_position: Point) -> Result<()> { ... }
fn set_full_screen(&mut self, mode: bool) -> Result<()> { ... }
fn set_full_screen_def(&mut self) -> Result<()> { ... }
fn set_background_color(
&mut self,
color: &impl ColorTraitConst,
color2: &impl ColorTraitConst,
) -> Result<()> { ... }
fn set_background_color_def(&mut self) -> Result<()> { ... }
fn set_background_texture(
&mut self,
image: &impl ToInputArray,
) -> Result<()> { ... }
fn set_background_texture_def(&mut self) -> Result<()> { ... }
fn set_background_mesh_lab(&mut self) -> Result<()> { ... }
fn spin(&mut self) -> Result<()> { ... }
fn spin_once(&mut self, time: i32, force_redraw: bool) -> Result<()> { ... }
fn spin_once_def(&mut self) -> Result<()> { ... }
fn set_off_screen_rendering(&mut self) -> Result<()> { ... }
fn remove_all_lights(&mut self) -> Result<()> { ... }
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<()> { ... }
fn add_light_def(&mut self, position: Vec3d) -> Result<()> { ... }
fn close(&mut self) -> Result<()> { ... }
fn register_keyboard_callback(
&mut self,
callback: Viz3d_KeyboardCallback,
) -> Result<()> { ... }
fn register_mouse_callback(
&mut self,
callback: Viz3d_MouseCallback,
) -> Result<()> { ... }
fn set_rendering_property(
&mut self,
id: &str,
property: i32,
value: f64,
) -> Result<()> { ... }
fn get_rendering_property(&mut self, id: &str, property: i32) -> Result<f64> { ... }
fn set_representation(&mut self, representation: i32) -> Result<()> { ... }
fn set_global_warnings(&mut self, enabled: bool) -> Result<()> { ... }
fn set_global_warnings_def(&mut self) -> Result<()> { ... }
}Expand description
Mutable methods for crate::viz::Viz3d
Required Methods§
fn as_raw_mut_Viz3d(&mut self) -> *mut c_void
Provided Methods§
fn set(&mut self, unnamed: &impl Viz3dTraitConst) -> Result<()>
Sourcefn show_widget(
&mut self,
id: &str,
widget: &impl WidgetTraitConst,
pose: Affine3d,
) -> Result<()>
fn show_widget( &mut self, id: &str, widget: &impl WidgetTraitConst, pose: Affine3d, ) -> Result<()>
Sourcefn show_widget_def(
&mut self,
id: &str,
widget: &impl WidgetTraitConst,
) -> Result<()>
fn show_widget_def( &mut self, id: &str, widget: &impl WidgetTraitConst, ) -> Result<()>
Shows a widget in the window.
§Parameters
- id: A unique id for the widget. @param widget The widget to be displayed in the window.
- pose: Pose of the widget.
§Note
This alternative version of Viz3dTrait::show_widget function uses the following default values for its arguments:
- pose: Affine3d::Identity()
Sourcefn remove_widget(&mut self, id: &str) -> Result<()>
fn remove_widget(&mut self, id: &str) -> Result<()>
Sourcefn remove_all_widgets(&mut self) -> Result<()>
fn remove_all_widgets(&mut self) -> Result<()>
Removes all widgets from the window.
Sourcefn show_image(
&mut self,
image: &impl ToInputArray,
window_size: Size,
) -> Result<()>
fn show_image( &mut self, image: &impl ToInputArray, window_size: Size, ) -> Result<()>
Sourcefn show_image_def(&mut self, image: &impl ToInputArray) -> Result<()>
fn show_image_def(&mut self, image: &impl ToInputArray) -> Result<()>
Removed all widgets and displays image scaled to whole window area.
§Parameters
- image: Image to be displayed.
- window_size: Size of Viz3d window. Default value means no change.
§Note
This alternative version of Viz3dTrait::show_image function uses the following default values for its arguments:
- window_size: Size(-1,-1)
Sourcefn set_widget_pose(&mut self, id: &str, pose: Affine3d) -> Result<()>
fn set_widget_pose(&mut self, id: &str, pose: Affine3d) -> Result<()>
Sets pose of a widget in the window.
§Parameters
- id: The id of the widget whose pose will be set. @param pose The new pose of the widget.
Sourcefn update_widget_pose(&mut self, id: &str, pose: Affine3d) -> Result<()>
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.
§Parameters
- id: The id of the widget whose pose will be updated. @param pose The pose that the current pose of the widget will be pre-multiplied by.
Sourcefn set_camera(&mut self, camera: &impl CameraTraitConst) -> Result<()>
fn set_camera(&mut self, camera: &impl CameraTraitConst) -> Result<()>
Sets the intrinsic parameters of the viewer using Camera.
§Parameters
- camera: Camera object wrapping intrinsic parameters.
Sourcefn set_viewer_pose(&mut self, pose: Affine3d) -> Result<()>
fn set_viewer_pose(&mut self, pose: Affine3d) -> Result<()>
Sourcefn reset_camera_viewpoint(&mut self, id: &str) -> Result<()>
fn reset_camera_viewpoint(&mut self, id: &str) -> Result<()>
Sourcefn reset_camera(&mut self) -> Result<()>
fn reset_camera(&mut self) -> Result<()>
Resets camera.
Sourcefn convert_to_window_coordinates(
&mut self,
pt: Point3d,
window_coord: &mut Point3d,
) -> Result<()>
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.
§Parameters
- pt: Point in world coordinate system.
- window_coord: Output point in window coordinate system.
Sourcefn conver_to_3d_ray(
&mut self,
window_coord: Point3d,
origin: &mut Point3d,
direction: &mut Vec3d,
) -> Result<()>
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.
§Parameters
- window_coord: Point in window coordinate system. @param origin Output origin of the ray.
- direction: Output direction of the ray.
Sourcefn set_window_size(&mut self, window_size: Size) -> Result<()>
fn set_window_size(&mut self, window_size: Size) -> Result<()>
Sourcefn save_screenshot(&mut self, file: &str) -> Result<()>
fn save_screenshot(&mut self, file: &str) -> Result<()>
Sourcefn set_window_position(&mut self, window_position: Point) -> Result<()>
fn set_window_position(&mut self, window_position: Point) -> Result<()>
Sets the position of the window in the screen.
§Parameters
- window_position: coordinates of the window
Sourcefn set_full_screen(&mut self, mode: bool) -> Result<()>
fn set_full_screen(&mut self, mode: bool) -> Result<()>
Sourcefn set_full_screen_def(&mut self) -> Result<()>
fn set_full_screen_def(&mut self) -> Result<()>
Sets or unsets full-screen rendering mode.
§Parameters
- mode: If true, window will use full-screen mode.
§Note
This alternative version of Viz3dTrait::set_full_screen function uses the following default values for its arguments:
- mode: true
Sourcefn set_background_color(
&mut self,
color: &impl ColorTraitConst,
color2: &impl ColorTraitConst,
) -> Result<()>
fn set_background_color( &mut self, color: &impl ColorTraitConst, color2: &impl ColorTraitConst, ) -> Result<()>
Sourcefn set_background_color_def(&mut self) -> Result<()>
fn set_background_color_def(&mut self) -> Result<()>
Sets background color.
§Note
This alternative version of Viz3dTrait::set_background_color function uses the following default values for its arguments:
- color: Color::black()
- color2: Color::not_set()
Sourcefn set_background_texture(&mut self, image: &impl ToInputArray) -> Result<()>
fn set_background_texture(&mut self, image: &impl ToInputArray) -> Result<()>
§C++ default parameters
- image: noArray()
Sourcefn set_background_texture_def(&mut self) -> Result<()>
fn set_background_texture_def(&mut self) -> Result<()>
§Note
This alternative version of Viz3dTrait::set_background_texture function uses the following default values for its arguments:
- image: noArray()
fn set_background_mesh_lab(&mut self) -> Result<()>
Sourcefn spin_once_def(&mut self) -> Result<()>
fn spin_once_def(&mut self) -> Result<()>
Starts the event loop for a given time.
§Parameters
- time: Amount of time in milliseconds for the event loop to keep running.
- force_redraw: If true, window renders.
§Note
This alternative version of Viz3dTrait::spin_once function uses the following default values for its arguments:
- time: 1
- force_redraw: false
Sourcefn set_off_screen_rendering(&mut self) -> Result<()>
fn set_off_screen_rendering(&mut self) -> Result<()>
Create a window in memory instead of on the screen.
Sourcefn remove_all_lights(&mut self) -> Result<()>
fn remove_all_lights(&mut self) -> Result<()>
Remove all lights from the current scene.
Sourcefn 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<()>
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.
§Parameters
- position: The position of the light.
- focalPoint: The point at which the light is shining
- color: The color of the light
- diffuseColor: The diffuse color of the light
- ambientColor: The ambient color of the light
- specularColor: The specular color of the light
§C++ default parameters
- focal_point: Vec3d(0,0,0)
- color: Color::white()
- diffuse_color: Color::white()
- ambient_color: Color::black()
- specular_color: Color::white()
Sourcefn add_light_def(&mut self, position: Vec3d) -> Result<()>
fn add_light_def(&mut self, position: Vec3d) -> Result<()>
Add a light in the scene.
§Parameters
- position: The position of the light.
- focalPoint: The point at which the light is shining
- color: The color of the light
- diffuseColor: The diffuse color of the light
- ambientColor: The ambient color of the light
- specularColor: The specular color of the light
§Note
This alternative version of Viz3dTrait::add_light function uses the following default values for its arguments:
- focal_point: Vec3d(0,0,0)
- color: Color::white()
- diffuse_color: Color::white()
- ambient_color: Color::black()
- specular_color: Color::white()
fn close(&mut self) -> Result<()>
Sourcefn register_keyboard_callback(
&mut self,
callback: Viz3d_KeyboardCallback,
) -> Result<()>
fn register_keyboard_callback( &mut self, callback: Viz3d_KeyboardCallback, ) -> Result<()>
Sourcefn register_mouse_callback(
&mut self,
callback: Viz3d_MouseCallback,
) -> Result<()>
fn register_mouse_callback( &mut self, callback: Viz3d_MouseCallback, ) -> Result<()>
Sourcefn set_rendering_property(
&mut self,
id: &str,
property: i32,
value: f64,
) -> Result<()>
fn set_rendering_property( &mut self, id: &str, property: i32, value: f64, ) -> Result<()>
Sets rendering property of a widget.
§Parameters
- id: Id of the widget.
- property: Property that will be modified.
- value: The new value of the property.
Rendering property can be one of the following:
- POINT_SIZE
- OPACITY
- LINE_WIDTH
- FONT_SIZE
REPRESENTATION: Expected values are
- REPRESENTATION_POINTS
- REPRESENTATION_WIREFRAME
- REPRESENTATION_SURFACE
IMMEDIATE_RENDERING:
- Turn on immediate rendering by setting the value to 1.
- Turn off immediate rendering by setting the value to 0.
SHADING: Expected values are
- SHADING_FLAT
- SHADING_GOURAUD
- SHADING_PHONG
Sourcefn get_rendering_property(&mut self, id: &str, property: i32) -> Result<f64>
fn get_rendering_property(&mut self, id: &str, property: i32) -> Result<f64>
Returns rendering property of a widget.
§Parameters
- id: Id of the widget.
- property: Property.
Rendering property can be one of the following:
- POINT_SIZE
- OPACITY
- LINE_WIDTH
- FONT_SIZE
REPRESENTATION: Expected values are
- REPRESENTATION_POINTS
- REPRESENTATION_WIREFRAME
- REPRESENTATION_SURFACE
IMMEDIATE_RENDERING:
- Turn on immediate rendering by setting the value to 1.
- Turn off immediate rendering by setting the value to 0.
SHADING: Expected values are
- SHADING_FLAT
- SHADING_GOURAUD
- SHADING_PHONG
Sourcefn set_representation(&mut self, representation: i32) -> Result<()>
fn set_representation(&mut self, representation: i32) -> Result<()>
Sets geometry representation of the widgets to surface, wireframe or points.
§Parameters
- representation: Geometry representation which can be one of the following:
- REPRESENTATION_POINTS
- REPRESENTATION_WIREFRAME
- REPRESENTATION_SURFACE
Sourcefn set_global_warnings(&mut self, enabled: bool) -> Result<()>
fn set_global_warnings(&mut self, enabled: bool) -> Result<()>
§C++ default parameters
- enabled: false
Sourcefn set_global_warnings_def(&mut self) -> Result<()>
fn set_global_warnings_def(&mut self) -> Result<()>
§Note
This alternative version of Viz3dTrait::set_global_warnings function uses the following default values for its arguments:
- enabled: false
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.