mirror of https://github.com/CGAL/cgal
more renaming
This commit is contained in:
parent
dcdb772059
commit
e2096afac7
|
|
@ -45,7 +45,7 @@ int main(int argc, char** argv) {
|
||||||
CGAL::parameters::do_not_triangulate_faces(false));
|
CGAL::parameters::do_not_triangulate_faces(false));
|
||||||
|
|
||||||
CGAL::Barycentric_coordinates::Mean_value_coordinates_3<Surface_mesh, Kernel> mv(quad_cage);
|
CGAL::Barycentric_coordinates::Mean_value_coordinates_3<Surface_mesh, Kernel> mv(quad_cage);
|
||||||
auto vertex_to_point_map = get_property_map(CGAL::vertex_point, deformed);
|
auto vertex_point_map = get_property_map(CGAL::vertex_point, deformed);
|
||||||
|
|
||||||
std::vector<FT> coords;
|
std::vector<FT> coords;
|
||||||
std::vector<Point_3> target_cube{p0_new, p1_new, p2_new, p3_new,
|
std::vector<Point_3> target_cube{p0_new, p1_new, p2_new, p3_new,
|
||||||
|
|
@ -53,7 +53,7 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
for(Surface_mesh::Vertex_index v : vertices(deformed)){
|
for(Surface_mesh::Vertex_index v : vertices(deformed)){
|
||||||
|
|
||||||
const Point_3 vertex_val = get(vertex_to_point_map, v);
|
const Point_3 vertex_val = get(vertex_point_map, v);
|
||||||
coords.clear();
|
coords.clear();
|
||||||
mv(vertex_val, std::back_inserter(coords));
|
mv(vertex_val, std::back_inserter(coords));
|
||||||
|
|
||||||
|
|
@ -65,7 +65,7 @@ int main(int argc, char** argv) {
|
||||||
z += target_cube[i].z() * coords[i];
|
z += target_cube[i].z() * coords[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
put(vertex_to_point_map, v, Point_3(x, y, z));
|
put(vertex_point_map, v, Point_3(x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ofstream out_original("sphere.off");
|
std::ofstream out_original("sphere.off");
|
||||||
|
|
|
||||||
|
|
@ -96,27 +96,27 @@ enum class Edge_case {
|
||||||
// Compute normal vector of the face (not normalized).
|
// Compute normal vector of the face (not normalized).
|
||||||
template<
|
template<
|
||||||
typename Face,
|
typename Face,
|
||||||
typename VertexToPointMap,
|
typename VertexPointMap,
|
||||||
typename TriangleMesh,
|
typename TriangleMesh,
|
||||||
typename GeomTraits>
|
typename GeomTraits>
|
||||||
typename GeomTraits::Vector_3 get_face_normal(
|
typename GeomTraits::Vector_3 get_face_normal(
|
||||||
const Face& face,
|
const Face& face,
|
||||||
const VertexToPointMap& vertex_to_point_map,
|
const VertexPointMap& vertex_point_map,
|
||||||
const TriangleMesh& triangle_mesh,
|
const TriangleMesh& tmesh,
|
||||||
const GeomTraits& traits){
|
const GeomTraits& traits){
|
||||||
|
|
||||||
using Point_3 = typename GeomTraits::Point_3;
|
using Point_3 = typename GeomTraits::Point_3;
|
||||||
using Vector_3 = typename GeomTraits::Vector_3;
|
using Vector_3 = typename GeomTraits::Vector_3;
|
||||||
const auto cross_3 = traits.construct_cross_product_vector_3_object();
|
const auto cross_3 = traits.construct_cross_product_vector_3_object();
|
||||||
|
|
||||||
const auto hedge = halfedge(face, triangle_mesh);
|
const auto hedge = halfedge(face, tmesh);
|
||||||
const auto vertices = vertices_around_face(hedge, triangle_mesh);
|
const auto vertices = vertices_around_face(hedge, tmesh);
|
||||||
CGAL_precondition(vertices.size() >= 3);
|
CGAL_precondition(vertices.size() >= 3);
|
||||||
|
|
||||||
auto vertex = vertices.begin();
|
auto vertex = vertices.begin();
|
||||||
const Point_3& point1 = get(vertex_to_point_map, *vertex); ++vertex;
|
const Point_3& point1 = get(vertex_point_map, *vertex); ++vertex;
|
||||||
const Point_3& point2 = get(vertex_to_point_map, *vertex); ++vertex;
|
const Point_3& point2 = get(vertex_point_map, *vertex); ++vertex;
|
||||||
const Point_3& point3 = get(vertex_to_point_map, *vertex);
|
const Point_3& point3 = get(vertex_point_map, *vertex);
|
||||||
|
|
||||||
const Vector_3 u = point2 - point1;
|
const Vector_3 u = point2 - point1;
|
||||||
const Vector_3 v = point3 - point1;
|
const Vector_3 v = point3 - point1;
|
||||||
|
|
@ -162,14 +162,14 @@ enum class Edge_case {
|
||||||
|
|
||||||
template<
|
template<
|
||||||
typename VertexRange,
|
typename VertexRange,
|
||||||
typename VertexToPointMap,
|
typename VertexPointMap,
|
||||||
typename TriangleMesh,
|
typename TriangleMesh,
|
||||||
typename OutIterator,
|
typename OutIterator,
|
||||||
typename GeomTraits>
|
typename GeomTraits>
|
||||||
OutIterator boundary_coordinates_3(
|
OutIterator boundary_coordinates_3(
|
||||||
VertexRange& vertices_face,
|
VertexRange& vertices_face,
|
||||||
const VertexToPointMap& vertex_to_point_map,
|
const VertexPointMap& vertex_point_map,
|
||||||
const TriangleMesh& triangle_mesh,
|
const TriangleMesh& tmesh,
|
||||||
const typename GeomTraits::Point_3& query,
|
const typename GeomTraits::Point_3& query,
|
||||||
OutIterator coordinates,
|
OutIterator coordinates,
|
||||||
const GeomTraits& traits,
|
const GeomTraits& traits,
|
||||||
|
|
@ -190,8 +190,8 @@ enum class Edge_case {
|
||||||
const auto v0 = *vertex_itr; vertex_itr++;
|
const auto v0 = *vertex_itr; vertex_itr++;
|
||||||
const auto v1 = *vertex_itr; vertex_itr++;
|
const auto v1 = *vertex_itr; vertex_itr++;
|
||||||
const auto v2 = *vertex_itr;
|
const auto v2 = *vertex_itr;
|
||||||
const Plane_3 face_plane(get(vertex_to_point_map, v0),
|
const Plane_3 face_plane(get(vertex_point_map, v0),
|
||||||
get(vertex_to_point_map, v1), get(vertex_to_point_map, v2));
|
get(vertex_point_map, v1), get(vertex_point_map, v2));
|
||||||
|
|
||||||
// Store 2d vertices
|
// Store 2d vertices
|
||||||
std::vector<Point_2> polygon;
|
std::vector<Point_2> polygon;
|
||||||
|
|
@ -200,7 +200,7 @@ enum class Edge_case {
|
||||||
Point_2 query_2 = face_plane.to_2d(query);
|
Point_2 query_2 = face_plane.to_2d(query);
|
||||||
for(auto v : vertices_face){
|
for(auto v : vertices_face){
|
||||||
|
|
||||||
*polygon_itr = face_plane.to_2d(get(vertex_to_point_map, v));
|
*polygon_itr = face_plane.to_2d(get(vertex_point_map, v));
|
||||||
polygon_itr++;
|
polygon_itr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -222,7 +222,7 @@ enum class Edge_case {
|
||||||
|
|
||||||
// Fill coordinates
|
// Fill coordinates
|
||||||
CGAL_assertion(bar_coords_2.size() == num_sides_face);
|
CGAL_assertion(bar_coords_2.size() == num_sides_face);
|
||||||
for(auto vertex_polyhedron : vertices(triangle_mesh)){
|
for(auto vertex_polyhedron : vertices(tmesh)){
|
||||||
|
|
||||||
bool found_vertex = false;
|
bool found_vertex = false;
|
||||||
auto bar_coords_itr = bar_coords_2.begin();
|
auto bar_coords_itr = bar_coords_2.begin();
|
||||||
|
|
@ -248,12 +248,12 @@ enum class Edge_case {
|
||||||
|
|
||||||
// Determine if the query point is on the interior, exterior or boundary
|
// Determine if the query point is on the interior, exterior or boundary
|
||||||
template<
|
template<
|
||||||
typename VertexToPointMap,
|
typename VertexPointMap,
|
||||||
typename PolygonMesh,
|
typename PolygonMesh,
|
||||||
typename OutIterator,
|
typename OutIterator,
|
||||||
typename GeomTraits>
|
typename GeomTraits>
|
||||||
Edge_case locate_wrt_polyhedron(
|
Edge_case locate_wrt_polyhedron(
|
||||||
const VertexToPointMap& vertex_to_point_map,
|
const VertexPointMap& vertex_point_map,
|
||||||
const PolygonMesh& polygon_mesh,
|
const PolygonMesh& polygon_mesh,
|
||||||
const typename GeomTraits::Point_3& query,
|
const typename GeomTraits::Point_3& query,
|
||||||
OutIterator coordinates,
|
OutIterator coordinates,
|
||||||
|
|
@ -280,14 +280,14 @@ enum class Edge_case {
|
||||||
CGAL_precondition(vertices_face.size() >= 3);
|
CGAL_precondition(vertices_face.size() >= 3);
|
||||||
|
|
||||||
auto vertex = vertices_face.begin();
|
auto vertex = vertices_face.begin();
|
||||||
const auto vertex_val = get(vertex_to_point_map, *vertex);
|
const auto vertex_val = get(vertex_point_map, *vertex);
|
||||||
|
|
||||||
// Vector connecting query point to vertex;
|
// Vector connecting query point to vertex;
|
||||||
const Vector_3 query_vertex = construct_vector_3(query, vertex_val);
|
const Vector_3 query_vertex = construct_vector_3(query, vertex_val);
|
||||||
|
|
||||||
// Calculate normals of faces
|
// Calculate normals of faces
|
||||||
Vector_3 face_normal_i = get_face_normal(
|
Vector_3 face_normal_i = get_face_normal(
|
||||||
face, vertex_to_point_map, polygon_mesh, traits);
|
face, vertex_point_map, polygon_mesh, traits);
|
||||||
face_normal_i = face_normal_i / sqrt(face_normal_i.squared_length());
|
face_normal_i = face_normal_i / sqrt(face_normal_i.squared_length());
|
||||||
|
|
||||||
// Distance of query to face
|
// Distance of query to face
|
||||||
|
|
@ -297,7 +297,7 @@ enum class Edge_case {
|
||||||
if(CGAL::abs(perp_dist_i) < tol){
|
if(CGAL::abs(perp_dist_i) < tol){
|
||||||
|
|
||||||
if(!boundary_flag)
|
if(!boundary_flag)
|
||||||
boundary_coordinates_3(vertices_face, vertex_to_point_map, polygon_mesh,
|
boundary_coordinates_3(vertices_face, vertex_point_map, polygon_mesh,
|
||||||
query, coordinates, traits, use_wp_flag);
|
query, coordinates, traits, use_wp_flag);
|
||||||
boundary_flag = true;
|
boundary_flag = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue