MEPP2 Project
test_calculate_scaling_openmesh.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 Lesser General Public License as
6 // published by the Free Software Foundation; either version 3 of
7 // the License, 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 #if(_MSC_VER >= 1400)
12 #ifndef _SCL_SECURE_NO_WARNINGS
13 #define _SCL_SECURE_NO_WARNINGS
14 #endif
15 #endif
16 #include <iostream>
17 #include <fstream>
18 #include <OpenMesh/Core/IO/MeshIO.hh>
19 
20 #define CGAL_USE_OM_POINTS
22 
24 
25 // Boost properties adaptor
26 #include <CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h>
27 #include <CGAL/boost/graph/properties_PolyMesh_ArrayKernelT.h>
28 
29 using namespace FEVV;
30 using namespace FEVV::Filters;
31 
32 //------------------------------------------------------------------------------
33 void
35 {
36  typedef OpenMesh::PolyMesh_ArrayKernelT<> Mesh;
37  typedef FEVV::Geometry_traits< Mesh > Geometry;
38  typedef Geometry::Scalar Scalar;
39 
40  std::ifstream in(filename);
41  Mesh m;
42  if(!OpenMesh::IO::read_mesh(m, filename))
43  {
44  std::cout << "failed";
45  return;
46  }
47 
48  auto pos_pm = get(boost::vertex_point, m);
49  calculate_scaling(m, pos_pm, Scalar(2.0), Scalar(3.0), Scalar(4.0));
50 
51  std::cout << "Done." << std::endl;
52 }
53 
54 //------------------------------------------------------------------------------
55 int
56 main(int narg, char **argv)
57 {
58  if(narg < 2)
59  {
60  std::cout << "Usage: " << argv[0]
61  << " filename; filename being an off file." << std::endl;
62  exit(EXIT_FAILURE);
63  }
64 
66  return 0;
67 }
FEVV::Filters
Definition: clean_topology.hpp:21
Geometry_traits_openmesh.h
FEVV::Geometry_traits
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
Definition: Geometry_traits.h:162
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
test_calculate_scaling_open_mesh
void test_calculate_scaling_open_mesh(char *filename)
Definition: test_calculate_scaling_openmesh.cpp:34
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::Filters::read_mesh
void read_mesh(const std::string &filename, FEVV::CGALPointSet &g, PMapsContainer &pmaps, bool=false)
Load mesh from file.
Definition: cgal_point_set_reader.hpp:110
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
main
int main(int narg, char **argv)
Definition: test_calculate_scaling_openmesh.cpp:56