MEPP2 Project
test_calculate_scaling_polyhedron.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/Cartesian.h>
15 #include <CGAL/Polyhedron_3.h>
16 #include <CGAL/IO/Polyhedron_iostream.h>
17 #include <CGAL/Polyhedron_items_with_id_3.h>
18 
19 #include "FEVV/Wrappings/Geometry_traits_cgal_polyhedron_3.h" // FEVV geometry wrapper
20 
22 
23 using namespace FEVV;
24 using namespace FEVV::Filters;
25 
26 void
27 test_calculate_scaling_polyhedron(std::string filename)
28 {
29  std::ifstream in(filename);
30  if(!in)
31  {
32  std::cout << "Unable to read file " << filename << std::endl;
33  exit(EXIT_FAILURE);
34  }
35 
36  typedef CGAL::Cartesian< long double > Kernel;
37  typedef CGAL::Polyhedron_3< Kernel, CGAL::Polyhedron_items_with_id_3 > Mesh;
38  typedef Geometry_traits< Mesh > Geometry;
39  typedef Geometry::Scalar Scalar;
40 
41  Mesh m;
42  in >> m;
43  auto pos_pm = get(boost::vertex_point, m);
44  calculate_scaling(m, pos_pm, Scalar(2.0), Scalar(3.0), Scalar(4.0));
45 
46  std::cout << "Done." << std::endl;
47 }
48 
49 int
50 main(int narg, char **argv)
51 {
52  if(narg < 2)
53  {
54  std::cout << "Usage: " << argv[0]
55  << " filename; filename being an off file." << std::endl;
56  exit(EXIT_FAILURE);
57  }
58 
60  return 0;
61 }
FEVV::Filters
Definition: clean_topology.hpp:21
test_calculate_scaling_polyhedron
void test_calculate_scaling_polyhedron(std::string filename)
Definition: test_calculate_scaling_polyhedron.cpp:27
FEVV::Geometry_traits
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
Definition: Geometry_traits.h:162
Kernel
CGAL::Cartesian< double > Kernel
Definition: test_complying_concepts_linear_cell_complex.cpp:22
main
int main(int narg, char **argv)
Definition: test_calculate_scaling_polyhedron.cpp:50
Geometry_traits_cgal_polyhedron_3.h
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
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