Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
248f2da6
Commit
248f2da6
authored
Oct 16, 2011
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GIS code cleanup.
parent
486df979
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
458 additions
and
484 deletions
+458
-484
sql/gcalc_slicescan.cc
sql/gcalc_slicescan.cc
+426
-414
sql/gcalc_slicescan.h
sql/gcalc_slicescan.h
+32
-70
No files found.
sql/gcalc_slicescan.cc
View file @
248f2da6
This diff is collapsed.
Click to expand it.
sql/gcalc_slicescan.h
View file @
248f2da6
...
@@ -114,78 +114,34 @@ protected:
...
@@ -114,78 +114,34 @@ protected:
/* Internal Gcalc coordinates to provide the precise calculations */
/* Internal Gcalc coordinates to provide the precise calculations */
#define GCALC_DIG_BASE 1000000000
#define GCALC_DIG_BASE 1000000000
typedef
int32
gcalc_digit_t
;
typedef
u
int32
gcalc_digit_t
;
typedef
long
long
gcalc_coord2
;
typedef
unsigned
long
long
gcalc_coord2
;
typedef
gcalc_digit_t
Gcalc_internal_coord
;
#define GCALC_COORD_BASE 2
#define GCALC_COORD_BASE 2
#define GCALC_COORD_BASE2 4
#define GCALC_COORD_BASE3 6
#define GCALC_COORD_BASE4 8
#define GCALC_COORD_BASE5 10
class
Gcalc_internal_coord
typedef
gcalc_digit_t
Gcalc_coord1
[
GCALC_COORD_BASE
];
{
typedef
gcalc_digit_t
Gcalc_coord2
[
GCALC_COORD_BASE
*
2
];
public:
typedef
gcalc_digit_t
Gcalc_coord3
[
GCALC_COORD_BASE
*
3
];
gcalc_digit_t
*
digits
;
int
sign
;
int
n_digits
;
void
set_zero
();
int
is_zero
()
const
;
#ifdef GCALC_CHECK_WITH_FLOAT
static
double
*
coord_extent
;
long
double
get_double
()
const
;
#endif
/*GCALC_CHECK_WITH_FLOAT*/
};
class
Gcalc_coord1
:
public
Gcalc_internal_coord
{
gcalc_digit_t
c
[
GCALC_COORD_BASE
];
public:
void
init
()
{
n_digits
=
GCALC_COORD_BASE
;
digits
=
c
;
}
int
set_double
(
double
d
,
double
ext
);
void
copy
(
const
Gcalc_coord1
*
from
);
};
class
Gcalc_coord2
:
public
Gcalc_internal_coord
{
gcalc_digit_t
c
[
GCALC_COORD_BASE
*
2
];
public:
void
init
()
{
n_digits
=
GCALC_COORD_BASE
*
2
;
digits
=
c
;
}
};
class
Gcalc_coord3
:
public
Gcalc_internal_coord
{
gcalc_digit_t
c
[
GCALC_COORD_BASE
*
3
];
public:
void
init
()
{
n_digits
=
GCALC_COORD_BASE
*
3
;
digits
=
c
;
}
};
void
gcalc_mul_coord
(
Gcalc_internal_coord
*
result
,
void
gcalc_mul_coord
(
Gcalc_internal_coord
*
result
,
int
result_len
,
const
Gcalc_internal_coord
*
a
,
const
Gcalc_internal_coord
*
a
,
int
a_len
,
const
Gcalc_internal_coord
*
b
);
const
Gcalc_internal_coord
*
b
,
int
b_len
);
void
gcalc_add_coord
(
Gcalc_internal_coord
*
result
,
void
gcalc_add_coord
(
Gcalc_internal_coord
*
result
,
int
result_len
,
const
Gcalc_internal_coord
*
a
,
const
Gcalc_internal_coord
*
a
,
const
Gcalc_internal_coord
*
b
);
const
Gcalc_internal_coord
*
b
);
void
gcalc_sub_coord
(
Gcalc_internal_coord
*
result
,
void
gcalc_sub_coord
(
Gcalc_internal_coord
*
result
,
int
result_len
,
const
Gcalc_internal_coord
*
a
,
const
Gcalc_internal_coord
*
a
,
const
Gcalc_internal_coord
*
b
);
const
Gcalc_internal_coord
*
b
);
int
gcalc_cmp_coord
(
const
Gcalc_internal_coord
*
a
,
int
gcalc_cmp_coord
(
const
Gcalc_internal_coord
*
a
,
const
Gcalc_internal_coord
*
b
);
const
Gcalc_internal_coord
*
b
,
int
len
);
/* Internal coordinates declarations end. */
/* Internal coordinates declarations end. */
...
@@ -280,11 +236,11 @@ public:
...
@@ -280,11 +236,11 @@ public:
#ifdef GCALC_CHECK_WITH_FLOAT
#ifdef GCALC_CHECK_WITH_FLOAT
long
double
get_double
(
const
Gcalc_internal_coord
*
c
)
const
;
long
double
get_double
(
const
Gcalc_internal_coord
*
c
)
const
;
#endif
/*GCALC_CHECK_WITH_FLOAT*/
#endif
/*GCALC_CHECK_WITH_FLOAT*/
double
coord_extent
;
private
:
private
:
Gcalc_dyn_list
::
Item
*
m_first
;
Gcalc_dyn_list
::
Item
*
m_first
;
Gcalc_dyn_list
::
Item
**
m_hook
;
Gcalc_dyn_list
::
Item
**
m_hook
;
int
m_n_points
;
int
m_n_points
;
double
coord_extent
;
}
;
}
;
...
@@ -422,10 +378,10 @@ public:
...
@@ -422,10 +378,10 @@ public:
inline
const
point
*
get_next
()
const
{
return
(
const
point
*
)
next
;
}
inline
const
point
*
get_next
()
const
{
return
(
const
point
*
)
next
;
}
/* 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 */
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
,
const
Gcalc_coord1
*
dy_b
);
const
Gcalc_coord1
dy_b
);
static
int
cmp_dx_dy
(
const
Gcalc_heap
::
Info
*
p1
,
static
int
cmp_dx_dy
(
const
Gcalc_heap
::
Info
*
p1
,
const
Gcalc_heap
::
Info
*
p2
,
const
Gcalc_heap
::
Info
*
p2
,
const
Gcalc_heap
::
Info
*
p3
,
const
Gcalc_heap
::
Info
*
p3
,
...
@@ -467,9 +423,16 @@ public:
...
@@ -467,9 +423,16 @@ public:
int
x_calculated
;
int
x_calculated
;
Gcalc_coord3
y_exp
;
Gcalc_coord3
y_exp
;
int
y_calculated
;
int
y_calculated
;
void
calc_t
();
void
calc_t
()
void
calc_y_exp
();
{
if
(
!
t_calculated
)
do_calc_t
();
}
void
calc_x_exp
();
void
calc_y_exp
()
{
if
(
!
y_calculated
)
do_calc_y
();
}
void
calc_x_exp
()
{
if
(
!
x_calculated
)
do_calc_x
();
}
void
do_calc_t
();
void
do_calc_x
();
void
do_calc_y
();
};
};
...
@@ -540,8 +503,6 @@ private:
...
@@ -540,8 +503,6 @@ private:
point
*
new_slice_point
()
point
*
new_slice_point
()
{
{
point
*
new_point
=
(
point
*
)
new_item
();
point
*
new_point
=
(
point
*
)
new_item
();
new_point
->
dx
.
init
();
new_point
->
dy
.
init
();
return
new_point
;
return
new_point
;
}
}
intersection_info
*
new_intersection_info
(
point
*
a
,
point
*
b
)
intersection_info
*
new_intersection_info
(
point
*
a
,
point
*
b
)
...
@@ -553,6 +514,7 @@ private:
...
@@ -553,6 +514,7 @@ private:
return
ii
;
return
ii
;
}
}
int
arrange_event
(
int
do_sorting
,
int
n_intersections
);
int
arrange_event
(
int
do_sorting
,
int
n_intersections
);
static
double
get_pure_double
(
const
Gcalc_internal_coord
*
d
,
int
d_len
);
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment