mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 18:55:53 +08:00
Fix @(Lukas Matena) note about using NDEBUG
This commit is contained in:
parent
d45ab1c484
commit
746300eafd
@ -7,10 +7,9 @@
|
|||||||
|
|
||||||
using namespace Slic3r;
|
using namespace Slic3r;
|
||||||
|
|
||||||
// Faster debug, comment when you want deep check
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
#define NDEBUG
|
// #define EXPENSIVE_DEBUG_CHECKS
|
||||||
#endif // !NDEBUG
|
#endif // NDEBUG
|
||||||
|
|
||||||
// only private namespace not neccessary be in .hpp
|
// only private namespace not neccessary be in .hpp
|
||||||
namespace QuadricEdgeCollapse {
|
namespace QuadricEdgeCollapse {
|
||||||
@ -100,12 +99,12 @@ namespace QuadricEdgeCollapse {
|
|||||||
const Triangle &t1, CopyEdgeInfos& infos, EdgeInfos &e_infos1);
|
const Triangle &t1, CopyEdgeInfos& infos, EdgeInfos &e_infos1);
|
||||||
void compact(const VertexInfos &v_infos, const TriangleInfos &t_infos, const EdgeInfos &e_infos, indexed_triangle_set &its);
|
void compact(const VertexInfos &v_infos, const TriangleInfos &t_infos, const EdgeInfos &e_infos, indexed_triangle_set &its);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifdef EXPENSIVE_DEBUG_CHECKS
|
||||||
void store_surround(const char *obj_filename, size_t triangle_index, int depth, const indexed_triangle_set &its,
|
void store_surround(const char *obj_filename, size_t triangle_index, int depth, const indexed_triangle_set &its,
|
||||||
const VertexInfos &v_infos, const EdgeInfos &e_infos);
|
const VertexInfos &v_infos, const EdgeInfos &e_infos);
|
||||||
bool check_neighbors(const indexed_triangle_set &its, const TriangleInfos &t_infos,
|
bool check_neighbors(const indexed_triangle_set &its, const TriangleInfos &t_infos,
|
||||||
const VertexInfos &v_infos, const EdgeInfos &e_infos);
|
const VertexInfos &v_infos, const EdgeInfos &e_infos);
|
||||||
#endif /* NDEBUG */
|
#endif /* EXPENSIVE_DEBUG_CHECKS */
|
||||||
|
|
||||||
// constants --> may be move to config
|
// constants --> may be move to config
|
||||||
const uint32_t check_cancel_period = 16; // how many edge to reduce before call throw_on_cancel
|
const uint32_t check_cancel_period = 16; // how many edge to reduce before call throw_on_cancel
|
||||||
@ -301,9 +300,9 @@ void Slic3r::its_quadric_edge_collapse(
|
|||||||
t_info1.set_deleted();
|
t_info1.set_deleted();
|
||||||
// triangle counter decrementation
|
// triangle counter decrementation
|
||||||
actual_triangle_count-=2;
|
actual_triangle_count-=2;
|
||||||
#ifndef NDEBUG
|
#ifdef EXPENSIVE_DEBUG_CHECKS
|
||||||
assert(check_neighbors(its, t_infos, v_infos, e_infos));
|
assert(check_neighbors(its, t_infos, v_infos, e_infos));
|
||||||
#endif // NDEBUG
|
#endif // EXPENSIVE_DEBUG_CHECKS
|
||||||
}
|
}
|
||||||
|
|
||||||
// compact triangle
|
// compact triangle
|
||||||
@ -815,7 +814,8 @@ void QuadricEdgeCollapse::compact(const VertexInfos & v_infos,
|
|||||||
its.indices.erase(its.indices.begin() + ti_new, its.indices.end());
|
its.indices.erase(its.indices.begin() + ti_new, its.indices.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifdef EXPENSIVE_DEBUG_CHECKS
|
||||||
|
|
||||||
// store triangle surrounding to file
|
// store triangle surrounding to file
|
||||||
void QuadricEdgeCollapse::store_surround(const char *obj_filename,
|
void QuadricEdgeCollapse::store_surround(const char *obj_filename,
|
||||||
size_t triangle_index,
|
size_t triangle_index,
|
||||||
@ -925,4 +925,4 @@ bool QuadricEdgeCollapse::check_neighbors(const indexed_triangle_set &its,
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif /* NDEBUG */
|
#endif /* EXPENSIVE_DEBUG_CHECKS */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user