source: GTP/trunk/Lib/Geom/GTGeometry/src/libs/detail/types.h @ 774

Revision 774, 1.9 KB checked in by gumbau, 18 years ago (diff)

GTGeometry and GeoTool? initial imports

Line 
1//
2// Copyright (C) 2004 Tanguy Fautré.
3// For conditions of distribution and use,
4// see copyright notice in tri_stripper.h
5//
6//////////////////////////////////////////////////////////////////////
7// SVN: $Id: types.h 86 2005-06-08 17:47:27Z gpsnoopy $
8//////////////////////////////////////////////////////////////////////
9
10#ifndef TRI_STRIPPER_HEADER_GUARD_TYPES_H
11#define TRI_STRIPPER_HEADER_GUARD_TYPES_H
12
13
14
15
16namespace triangle_stripper {
17
18        namespace detail {
19
20
21
22
23class triangle
24{
25public:
26        triangle() { }
27        triangle(index A, index B, index C)
28                : m_A(A), m_B(B), m_C(C), m_StripID(0) { }
29
30        void ResetStripID()                                                     { m_StripID = 0; }
31        void SetStripID(size_t StripID)                         { m_StripID = StripID; }       
32        size_t StripID() const                                          { return m_StripID; }
33
34        index A() const                                                         { return m_A; }
35        index B() const                                                         { return m_B; }
36        index C() const                                                         { return m_C; }
37       
38private:
39        index   m_A;
40        index   m_B;
41        index   m_C;
42
43        size_t  m_StripID;
44};
45
46
47
48class triangle_edge
49{
50public:
51        triangle_edge(index A, index B)
52                : m_A(A), m_B(B) { }
53
54        index A() const                                                         { return m_A; }
55        index B() const                                                         { return m_B; }
56
57        bool operator == (const triangle_edge & Right) const {
58                return ((A() == Right.A()) && (B() == Right.B()));
59        }
60
61private:
62        index   m_A;
63        index   m_B;
64};
65
66
67
68enum triangle_order { ABC, BCA, CAB };
69
70
71
72class strip
73{
74public:
75        strip()
76                : m_Start(0), m_Order(ABC), m_Size(0) { }
77
78        strip(size_t Start, triangle_order Order, size_t Size)
79                : m_Start(Start), m_Order(Order), m_Size(Size) { }
80
81        size_t Start() const                                            { return m_Start; }
82        triangle_order Order() const                            { return m_Order; }
83        size_t Size() const                                                     { return m_Size; }
84
85private:
86        size_t                  m_Start;
87        triangle_order  m_Order;
88        size_t                  m_Size;
89};
90
91
92
93
94        } // namespace detail
95
96} // namespace triangle_stripper
97
98
99
100
101#endif // TRI_STRIPPER_HEADER_GUARD_TYPES_H
Note: See TracBrowser for help on using the repository browser.