Subversion Repositories gelsvn

Rev

Rev 526 | Rev 547 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 526 Rev 546
Line 10... Line 10...
10
 * ----------------------------------------------------------------------- */
10
 * ----------------------------------------------------------------------- */
11
 
11
 
12
#ifndef __HMESH_ITEMID_H__
12
#ifndef __HMESH_ITEMID_H__
13
#define __HMESH_ITEMID_H__
13
#define __HMESH_ITEMID_H__
14
 
14
 
-
 
15
#include <iostream>
-
 
16
 
15
namespace HMesh
17
namespace HMesh
16
{
18
{
17
	template<typename ITEM, typename ITEMID>
19
	template<typename ITEM, typename ITEMID>
18
	class AttributeVector;
20
	class AttributeVector;
19
	
21
	
-
 
22
	struct VertexTag {};
-
 
23
    struct FaceTag {};
-
 
24
    struct HalfEdgeTag {};
-
 
25
	
20
    template<typename T>
26
    template<typename T>
21
    class ItemID
27
    class ItemID
22
    {
28
    {
23
    public:
29
    public:
24
        ItemID();
30
        ItemID();
25
 
31
 
26
        bool operator ==(const ItemID& other) const;
32
        bool operator ==(const ItemID& other) const;
27
        bool operator !=(const ItemID& other) const;
33
        bool operator !=(const ItemID& other) const;
28
        bool operator <(const ItemID& other) const;
34
        bool operator <(const ItemID& other) const;
-
 
35
		
-
 
36
		friend std::ostream& operator<<(std::ostream& os, const ItemID<FaceTag>&);
29
 
37
		
30
    private:
38
    private:
31
        typedef unsigned int IndexType;  
39
        typedef unsigned int IndexType;  
32
        static const IndexType INVALID_INDEX =  0xffffffff;
40
        static const IndexType INVALID_INDEX =  0xffffffff;
33
 
41
 
34
        ItemID(IndexType index);
42
        ItemID(IndexType index);
Line 38... Line 46...
38
        friend class AttributeVector;
46
        friend class AttributeVector;
39
 
47
 
40
        IndexType index;
48
        IndexType index;
41
    };
49
    };
42
 
50
 
43
    struct VertexTag {};
-
 
44
    struct FaceTag {};
-
 
45
    struct HalfEdgeTag {};
-
 
46
 
51
 
47
    typedef ItemID<VertexTag> VertexID;
52
    typedef ItemID<VertexTag> VertexID;
48
    typedef ItemID<FaceTag> FaceID;
53
    typedef ItemID<FaceTag> FaceID;
49
    typedef ItemID<HalfEdgeTag> HalfEdgeID;
54
    typedef ItemID<HalfEdgeTag> HalfEdgeID;
50
 
55
 
Line 68... Line 73...
68
 
73
 
69
    template<typename T>
74
    template<typename T>
70
    inline bool ItemID<T>::operator <(const ItemID& other) const
75
    inline bool ItemID<T>::operator <(const ItemID& other) const
71
    { return index < other.index; }
76
    { return index < other.index; }
72
 
77
 
-
 
78
	inline std::ostream& operator<<(std::ostream& os, const FaceID& iid)
-
 
79
	{
-
 
80
		return (os << iid.index);
-
 
81
	}
73
 
82
	
74
}
83
}
75
 
84
 
76
#endif
85
#endif
77
 
86