MEPP2 Project
compression_valence.h
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 #pragma once
12 
14 
15 namespace FEVV {
16 namespace Filters {
17 
18 
49 template< typename HalfedgeGraph,
50  typename PointMap,
51  typename VertexColorMap,
52  typename GeometryTraits = FEVV::Geometry_traits< HalfedgeGraph > >
53 std::string
54 compression_valence(HalfedgeGraph &g,
55  PointMap *pm,
56  VertexColorMap *v_cm, /* nullptr allowed */
57  const std::string &input_filename,
58  const std::string &output_filename,
59  bool with_compression,
60  bool with_adaptative_quantization,
61  int max_vertices,
62  int quantiz_bits,
63  const GeometryTraits &/*gt*/)
64 {
66  compr_valence_component;
67 
68  std::string result = compr_valence_component.Main_Function(
69  g, /* mesh */
70  pm, /* point map */
71  v_cm, /* vertex color map */
72  input_filename,
73  output_filename, /*File_Name*/
74  quantiz_bits, /*Qbit*/
75  max_vertices, /*Number_vertices*/
76  false, /*Is_normal_flipping_selected*/
77  false, /*Is_use_metric_selected*/
78  0, /*Metric_threshold*/
79  false, /*Is_use_forget_metric_selected*/
80  0, /*Forget_metric_value*/
81  with_compression, /*Is_compression_selected*/
82  with_adaptative_quantization, /*Is_adaptive_quantization_selected*/
83  true /*Is_bijection_selected*/
84  );
85 
86  return result;
87 }
88 
89 
120 template< typename HalfedgeGraph,
121  typename PointMap,
122  typename VertexColorMap,
123  typename GeometryTraits = FEVV::Geometry_traits< HalfedgeGraph > >
124 std::string
125 compression_valence(HalfedgeGraph &g,
126  PointMap *pm,
127  VertexColorMap *v_cm, /* nullptr allowed */
128  const std::string &input_filename,
129  const std::string &output_filename,
130  bool with_compression = false,
131  bool with_adaptative_quantization = false,
132  int max_vertices = 100,
133  int quantiz_bits = 10)
134 {
135  GeometryTraits gt(g);
136  return compression_valence< HalfedgeGraph,
137  PointMap,
138  VertexColorMap,
139  GeometryTraits >(g,
140  pm,
141  v_cm,
142  input_filename,
143  output_filename,
144  with_compression,
145  with_adaptative_quantization,
146  max_vertices,
147  quantiz_bits,
148  gt);
149 }
150 
151 
152 } // namespace Filters
153 } // namespace FEVV
Compression_Valence_Component
Compression valence component.
Definition: Compression_Valence_Component.h:211
FEVV::Filters::compression_valence
std::string compression_valence(HalfedgeGraph &g, PointMap *pm, VertexColorMap *v_cm, const std::string &input_filename, const std::string &output_filename, bool with_compression, bool with_adaptative_quantization, int max_vertices, int quantiz_bits, const GeometryTraits &)
Compress the input mesh using the Compression Valence algorithm.
Definition: compression_valence.h:54
FEVV::Geometry_traits< HalfedgeGraph >
Compression_Valence_Component.h
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
Compression_Valence_Component::Main_Function
std::string Main_Function(HalfedgeGraph &pMesh, PointMap *_pm, VertexColorMap *_v_cm, const std::string &Input_File_Name, const std::string &File_Name, const int &Qbit, const int &NVertices, const bool Is_normal_flipping_selected, const bool Is_use_metric_selected, const float &Metric_thread, const bool Is_use_forget_metric_selected, const int &Forget_value, const bool Is_compression_selected, const bool Is_adaptive_quantization_selected, const bool Is_bijection_selected)
Main function of compression.
Definition: Compression_Valence_Component.inl:56