14 #include <Eigen/Geometry>
16 #include <unordered_set>
37 namespace visualization {
48 : light_dir_(
std::make_unique<rendering::LightDirectionInteractorLogic>(
49 scene->GetScene(), camera)) {}
52 return *light_dir_.get();
56 std::function<
void(
const Eigen::Vector3f&)> on_changed) {
57 on_light_dir_changed_ = on_changed;
65 light_dir_->StartMouseDrag();
68 int dx = e.
x - mouse_down_x_;
69 int dy = e.
y - mouse_down_y_;
70 light_dir_->Rotate(dx, dy);
71 if (on_light_dir_changed_) {
72 on_light_dir_changed_(light_dir_->GetCurrentDirection());
80 light_dir_->EndMouseDrag();
90 std::unique_ptr<rendering::LightDirectionInteractorLogic> light_dir_;
91 int mouse_down_x_ = 0;
92 int mouse_down_y_ = 0;
93 std::function<void(
const Eigen::Vector3f&)> on_light_dir_changed_;
99 : ibl_(
std::make_unique<rendering::IBLRotationInteractorLogic>(
108 on_rotation_changed_ = on_changed;
116 ibl_->StartMouseDrag();
119 int dx = e.
x - mouse_down_x_;
120 int dy = e.
y - mouse_down_y_;
122 ibl_->RotateZ(dx, dy);
124 ibl_->Rotate(dx, dy);
126 if (on_rotation_changed_) {
127 on_rotation_changed_(ibl_->GetCurrentRotation());
135 ibl_->EndMouseDrag();
145 std::unique_ptr<rendering::IBLRotationInteractorLogic> ibl_;
146 int mouse_down_x_ = 0;
147 int mouse_down_y_ = 0;
149 on_rotation_changed_;
155 : camera_controls_(
std::make_unique<rendering::CameraInteractorLogic>(
159 return *camera_controls_.get();
167 camera_controls_->StartMouseDrag();
172 int dx = e.
x - last_mouse_x_;
173 int dy = e.
y - last_mouse_y_;
177 camera_controls_->ResetMouseDrag();
178 camera_controls_->RotateZ(dx, dy);
180 camera_controls_->RotateFly(-dx, -dy);
190 camera_controls_->EndMouseDrag();
199 case KeyEvent::Type::DOWN:
200 keys_down_.insert(e.
key);
202 case KeyEvent::Type::UP:
203 keys_down_.erase(e.
key);
210 if (!keys_down_.empty()) {
211 auto& bounds = camera_controls_->GetBoundingBox();
212 const float dist = float(0.0025 * bounds.GetExtent().norm());
213 const float angle_rad = 0.0075f;
215 auto HasKey = [
this](uint32_t key) ->
bool {
216 return (keys_down_.find(key) != keys_down_.end());
219 auto move = [
this, &redraw](
const Eigen::Vector3f& v) {
220 camera_controls_->MoveLocal(v);
223 auto rotate = [
this, &redraw](
float angle_rad,
224 const Eigen::Vector3f& axis) {
225 camera_controls_->RotateLocal(angle_rad, axis);
228 auto rotateZ = [
this, &redraw](
int dy) {
229 camera_controls_->StartMouseDrag();
230 camera_controls_->RotateZ(0, dy);
259 rotate(angle_rad, {1, 0, 0});
262 rotate(-angle_rad, {1, 0, 0});
265 rotate(angle_rad, {0, 1, 0});
268 rotate(-angle_rad, {0, 1, 0});
275 std::unique_ptr<rendering::CameraInteractorLogic> camera_controls_;
276 int last_mouse_x_ = 0;
277 int last_mouse_y_ = 0;
278 std::set<uint32_t> keys_down_;
388 rotation_(new rendering::ModelInteractorLogic(
396 std::unique_ptr<rendering::ModelInteractorLogic> rotation_;
405 : camera_controls_(
std::make_unique<rendering::CameraInteractorLogic>(
414 if (e.
button.count == 2 &&
418 scene_->GetRenderer().RenderToDepthImage(
419 scene_->GetView(), scene_->GetScene(),
420 [x, y,
this](std::shared_ptr<geometry::Image> img) {
421 ChangeCenterOfRotation(img, x, y);
435 camera_controls_->Zoom(
451 std::unique_ptr<rendering::CameraInteractorLogic> camera_controls_;
454 void ChangeCenterOfRotation(std::shared_ptr<geometry::Image> depth_img,
457 const int radius_px = 2;
458 float far_z = 0.999999f;
459 float win_z = *depth_img->PointerAt<
float>(x, y);
460 if (win_z >= far_z) {
461 for (
int v = y - radius_px; v < y + radius_px; ++v) {
462 for (
int u = x - radius_px; u < x + radius_px; ++u) {
463 float z = *depth_img->PointerAt<
float>(x, y);
472 float(x),
float(vp[3] - y), win_z,
float(vp[2]),
488 std::make_unique<rendering::CameraSphereInteractorLogic>(
494 std::unique_ptr<rendering::CameraInteractorLogic> camera_controls_;
503 :
Super(scene, camera),
508 pick_->GetMatrixInteractor().SetViewSize(
size.width,
size.height);
512 const std::vector<SceneWidget::PickableGeometry>& geometry) {
513 pick_->SetPickableGeometry(geometry);
522 std::vector<std::pair<size_t, Eigen::Vector3d>>>&,
524 pick_->SetOnPointsPicked(on_picked);
528 std::function<
void(
const std::vector<Eigen::Vector2i>&)> on_ui) {
529 pick_->SetOnUIChanged(on_ui);
533 pick_->SetOnStartedPolygonPicking(on_poly_pick);
547 pick_->SetNeedsRedraw();
554 std::unique_ptr<PickPointsInteractor> pick_;
570 current_ = rotate_.get();
574 rotate_->GetMatrixInteractor().SetViewSize(
size.width,
size.height);
575 rotate_sphere_->GetMatrixInteractor().SetViewSize(
size.width,
577 fly_->GetMatrixInteractor().SetViewSize(
size.width,
size.height);
578 sun_->GetMatrixInteractor().SetViewSize(
size.width,
size.height);
579 ibl_->GetMatrixInteractor().SetViewSize(
size.width,
size.height);
580 model_->GetMatrixInteractor().SetViewSize(
size.width,
size.height);
581 pick_->SetViewSize(
size);
585 rotate_->GetMatrixInteractor().SetBoundingBox(bounds);
586 rotate_sphere_->GetMatrixInteractor().SetBoundingBox(bounds);
587 fly_->GetMatrixInteractor().SetBoundingBox(bounds);
588 sun_->GetMatrixInteractor().SetBoundingBox(bounds);
589 ibl_->GetMatrixInteractor().SetBoundingBox(bounds);
590 model_->GetMatrixInteractor().SetBoundingBox(bounds);
591 pick_->GetMatrixInteractor().SetBoundingBox(bounds);
595 if (GetControls() == SceneWidget::Controls::ROTATE_CAMERA_SPHERE) {
596 return rotate_sphere_->GetCenterOfRotation();
598 return rotate_->GetCenterOfRotation();
603 rotate_->SetCenterOfRotation(center);
604 rotate_sphere_->SetCenterOfRotation(center);
608 std::function<
void(
const Eigen::Vector3f&)> onChanged) {
609 sun_->SetOnSunLightChanged(onChanged);
613 sun_interactor_enabled_ = enable;
617 const std::vector<SceneWidget::PickableGeometry>& geometry) {
618 pick_->SetPickableGeometry(geometry);
627 std::vector<std::pair<size_t, Eigen::Vector3d>>>&,
629 pick_->SetOnPointsPicked(on_picked);
633 pick_->SetOnStartedPolygonPicking(on_poly_pick);
643 std::function<
void(
const std::vector<Eigen::Vector2i>&)> on_ui) {
644 pick_->SetOnInteractorUIUpdated(on_ui);
648 if (current_ == rotate_sphere_.get()) {
649 return SceneWidget::Controls::ROTATE_CAMERA_SPHERE;
650 }
else if (current_ == fly_.get()) {
651 return SceneWidget::Controls::FLY;
652 }
else if (current_ == sun_.get()) {
653 return SceneWidget::Controls::ROTATE_SUN;
654 }
else if (current_ == ibl_.get()) {
655 return SceneWidget::Controls::ROTATE_IBL;
656 }
else if (current_ == model_.get()) {
657 return SceneWidget::Controls::ROTATE_MODEL;
658 }
else if (current_ == pick_.get()) {
659 return SceneWidget::Controls::PICK_POINTS;
661 return SceneWidget::Controls::ROTATE_CAMERA;
667 case SceneWidget::Controls::ROTATE_CAMERA:
668 current_ = rotate_.get();
670 case SceneWidget::Controls::ROTATE_CAMERA_SPHERE:
671 current_ = rotate_sphere_.get();
673 case SceneWidget::Controls::FLY:
674 current_ = fly_.get();
676 case SceneWidget::Controls::ROTATE_SUN:
677 current_ = sun_.get();
679 case SceneWidget::Controls::ROTATE_IBL:
680 current_ = ibl_.get();
682 case SceneWidget::Controls::ROTATE_MODEL:
683 current_ = model_.get();
685 case SceneWidget::Controls::PICK_POINTS:
686 current_ = pick_.get();
692 if (current_ == rotate_.get() && sun_interactor_enabled_) {
693 if (e.
type == MouseEvent::Type::BUTTON_DOWN &&
696 override_ = sun_.get();
702 }
else if (current_) {
706 if (override_ && e.
type == MouseEvent::Type::BUTTON_UP) {
719 if (current_->Tick(e)) {
727 bool sun_interactor_enabled_ =
true;
729 std::unique_ptr<RotateCameraInteractor> rotate_;
730 std::unique_ptr<RotateCameraSphereInteractor> rotate_sphere_;
731 std::unique_ptr<FlyInteractor> fly_;
732 std::unique_ptr<RotateSunInteractor> sun_;
733 std::unique_ptr<RotateIBLInteractor> ibl_;
734 std::unique_ptr<RotateModelInteractor> model_;
735 std::unique_ptr<PickInteractor> pick_;
743 static int g_next_button_id = 1;
748 std::shared_ptr<rendering::CloudViewerScene>
scene_;
753 int buttons_down_ = 0;
754 double last_fast_time_ = 0.0;
755 bool frame_rect_changed_ =
false;
757 bool scene_caching_enabled_ =
false;
764 bool is_using =
false;
768 float orig_aspect = intrinsics_.width / intrinsics_.height;
769 float aspect = float(
frame.width) / float(
frame.height);
770 Eigen::Matrix3d scale;
772 scale << 1.0, 0.0, 0.0, 0.0, (aspect / orig_aspect), 0.0, 0.0, 0.0,
775 scale << (orig_aspect / aspect), 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0,
778 Eigen::Matrix3d m = intrinsics_.matrix * scale;
779 auto* camera = scene_->GetCamera();
782 intrinsics_.width, intrinsics_.height);
787 if (
frame.height > 0) {
788 aspect = float(
frame.width) / float(
frame.height);
790 auto* camera = scene_->GetCamera();
792 camera->SetProjection(verticalFoV, aspect,
799 impl_->id_ = std::string(
"SceneWidget##widget3d_") +
811 if (f.
width == old_frame.width && f.
height == old_frame.height)
return;
820 impl_->frame_rect_changed_ =
true;
824 const ccBBox& scene_bounds,
825 const Eigen::Vector3f& center_of_rotation) {
826 impl_->intrinsics_.is_using =
false;
827 impl_->bounds_ = scene_bounds;
828 impl_->controls_->SetBoundingBox(scene_bounds);
829 impl_->controls_->SetCenterOfRotation(center_of_rotation);
833 impl_->UpdateFarPlane(
GetFrame(), verticalFoV);
837 const Eigen::Matrix4d& extrinsic,
838 const ccBBox& scene_bounds) {
840 intrinsic.
height_, scene_bounds);
844 const Eigen::Matrix4d& extrinsic,
845 int intrinsic_width_px,
846 int intrinsic_height_px,
847 const ccBBox& scene_bounds) {
848 impl_->intrinsics_.is_using =
true;
849 impl_->intrinsics_.matrix = intrinsic;
850 impl_->intrinsics_.width = intrinsic_width_px;
851 impl_->intrinsics_.height = intrinsic_height_px;
852 impl_->bounds_ = scene_bounds;
853 impl_->controls_->SetBoundingBox(scene_bounds);
855 auto* camera = GetCamera();
857 *camera, intrinsic, extrinsic, intrinsic_width_px,
858 intrinsic_height_px, scene_bounds);
863 Eigen::Vector3f forward = camera->GetForwardVector();
864 Eigen::Vector3f pos = camera->GetPosition();
865 Eigen::Vector3f toCenter = scene_bounds.
GetCenter().cast<
float>() - pos;
866 float dist = toCenter.dot(forward);
867 Eigen::Vector3f cor = pos +
dist * forward;
868 impl_->controls_->SetCenterOfRotation(cor);
872 const Eigen::Vector3f& eye,
873 const Eigen::Vector3f& up) {
874 GetCamera()->
LookAt(center, eye, up);
875 impl_->controls_->SetCenterOfRotation(center);
876 impl_->UpdateFarPlane(
GetFrame(), GetCamera()->GetFieldOfView());
880 return impl_->controls_->GetCenterOfRotation();
884 impl_->controls_->SetCenterOfRotation(center);
889 impl_->on_camera_changed_ = on_cam_changed;
893 std::function<
void(
const Eigen::Vector3f&)> on_dir_changed) {
894 impl_->on_light_dir_changed_ = on_dir_changed;
895 impl_->controls_->SetOnSunLightChanged([
this](
const Eigen::Vector3f& dir) {
896 impl_->scene_->GetScene()->SetSunLightDirection(dir);
897 if (impl_->on_light_dir_changed_) {
898 impl_->on_light_dir_changed_(dir);
904 impl_->controls_->SetSunInteractorEnabled(enable);
908 const std::vector<PickableGeometry>& geometry) {
909 impl_->controls_->SetPickableGeometry(geometry);
913 impl_->controls_->SetPickablePointSize(px);
920 std::vector<std::pair<size_t, Eigen::Vector3d>>>&,
922 impl_->controls_->SetOnPointsPicked(on_picked);
926 impl_->scene_ = scene;
928 auto view = impl_->scene_->GetView();
929 impl_->controls_ = std::make_shared<Interactors>(impl_->scene_.get(),
931 impl_->controls_->SetOnInteractorUIUpdated(
932 [
this](
const std::vector<Eigen::Vector2i>& lines) {
933 impl_->ui_lines_ = lines;
940 std::function<
void()> on_poly_pick) {
941 impl_->controls_->SetOnStartedPolygonPicking(on_poly_pick);
947 impl_->controls_->ClearPolygonPick();
950 impl_->controls_->DoPolygonPick();
956 return impl_->scene_;
961 return impl_->scene_->GetView();
968 if (mode == Controls::ROTATE_CAMERA &&
969 impl_->controls_->GetControls() == Controls::FLY) {
970 impl_->controls_->SetControls(mode);
977 auto camera = GetCamera();
978 Eigen::Vector3f to_center = impl_->bounds_.GetCenter().cast<
float>() -
979 camera->GetPosition();
980 Eigen::Vector3f forward = camera->GetForwardVector();
981 Eigen::Vector3f center =
982 camera->GetPosition() + to_center.norm() * forward;
983 impl_->controls_->SetCenterOfRotation(center);
985 impl_->controls_->SetControls(mode);
990 impl_->scene_caching_enabled_ = enable;
992 impl_->scene_->GetScene()->SetViewActive(impl_->scene_->GetViewId(),
999 if (!impl_->scene_caching_enabled_)
return;
1001 impl_->scene_->GetScene()->SetRenderOnce(impl_->scene_->GetViewId());
1002 impl_->controls_->SetPickNeedsRedraw();
1007 if (currentQuality != quality) {
1008 impl_->current_render_quality_ = quality;
1011 if (impl_->scene_caching_enabled_) {
1012 impl_->scene_->GetScene()->SetViewActive(
1013 impl_->scene_->GetViewId(),
true);
1016 impl_->scene_->SetLOD(
1018 if (impl_->scene_caching_enabled_) {
1019 impl_->scene_->GetScene()->SetRenderOnce(
1020 impl_->scene_->GetViewId());
1027 return impl_->current_render_quality_;
1037 float max_dim = float(1.25 * impl_->bounds_.GetMaxExtent());
1038 Eigen::Vector3f center = impl_->bounds_.GetCenter().cast<
float>();
1039 Eigen::Vector3f eye, up;
1042 eye = Eigen::Vector3f(center.x() + max_dim, center.y(), center.z());
1043 up = Eigen::Vector3f(0, 1, 0);
1047 eye = Eigen::Vector3f(center.x(), center.y() + max_dim, center.z());
1048 up = Eigen::Vector3f(1, 0, 0);
1052 eye = Eigen::Vector3f(center.x(), center.y(), center.z() + max_dim);
1053 up = Eigen::Vector3f(0, 1, 0);
1057 GetCamera()->
LookAt(center, eye, up);
1058 impl_->controls_->SetCenterOfRotation(center);
1063 return impl_->scene_->GetCamera();
1068 auto l = std::make_shared<Label3D>(pos, text);
1069 impl_->labels_3d_.insert(l);
1074 auto liter = impl_->labels_3d_.find(label);
1075 if (liter != impl_->labels_3d_.end()) {
1076 impl_->labels_3d_.erase(liter);
1088 if (impl_->frame_rect_changed_) {
1089 impl_->frame_rect_changed_ =
false;
1091 impl_->controls_->SetViewSize(
Size(f.width, f.height));
1094 int y =
context.screenHeight - (f.height + f.y);
1096 impl_->scene_->SetViewport(f.x, y, f.width, f.height);
1098 if (impl_->intrinsics_.is_using) {
1100 impl_->UpdateFromIntrinsicMatrix(f);
1103 float aspect = 1.0f;
1105 aspect = float(f.width) / float(f.height);
1107 auto* camera = GetCamera();
1108 camera->SetProjection(camera->GetFieldOfView(), aspect,
1109 camera->GetNear(), camera->GetFar(),
1110 camera->GetFieldOfViewType());
1113 impl_->controls_->SetPickNeedsRedraw();
1120 ImGui::SetNextWindowPos(ImVec2(
float(f.x),
float(f.y)));
1121 ImGui::SetNextWindowSize(ImVec2(
float(f.width),
float(f.height)));
1122 ImGui::Begin(impl_->id_.c_str(),
nullptr,
1123 ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoInputs |
1124 ImGuiWindowFlags_NoNav |
1125 ImGuiWindowFlags_NoBackground);
1127 auto render_tex = impl_->scene_->GetView()->GetColorBuffer();
1128 ImTextureID image_id =
reinterpret_cast<ImTextureID
>(render_tex.GetId());
1129 ImGui::Image(image_id, ImVec2(f.width, f.height), ImVec2(0.0f, 1.0f),
1130 ImVec2(1.0f, 0.0f));
1132 if (!impl_->labels_3d_.empty()) {
1134 for (
const auto& l : impl_->labels_3d_) {
1135 auto ndc = GetCamera()->
GetNDC(l->GetPosition());
1136 ndc += Eigen::Vector2f::Ones();
1139 ndc.y() *= f.height;
1140 ImGui::SetCursorScreenPos(
1141 ImVec2(ndc.x() - f.x, f.height - ndc.y() - f.y));
1142 auto color = l->GetTextColor();
1143 ImGui::TextColored({
color.GetRed(),
color.GetGreen(),
1145 "%s", l->GetText());
1150 if (!impl_->ui_lines_.empty()) {
1151 ImDrawList* draw_list = ImGui::GetWindowDrawList();
1153 for (
size_t i = 0; i < impl_->ui_lines_.size() - 1; i += 2) {
1154 auto& p0 = impl_->ui_lines_[i];
1155 auto& p1 = impl_->ui_lines_[i + 1];
1156 draw_list->AddLine({float(p0.x()), float(p0.y())},
1157 {float(p1.x()), float(p1.y())}, ui_color, 2);
1180 impl_->buttons_down_ |= int(e.
button.button);
1182 impl_->buttons_down_ &= ~int(e.
button.button);
1189 impl_->controls_->Mouse(
local);
1191 if (impl_->on_camera_changed_) {
1192 impl_->on_camera_changed_(GetCamera());
1199 impl_->controls_->Key(e);
1201 if (impl_->on_camera_changed_) {
1202 impl_->on_camera_changed_(GetCamera());
1208 auto result = impl_->controls_->Tick(e);
virtual Eigen::Vector3d GetCenter() const override
Returns the center of the geometry coordinates.
Contains the pinhole camera intrinsic parameters.
int height_
Height of the image.
int width_
Width of the image.
Eigen::Matrix3d intrinsic_matrix_
static Application & GetInstance()
bool Tick(const TickEvent &e) override
FlyInteractor(rendering::Camera *camera)
void Mouse(const MouseEvent &e) override
rendering::MatrixInteractorLogic & GetMatrixInteractor() override
void Key(const KeyEvent &e) override
void SetBoundingBox(const ccBBox &bounds)
void SetSunInteractorEnabled(bool enable)
void Key(const KeyEvent &e)
void SetOnPointsPicked(std::function< void(const std::map< std::string, std::vector< std::pair< size_t, Eigen::Vector3d >>> &, int)> on_picked)
void SetCenterOfRotation(const Eigen::Vector3f ¢er)
void SetViewSize(const Size &size)
void SetOnSunLightChanged(std::function< void(const Eigen::Vector3f &)> onChanged)
Interactors(rendering::CloudViewerScene *scene, rendering::Camera *camera)
void SetPickablePointSize(int px)
SceneWidget::Controls GetControls() const
Widget::DrawResult Tick(const TickEvent &e)
void SetPickNeedsRedraw()
void Mouse(const MouseEvent &e)
void SetOnInteractorUIUpdated(std::function< void(const std::vector< Eigen::Vector2i > &)> on_ui)
void SetPickableGeometry(const std::vector< SceneWidget::PickableGeometry > &geometry)
void SetControls(SceneWidget::Controls mode)
void SetOnStartedPolygonPicking(std::function< void()> on_poly_pick)
Eigen::Vector3f GetCenterOfRotation() const
void SetViewSize(const Size &size)
void SetPickableGeometry(const std::vector< SceneWidget::PickableGeometry > &geometry)
void SetOnPointsPicked(std::function< void(const std::map< std::string, std::vector< std::pair< size_t, Eigen::Vector3d >>> &, int)> on_picked)
PickInteractor(rendering::CloudViewerScene *scene, rendering::Camera *camera)
void SetOnInteractorUIUpdated(std::function< void(const std::vector< Eigen::Vector2i > &)> on_ui)
void Mouse(const MouseEvent &e) override
void SetPickablePointSize(int px)
void Key(const KeyEvent &e) override
void SetOnStartedPolygonPicking(std::function< void()> on_poly_pick)
RotateCameraInteractor(rendering::CloudViewerScene *scene, rendering::Camera *camera)
void Mouse(const MouseEvent &e) override
RotateCameraSphereInteractor(rendering::CloudViewerScene *scene, rendering::Camera *camera)
void SetOnChanged(std::function< void(const rendering::Camera::Transform &)> on_changed)
rendering::MatrixInteractorLogic & GetMatrixInteractor() override
RotateIBLInteractor(rendering::Scene *scene, rendering::Camera *camera)
void Mouse(const MouseEvent &e) override
void Key(const KeyEvent &e) override
RotateModelInteractor(rendering::CloudViewerScene *scene, rendering::Camera *camera)
void Mouse(const MouseEvent &e) override
RotateSunInteractor(rendering::CloudViewerScene *scene, rendering::Camera *camera)
rendering::MatrixInteractorLogic & GetMatrixInteractor() override
void SetOnSunLightChanged(std::function< void(const Eigen::Vector3f &)> on_changed)
void Mouse(const MouseEvent &e) override
void Key(const KeyEvent &e) override
void Key(const KeyEvent &e) override
Eigen::Vector3f GetCenterOfRotation() const
rendering::MatrixInteractorLogic & GetMatrixInteractor() override
void SetInteractor(rendering::RotationInteractorLogic *r)
rendering::RotationInteractorLogic * interactor_
void SetCenterOfRotation(const Eigen::Vector3f ¢er)
void Mouse(const MouseEvent &e) override
virtual Eigen::Vector2f GetNDC(const Eigen::Vector3f &pt) const =0
virtual Eigen::Vector3f Unproject(float x, float y, float z, float view_width, float view_height) const =0
Eigen::Transform< float, 3, Eigen::Affine > Transform
static void SetupCameraAsPinholeCamera(rendering::Camera &camera, const Eigen::Matrix3d &intrinsic, const Eigen::Matrix4d &extrinsic, int intrinsic_width_px, int intrinsic_height_px, const ccBBox &scene_bounds)
static float CalcNearPlane()
Returns a good value for the near plane.
static float CalcFarPlane(const rendering::Camera &camera, const ccBBox &scene_bounds)
virtual void LookAt(const Eigen::Vector3f ¢er, const Eigen::Vector3f &eye, const Eigen::Vector3f &up)=0
Camera * GetCamera() const
virtual void RotateZ(int dx, int dy)
Rotates about the forward axis of the matrix.
virtual void Rotate(int dx, int dy)
virtual void Dolly(float dy, DragType drag_type)
void SetViewSize(int width, int height)
Eigen::Vector3f GetCenterOfRotation() const
virtual void UpdateMouseDragUI()
virtual void StartMouseDrag()
virtual void Pan(int dx, int dy)
virtual void EndMouseDrag()
virtual void SetCenterOfRotation(const Eigen::Vector3f ¢er)
virtual std::array< int, 4 > GetViewport() const =0
static double dist(double x1, double y1, double x2, double y2)
uint32_t colorToImguiRGBA(const Color &color)
static const double DELAY_FOR_BEST_RENDERING_SECS
static const double MIN_FAR_PLANE
Generic file read and write utility for python interface.
std::string to_string(const T &n)
struct cloudViewer::visualization::gui::MouseEvent::@17::@21 wheel