1#ifndef GUIK_SENSOR_VIEW_CAMERA_CONTROL_HPP
2#define GUIK_SENSOR_VIEW_CAMERA_CONTROL_HPP
11 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
17 const Eigen::Isometry3f& T_sensor_camera = Eigen::Translation3f(-5.0f, 0.0f, 0.1f) * Eigen::Isometry3f::Identity(),
18 double smoothing_factor_trans = 0.75,
19 double smoothing_factor_rot = 0.9);
38 template <
typename Transform>
40 Eigen::Isometry3f T(T_world_sensor.template cast<float>().matrix());
52 template <
typename Transform>
54 Eigen::Isometry3f T(T_sensor_camera.template cast<float>().matrix());
58 virtual void mouse(
const Eigen::Vector2f& p,
int button,
bool down)
override;
59 virtual void drag(
const Eigen::Vector2f& p,
int button)
override;
60 virtual void scroll(
const Eigen::Vector2f& rel)
override;
65 virtual std::string
name()
const override {
return "SensorViewCameraControl"; }
68 Eigen::Isometry3f T_sensor_camera;
69 Eigen::Isometry3f T_world_sensor;
70 Eigen::Isometry3f T_world_sensor_smoothed;
71 double smoothing_factor_trans;
72 double smoothing_factor_rot;
74 bool z_axis_alignment;
77 double distance_scale;
81 bool left_button_down;
82 Eigen::Vector2f drag_last_pos;
Base class for camera control. This class defines the interface for controlling the camera in the vie...
Definition camera_control.hpp:19
void set_sensor_camera_transform(const Eigen::Isometry3f &T_sensor_camera)
Set the transform from sensor frame to camera frame (T_sensor_camera).
virtual void lookat(const Eigen::Isometry3f &T_world_sensor) override
Same as set_sensor_pose.
Definition sensor_view_camera_control.hpp:46
virtual void scroll(const Eigen::Vector2f &rel) override
Scroll event callback. This method is called when the mouse wheel is scrolled.
void set_smoothing_factor_trans(double factor)
Set the translation smoothing factor.
virtual ~SensorViewCameraControl() override
void set_sensor_camera_transform(const Transform &T_sensor_camera)
Set the transform from sensor frame to camera frame using a generic transform.
Definition sensor_view_camera_control.hpp:53
virtual void mouse(const Eigen::Vector2f &p, int button, bool down) override
Mouse event callback. This method is called when a mouse button is pressed or released.
void set_sensor_pose(const Eigen::Isometry3f &T_world_sensor)
Set the raw sensor pose (T_world_sensor).
void set_smoothing_factor_rot(double factor)
Set the rotation smoothing factor.
void set_smoothing_factor(double trans, double rot)
Set both smoothing factors. 0 = no smoothing (instant snap), 1 = maximum smoothing (very slow follow)...
EIGEN_MAKE_ALIGNED_OPERATOR_NEW SensorViewCameraControl(const Eigen::Isometry3f &T_sensor_camera=Eigen::Translation3f(-5.0f, 0.0f, 0.1f) *Eigen::Isometry3f::Identity(), double smoothing_factor_trans=0.75, double smoothing_factor_rot=0.9)
virtual Eigen::Vector2f depth_range() const override
Get the depth range of the camera. This method can be overridden by derived classes to specify a cust...
virtual void drag(const Eigen::Vector2f &p, int button) override
Mouse drag event callback. This method is called when the mouse is moved while a button is pressed.
void set_z_axis_alignment(bool enabled)
Enable or disable z-axis alignment. When enabled (default), the camera up direction is locked to the ...
virtual std::string name() const override
Definition sensor_view_camera_control.hpp:65
void set_sensor_pose(const Transform &T_world_sensor)
Set the raw sensor pose using a generic transform.
Definition sensor_view_camera_control.hpp:39
virtual Eigen::Matrix4f view_matrix() const override
Get the view matrix of the camera. This method must be implemented by derived classes to return the c...
Definition drawable_container.hpp:9