remove debug code

less verbose output
This commit is contained in:
Sven Oesau 2024-04-25 10:45:20 +02:00
parent 1a54b648a4
commit 436a53e4b1
5 changed files with 13 additions and 84 deletions

View File

@ -38,7 +38,7 @@ public:
typedef typename Kernel::Line_2 Line_2;
typedef typename Kernel::Segment_2 Segment_2;
typedef Support_line_2<Kernel> Support_line_DS;
typedef Support_line<Kernel> Support_line_DS;
typedef CGAL::KSP_2::internal::Vertex<FT> Vertex;
typedef CGAL::KSP_2::internal::Segment Segment;

View File

@ -211,7 +211,6 @@ public:
pfaces.clear();
}
};
std::ofstream eventlog;
private:
std::vector<Support_plane> m_support_planes;
@ -220,7 +219,6 @@ private:
std::vector<std::vector<Point_3> > m_input_polygons;
To_exact to_exact;
From_exact from_exact;
@ -245,7 +243,6 @@ private:
public:
Data_structure(const Parameters& parameters, const std::string &prefix) : to_exact(), from_exact(), m_parameters(parameters), m_prefix(prefix) {
eventlog << std::setprecision(17);
}
template<typename Type1, typename Type2, typename ResultType>
@ -376,15 +373,11 @@ public:
if (m_intersection_graph.iedge_is_on_bbox(edge))
return 0;
bool verbose = false;
// Count faces
std::size_t numfaces = 0;
for (std::size_t i = 0; i < m_support_planes.size(); i++)
numfaces += m_support_planes[i].data().mesh.number_of_faces();
eventlog << "#faces: " << numfaces << std::endl;
Support_plane& sp = m_support_planes[sp_idx];
To_exact to_exact;
@ -394,12 +387,6 @@ public:
typename Intersection_graph::Kinetic_interval& kinetic_interval = m_intersection_graph.kinetic_interval(edge, sp_idx);
/*
if (kinetic_interval.size() != 0) {
int a;
a = 3;
}*/
Point_2 s = sp.to_2d(from_exact(point_3(m_intersection_graph.source(edge))));
IkPoint_2 s2 = sp.to_2d(point_3(m_intersection_graph.source(edge)));
Point_2 t = sp.to_2d(from_exact(point_3(m_intersection_graph.target(edge))));
@ -431,20 +418,6 @@ public:
else
event.face = faces.first;
if (event.face == 403 && m_intersection_graph.source(edge) == 393 && m_intersection_graph.target(edge) == 382) {
verbose = true;
eventlog << "triggered" << std::flush;
}
if (verbose) {
eventlog << "s: " << s.x() << " " << s.y() << std::endl;
eventlog << "t: " << t.x() << " " << t.y() << std::endl;
eventlog << "segment: " << segment << std::endl;
eventlog << "segment_length: " << segment_length << std::endl;
eventlog << "to_source: " << to_source << std::endl;
eventlog << "to_target: " << to_target << std::endl;
}
for (std::size_t i = 0; i < sp.data().original_directions.size(); i++) {
if (source_idx == uninitialized && sp.data().original_directions[i] > to_source)
source_idx = i;
@ -462,13 +435,6 @@ public:
IkVector_2 tt2 = to_target2.vector(), ts2 = to_source2.vector();
bool ccw = (tt2.x() * ts2.y() - tt2.y() * ts2.x()) < 0;
if (verbose) {
eventlog << "source_idx: " << source_idx << std::endl;
eventlog << "target_idx: " << target_idx << std::endl;
eventlog << "tt2: " << from_exact(tt2) << std::endl;
eventlog << "ccw: " << ccw << std::endl;
}
// Check whether the segment is cw or ccw oriented.
if (!ccw) {
std::size_t tmp = source_idx;
@ -484,11 +450,6 @@ public:
t2 = tmp_p2;
}
if (verbose) {
eventlog << "s2: " << from_exact(s2) << std::endl;
eventlog << "t2: " << from_exact(t2) << std::endl;
}
if (source_idx <= target_idx)
num = target_idx - source_idx;
else
@ -498,10 +459,6 @@ public:
std::vector<IkPoint_2> intersections(num);
std::vector<IkFT> intersections_bary(num);
if (verbose) {
eventlog << "num: " << num << std::endl;
}
// Shooting rays to find intersection with line of IEdge
typename Intersection_kernel::Line_3 l3 = m_intersection_graph.line_3(edge);
const typename Intersection_kernel::Line_2 l = sp.to_2d(l3);
@ -514,8 +471,6 @@ public:
}
IkPoint_2 p;
FT diff = sp.data().original_vectors[idx].squared_length() - from_exact(sp.data().original_rays[idx].to_vector().squared_length());
if (CGAL::abs(diff) > 0.001)
eventlog << "diff: " << diff << std::endl;
if (CGAL::assign(p, result)) {
IkFT l = CGAL::approximate_sqrt(sp.data().original_vectors[idx].squared_length());
@ -533,18 +488,6 @@ public:
// If the intersection is a segment, it can be safely ignored as there are also two intersections with the adjacent edges.
}
if (verbose) {
eventlog << "intersections_bary:";
for (IkFT bary : intersections_bary)
eventlog << " " << from_exact(bary);
eventlog << std::endl;
eventlog << "intersections:";
for (IkPoint_2 p : intersections)
eventlog << " " << from_exact(p);
eventlog << std::endl;
}
// Calculate pedge vs ivertex collision
IkFT edge_time[2];
@ -613,17 +556,16 @@ public:
event.intersection_bary = 1;
}
/*
if (kinetic_interval.size() > 4) {
if (kinetic_interval[2].first > kinetic_interval[1].first) {
int a;
a = 2;
}
}*/
}
CGAL_assertion(0 <= event.intersection_bary && event.intersection_bary <= 1);
eventlog.flush();
return event.time;
}
@ -634,8 +576,6 @@ public:
for (std::size_t i = 0; i < m_support_planes.size(); i++)
faces += m_support_planes[i].data().mesh.number_of_faces();
eventlog << "#faces: " << faces << std::endl;
for (std::size_t sp_idx = 6; sp_idx < m_support_planes.size(); sp_idx++) {
std::vector<IEdge> border;
m_support_planes[sp_idx].get_border(m_intersection_graph, border);
@ -647,8 +587,6 @@ public:
Face_event fe;
IkFT t = calculate_edge_intersection_time(sp_idx, edge, fe);
if (t > 0) {
eventlog << CGAL::to_double(fe.time) << ": " << fe.support_plane << " " << fe.face << " " << fe.crossed_edge << " " << CGAL::to_double(fe.intersection_bary) << std::endl;
eventlog.flush();
queue.push(fe);
}
}

View File

@ -140,7 +140,6 @@ private:
********************************/
void apply(const Face_event& event) {
m_data.eventlog << ".";
if (m_data.igraph().face(event.face).part_of_partition) {
return;
}

View File

@ -729,18 +729,6 @@ public:
const Vertex_index add_vertex(const Point_2& point) {
return m_data->mesh.add_vertex(point);
}
/*
const Vertex_index duplicate_vertex(const Vertex_index& v) {
// TODO: We cannot take it by reference because it fails for EPECK
// when called from front_and_back_34() in Data_structure.
const auto pp = m_data->mesh.point(v);
const auto vi = m_data->mesh.add_vertex(pp);
m_data->direction[vi] = m_data->direction[v];
m_data->v_ivertex_map[vi] = m_data->v_ivertex_map[v];
m_data->v_iedge_map[vi] = m_data->v_iedge_map[v];
return vi;
}*/
void remove_vertex(const Vertex_index& vi) {
m_data->mesh.remove_vertex(vi);

View File

@ -984,10 +984,12 @@ public:
if (!added_volumes[i])
std::cout << "volume " << i << " has not been added" << std::endl;
std::cout << "lcc #volumes: " << lcc.template one_dart_per_cell<3>().size() << " ksp #volumes: " << number_of_volumes() << std::endl;
std::cout << "lcc #faces: " << lcc.template one_dart_per_cell<2>().size() << " ksp #faces: " << num_faces << std::endl;
std::cout << "lcc #n-edges: " << lcc.template one_dart_per_cell<1>().size() << std::endl;
std::cout << "lcc #vtx: " << lcc.template one_dart_per_cell<0>().size() << " ksp #vtx: " << vtx.size() << std::endl;
if (m_parameters.verbose) {
std::cout << "lcc #volumes: " << lcc.template one_dart_per_cell<3>().size() << " ksp #volumes: " << number_of_volumes() << std::endl;
std::cout << "lcc #faces: " << lcc.template one_dart_per_cell<2>().size() << " ksp #faces: " << num_faces << std::endl;
std::cout << "lcc #n-edges: " << lcc.template one_dart_per_cell<1>().size() << std::endl;
std::cout << "lcc #vtx: " << lcc.template one_dart_per_cell<0>().size() << " ksp #vtx: " << vtx.size() << std::endl;
}
// Verification
// Check attributes in each dart
@ -1012,7 +1014,8 @@ public:
}
}
lcc.display_characteristics(std::cout) << std::endl;
if (m_parameters.verbose)
lcc.display_characteristics(std::cout) << std::endl;
if (!lcc.is_valid())
std::cout << "LCC is not valid" << std::endl;
@ -2391,7 +2394,8 @@ private:
idx++;
}
std::cout << "input split into " << m_partition_nodes.size() << " partitions" << std::endl;
if (m_parameters.verbose)
std::cout << "input split into " << m_partition_nodes.size() << " partitions" << std::endl;
}
};