-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdjacentOrientedFace.h
82 lines (70 loc) · 1.77 KB
/
AdjacentOrientedFace.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* @file AdjacentOrientedFace.h
* @author Dan R. Lipsa
* @date 20 May 2010
* @brief Keeps track of all faces an edge is part of.
* @ingroup data model
*
*/
#ifndef __ADJACENT_ORIENTED_FACE_H__
#define __ADJACENT_ORIENTED_FACE_H__
#include "Comparisons.h"
class AdjacentBody;
class Face;
class OrientedEdge;
class OrientedFace;
/**
* @brief Keeps track of all faces an edge is part of.
*/
class AdjacentOrientedFace
{
public:
AdjacentOrientedFace (const boost::shared_ptr<OrientedFace>& face,
size_t edgeIndex) :
m_orientedFace (face),
m_orientedEdgeIndex (edgeIndex)
{
}
AdjacentOrientedFace () :
m_orientedEdgeIndex(0)
{
}
boost::shared_ptr<OrientedFace> GetOrientedFace () const
{
return m_orientedFace.lock ();
}
boost::shared_ptr<Face> GetFace () const;
OrientedEdge GetOrientedEdge () const;
size_t GetOrientedEdgeIndex () const
{
return m_orientedEdgeIndex;
}
bool IsOrientedEdgeReversed () const;
bool IsStandalone () const;
const AdjacentBody& GetAdjacentBody () const;
size_t GetBodyId () const;
boost::shared_ptr<Body> GetBody () const;
void clear ()
{
m_orientedFace.reset ();
m_orientedEdgeIndex = 0;
}
/**
* Returns true if the angle between normals is less than 90 degrees.
*/
bool IsValidNext (const AdjacentOrientedFace& next) const;
string ToString () const;
private:
boost::weak_ptr<OrientedFace> m_orientedFace;
size_t m_orientedEdgeIndex;
};
typedef multiset<AdjacentOrientedFace,
OrientedFaceIndexLessThan> AdjacentOrientedFaces;
inline ostream& operator<< (ostream& ostr, const AdjacentOrientedFace& ofi)
{
return ostr << ofi.ToString ();
}
#endif //__ADJACENT_ORIENTED_FACE_H__
// Local Variables:
// mode: c++
// End: