10 #include <IJsonConvertibleIO.h>
17 namespace visualization {
20 static const std::unordered_map<std::string, std::string>
22 {
"parameter",
"The pinhole camera parameter to convert from."},
23 {
"scale",
"Scale ratio."},
24 {
"x",
"Distance the mouse cursor has moved in x-axis."},
25 {
"y",
"Distance the mouse cursor has moved in y-axis."},
26 {
"xo",
"Original point coordinate of the mouse in x-axis."},
27 {
"yo",
"Original point coordinate of the mouse in y-axis."},
28 {
"step",
"The step to change field of view."},
29 {
"z_near",
"The depth of the near z-plane of the visualizer."},
30 {
"z_far",
"The depth of the far z-plane of the visualizer."},
34 py::class_<ViewControl, PyViewControl<>, std::shared_ptr<ViewControl>>
35 viewcontrol(m,
"ViewControl",
"View controller for visualizer.");
36 py::detail::bind_default_constructor<ViewControl>(viewcontrol);
40 return std::string(
"ViewControl");
43 "convert_to_pinhole_camera_parameters",
49 "Function to convert ViewControl to "
50 "camera::PinholeCameraParameters")
51 .def(
"convert_from_pinhole_camera_parameters",
53 "parameter"_a,
"allow_arbitrary"_a =
false)
57 "x"_a,
"y"_a,
"xo"_a = 0.0,
"yo"_a = 0.0)
59 "Function to process translation",
"x"_a,
"y"_a,
"xo"_a = 0.0,
62 "Function to process translation of camera",
"forward"_a,
65 "Function to process rotation of camera in a local"
67 "x"_a,
"y"_a,
"xo"_a = 0.0,
"yo"_a = 0.0)
68 .def(
"reset_camera_local_rotate",
70 "Resets the coordinate frame for local camera rotations")
72 "Function to get field of view")
74 "Function to change field of view",
"step"_a = 0.45)
76 "Function to change the near z-plane of the visualizer to a "
77 "constant value, i.e., independent of zoom and bounding box "
81 "Function to change the far z-plane of the visualizer to a "
82 "constant value, i.e., independent of zoom and bounding box "
86 "Function to remove a previously set constant z near value, "
87 "i.e., near z-plane of the visualizer is dynamically set "
88 "dependent on zoom and bounding box size.")
90 "Function to remove a previously set constant z far value, "
91 "i.e., far z-plane of the visualizer is dynamically set "
92 "dependent on zoom and bounding box size.")
94 "Set the lookat vector of the visualizer",
"lookat"_a)
96 "Set the up vector of the visualizer",
"up"_a)
98 "Set the front vector of the visualizer",
"front"_a)
100 "Set the zoom of the visualizer",
"zoom"_a);
104 "convert_from_pinhole_camera_parameters",
107 "convert_to_pinhole_camera_parameters",
Contains both intrinsic and extrinsic pinhole camera parameters.
View controller for visualizer.
void SetConstantZFar(double z_far)
double GetFieldOfView() const
Function to get field of view.
void SetFront(const Eigen::Vector3d &front)
void SetUp(const Eigen::Vector3d &up)
virtual void Translate(double x, double y, double xo=0.0, double yo=0.0)
Function to process translation.
virtual void Rotate(double x, double y, double xo=0.0, double yo=0.0)
Function to process rotation.
virtual void CameraLocalTranslate(double forward, double right, double up)
virtual void CameraLocalRotate(double x, double y, double xo=0.0, double yo=0.0)
virtual void ChangeFieldOfView(double step)
void SetConstantZNear(double z_near)
bool ConvertFromPinholeCameraParameters(const camera::PinholeCameraParameters ¶meters, bool allow_arbitrary=false)
void SetLookat(const Eigen::Vector3d &lookat)
virtual void Scale(double scale)
void UnsetConstantZNear()
virtual void ResetCameraLocalRotate()
bool ConvertToPinholeCameraParameters(camera::PinholeCameraParameters ¶meters)
void SetZoom(const double zoom)
void ClassMethodDocInject(py::module &pybind_module, const std::string &class_name, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
static const std::unordered_map< std::string, std::string > map_view_control_docstrings
void pybind_viewcontrol(py::module &m)
void pybind_viewcontrol_method(py::module &m)
Generic file read and write utility for python interface.