-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMinDistance.h
53 lines (47 loc) · 1.13 KB
/
MinDistance.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Author : XuBenHao
// Version : 1.0.0
// Mail : [email protected]
// Copyright : XuBenHao 2020 - 2030
#ifndef AILIB_ALGORITHM_GEOMETRY_MINDISTANCE_H
#define AILIB_ALGORITHM_GEOMETRY_MINDISTANCE_H
#include "..\..\stdafx.h"
#include "..\..\DataStruct\Array\DynArray.h"
#include "..\..\DataStruct\Stack\DynStack.h"
#include "Geometry.h"
namespace AlLib
{
namespace Algorithm
{
namespace Geo
{
extern "C" class ALGORITHMLIB MinDistance
{
public:
enum Flag
{
LEFT,
RIGHT,
};
class FlagPoint
{
public:
FlagPoint();
FlagPoint(Math::Point<2>* pPo_, Flag nFlag_);
~FlagPoint();
public:
Math::Point<2> m_poP;
Flag m_nFlag;
};
MinDistance();
~MinDistance();
double Run(const DataStruct::Array::DynArray<Math::Point<2>>& poArr_);
private:
double CalculateMinDistance(
const DataStruct::Array::DynArray<FlagPoint*>& arrPos_,
const DataStruct::Array::DynArray<FlagPoint*>& arrSortedByX_,
const DataStruct::Array::DynArray<FlagPoint*>& arrSortedByY_);
};
}
}
}
#endif