Skip to content

File CLI_Metrics_config.cpp

File List > benchmark > metrics > CLI_Metrics_config.cpp

Go to the documentation of this file

#include "implementations/bench_bounding_box.h"
#include "implementations/bench_centroid_to_face.h"
#include "implementations/bench_edge_face_intersections.h"
#include "implementations/bench_global_memory_peak.h"
#include "implementations/bench_heatmap.h"
#include "CLI/App.hpp"
#include "implementations/bench_holes.h"


// --- Doc :
// Ajouter métrique : auto* cmd = group.add_subcommand("nom_metrique", "description_metrique");
// Ajouter callback (méthode à executer) :
// memory_peak->callback([]() {
//      metrics.push_back(methode_metrique);
// });

void static addMetrics(CLI::Option_group& group, std::vector<std::shared_ptr<Metric>>& metrics) {
    // Métrique nombre intersections arete - face
    auto* EFIntersections = group.add_subcommand("intersections", "Affiche le nombre d'intersections Arete-Face entre le mesh original et le mesh reconstruit");
    EFIntersections->callback([&metrics]() {
        metrics.push_back(std::make_shared<EdgeFaceIntersection>());
    });

    auto* bbox = group.add_subcommand("bbox", "Bounding box metrics");
    bbox->callback([&metrics]() {
        metrics.push_back(std::make_shared<BoundingBoxMetric>());
    });

    auto* ctf = group.add_subcommand("ctf", "Distances centroid -> faces");
    ctf->callback([&metrics]() {
        metrics.push_back(std::make_shared<CentroidToFaceMetric>());
    });

    auto* memory_peak = group.add_subcommand("global_peak", "Donne le pic mémoire global (quantité de mémoire maximum que l'application a besoin) en Mo");
    memory_peak->callback([&metrics]() {
        metrics.push_back(std::make_shared<MemoryPeakGlobal>());
    });

    auto* heatmap = group.add_subcommand("heatmap", "Ajoute des coordonnées de textures en chaque point d ela mesh reconstruite pour donner une carte de chaleur"
                                                    "correspondant à la distance point (mesh reconstruit) vers face (mesh original)");
    heatmap->callback([&metrics]() {
        metrics.push_back(std::make_shared<Heatmap>());
    });

    auto* holes = group.add_subcommand("holes", "Donne le nombre de trous détectés dans le mesh reconstruit");
    holes->callback([&metrics]() {
        metrics.push_back(std::make_shared<Holes>());
    });

    auto* vertices = group.add_subcommand("vertices", "Donne le nombre de sommets du maillage d'origine et du maillage reconstruit");
    vertices->callback([&metrics]() {
        metrics.push_back(std::make_shared<VertexCount>());
    });

    auto* faces = group.add_subcommand("faces", "Donne le nombre de faces du maillage d'origine et du maillage reconstruit");
    faces->callback([&metrics]() {
        metrics.push_back(std::make_shared<FaceCount>());
    });
}