MEPP2 Project
test_calculate_scaling_surfacemesh.cpp
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published
6 // by the Free Software Foundation; either version 3 of the License,
7 // or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 #include <fstream>
12 #include <string>
13 
14 #include <CGAL/Surface_mesh.h>
15 #include <CGAL/Cartesian.h>
16 
18 
20 
21 using namespace FEVV;
22 using namespace FEVV::Filters;
23 
24 void
26 {
27  std::ifstream in(filename);
28  if(!in)
29  {
30  std::cout << "Unable to read file " << filename << std::endl;
31  exit(EXIT_FAILURE);
32  }
33 
34  typedef CGAL::Cartesian< double > Kernel;
35  typedef CGAL::Surface_mesh< Kernel::Point_3 > Mesh;
36  typedef Geometry_traits< Mesh > Geometry;
37  typedef Geometry::Scalar Scalar;
38 
39  Mesh m;
40  in >> m;
41  auto pos_pm = get(boost::vertex_point, m);
42  calculate_scaling(m, pos_pm, Scalar(2.0), Scalar(3.0), Scalar(4.0));
43 
44  std::cout << "Done." << std::endl;
45 }
46 
47 int
48 main(int narg, char **argv)
49 {
50  if(narg < 2)
51  {
52  std::cout << "Usage: " << argv[0]
53  << " filename; filename being an off file." << std::endl;
54  exit(EXIT_FAILURE);
55  }
56 
58  return 0;
59 }
test_calculate_scaling_surface_mesh
void test_calculate_scaling_surface_mesh(std::string filename)
Definition: test_calculate_scaling_surfacemesh.cpp:25
FEVV::Filters
Definition: clean_topology.hpp:21
FEVV::Geometry_traits
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
Definition: Geometry_traits.h:162
Geometry_traits_cgal_surface_mesh.h
Kernel
CGAL::Cartesian< double > Kernel
Definition: test_complying_concepts_linear_cell_complex.cpp:22
FEVV::Filters::calculate_scaling
void calculate_scaling(Graph &g, PointMap &pm, typename GeometryTraits::Scalar scale_x, typename GeometryTraits::Scalar scale_y, typename GeometryTraits::Scalar scale_z, const GeometryTraits &gt)
Scale a mesh.
Definition: scaling.hpp:38
FEVV::get
FEVV::PCLPointCloudPointMap::value_type get(const FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key)
Specialization of get(point_map, key) for PCLPointCloud.
Definition: Graph_properties_pcl_point_cloud.h:117
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
scaling.hpp
main
int main(int narg, char **argv)
Definition: test_calculate_scaling_surfacemesh.cpp:48
Mesh
FEVV::DataStructures::AIF::AIFMesh Mesh
Definition: test_complying_concepts_aif.cpp:18
FEVV::DataStructures::AIF::AIFMesh
This class represents an AIF structure. AIF structure can deal with both manifold and non-manifold su...
Definition: AIFMesh.hpp:47