mirror of https://github.com/CGAL/cgal
[OTR2] Deterministic reconstruction (#9092)
## Summary of Changes Using timestamps to make iteration through vertices, edges and faces deterministic ## Release Management * Affected package(s): Optimal_transportation_reconstruction_2 * Issue(s) solved (if any): fix #8745
This commit is contained in:
commit
754e57ac3c
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
#include <CGAL/OTR_2/Cost.h>
|
||||
#include <CGAL/Triangulation_face_base_2.h>
|
||||
#include <CGAL/Has_timestamp.h>
|
||||
#include <CGAL/Time_stamper.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -62,6 +64,8 @@ private:
|
|||
|
||||
FT m_relevance[3];
|
||||
|
||||
std::size_t time_stamp_ = std::size_t(-2);
|
||||
|
||||
public:
|
||||
Reconstruction_face_base_2()
|
||||
{
|
||||
|
|
@ -190,6 +194,18 @@ public:
|
|||
for (int i = 0; i < 3; ++i)
|
||||
clean_samples(i);
|
||||
}
|
||||
|
||||
/// For the determinism of Compact_container iterators
|
||||
///@{
|
||||
typedef Tag_true Has_timestamp;
|
||||
|
||||
std::size_t time_stamp() const {
|
||||
return time_stamp_;
|
||||
}
|
||||
void set_time_stamp(const std::size_t& ts) {
|
||||
time_stamp_ = ts;
|
||||
}
|
||||
///@}
|
||||
};
|
||||
|
||||
//---------------STRUCT LESS FACE_HANDLE---------------------
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
|
||||
#include <CGAL/Triangulation_vertex_base_2.h>
|
||||
#include <CGAL/Has_timestamp.h>
|
||||
#include <CGAL/Time_stamper.h>
|
||||
#include <CGAL/OTR_2/Sample.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -53,6 +55,7 @@ private:
|
|||
int m_sample;
|
||||
Point m_relocated;
|
||||
FT m_relevance;
|
||||
std::size_t time_stamp_ = std::size_t(-2);
|
||||
|
||||
|
||||
public:
|
||||
|
|
@ -110,6 +113,18 @@ public:
|
|||
Point& relocated() { return m_relocated; }
|
||||
|
||||
bool has_sample_assigned() const { return sample() != -1; }
|
||||
|
||||
/// For the determinism of Compact_container iterators
|
||||
///@{
|
||||
typedef Tag_true Has_timestamp;
|
||||
|
||||
std::size_t time_stamp() const {
|
||||
return time_stamp_;
|
||||
}
|
||||
void set_time_stamp(const std::size_t& ts) {
|
||||
time_stamp_ = ts;
|
||||
}
|
||||
///@}
|
||||
};
|
||||
//---------------STRUCT LESS VERTEX_HANDLE---------------------
|
||||
template <class T>
|
||||
|
|
|
|||
Loading…
Reference in New Issue