15#include "reusex/core/logging.hpp"
16#include "reusex/core/processing_observer.hpp"
17#include "reusex/core/stages.hpp"
18#include "reusex/types.hpp"
20#include <pcl/Vertices.h>
21#include <pcl/correspondence.h>
23#include <Eigen/Geometry>
24#include <fmt/format.h>
43 using Pair = std::pair<Eigen::Vector4d, Eigen::Vector3d>;
52 if constexpr (std::is_same_v<T, Eigen::Vector4d>) {
54 }
else if constexpr (std::is_same_v<
55 T, std::pair<Eigen::Vector4d, Eigen::Vector3d>>) {
57 }
else if constexpr (std::is_same_v<T, PlanePair>) {
59 }
else if constexpr (std::is_same_v<
60 T, std::shared_ptr<geometry::CellComplex>>) {
62 }
else if constexpr (std::is_same_v<T, CloudConstPtr>) {
67 core::debug(
"viewer_add_geometry<{}> called for '{}' at stage '{}' "
68 "(no handler registered)",
69 typeid(T).name(), name,
to_string(stage));
76 for (
size_t i = 0; i < geometries.size(); ++i) {
84 [[maybe_unused]]
const Eigen::Vector4d &plane,
85 Stage stage,
int = 0) {
87 core::debug(
"viewer_add_plane called for '{}' at stage '{}' "
88 "(no handler registered)",
93 std::string_view name,
94 [[maybe_unused]]
const std::pair<Eigen::Vector4d, Eigen::Vector3d> &plane,
95 Stage stage,
int = 0) {
97 core::debug(
"viewer_add_plane (with origin) called for '{}' at stage '{}' "
98 "(no handler registered)",
104 Stage stage,
int = 0) {
106 core::debug(
"viewer_add_plane_pair called for '{}' at stage '{}' "
107 "(no handler registered)",
112 std::string_view name,
113 [[maybe_unused]]
const std::shared_ptr<reusex::geometry::CellComplex> &cc,
114 Stage stage,
int = 0) {
116 core::debug(
"viewer_add_cell_complex called for '{}' at stage '{}' "
117 "(no handler registered)",
123 Stage stage,
int = 0) {
125 core::debug(
"viewer_add_cloud called for '{}' at stage '{}' "
126 "(no handler registered)",
131 std::string_view name, [[maybe_unused]]
double focal_x,
132 [[maybe_unused]]
double focal_y, [[maybe_unused]]
int image_width,
133 [[maybe_unused]]
int image_height,
134 [[maybe_unused]]
const Eigen::Affine3f &pose,
Stage stage,
136 core::debug(
"viewer_add_camera_frustum called for '{}' at stage '{}' "
137 "(no handler registered)",
142 std::string_view name, [[maybe_unused]]
const CloudLocPtr &disc_points,
143 [[maybe_unused]]
const std::shared_ptr<std::vector<pcl::Vertices>>
145 [[maybe_unused]]
const pcl::CorrespondencesPtr &edges,
Stage stage,
147 core::debug(
"viewer_add_visibility_graph called for '{}' at stage '{}' "
148 "(no handler registered)",
156 Stage stage,
int = 0) {
157 core::debug(
"viewer_add_labeled_cloud called for '{}' at stage '{}' "
158 "(no handler registered)",
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)
auto to_string(Material value) -> std::string_view
Convert Material enum to its string identifier.
typename CloudL::ConstPtr CloudLConstPtr
typename Cloud::ConstPtr CloudConstPtr
typename CloudLoc::Ptr CloudLocPtr