Subversion Repositories gelsvn

Rev

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

Rev 178 Rev 409
Line 35... Line 35...
35
		If the optional idx argument is present, the face array is resized so 
35
		If the optional idx argument is present, the face array is resized so 
36
		that the new index == idx. */
36
		that the new index == idx. */
37
		int add_face(const CGLA::Vec3i& f, int idx=-1) 
37
		int add_face(const CGLA::Vec3i& f, int idx=-1) 
38
		{
38
		{
39
			if(idx < 0)
39
			if(idx < 0)
40
				idx = faces.size();
40
				idx = static_cast<int>(faces.size());
41
			faces.resize(idx+1,NULL_FACE);
41
			faces.resize(idx+1,NULL_FACE);
42
			faces[idx] = f;
42
			faces[idx] = f;
43
			return idx;
43
			return idx;
44
		}
44
		}
45
 
45
 
46
		/// Return the number of faces.
46
		/// Return the number of faces.
47
		int no_faces() const {return faces.size();}
47
		int no_faces() const {return static_cast<int>(faces.size());}
48
 
48
 
49
		/** Return the face corresponding to a given index. 
49
		/** Return the face corresponding to a given index. 
50
				
50
				
51
				The NULL_FACE	is returned if the index is out of bounds. */
51
				The NULL_FACE	is returned if the index is out of bounds. */
52
		const CGLA::Vec3i& face(size_t idx) const
52
		const CGLA::Vec3i& face(size_t idx) const
Line 67... Line 67...
67
		// ----------------------------------------
67
		// ----------------------------------------
68
 
68
 
69
		/// Add a vertex and return the index of the vertex.
69
		/// Add a vertex and return the index of the vertex.
70
		int add_vertex(const CGLA::Vec3f& v)
70
		int add_vertex(const CGLA::Vec3f& v)
71
		{
71
		{
72
			int idx= verts.size();
72
			int idx= static_cast<int>(verts.size());
73
			verts.push_back(v);
73
			verts.push_back(v);
74
			return idx;
74
			return idx;
75
		}
75
		}
76
 
76
 
77
		/// Return the number of vertices.
77
		/// Return the number of vertices.
78
		int no_vertices() const {return verts.size();}
78
		int no_vertices() const {return static_cast<int>(verts.size());}
79
 
79
 
80
		/** Return the vertex corresponding to a given index. 
80
		/** Return the vertex corresponding to a given index. 
81
				
81
				
82
		User is responsible	for bounds checking. */
82
		User is responsible	for bounds checking. */
83
		const CGLA::Vec3f& vertex(int idx) const
83
		const CGLA::Vec3f& vertex(int idx) const