Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-uggrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
staging
dune-uggrid
Commits
963963cf
Commit
963963cf
authored
1 year ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused type coord_point and related methods
parent
ab0b89d9
No related branches found
No related tags found
1 merge request
!225
Simplifications and removal of unused code
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/uggrid/gm/evm.cc
+0
-80
0 additions, 80 deletions
dune/uggrid/gm/evm.cc
dune/uggrid/gm/evm.h
+0
-25
0 additions, 25 deletions
dune/uggrid/gm/evm.h
with
0 additions
and
105 deletions
dune/uggrid/gm/evm.cc
+
0
−
80
View file @
963963cf
...
...
@@ -88,86 +88,6 @@ const DOUBLE NS_DIM_PREFIX unit_vec[DIM][DIM]={{1,0,0},{0,1,0},{0,0,1}};
#define MIN_DETERMINANT 0.0001*SMALL_C
/****************************************************************************/
/****************************************************************************/
/****************************************************************************/
/**** ****/
/**** general routines ****/
/**** ****/
/****************************************************************************/
/****************************************************************************/
/****************************************************************************/
/****************************************************************************/
/*D
PointInPolygon - Decide if Point lies in the polygon of Points
SYNOPSIS:
INT PointInPolygon (const COORD_POINT *Points, INT n,
const COORD_POINT Point);
PARAMETERS:
. Points - polygon given by array of 'COORD_POINT' structures
. n - number of corners
. Point - Point in question
STRUCTURES:
.vb
struct coord_point
{
DOUBLE x;
DOUBLE y;
};
.ve
DESCRIPTION:
This function decides if 'Point' lies in the polygon of 'Points'.
The number of corners of the polygon must be less than or equal
than 4 in the current implementation!
RETURN VALUE:
bool
.n false when lies not in the polygon
.n true when lies in the polygon.
D*/
/****************************************************************************/
#define POLYMAX 8
bool
NS_DIM_PREFIX
PointInPolygon
(
const
COORD_POINT
*
Points
,
INT
n
,
COORD_POINT
Point
)
{
[[
maybe_unused
]]
DOUBLE
D
[
POLYMAX
]
,
tau
[
POLYMAX
],
xa
,
ya
,
xe
,
ye
;
int
i
,
left
,
right
;
assert
(
n
<=
POLYMAX
);
if
(
n
<=
2
)
return
false
;
xa
=
Points
[
0
].
x
;
ya
=
Points
[
0
].
y
;
for
(
i
=
1
;
i
<=
n
;
i
++
)
{
xe
=
Points
[
i
%
n
].
x
;
ye
=
Points
[
i
%
n
].
y
;
D
[
i
-
1
]
=
(
xe
-
xa
)
*
(
xe
-
xa
)
+
(
ye
-
ya
)
*
(
ye
-
ya
);
tau
[
i
-
1
]
=
(
-
(
ye
-
ya
)
*
(
Point
.
x
-
xa
)
+
(
xe
-
xa
)
*
(
Point
.
y
-
ya
));
xa
=
xe
;
ya
=
ye
;
}
left
=
right
=
0
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
tau
[
i
]
>=
0.0
)
left
++
;
if
(
tau
[
i
]
<=
0.0
)
right
++
;
/* if (tau[i]>=D[i]*SMALL_C) left++;
if (tau[i]<=-D[i]*SMALL_C) right++; */
}
if
(
left
==
n
||
right
==
n
)
return
true
;
return
false
;
}
/****************************************************************************/
/****************************************************************************/
/****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
dune/uggrid/gm/evm.h
+
0
−
25
View file @
963963cf
...
...
@@ -64,15 +64,6 @@ START_UGDIM_NAMESPACE
#define SQRT(a) sqrt((double)(a))
#define POW(a,b) pow((double)(a),(double)(b))
/* macros for coord points */
#define COPY_SC_TO_SH(p1,p2) (p2).x=(short)((p1).x);(p2).y=(short)((p1).y)
#define CP_SUBTRACT(A,B,C) {(C).x = (A).x - (B).x;\
(C).y = (A).y - (B).y;}
#define CP_LIMCOMB(a,A,b,B,C) {(C).x = (DOUBLE)(a)*(A).x + (DOUBLE)(b)*(B).x;\
(C).y = (DOUBLE)(a)*(A).y + (DOUBLE)(b)*(B).y;}
#define CP_SCALARPRODUCT(A,B,c) (c) = (A).x*(B).x + (A).y*(B).y;
#define CP_EUKLIDNORM(A,b) (b) = (DOUBLE)sqrt((double)((A).x*(A).x+(A).y*(A).y));
/* macros for 1D vector operations */
#define V1_COPY(A,C) {(C)[0] = (A)[0];}
...
...
@@ -233,19 +224,6 @@ START_UGDIM_NAMESPACE
#endif
/****************************************************************************/
/* */
/* typedef of 2d points for screen coordinates */
/* */
/****************************************************************************/
struct
coord_point
{
DOUBLE
x
;
DOUBLE
y
;
};
typedef
struct
coord_point
COORD_POINT
;
/****************************************************************************/
/* */
...
...
@@ -261,9 +239,6 @@ extern const DOUBLE unit_vec[DIM][DIM];
/* */
/****************************************************************************/
/* general routines */
bool
PointInPolygon
(
const
COORD_POINT
*
Points
,
INT
n
,
COORD_POINT
Point
);
/* 2D routines */
DOUBLE
vp
(
const
DOUBLE
x1
,
const
DOUBLE
y1
,
const
DOUBLE
x2
,
const
DOUBLE
y2
);
DOUBLE
c_tarea
(
const
DOUBLE
*
x0
,
const
DOUBLE
*
x1
,
const
DOUBLE
*
x2
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment