Go to the documentation of this file.00001 #ifndef OPENTISSUE_COLLISION_SDF_SDF_SEMIAUTO_INIT_GEOMETRY_H
00002 #define OPENTISSUE_COLLISION_SDF_SDF_SEMIAUTO_INIT_GEOMETRY_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/collision/sdf/sdf_init_geometry.h>
00013 #include <OpenTissue/core/containers/grid/util/grid_mesh2phi.h>
00014
00015 namespace OpenTissue
00016 {
00017
00018 namespace sdf
00019 {
00020
00021
00041 template<typename mesh_type,typename sdf_geometry_type>
00042 void semiauto_init_geometry(
00043 mesh_type & mesh
00044 , double edge_resolution
00045 , bool face_sampling
00046 , sdf_geometry_type & geometry
00047 , unsigned int max_resolution = 64
00048 , bool use_gpu = true
00049 )
00050 {
00051 typedef typename sdf_geometry_type::grid_type grid_type;
00052
00053 grid_type phi;
00054 OpenTissue::grid::mesh2phi(mesh, phi, max_resolution, use_gpu);
00055 init_geometry(mesh,phi,edge_resolution,face_sampling,geometry);
00056 }
00057
00058
00079 template<typename mesh_type,typename sdf_geometry_type>
00080 void semiauto_init_geometry(
00081 mesh_type & mesh
00082 , double edge_resolution
00083 , bool face_sampling
00084 , sdf_geometry_type & geometry
00085 , double bandsize
00086 , unsigned int resolution
00087 , bool use_gpu = true
00088 )
00089 {
00090 typedef typename sdf_geometry_type::grid_type grid_type;
00091
00092 grid_type phi;
00093 OpenTissue::grid::mesh2phi(mesh,phi, bandsize, resolution, use_gpu);
00094 init_geometry(mesh,phi,edge_resolution,face_sampling,geometry);
00095 }
00096
00097 }
00098
00099 }
00100
00101
00102 #endif