opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
landmark_helpers.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <cstddef>
8#include <filesystem>
9#include <functional>
10#include <iosfwd>
11#include <optional>
12#include <span>
13#include <string>
14#include <string_view>
15#include <vector>
16
17namespace opyn { class MaybeNamedLandmarkPair; }
18
19namespace opyn
20{
21 struct CSVParseWarning final {
22 size_t lineNumber;
23 std::string message;
24 };
25
26 std::string to_string(const CSVParseWarning&);
27
29 std::istream&,
30 const std::function<void(Landmark&&)>& landmarkConsumer,
31 const std::function<void(CSVParseWarning)>& warningConsumer = [](auto){}
32 );
33
35 const std::filesystem::path&
36 );
37
39 std::ostream&,
40 const std::function<std::optional<Landmark>()>& landmarkProducer,
42 );
43
44 // generates names for any unnamed landmarks and ensures that the names are
45 // unique amongst all supplied landmarks (both named and unnamed)
46 std::vector<NamedLandmark> GenerateNames(
47 std::span<const Landmark>,
48 std::string_view prefix = "unnamed_"
49 );
50
52 std::vector<Landmark>,
53 std::vector<Landmark>,
54 const std::function<void(const MaybeNamedLandmarkPair&)>& consumer
55 );
56}
Definition maybe_named_landmark_pair.h:17
Definition component_registry.h:14
void ReadLandmarksFromCSV(std::istream &, const std::function< void(Landmark &&)> &landmarkConsumer, const std::function< void(CSVParseWarning)> &warningConsumer=[](auto){})
std::string to_string(const CSVParseWarning &)
LandmarkCSVFlags
Definition landmark_csv_flags.h:7
void TryPairingLandmarks(std::vector< Landmark >, std::vector< Landmark >, const std::function< void(const MaybeNamedLandmarkPair &)> &consumer)
std::vector< NamedLandmark > GenerateNames(std::span< const Landmark >, std::string_view prefix="unnamed_")
std::vector< Landmark > ReadLandmarksFromCSVIntoVectorOrThrow(const std::filesystem::path &)
void WriteLandmarksToCSV(std::ostream &, const std::function< std::optional< Landmark >()> &landmarkProducer, LandmarkCSVFlags=LandmarkCSVFlags::None)
Definition landmark_helpers.h:21
size_t lineNumber
Definition landmark_helpers.h:22
std::string message
Definition landmark_helpers.h:23
Definition landmark.h:10