DSC
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
mesh_io.h
1 //
2 // Deformabel Simplicial Complex (DSC) method
3 // Copyright (C) 2013 Technical University of Denmark
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // See licence.txt for a copy of the GNU General Public License.
16 
17 #pragma once
18 
19 #include "util.h"
20 #include "geometry.h"
21 
22 namespace is_mesh {
23  class ISMesh;
24 
28  void import_tet_mesh(const std::string & filename, std::vector<vec3>& points, std::vector<int>& tets, std::vector<int>& tet_labels);
29 
33  void import_surface_mesh(const std::string& filename, std::vector<vec3>& points, std::vector<int>&triangleIndices);
34 
38  void import_voxel_grid(const std::string& filename, vec3& origin, vec3& voxel_size, int& x, int& y, int& z, std::vector<int>& voxels);
39 
43  std::shared_ptr<Geometry> load_geometry(std::ifstream& file);
44 
48  void import_geometry(const std::string& filename, vec3& origin, vec3& size, double& discretization, std::vector<unsigned int>& labels, std::vector<std::shared_ptr<Geometry>>& geometries);
49 
53  void export_tet_mesh(const std::string& filename, std::vector<vec3>& points, std::vector<int>& tets, std::vector<int>& tet_labels);
54 
58  void export_surface_mesh(const std::string& filename, std::vector<vec3>& points, std::vector<int>& faces);
59 
60 
64  void export_tet_mesh(const std::string& filename, ISMesh &mesh);
65 
69  void export_surface_mesh(const std::string& filename, ISMesh &mesh);
70 
74  void export_surface_mesh_debug(const std::string &filename, ISMesh &mesh);
75 }
void export_surface_mesh(const std::string &filename, std::vector< vec3 > &points, std::vector< int > &faces)
Definition: mesh_io.cpp:375
A 3D double vector.
Definition: Vec3d.h:26
void export_tet_mesh(const std::string &filename, std::vector< vec3 > &points, std::vector< int > &tets, std::vector< int > &tet_labels)
Definition: mesh_io.cpp:351
void import_surface_mesh(const std::string &filename, std::vector< vec3 > &points, std::vector< int > &triangleIndices)
Definition: mesh_io.cpp:106
void export_surface_mesh_debug(const std::string &filename, ISMesh &mesh)
Definition: mesh_io.cpp:425
void import_tet_mesh(const std::string &filename, std::vector< vec3 > &points, std::vector< int > &tets, std::vector< int > &tet_labels)
Definition: mesh_io.cpp:64
void import_voxel_grid(const std::string &filename, vec3 &origin, vec3 &voxel_size, int &Ni, int &Nj, int &Nk, std::vector< int > &voxels)
Definition: mesh_io.cpp:161
std::shared_ptr< Geometry > load_geometry(std::ifstream &file)
Definition: mesh_io.cpp:208
void import_geometry(const std::string &filename, vec3 &origin, vec3 &size, double &discretization, std::vector< unsigned int > &labels, std::vector< std::shared_ptr< Geometry >> &geometries)
Definition: mesh_io.cpp:307