-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtannode.h
35 lines (29 loc) · 810 Bytes
/
tannode.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
#ifndef TANNODE_H
#define TANNODE_H
#include <map>
#include "tanvector.h"
class TanNode
{
public:
TanNode();
TanNode(const TanVector & vec);
TanNode(double x, double y, double z);
private:
TanVector vec;
long id;
static long curId;
static std::map<TanNode, long> mapNode2Id;
static std::map<long, TanNode> mapId2Node;
public:
bool valid() const;
long getId() const;
TanVector getVector() const;
static std::map<long, TanNode> getAllNodes();
static void clearAllNodes();
public:
static TanNode getNodeById(long id);
static TanNode getNodeByVector(const TanVector & vector, bool create = false);
friend bool operator < (const TanNode & n1, const TanNode & n2);
};
bool operator < (const TanNode & n1, const TanNode & n2);
#endif // TANNODE_H