src/gl/common.h

changeset 22
6da867fa5429
parent 21
0133e565e072
child 26
3a9e761e4faa
equal deleted inserted replaced
21:0133e565e072 22:6da867fa5429
58 linetypes::Id id; 58 linetypes::Id id;
59 59
60 /** 60 /**
61 * @return amount of vertices used for geometry 61 * @return amount of vertices used for geometry
62 */ 62 */
63 inline int numPolygonVertices() const 63 inline unsigned int numPolygonVertices() const
64 { 64 {
65 if (type == Type::ConditionalEdge) 65 if (type == Type::ConditionalEdge)
66 return 2; 66 return 2;
67 else 67 else
68 return numVertices(); 68 return numVertices();
69 } 69 }
70 70
71 /** 71 /**
72 * @return amount of vertices 72 * @return amount of vertices
73 */ 73 */
74 inline int numVertices() const 74 inline unsigned int numVertices() const
75 { 75 {
76 switch (type) 76 switch (type)
77 { 77 {
78 case Type::EdgeLine: 78 case Type::EdgeLine:
79 return 2; 79 return 2;
80 case Type::Triangle: 80 case Type::Triangle:
81 return 3; 81 return 3;
82 case Type::ConditionalEdge: 82 case Type::ConditionalEdge:
83 case Type::Quadrilateral: 83 case Type::Quadrilateral:
84 return 4; 84 return 4;
85 default:
86 return 0;
87 } 85 }
86 return 0;
88 } 87 }
89 }; 88 };
90 89
91 Q_DECLARE_METATYPE(gl::Polygon) 90 Q_DECLARE_METATYPE(gl::Polygon)
92 91

mercurial