80 lines
2.8 KiB
C++
80 lines
2.8 KiB
C++
#ifndef BAR_INTERSECTION_VISUALIZER_H
|
|
#define BAR_INTERSECTION_VISUALIZER_H
|
|
|
|
#include "BarIntersection.h"
|
|
#include "VZNL_Types.h"
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
/**
|
|
* @brief VTK-based visualizer for bar intersection detection
|
|
*/
|
|
class BarIntersectionVisualizer {
|
|
public:
|
|
BarIntersectionVisualizer();
|
|
~BarIntersectionVisualizer();
|
|
|
|
/** @brief Visualize original point cloud */
|
|
void VisualizePointCloud(
|
|
const SVzNLPointXYZ* points, int count,
|
|
const std::string& title = "Original Point Cloud"
|
|
);
|
|
|
|
/** @brief Visualize plane segmentation (plane vs non-plane) */
|
|
void VisualizePlaneSegmentation(
|
|
const SVzNLPointXYZ* planePoints, int planeCount,
|
|
const SVzNL3DPointF* normal,
|
|
const SVzNLPointXYZ* allPoints, int totalCount,
|
|
const std::string& title = "Plane Segmentation"
|
|
);
|
|
|
|
/** @brief Visualize aligned point cloud */
|
|
void VisualizeAlignedPoints(
|
|
const SVzNLPointXYZ* alignedPoints, int count,
|
|
const std::string& title = "Aligned Point Cloud"
|
|
);
|
|
|
|
/** @brief Visualize filtered points (bars only) */
|
|
void VisualizeFilteredPoints(
|
|
const SVzNLPointXYZ* filteredPoints, int count,
|
|
const std::string& title = "Filtered Points (Bars)"
|
|
);
|
|
|
|
/** @brief Visualize detected clusters with centroid spheres */
|
|
void VisualizeClusters(
|
|
const SVzNLPointXYZ* points, int count,
|
|
const SGrowthCluster* clusters, int clusterCount,
|
|
const std::string& title = "Detected Clusters"
|
|
);
|
|
|
|
/** @brief Visualize final detection result */
|
|
void VisualizeResult(
|
|
const SVzNLPointXYZ* points, int rows, int cols,
|
|
const SBarIntersectionResult& result,
|
|
const std::string& title = "Detection Result"
|
|
);
|
|
|
|
/** @brief Visualize best cluster highlighted (filtered aligned points) */
|
|
void VisualizeBestCluster(
|
|
const SBarIntersectionResult& result,
|
|
const std::string& title = "Best Cluster"
|
|
);
|
|
|
|
void SetInteractive(bool interactive);
|
|
void SetOutputDirectory(const std::string& dir);
|
|
void SaveScreenshot(void* renderer, const std::string& filename);
|
|
|
|
private:
|
|
bool m_interactive;
|
|
std::string m_outputDir;
|
|
void* CreatePointCloudActor(const SVzNLPointXYZ* points, int count,
|
|
double r, double g, double b, double pointSize);
|
|
void* CreateLineActor(float x1, float y1, float z1,
|
|
float x2, float y2, float z2,
|
|
double r, double g, double b, double lineWidth);
|
|
void* CreateSphereActor(float cx, float cy, float cz, float radius,
|
|
double r, double g, double b);
|
|
};
|
|
|
|
#endif // BAR_INTERSECTION_VISUALIZER_H
|