Commit e9985077 authored by Alexey Botchkov's avatar Alexey Botchkov

GIS library code cleanup.

GCALC_DBUG_OFF and related infrastructure defined so we can enable/disable debugging conveniently.

per-file comments:
  sql/gcalc_slicescan.cc
GIS library code cleanup.
  sql/gcalc_slicescan.h
GIS library code cleanup.
  sql/gcalc_tools.cc
GIS library code cleanup.
  sql/gcalc_tools.h
GIS library code cleanup.
parent 6e7d578b
This diff is collapsed.
...@@ -17,6 +17,16 @@ ...@@ -17,6 +17,16 @@
#ifndef GCALC_SLICESCAN_INCLUDED #ifndef GCALC_SLICESCAN_INCLUDED
#define GCALC_SLICESCAN_INCLUDED #define GCALC_SLICESCAN_INCLUDED
#ifndef DBUG_OFF
#define GCALC_CHECK_WITH_FLOAT
#else
#define GCALC_DBUG_OFF
#endif /*DBUG_OFF*/
#define GCALC_DBUG_PRINT(b) DBUG_PRINT("Gcalc", b)
#define GCALC_DBUG_ENTER(a) DBUG_ENTER("Gcalc "a)
#define GCALC_DBUG_RETURN(r) DBUG_RETURN(r)
#define GCALC_DBUG_ASSERT(r) DBUG_ASSERT(r)
/* /*
Gcalc_dyn_list class designed to manage long lists of same-size objects Gcalc_dyn_list class designed to manage long lists of same-size objects
...@@ -102,12 +112,6 @@ typedef long long coord2; ...@@ -102,12 +112,6 @@ typedef long long coord2;
#define C_SCALE 1e13 #define C_SCALE 1e13
#define COORD_BASE 2 #define COORD_BASE 2
#ifndef DBUG_OFF
//#define GCALC_CHECK_WITH_FLOAT
#define NO_TESTING
#else
#define NO_TESTING
#endif /*DBUG_OFF*/
class Gcalc_internal_coord class Gcalc_internal_coord
{ {
...@@ -349,22 +353,17 @@ public: ...@@ -349,22 +353,17 @@ public:
class point : public Gcalc_dyn_list::Item class point : public Gcalc_dyn_list::Item
{ {
public: public:
#ifdef TMP_BLOCK
double x;
double dx_dy;
int horiz_dir;
#endif /*TMP_BLOCK*/
Gcalc_coord1 dx; Gcalc_coord1 dx;
Gcalc_coord1 dy; Gcalc_coord1 dy;
Gcalc_heap::Info *pi; Gcalc_heap::Info *pi;
Gcalc_heap::Info *next_pi; Gcalc_heap::Info *next_pi;
sc_thread_id thread; sc_thread_id thread;
const Gcalc_coord1 *l_border;
const Gcalc_coord1 *r_border;
int always_on_left;
const point *intersection_link; const point *intersection_link;
Gcalc_scan_events event; Gcalc_scan_events event;
#ifdef TO_REMOVE
point *next_link;
#endif /*TO_REMOVE*/
inline const point *c_get_next() const inline const point *c_get_next() const
{ return (const point *)next; } { return (const point *)next; }
...@@ -377,10 +376,6 @@ public: ...@@ -377,10 +376,6 @@ public:
void copy_all(const point *from); void copy_all(const point *from);
/* Compare the dx_dy parameters regarding the horiz_dir */ /* Compare the dx_dy parameters regarding the horiz_dir */
/* returns -1 if less, 0 if equal, 1 if bigger */ /* returns -1 if less, 0 if equal, 1 if bigger */
#ifdef TMP_BLOCK
static int cmp_dx_dy(int horiz_dir_a, double dx_dy_a,
int horiz_dir_b, double dx_dy_b);
#endif /*TMP_BLOCK*/
static int cmp_dx_dy(const Gcalc_coord1 *dx_a, static int cmp_dx_dy(const Gcalc_coord1 *dx_a,
const Gcalc_coord1 *dy_a, const Gcalc_coord1 *dy_a,
const Gcalc_coord1 *dx_b, const Gcalc_coord1 *dx_b,
...@@ -409,10 +404,6 @@ public: ...@@ -409,10 +404,6 @@ public:
int n_row; int n_row;
sc_thread_id thread_a; sc_thread_id thread_a;
sc_thread_id thread_b; sc_thread_id thread_b;
#ifdef TMP_BLOCK
double x;
double y;
#endif /*TMP_BLOCK*/
const Gcalc_heap::Intersection_info *ii; const Gcalc_heap::Intersection_info *ii;
inline intersection *get_next() { return (intersection *)next; } inline intersection *get_next() { return (intersection *)next; }
}; };
...@@ -430,9 +421,6 @@ public: ...@@ -430,9 +421,6 @@ public:
const Gcalc_heap::Info *pi; const Gcalc_heap::Info *pi;
const Gcalc_heap::Intersection_info *isc; const Gcalc_heap::Intersection_info *isc;
}; };
#ifdef TMP_BLOCK
double y;
#endif /*TMP_BLOCK*/
slice_state() : slice(NULL) {} slice_state() : slice(NULL) {}
void clear_event_position() void clear_event_position()
{ {
......
This diff is collapsed.
...@@ -222,9 +222,9 @@ public: ...@@ -222,9 +222,9 @@ public:
int get_result(Gcalc_result_receiver *storage); int get_result(Gcalc_result_receiver *storage);
void reset(); void reset();
#ifndef DBUG_OFF #ifndef GCALC_DBUG_OFF
int n_res_points; int n_res_points;
#endif /*DBUG_OFF*/ #endif /*GCALC_DBUG_OFF*/
class res_point : public Gcalc_dyn_list::Item class res_point : public Gcalc_dyn_list::Item
{ {
public: public:
...@@ -235,23 +235,19 @@ public: ...@@ -235,23 +235,19 @@ public:
const Gcalc_heap::Intersection_info *ii; const Gcalc_heap::Intersection_info *ii;
res_point *first_poly_node; res_point *first_poly_node;
}; };
#ifdef TMP_BLOCK
union union
{ {
#endif /*TMP_BLOCK*/
res_point *outer_poly; res_point *outer_poly;
uint32 poly_position; uint32 poly_position;
#ifdef TMP_BLOCK
}; };
#endif /*TMP_BLOCK*/
res_point *up; res_point *up;
res_point *down; res_point *down;
res_point *glue; res_point *glue;
Gcalc_function::shape_type type; Gcalc_function::shape_type type;
Gcalc_dyn_list::Item **prev_hook; Gcalc_dyn_list::Item **prev_hook;
#ifndef DBUG_OFF #ifndef GCALC_DBUG_OFF
int point_n; int point_n;
#endif /*DBUG_OFF*/ #endif /*GCALC_DBUG_OFF*/
void set(const Gcalc_scan_iterator *si); void set(const Gcalc_scan_iterator *si);
res_point *get_next() { return (res_point *)next; } res_point *get_next() { return (res_point *)next; }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment