6#include "reusex/core/logging.hpp"
7#include "reusex/types.hpp"
9#include <pcl/Vertices.h>
10#include <pcl/correspondence.h>
12#include <Eigen/Geometry>
13#include <fmt/format.h>
53 using Pair = std::pair<Eigen::Vector4d, Eigen::Vector3d>;
62 if constexpr (std::is_same_v<T, Eigen::Vector4d>) {
64 }
else if constexpr (std::is_same_v<
65 T, std::pair<Eigen::Vector4d, Eigen::Vector3d>>) {
67 }
else if constexpr (std::is_same_v<T, PlanePair>) {
69 }
else if constexpr (std::is_same_v<
70 T, std::shared_ptr<geometry::CellComplex>>) {
72 }
else if constexpr (std::is_same_v<T, CloudConstPtr>) {
77 core::debug(
"viewer_add_geometry<{}> called for '{}' at stage '{}' "
78 "(no handler registered)",
79 typeid(T).name(), name,
to_string(stage));
86 for (
size_t i = 0; i < geometries.size(); ++i) {
94 [[maybe_unused]]
const Eigen::Vector4d &plane,
95 Stage stage,
int = 0) {
97 core::debug(
"viewer_add_plane called for '{}' at stage '{}' "
98 "(no handler registered)",
103 std::string_view name,
104 [[maybe_unused]]
const std::pair<Eigen::Vector4d, Eigen::Vector3d> &plane,
105 Stage stage,
int = 0) {
107 core::debug(
"viewer_add_plane (with origin) called for '{}' at stage '{}' "
108 "(no handler registered)",
114 Stage stage,
int = 0) {
116 core::debug(
"viewer_add_plane_pair called for '{}' at stage '{}' "
117 "(no handler registered)",
122 std::string_view name,
123 [[maybe_unused]]
const std::shared_ptr<reusex::geometry::CellComplex> &cc,
124 Stage stage,
int = 0) {
126 core::debug(
"viewer_add_cell_complex called for '{}' at stage '{}' "
127 "(no handler registered)",
133 Stage stage,
int = 0) {
135 core::debug(
"viewer_add_cloud called for '{}' at stage '{}' "
136 "(no handler registered)",
141 std::string_view name, [[maybe_unused]]
double focal_x,
142 [[maybe_unused]]
double focal_y, [[maybe_unused]]
int image_width,
143 [[maybe_unused]]
int image_height,
144 [[maybe_unused]]
const Eigen::Affine3f &pose,
Stage stage,
146 core::debug(
"viewer_add_camera_frustum called for '{}' at stage '{}' "
147 "(no handler registered)",
152 std::string_view name, [[maybe_unused]]
const CloudLocPtr &disc_points,
153 [[maybe_unused]]
const std::shared_ptr<std::vector<pcl::Vertices>>
155 [[maybe_unused]]
const pcl::CorrespondencesPtr &edges,
Stage stage,
157 core::debug(
"viewer_add_visibility_graph called for '{}' at stage '{}' "
158 "(no handler registered)",
166 Stage stage,
int = 0) {
167 core::debug(
"viewer_add_labeled_cloud called for '{}' at stage '{}' "
168 "(no handler registered)",
virtual void on_process_started(Stage, size_t)
virtual void on_process_finished(Stage)
virtual void on_process_updated(Stage, size_t)
virtual ~IProgressObserver()=default
virtual void viewer_add_plane(std::string_view name, const std::pair< Eigen::Vector4d, Eigen::Vector3d > &plane, Stage stage, int=0)
virtual ~IVisualObserver()=default
virtual void viewer_add_cloud(std::string_view name, const CloudConstPtr &cloud, Stage stage, int=0)
std::pair< Eigen::Vector4d, Eigen::Vector3d > Pair
virtual void viewer_add_plane_pair(std::string_view name, const PlanePair &pair, Stage stage, int=0)
virtual void viewer_add_camera_frustum(std::string_view name, double focal_x, double focal_y, int image_width, int image_height, const Eigen::Affine3f &pose, Stage stage, int=0)
virtual void viewer_add_cell_complex(std::string_view name, const std::shared_ptr< reusex::geometry::CellComplex > &cc, Stage stage, int=0)
virtual void viewer_add_visibility_graph(std::string_view name, const CloudLocPtr &disc_points, const std::shared_ptr< std::vector< pcl::Vertices > > &disc_outlines, const pcl::CorrespondencesPtr &edges, Stage stage, int=0)
std::pair< Pair, Pair > PlanePair
virtual void viewer_add_labeled_cloud(std::string_view name, const CloudConstPtr &cloud, const CloudLConstPtr &labels, Stage stage, int=0)
void viewer_add_geometry(std::string_view name, const T &geometry, Stage stage, int idx=0)
virtual void viewer_add_plane(std::string_view name, const Eigen::Vector4d &plane, Stage stage, int=0)
void viewer_add_geometries(std::string_view name, const T &geometries, Stage stage)
void operator+=(size_t increment)
ProgressObserver(Stage stage, size_t total=0)
void update(size_t progress=1)
void reset_visual_observer()
auto to_string(Material value) -> std::string_view
Convert Material enum to its string identifier.
void set_visual_observer(IVisualObserver *observer)
auto get_visual_observer() -> IVisualObserver *
void reset_progress_observer()
auto get_progress_observer() -> IProgressObserver *
void set_progress_observer(IProgressObserver *observer)
typename CloudL::ConstPtr CloudLConstPtr
typename Cloud::ConstPtr CloudConstPtr
typename CloudLoc::Ptr CloudLocPtr