-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdvFront.h
More file actions
69 lines (45 loc) · 1.5 KB
/
Copy pathAdvFront.h
File metadata and controls
69 lines (45 loc) · 1.5 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#pragma warning(disable : 4996)
#include"vector"
typedef struct DoubleLinkedList1
{
double key, y;
long TriangleIndex; // pointer to triangle
long EntryIndex;
long VertexNo; // vertexIndex
DoubleLinkedList1* RPointer;
DoubleLinkedList1* LPointer;
DoubleLinkedList1* Next; // for making the stack
} DoubleLinkedList;
class AdvFront
{
private:
double XMax, XMin, Size;
double RoundingTolerance, SmallTriangleTolerance;
int NoOfCells;
std::vector<DoubleLinkedList*> SkipTable;
DoubleLinkedList* Left;
DoubleLinkedList* Right;
DoubleLinkedList* CurrentLeft;
DoubleLinkedList* CurrentRight;
DoubleLinkedList1* Pool;
int ReturnEntryIndex(double x);
DoubleLinkedList* ReturnFromPool();
void InsertIntoPool(DoubleLinkedList* w);
public:
void Init(int Fraction, double xmin, double ymin, double xmax, double rt);
DoubleLinkedList* ReturnLeft() { return Left; }
DoubleLinkedList* ReturnRight() { return Right; }
DoubleLinkedList* ReturnCurrentLeft() { return CurrentLeft; }
DoubleLinkedList* ReturnCurrentRight() { return CurrentRight; }
DoubleLinkedList* Insert(double x, double y, long vertex, long TIndex);
void InsertRightFrom(DoubleLinkedList* RefPointer, double x, double y, int v, int ti);
int Projection(double x, double y);
int UpdateTIndex(double x, long i, long j, long ti);
void DeleteElement(DoubleLinkedList* Pointer, int TIndex);
void ClearAF();
int ClearAFInBetween();
// aux
void PrintAF(const char* fname);
void PrintAFCoordinates(const char* fname);
};