intersect_debug.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Begin License:
  2. // Copyright (C) 2006-2014 Tobias Sargeant (tobias.sargeant@gmail.com).
  3. // All rights reserved.
  4. //
  5. // This file is part of the Carve CSG Library (http://carve-csg.com/)
  6. //
  7. // This file may be used under the terms of either the GNU General
  8. // Public License version 2 or 3 (at your option) as published by the
  9. // Free Software Foundation and appearing in the files LICENSE.GPL2
  10. // and LICENSE.GPL3 included in the packaging of this file.
  11. //
  12. // This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
  13. // INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
  14. // A PARTICULAR PURPOSE.
  15. // End:
  16. #if defined(HAVE_CONFIG_H)
  17. # include <carve_config.h>
  18. #endif
  19. #include <carve/csg.hpp>
  20. #include <list>
  21. #include <set>
  22. #include <iostream>
  23. #include <algorithm>
  24. #include "intersect_debug.hpp"
  25. namespace carve {
  26. namespace csg {
  27. #if defined(CARVE_DEBUG)
  28. #define DEBUG_DRAW_FACE_EDGES
  29. #define DEBUG_DRAW_INTERSECTIONS
  30. // #define DEBUG_DRAW_OCTREE
  31. #define DEBUG_DRAW_INTERSECTION_LINE
  32. // #define DEBUG_DRAW_GROUPS
  33. // #define DEBUG_PRINT_RESULT_FACES
  34. IntersectDebugHooks *g_debug = NULL;
  35. IntersectDebugHooks *intersect_installDebugHooks(IntersectDebugHooks *hooks) {
  36. IntersectDebugHooks *h = g_debug;
  37. g_debug = hooks;
  38. return h;
  39. }
  40. bool intersect_debugEnabled() { return true; }
  41. #else
  42. IntersectDebugHooks *intersect_installDebugHooks(IntersectDebugHooks * /* hooks */) {
  43. return NULL;
  44. }
  45. bool intersect_debugEnabled() { return false; }
  46. #endif
  47. }
  48. }