//
// postprocess.cpp
//     The actual TriplClust post-processing.
//
// Author:  Christoph Dalitz
// Date:    2022-11-07
// License: see ../LICENSE
//

#ifndef POSTPROCESS_H
#define POSTPROCESS_H

#include "pointcloud.h"
#include "directedgraph.h"

/** @file */ 

/**
 * @brief Processes entire point cloud and reassigns cluster id labels, if appropriate.
 *
 * @param cloud Pointcloud generated by triplclust
 * @param min_depth Minimum number of points making a branch
 * @param verbose Verbosity level
 * @return RC Number of split up clusters 
 */
int process_pointcloud(PointCloud &cloud, int min_depth=25, int verbose=0);


/**
 * @brief processes cluster with given id in point cloud and reassign cluster id labels, if appropriate.
 * 
 * @param cloud the complete point cloud
 * @param cloud_indexes indexes of elements in cloud with cluster_id
 * @param cluster_id cluster id that is to be processed
 * @param next_label next free label for new ids
 * @param min_depth minimum number of points making a branch
 * @param verbose verbosity level
 * @return int number of split up clusters
 */
int process_cluster(PointCloud &cloud, std::vector<size_t> cloud_indexes, size_t cluster_id, size_t* next_label, size_t min_depth, int verbose);


#endif
