Subversion Repositories gelsvn

Rev

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

Rev 183 Rev 362
Line 1... Line 1...
1
#ifndef __HMESHUTIL_BUILD_MANIFOLD_H__
1
#ifndef __HMESHUTIL_BUILD_MANIFOLD_H__
2
#define __HMESHUTIL_BUILD_MANIFOLD_H__
2
#define __HMESHUTIL_BUILD_MANIFOLD_H__
3
 
3
 
4
#include <vector>
4
#include <vector>
5
#include "HMesh/Manifold.h"
5
#include "HMesh/Manifold.h"
-
 
6
#include "Geometry/TriMesh.h"
6
 
7
 
7
namespace HMesh
8
namespace HMesh
8
{
9
{
9
		
-
 
10
	void close_holes(Manifold& m);
-
 
11
 
-
 
12
 
10
 
13
  /** Build a manifold from an indexed face set. The arguments are 
11
  /** Build a manifold from an indexed face set. The arguments are 
14
      the manifold m, the number of vertices, no_vertices, the vector 
12
      the manifold m, the number of vertices, no_vertices, the vector 
15
      of vertices, vertvec, the number of faces, no_faces. facevec 
13
      of vertices, vertvec, the number of faces, no_faces. facevec 
16
      is an array where each entry indicates the number of vertices
14
      is an array where each entry indicates the number of vertices
Line 22... Line 20...
22
			    const CGLA::Vec3f* vertvec,
20
			    const CGLA::Vec3f* vertvec,
23
			    int no_faces,
21
			    int no_faces,
24
			    const int *facevec,
22
			    const int *facevec,
25
			    const int * indices,
23
			    const int * indices,
26
			    const int * touch=0);
24
			    const int * touch=0);
-
 
25
				
-
 
26
	/// Build a manifold directly from a TriMesh.
-
 
27
	inline void build_manifold(HMesh::Manifold& m, const Geometry::TriMesh& mesh)
-
 
28
	{
-
 
29
		std::vector<int> faces(mesh.geometry.no_faces(), 3);
-
 
30
		build_manifold(m, mesh.geometry.no_vertices(), 
-
 
31
						  &mesh.geometry.vertex(0), 
-
 
32
						  faces.size(), &faces[0], 
-
 
33
						  reinterpret_cast<const int*>(&mesh.geometry.face(0)));
-
 
34
	}
27
	
35
	
28
}
36
}
29
 
37
 
30
#endif
38
#endif