MEPP2 Project
Compression_Valence_Component.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 
13 #include "arithmetic_codec.hpp"
14 
15 #include <boost/graph/graph_traits.hpp>
18 
19 #include <queue>
20 #include <list>
21 
22 // struct of integer coordinates
23 
30 
31 struct Point_Int
32 {
33 
34  int x;
35  int y;
36  int z;
37 
43 
44  Point_Int() { x = y = z = 0; }
45 
54 
55  const Point_Int operator+(const Point_Int &Pt) const
56  {
57  Point_Int Res;
58  Res.x = x + Pt.x;
59  Res.y = y + Pt.y;
60  Res.z = z + Pt.z;
61 
62  return Res;
63  }
64 
73 
74  const Point_Int operator-(const Point_Int &Pt) const
75  {
76  Point_Int Res;
77  Res.x = x - Pt.x;
78  Res.y = y - Pt.y;
79  Res.z = z - Pt.z;
80 
81  return Res;
82  }
83 
92 
93  bool operator==(const Point_Int &Pt) const
94  {
95  return (x == Pt.x && y == Pt.y && z == Pt.z);
96  }
97 
106 
107  bool operator!=(const Point_Int &Pt) const { return !(*this == Pt); }
108 };
109 
110 
117 
119 {
120  int c0;
121  int c1;
122  int c2;
123 
124  Color_Unit() { c0 = c1 = c2 = 0; }
125 
126  // ELO+ begin
127  // constructor to easily store data in property maps
128  Color_Unit(int _c0, int _c1, int _c2)
129  {
130  c0 = _c0;
131  c1 = _c1;
132  c2 = _c2;
133  }
134  // ELO+ end
135 
136 
145 
146  const Color_Unit operator+(const Color_Unit &m_color) const
147  {
148  Color_Unit Res;
149  Res.c0 = c0 + m_color.c0;
150  Res.c1 = c1 + m_color.c1;
151  Res.c2 = c2 + m_color.c2;
152 
153  return Res;
154  }
155 
164 
165  const Color_Unit operator-(const Color_Unit &m_color) const
166  {
167  Color_Unit Res;
168  Res.c0 = c0 - m_color.c0;
169  Res.c1 = c1 - m_color.c1;
170  Res.c2 = c2 - m_color.c2;
171 
172  return Res;
173  }
174 
183 
184  bool operator==(const Color_Unit &m_color) const
185  {
186  return (c0 == m_color.c0 && c1 == m_color.c1 && c2 == m_color.c2);
187  }
188 
195 
196  bool operator!=(const Color_Unit &m_color) const
197  {
198  return !(*this == m_color);
199  }
200 };
201 
208 
209 template< typename HalfedgeGraph, typename PointMap, typename VertexColorMap >
211 {
212 public:
213  typedef boost::graph_traits< HalfedgeGraph > GraphTraits;
215  typedef typename GraphTraits::vertex_iterator vertex_iterator;
216  typedef typename GraphTraits::face_descriptor face_descriptor;
217  typedef typename GraphTraits::face_iterator face_iterator;
218  typedef typename GraphTraits::halfedge_descriptor halfedge_descriptor;
219  typedef typename GraphTraits::halfedge_iterator halfedge_iterator;
222 
223 
229 
231  {
232  IsOneColor = false;
233  Decompress_count = 0;
234 
235  Smallest_Alpha = 5000;
236  Smallest_Gamma = 5000;
237 
238  Smallest_C0 = 5000;
239  Smallest_C1 = 5000;
240  Smallest_C2 = 5000;
241 
242  /*ColorDiffMinC0 = 5000;
243  ColorDiffMinC1 = 5000;
244  ColorDiffMinC2 = 5000;*/
245 
246  IsColored = false;
248 
249  // from IHM
250  IsCompressed = false;
251  IsDecompress = false;
252  // Afficher = false;
253 
255  // ELO sequence mode is enabled by default on Mepp1
256  // ELO but disabled by default on Mepp2 because mesh
257  // ELO sequence is not yet supported
258  Sequence = false; // ELO- Sequence = true;
259  Visu_level = 0;
260  Process_level = 0;
261  // Writing_level = -1;
262 
264 
265  m_VC[0] = 0.;
266  m_VC[1] = 0.;
267  m_VC[2] = 0.;
268  m_Dist = 0.0005;
269 
271  }
272 
278 
279 
280  // Main Function
281 
308  std::string Main_Function(HalfedgeGraph &pMesh,
309  PointMap *_pm,
310  VertexColorMap *_v_cm,
311  const std::string &Input_File_Name,
312  const std::string &File_Name,
313  const int &Qbit,
314  const int &NVertices,
315  const bool Is_normal_flipping_selected,
316  const bool Is_use_metric_selected,
317  const float &Metric_thread,
318  const bool Is_use_forget_metric_selected,
319  const int &Forget_value,
320  const bool Is_compression_selected,
321  const bool Is_adaptive_quantization_selected,
322  const bool Is_bijection_selected);
323 
324  // Initialization
325 
335  void Global_Initialization(HalfedgeGraph &pMesh,
336  const int &Quantization_bit,
337  const char *File_name,
338  const PointMap *pm,
339  VertexColorMap *v_cm);
340 
348  void Quantization(HalfedgeGraph &pMesh, const PointMap *pm);
349 
356  void Color_Initialization(HalfedgeGraph &pMesh, VertexColorMap *v_cm);
357 
367  void Multiple_Components_Initialization(HalfedgeGraph &pMesh,
368  const PointMap *pm,
369  const int &Quantization_bit);
370 
378  void Init(HalfedgeGraph &mesh);
379 
380 #if 0 // TODO-elo-restore-if-needed
381 
387  void Color_Quantization(HalfedgeGraph &pMesh);
388 #endif
389 
408  void Simplification(HalfedgeGraph &pMesh,
409  const PointMap *_pm,
410  const int &NVertices,
411  const bool Is_normal_flipping_selected,
412  const bool Is_use_metric_selected,
413  const float &Metric_thread,
414  const bool Is_use_forget_metric_selected,
415  const int &Forget_value);
416 
431  int Decimation_Conquest(HalfedgeGraph &pMesh,
432  const PointMap *_pm,
433  const bool Is_normal_flipping_selected,
434  const bool Is_use_metric_selected,
435  const float &Metric_thread,
436  const bool Is_use_forget_metric_selected,
437  const int &Forget_value,
438  const int &Component_ID);
439 
453  int Regulation(HalfedgeGraph &_pMesh,
454  const bool Normal_flipping,
455  const bool Use_metric,
456  const float &Metric_thread,
457  const bool Use_forget_metric,
458  const int &Forget_value,
459  const int &Component_ID,
460  const PointMap *_pm);
461 
462 
463  // Adaptive Quantization
464 
484  void Adaptive_Quantization(HalfedgeGraph &pMesh,
485  PointMap *_pm,
486  VertexColorMap *_v_cm,
487  const int &NVertices,
488  const bool Is_normal_flipping_selected,
489  const bool Is_use_metric_selected,
490  const float &Metric_thread,
491  const bool Is_use_forget_metric_selected,
492  const int &Forget_value,
493  const int &Qbit);
494 
495 
504  void Augment_Geometry_Quantization_Precision(HalfedgeGraph &pMesh,
506  const int &Component_ID,
507  PointMap *_pm);
508 
518  void Diminush_Geometry_Quantization_Precision(HalfedgeGraph &pMesh,
519  const int &Component_ID,
520  PointMap *_pm);
521 
532  void Calculate_Edge_Color_Difference(HalfedgeGraph &pMesh,
533  const int &Component_ID,
534  double &Max_color,
535  double &Mean_color,
536  int &Number_of_vertices);
537 
545  void Diminush_Color_Quantization_Precision(HalfedgeGraph &pMesh,
546  const int Component_ID,
547  VertexColorMap *_v_cm);
548 
557  void Augment_Color_Quantization_Precision(HalfedgeGraph &_pMesh,
559  const int &Component_ID,
560  VertexColorMap *_v_cm);
561 
562  // Compression
563 
575  void Compression(HalfedgeGraph &pMesh,
576  const char *File_Name,
577  const int &Qbit,
578  unsigned &Connectivity_size,
579  unsigned &Color_size,
580  unsigned &Total_size,
581  const PointMap *_pm);
582 
583 #if 0 // TODO-elo-restore-if-needed
584 
591  int Calculate_Connectivity_Rate(void);
592 #endif
593 
601 
610  void Remove_Last_Phase_Elements(const int &Component_ID);
611 
623  void Write_Base_Mesh(const HalfedgeGraph &pMesh,
624  Arithmetic_Codec &Enc,
625  unsigned &Connectivity_size,
626  unsigned &Color_size,
627  const int &Num_color_base_mesh,
628  const PointMap *_pm);
629 
630 
631  // Decompression
632 
643  void Decompress_Init(HalfedgeGraph &pMesh,
644  PointMap *_pm,
645  VertexColorMap *_v_cm,
646  bool &has_color,
647  const std::string &Input_File_Name);
648 
649 #if 0 // TODO-elo-restore-if-needed
650 
656  void Decompression_From_File(HalfedgeGraph &pMesh);
657 #endif
658 
664  void Write_Info(HalfedgeGraph &pMesh);
665 
666 #if 0 // TODO-elo-restore-if-needed
667 
673  void Decompression_From_Sequence(HalfedgeGraph &pMesh, HalfedgeGraph &New_mesh);
674 
675 
681  void Decompression_Coarser_From_File(HalfedgeGraph &pMesh);
682 #endif
683 
687  void write_intermediate_mesh(/*const*/ HalfedgeGraph &_pMesh,
688  const VertexColorMap *_v_cm);
689 
696  static void copy_mesh(const HalfedgeGraph &_pMesh,
697  const VertexColorMap *_v_cm,
698  HalfedgeGraph &mesh_copy,
699  VertexColorMap *v_cm_copy /* nullptr allowed */);
700 
706  const HalfedgeGraph &_pMesh,
707  const VertexColorMap *_v_cm,
708  std::vector< HalfedgeGraph * > *intermediate_meshes,
709  std::vector< VertexColorMap * >
710  *intermediate_vertexColorMaps /* nullptr allowed */);
711 
712 
719  std::string Decompression_All_From_File(
720  HalfedgeGraph &_pMesh,
721  PointMap *_pm,
722  VertexColorMap *_v_cm,
723  bool do_write_info,
724  std::vector< HalfedgeGraph * > *intermediate_meshes /* nullptr allowed */,
725  std::vector< VertexColorMap * >
726  *intermediate_vertexColorMaps /* nullptr allowed */,
727  int stop_level = -1 /* decompression level to stop at */,
728  bool do_write_intermediate_meshes = false);
729 
730 
731 #if 0 // TODO-elo-restore-if-needed
732 
738  void Decompression_Specific_Level_From_File(HalfedgeGraph &pMesh, const int & WL);
739 
745  void JCW_Decompression_From_File(HalfedgeGraph &pMesh);
746 
747 
753  void JCW_Decompression_Without_Extraction_From_File(HalfedgeGraph &pMesh);
754 
755 
762  void JCW_Decompression_From_Sequence(HalfedgeGraph &pMesh, HalfedgeGraph &New_mesh);
763 
764 
772  void JCW_Decompression_Without_Extraction_From_Sequence(HalfedgeGraph &pMesh, HalfedgeGraph &New_mesh);
773 
780  QString Show_Text(void);
781 #endif
782 
783 
793  int Decompress_Each_Step(HalfedgeGraph &_pMesh,
794  PointMap *_pm,
795  VertexColorMap *_v_cm);
796 
805  void Un_Decimation_Conquest(HalfedgeGraph &pMesh,
807  const int &Component_ID,
808  PointMap *_pm,
809  VertexColorMap *_v_cm);
810 
819  void Un_Regulation(HalfedgeGraph &_pMesh,
821  const int &Component_ID,
822  PointMap *_pm,
823  VertexColorMap *_v_cm);
824 
825 #if 0 // TODO-elo-restore-if-needed
826  // Other functions
827  // void Separate_Components(HalfedgeGraph &pMesh);
828 
837  double Calculate_Area(HalfedgeGraph & pMesh);
838 #endif
839 
851  bool Error_Projected_Surface(const HalfedgeGraph &_pMesh,
852  const PointMap *_pm,
853  const halfedge_descriptor &_h,
854  const int &_Component_ID,
855  const double &Mean_color,
856  const double &Mean_area);
857 
867  void Recalculate_Component_Area(HalfedgeGraph &pMesh,
868  const PointMap *_pm,
869  const int &Component_ID,
870  int &Number_facets);
871 
872 
881  inline Point_Int Change_Real_Int(const Point3d &pt, const int &Component_ID);
882 
892  inline Point3d Change_Int_Real(const Point_Int &pt, const int &Component_ID);
893 
894 
895 #if 0 // TODO-elo-restore-if-needed
896 
904  void Attibute_Seed_Gate_Flag(HalfedgeGraph &Original_mesh, HalfedgeGraph &New_mesh);
905 #endif
906 
915  {
916  // To measure exact quantity of bits used for decompression.
917  unsigned Adjust_value;
918  if(this->IsColored)
919  Adjust_value = 25 + 9 * 4;
920  else
921  Adjust_value = 25;
922 
923  return this->Decoder.calculate_current_decoded_size() + Adjust_value;
924  }
925 
926 #if 0 // TODO-elo-restore-if-needed
927 
936  int GetResolutionChange(HalfedgeGraph *pMesh, float Prec);
937 
943  void Stop_Decoder(void) {this->Decoder.stop_decoder(); }
944 
946  // Joint Compression Watermarking (JCW) //
948 
973  QString Joint_Compression_Watermarking(HalfedgeGraph &pMesh,
974  const char * Input_File_Name,
975  const char * Output_File_Name,
976  const int & Number_bins,
977  const int & Number_regions,
978  const int & Embedding_strength,
979  const char * Embedding_message,
980  const bool Is_complete_reversibility_selected,
981  const bool Is_divide_regions_selected,
982  const int & Thres_divide_regions,
983  const int &Qbit,
984  const int & NVertices,
985  const bool Normal_flipping,
986  const bool Use_metric,
987  const float & Metric_thread,
988  const bool Use_forget_metric,
989  const int &Forget_value);
990 
991 
1006  int JCW_Decimation_For_Segmentation(HalfedgeGraph &pMesh,const bool Normal_flipping,const bool Use_metric,const float &Metric_thread, const bool Use_forget_metric,const int &Forget_value, const int & Component_ID);
1007 
1023  int JCW_Regulation_For_Segmentation(HalfedgeGraph &pMesh,const bool Normal_flipping,const bool Use_metric,const float &Metric_thread, const bool Use_forget_metric,const int &Forget_value, const int & Component_ID);
1024 
1037  void JCW_Un_Regulation_For_Insertion(HalfedgeGraph &pMesh, const int & Component_ID, list<int> & FP_Connectivity, list<Point3d> & SP_Moved_Position, list<Point3d> & SP_Original_Position, list<Point_Int> & SP_Watermarked_Position, list<vector<int> > & JCW_ERROR);
1038 
1052  void JCW_Un_Decimation_For_Insertion(HalfedgeGraph &pMesh, const int & Component_ID, list<int> & FP_Connectivity, list<Point3d> & SP_Moved_Position, list<Point3d> & SP_Original_Position, list<Point_Int> & SP_Watermarked_Position, list<vector<int> > & JCW_ERROR);
1053 
1063  Point3d JCW_Barycenter_Patch_Before_Removal(const Halfedge_handle & h, const int & Direction);
1064 
1076  Point3d JCW_Barycenter_Patch_After_Removal(const Halfedge_handle & h, const int & valence, const int & Direction);
1077 
1089  Point3d JCW_Barycenter_Patch_Before_Removal(const Halfedge_handle & h, const int & valence, const int & Direction);
1090 
1099  void JCW_Un_Decimation_Conquest(HalfedgeGraph &pMesh,Arithmetic_Codec & Decoder, const int & Component_ID);
1100 
1110  void JCW_Un_Regulation(HalfedgeGraph &pMesh, Arithmetic_Codec & Decoder, const int & Component_ID);
1111 
1122  void JCW_Un_Regulation_For_Region_Detection(HalfedgeGraph & pMesh, const int & Component_ID, list<int> & FP_connect, list<Point3d> & FP_Geo, list<int> & FP_RN);
1123 
1135  void JCW_Un_Decimation_For_Region_Detection(HalfedgeGraph & pMesh, const int & Component_ID, list<int> & FP_connect, list<Point3d> & FP_Geo, list<int> & FP_RN);
1136 
1144  vector<double> JCW_Evaluate_Robustness(void);
1145 
1152  void Set_Number_Bin(const int & NB)
1153  {
1154  this->m_NumberBin = NB;
1155  }
1156 
1163  int Get_Number_Bin(void)
1164  {
1165  return this->m_NumberBin;
1166  }
1167 
1175  void Set_Embedding_Level(const int &EL)
1176  {
1177  this->m_EmbeddingStrength = EL;
1178  }
1179 
1187  int Get_Embedding_Level(void)
1188  {
1189  return this->m_EmbeddingStrength;
1190  }
1191 
1198  void Set_Number_Region(const int &NR)
1199  {
1200  this->m_NumberRegion = NR;
1201  }
1202 
1209  int Get_Number_Region(void)
1210  {
1211  return this->m_NumberRegion;
1212  }
1213 
1220  void JCW_Calculate_Mesh_Center(HalfedgeGraph &pMesh);
1221 
1227  void JCW_Calculate_Radius(HalfedgeGraph &pMesh);
1228 
1236  void JCW_Expand_Mesh(HalfedgeGraph &pMesh);
1237 
1245  void JCW_Quantization(HalfedgeGraph &pMesh);
1246 
1254  void JCW_Generate_Regions_On_Base_Mesh(HalfedgeGraph &pMesh);
1255 
1268  void JCW_Region_Mass_Center_Insert_Watermark(HalfedgeGraph & pMesh, list<Point3d> & FP_Geometry, list<int> & FP_Region_Number, list<Point_Int> & SP_Watermarked_Position, list<Point3d> & SP_Moved_Position, list<Point3d> & SP_Original_Position, list<vector<int> > & JCW_ERROR);
1269 
1270 
1278  void JCW_Region_Mass_Center_Extract_Watermark(HalfedgeGraph & pMesh);
1279 
1287  void JCW_Code_Difference_Histogram_Shifting(HalfedgeGraph &pMesh,const int & Component_ID);
1288 
1297  void JCW_Decode_Difference_Histogram_Shifting(HalfedgeGraph &pMesh, const int & Component_ID);
1298 
1305  void Initialize_Spherical_Coordinates(HalfedgeGraph &pMesh);
1306 
1314  void Convert_To_Spherical(const Point3d & Pt, double * Spheric);
1315 
1324  void Convert_To_Cartesian(const double * Spheric, double * Cartesian);
1325 
1336  int JCW_Decompress_One_Level(HalfedgeGraph &pMesh, const char* File_Name, const int & Noise_mode);
1337 
1347  int JCW_Decompress_One_Level_Without_Extraction(HalfedgeGraph &pMesh, const char* File_Name);
1348 
1349 
1359  int JCW_Divide_Big_Regions(HalfedgeGraph &pMesh, const int & Thres_divide_regions);
1360 
1367  void JCW_Colorify_Regions(HalfedgeGraph & pMesh);
1368 
1373  void Read_Information_To_Hide(const char * Embedding_message);
1374 
1381  QString Write_Information_To_Hide();
1382 
1388  void Clear_After_Compression();
1389 #endif
1390 
1391 private:
1392  std::vector< bool >
1394 
1395  bool IsColored;
1396  bool IsOneColor;
1397 
1398  float OnlyColor[3];
1399  // Number of connectivity symbol types. Without boundary = 5, with boundary =
1400  // 7;
1401  // int NummberConnectivitySymbols;
1402 
1403  // To encode each type of operation between decimation and increase of
1404  // quantization resolution
1405  std::vector< std::list< int > > ListOperation;
1406  std::vector< std::list< int > >
1408  std::vector< std::list< Point_Int > >
1410  std::vector< std::list< int > >
1412  std::vector< std::list< int > >
1414 
1415  std::list< Point_Int >
1417  std::list< int >
1419 
1420  std::vector< std::list< int > >
1422  std::vector< std::list< int > > AlphaOffset;
1423  std::vector< std::list< int > >
1425  std::vector< std::list< int > > GammaOffset;
1426 
1427 
1428  // Quantization
1429  std::vector< unsigned > Qbit;
1430  std::vector< float > xmin;
1431  std::vector< float > ymin;
1432  std::vector< float > zmin;
1433  std::vector< float > xmax;
1434  std::vector< float > ymax;
1435  std::vector< float > zmax;
1436  std::vector< float > Quantization_Step;
1437 
1440 
1441  std::vector< double > HighestLengthBB;
1442  std::vector< double > ComponentVolume;
1443  std::vector< double > ComponentArea;
1444  std::vector< int >
1446 
1447  // Used for adatative quantization.
1448  std::vector< std::list< int > >
1450  std::vector< std::list< int > >
1452 
1453  // for color
1454  std::vector< std::list< int > >
1456  std::vector< std::list< int > >
1458  std::vector< std::list< int > >
1460 
1461  // Colors
1462  std::vector< std::list< Color_Unit > >
1464  std::list< Color_Unit >
1466 
1467  float C0_Min;
1468  float C1_Min;
1469  float C2_Min;
1470 
1472  std::vector< int > NumberColorQuantization;
1473 
1475  int Smallest_C1;
1477  int Smallest_C2;
1479 
1481  int C0_Range;
1482  int C1_Range;
1483  int C2_Range;
1484 
1485  /*int ColorDiffMinC0;///< The color difference minimum c0 for restoration of
1486  colors in Mapping table int ColorDiffMinC1;///< The first color difference
1487  minimum c1 for restoration of colors in Mapping table int ColorDiffMinC2;///<
1488  The second color difference minimum c2 for restoration of colors in Mapping
1489  table
1490 
1491  int ColorDiffRangeC0;///< The color difference range c 0 for restoration of
1492  colors in Mapping table int ColorDiffRangeC1;///< The first color difference
1493  range c1 for restoration of colors in Mapping table
1494  int ColorDiffRangeC2;///< The second color difference range c2 for restoration
1495  of colors in Mapping table*/
1496 
1498  // vector<Color_Unit> ColorArray; ///< Color table
1499  // vector<Color_Unit> PredictedColorArray; ///< Predicted values of colors in
1500  // color table using prediction based on neighbors. vector<Color_Unit>
1501  // DifferenceColor; ///< Difference between original and quantized vertex
1502  // color. need to turn into lossless coding.
1503  //
1504  // list<int> ColorIndex;///< List of color index
1505  // vector<int> ReorderingColorIndex;///< Vector of reordering color
1506  // index list<int> InterColorIndex; ///< Vector of
1507  // inter color index
1508  // vector<int> Number_color_index; ///< contain occurence of each
1509  // initial color vector<int> IsKnownIndex;///< is known index
1510 
1511 
1512  // Decoder
1513 
1515 
1519 
1521 
1522  std::vector< int >
1524  std::vector< int > NumberChangeQuantization;
1525 
1528  int DumpSymbolRegulation;
1531 
1535  int NumberComponents;
1537 
1540 
1541  std::vector< int > ComponentOperations;
1542 
1543  // JCW
1547  double m_VC[3];
1548  double m_Rmin;
1549  double m_Rmax;
1550  double m_Dist;
1551  std::vector< int >
1553  std::list< int > m_Watermarks;
1554 
1556 
1557  std::vector< int >
1559  std::vector< int >
1561  std::vector< double > m_Rad_decision;
1562 
1563  std::list< std::vector< int > >
1565  std::list< int >
1567 
1569 
1570  std::list< int > JCW_Connectivity;
1571  std::list< Point_Int > JCW_Geometry;
1572 
1573  // double LUT_CourbureClust[3*256];
1574  std::vector< std::vector< float > > Region_Color;
1576  int Number_Save_Over_bins;
1581  bool Is_Bijection_Enabled;
1584 
1585  // from IHM
1586 public:
1593  std::string File_name;
1594 
1595  std::vector< float >
1597  std::vector< float >
1600  std::string Message;
1601 
1602 public: // private:
1603  // bool Afficher; ///<
1604  bool Sequence;
1606 
1610 
1611  FILE *Dec_Info;
1612  // int Writing_level; ///< Level of
1613  std::string
1615 
1616  // ELO+
1617  //--------------------------------------------------------------------
1618  // Property maps that replace ancient vertex/halfedge/face attributes
1619  //--------------------------------------------------------------------
1620 
1622  vertex_color_int; // ELO replace pVertex->color_int(...)
1624  vertex_Seed_Edge; // ELO replace pVertex->Seed_Edge
1626  vertex_Component_Number; // ELO replace pVertex->Component_Number
1628  Vertex_Flag; // ELO replace pVert->Vertex_Flag
1630  Vertex_Number; // ELO replace pVert->Vertex_Number
1632  Vertex_Sign; // ELO replace pVert->Vertex_Sign
1634  vertex_normal; // ELO replace pVertex->normal()
1636  vertex_Q_Index; // ELO replace pVertex->Q_Index
1638  vertex_Region_Number; // ELO replace pVert->Region_Number
1640  vertex_Removal_Order; // ELO replace pVert->Removal_Order
1641 
1643  facet_tag; // ELO replace pFacet->tag(...)
1645  facet_Component_Number; // ELO replace pFacet->Component_Number
1647  Facet_Flag; // ELO replace pFacet->Facet_Flag
1649  facet_normal; // ELO replace pFacet->normal()
1650 
1651 
1652  //-----------------------------------------------------------
1653  // Functions moved from Compression_Valence_Common.h
1654  //-----------------------------------------------------------
1655 
1663  bool Is_Border_Vertex(const halfedge_descriptor &h,
1664  const HalfedgeGraph &mesh);
1665 
1674  int Find_Type(const HalfedgeGraph &_pMesh,
1675  const halfedge_descriptor &h,
1676  const int &valence);
1677 
1688  bool Is_Manifold_Property_Violated(const HalfedgeGraph &_pMesh,
1689  const halfedge_descriptor &h,
1690  const int &type,
1691  const int &valence);
1692 
1702  bool Is_Normal_Flipping_Occured(const HalfedgeGraph &_pMesh,
1703  const PointMap *_pm,
1704  const halfedge_descriptor &h,
1705  const unsigned &valence);
1706 
1716  Vector Triangle_Normal(const HalfedgeGraph &_pMesh,
1717  const PointMap *_pm,
1718  const halfedge_descriptor &h);
1719 
1731  Vector Triangle_Normal(const HalfedgeGraph &_pMesh,
1732  const Point3d &P,
1733  const Point3d &Q,
1734  const Point3d &R);
1735 
1748  bool Is_Geometric_Metric_Violated(const HalfedgeGraph &_pMesh,
1749  const PointMap *_pm,
1750  const halfedge_descriptor &h,
1751  const int &type,
1752  const unsigned int &valence,
1753  const float &Threshold);
1754 
1755 
1764  // TODO-elo share this function with Curvature filter that uses its own one
1765  // TODO-elo see
1766  // https://github.com/MEPP-team/MEPP2/blob/master/FEVV/Filters/Generic/Manifold/Curvature/curvature.hpp#L105
1767  double Area_Facet_Triangle(
1768  const typename boost::graph_traits< HalfedgeGraph >::halfedge_descriptor
1769  &h,
1770  const HalfedgeGraph &mesh,
1771  const PointMap *pm);
1772 
1782  double Area_Facet_Triangle(const Point3d &P,
1783  const Point3d &Q,
1784  const Point3d &R,
1785  const HalfedgeGraph &_pMesh);
1786 
1791  double Volume(const Point3d &A,
1792  const Point3d &B,
1793  const Point3d &C,
1794  const Point3d &D,
1795  const HalfedgeGraph &_pMesh);
1796 
1806  const HalfedgeGraph &_pMesh);
1807 
1818  const int &valence,
1819  const HalfedgeGraph &_pMesh);
1820 
1831  const HalfedgeGraph &_pMesh,
1832  const PointMap *_pm);
1833 
1844  const int &valence,
1845  const HalfedgeGraph &_pMesh,
1846  const PointMap *_pm);
1847 
1858  void Retriangulation(HalfedgeGraph &pMesh,
1859  const halfedge_descriptor &ch,
1860  const unsigned &valence,
1861  const unsigned &Vertex_number,
1862  const int &Component_ID,
1863  const PointMap *_pm);
1864 
1875  Vector Normal_Patch(const halfedge_descriptor &const_h,
1876  const unsigned int &valence,
1877  const HalfedgeGraph &_pMesh,
1878  const PointMap *_pm);
1879 
1891  const Vector &normal,
1892  Vector &T2,
1893  const HalfedgeGraph &_pMesh,
1894  const PointMap *_pm);
1895 
1907  Point_Int Frenet_Rotation(const Point_Int &Dist,
1908  const Vector &T1,
1909  const Vector &T2,
1910  const Vector &normal);
1911 
1912 
1925  const Vector &T1,
1926  const Vector &T2,
1927  const Vector &normal);
1928 
1938  Color_Unit
1940  const int &valence,
1941  const HalfedgeGraph &_pMesh);
1942 
1953  int Estimate_Geometry_Quantization(double volume,
1954  double area,
1955  int number_vertices);
1956 
1968  int Get_Correct_Vector(int i, int j, int k);
1969 
1980  bool Remove_Edges(HalfedgeGraph &_pMesh,
1981  const halfedge_descriptor &h,
1982  const int &type);
1983 
1991  void Get_Coefficient_Up_Quantization(const int &Correct_symbol, int coeff[3]);
1992 
1993 
1994  //-----------------------------------------------------------
1995  // Miscellaneous
1996  //-----------------------------------------------------------
1997 
1998 
2002  void compute_normals(const HalfedgeGraph &_pMesh, const PointMap *_pm);
2003 
2007  void compute_normals_per_facet(const HalfedgeGraph &_pMesh,
2008  const PointMap *_pm);
2009 
2013  void compute_normals_per_vertex(const HalfedgeGraph &_pMesh);
2014 
2018  void compute_facet_normal(const face_descriptor &f,
2019  const HalfedgeGraph &_pMesh,
2020  const PointMap *_pm);
2021 
2026  const HalfedgeGraph &_pMesh);
2027 
2031  void print_halfedge(const std::string &title,
2032  const halfedge_descriptor &h,
2033  const HalfedgeGraph &_pMesh,
2034  const PointMap *_pm);
2035 
2039  void print_vertex(const std::string &title,
2040  const vertex_descriptor &v,
2041  const PointMap *_pm);
2042 
2046  std::string vertex_to_string(const vertex_descriptor &v, const PointMap *_pm);
2047 
2051  std::string halfedge_to_string(const halfedge_descriptor &h,
2052  const HalfedgeGraph &_pMesh,
2053  const PointMap *_pm);
2054 
2058  std::string edge_to_string(const halfedge_descriptor &h,
2059  const HalfedgeGraph &_pMesh,
2060  const PointMap *_pm);
2061 
2065  void DBG_print_mesh_geometry(const HalfedgeGraph &_pMesh,
2066  const PointMap *_pm,
2067  const std::string &header = std::string());
2068 
2072  void DBG_print_mesh_vertexcolor(const HalfedgeGraph &_pMesh,
2073  const VertexColorMap *_v_cm,
2074  const std::string &header = std::string());
2075 
2079  bool v_inf_to_v(const vertex_descriptor &v1,
2080  const vertex_descriptor &v2,
2081  const PointMap *_pm);
2082 
2086  void build_mesh(HalfedgeGraph &_pMesh,
2087  PointMap *_pm,
2088  VertexColorMap *_v_cm,
2089  const std::vector< Point3d > &vlist,
2090  const std::vector< int > &flist,
2091  const std::vector< float > &clist,
2092  const std::vector< int > &Color_index_list);
2093 
2098 
2102  void truncate_colors(const HalfedgeGraph &_pMesh,
2103  VertexColorMap *_v_cm);
2104 };
2105 
2106 // implementation details
2108 
2109 
2110 /* \page CompressionValencePage Compression Valence Documentation
2111  *
2112  * \section auth Authors
2113  * H. LEE, C. DIKICI, G. LAVOUE and F. DUPONT \n
2114  * M2DisCo Team, LIRIS, CNRS, Universite Lyon 1/INSA-Lyon, France. \n
2115  * \n
2116  * Please contact the authors \n H. LEE (hosmail@gmail.com), C. DIKICI
2117  (cagataydikici@yahoo.com),
2118  * G. LAVOUE (glavoue@liris.cnrs.fr) and F. DUPONT (fdupont@liris.cnrs.fr) \n
2119  * in case you have any question, comment or a bug to report.
2120  * \n
2121  * \n
2122  *
2123  * \section paper_reference Related publications
2124  * Here is the list of related papers if you want to cite our methods. \n
2125  * It is also strongly recommended that you read these papers
2126  * in order to know the parameters used in our methods.
2127  * \n
2128  *
2129  * \subsection compression_paper Progressive compression of colored meshes
2130  * H. LEE, G. LAVOUE, F. DUPONT, \n
2131  * Rate-distortion optimization for progressive compression of 3D mesh with
2132  color attributes, \n
2133  * The Visual Computer, 2011.
2134  * \n
2135  *
2136  * \subsection jcw_paper Joint watermarking and progressive compression of 3D
2137  meshes
2138  * H. LEE, C. DIKICI, G. LAVOUE, F. DUPONT, \n
2139  * Joint reversible watermarking and progressive compression of 3D meshes, \n
2140  * The Visual Computer 27(6-8):781-792, 2011.
2141  * \n
2142  * \n
2143  *
2144  * \section overview Overview
2145  * This Compression Valence component has two main functions:
2146  * (1) a progressive compresion and (2) a joint progressive compression and
2147  reversible watermarking for 3D meshes. \n
2148  * The progressive compression method simplifies iteratively an input mesh to
2149  generate differents levels of details (LoDs). \n
2150  * These LoDs are then transmitted progressively in a coarse-to-fine way at the
2151  decompression. \n
2152  * In particular, our method adapts the quantization precision (both geometry
2153  and color) to each LoD in order to optimize the rate-distortion (R-D)
2154  trade-off. \n \n
2155  * Our joint progressive compression and reversible watermarking method offers a
2156  possibility to embed an watermark information
2157  * in order to protect the ownership of the input mesh. \n
2158  * Hence, at each decompression step, the inserted message can be extracted also
2159  progressively. \n
2160  * The embedded watermarks are reversible, meaning that the deformation caused
2161  by watermarking embedding step can be removed when extracting the watermark.
2162  * \n
2163  * \n
2164  *
2165  * \section howto_use How to use this component
2166  * \subsection howto_progressive_compression Progressive compression
2167  * First of all you have to load a mesh. \n
2168  * To compress the input mesh, choose "Compression" and a windows appears. \n
2169  * (1) File name : to choose a name for the compressed file. Please
2170  be aware that the file extension should be ".p3d". \n
2171  * (2) Mode : the mode "Simplification" does not generate a
2172  compressed file. \n
2173  * (3) Compression mode : to enable or disable the use of the adaptation
2174  of quantization precision. \n
2175  * (4) Quantization bits : the number of bits for the geometry
2176  quantization. \n
2177  * (5) # Vertices wanted : the number of vertices of the base (the
2178  coarsest) mesh. \n
2179  * (6) Use bijection : to enable or disable the use of the bijection
2180  for the geometry encoding. This bijection reduces the coding rates but it needs
2181  a longer processing time. \n
2182  * (7) Forbid normal flipping : this option is used to forbid a normal flipping
2183  when removing a vertex. \n
2184  * (8) Use Metric : this option is used to forbid a vertex removal
2185  if it induces a significant deformation. The threshold value is initially set
2186  to 0.25. \n The use of this metric can be "forgetted" if the number of vertices
2187  of the current intermediate mesh is superior to an user-defined threshold. \n
2188  * \n
2189  * For the decompression, first you have to load a .p3d file. Then, the base
2190  mesh is rendered. \n
2191  * To obtain higher LoDs, you can use : \n
2192  * (1) "Decompression : all LoDs", to decompress all LoDs and the finest
2193  intermediate is visualized, \n
2194  * (2) "Decompression : next LoD", to decompress one level and the next LoD is
2195  rendered (ALT + left mouse button), \n
2196  * (3) "Decompression : go to specific LoD", to reach the desired LoD. \n
2197  * You can also visualize the previous LoDs by selecting "Decompression :
2198  previous LoD" (ALT + right mouse button). \n \n
2199  * After loading the .p3d file, you can enable or disable the option of mesh
2200  sequence generation with the menu "Activate/Desactivate mesh sequence
2201  generation". \n
2202  * When this option is enabled, all LoDs are stored in the memory, so that the
2203  navigation of differents LoDs can be performed quickly. \n
2204  * You can disable this option in order to save the memory.
2205  * In this case, when you want to visualize the previous LoD, the decompression
2206  is performed again until getting the previous LoD.
2207  * The navigation takes a longer time. \n
2208  * Note that this option can be modified only after the rendering of the base
2209  mesh and it cannot be modified when any decompression operation is achieved. \n
2210  * \n
2211  * \subsection howto_jcw Joint compression and watermarking
2212  * First of all you have to load a mesh. \n
2213  * You can apply our joint method by selecting "JCW - Compression and
2214  Watermarking embedding". \n
2215  * (1) File name : to choose a name for the compressed file (.p3d).
2216  \n
2217  * (2) Q bits : the number of bits for the geometry
2218  quantization. \n
2219  * (3) # vertices : the number of the base mesh after an iterative
2220  simplification. \n
2221  * (4) # Bins : the number of the histogram bins. \n
2222  * (5) # Regions : the number of regions. One watermark bit is
2223  embedded in each region. \n
2224  * (6) Embedding Strength : the number of shifted bins when
2225  embedding/extracting the watermark. \n
2226  * (7) Embedding Message : the message to insert. When this field is empty
2227  or the length of the message is shorter than necessary, the message is
2228  generated randomly. \n
2229  * (8) Divide Regions : when this option is selected, the big region is
2230  divided in two in order to insert more watermark bits. \n
2231  * (9) Complete Reversibility : When this option is checked, the initial
2232  positions of all vertices are exactly restored. Some extra coding bits are
2233  necessary.
2234  * \n
2235  * For the decompression and the watermark extraction,
2236  * you have to load a .p3d file. \n
2237  * To obtain higher LoDs, you can select "JCW - Decompression and Watermark
2238  extraction : next LoD". \n
2239  * The extracted message is shown in the status bar of the main window. \n
2240  * To visualize the results without watermark extraction (non authorized users),
2241  you can use "JCW - Decompression without extraction : next LoD". \n
2242  * \n
2243  *
2244  * \section last_updated Last updated
2245  * 18 May, 2011
2246  *
2247  */
Compression_Valence_Component
Compression valence component.
Definition: Compression_Valence_Component.h:211
Compression_Valence_Component::Volume
double Volume(const Point3d &A, const Point3d &B, const Point3d &C, const Point3d &D, const HalfedgeGraph &_pMesh)
Definition: Compression_Valence_Component.inl:7618
Compression_Valence_Component::NumberSymbol
std::vector< std::list< int > > NumberSymbol
Number of symbols of each simplification step.
Definition: Compression_Valence_Component.h:1411
Compression_Valence_Component::Vertex_Number
FEVV::Vertex_pmap< HalfedgeGraph, int > Vertex_Number
Definition: Compression_Valence_Component.h:1630
Color_Unit
Struct of integer color components.
Definition: Compression_Valence_Component.h:119
Point_Int::operator==
bool operator==(const Point_Int &Pt) const
Comparison operatior ==.
Definition: Compression_Valence_Component.h:93
Compression_Valence_Component::vertex_color_int
FEVV::Vertex_pmap< HalfedgeGraph, Color_Unit > vertex_color_int
Definition: Compression_Valence_Component.h:1622
Compression_Valence_Component::Calculate_Geometry_Color_Offset_Range
void Calculate_Geometry_Color_Offset_Range(void)
Calculates the geometry color offset range. This function is needed since the coder/decoder deals onl...
Definition: Compression_Valence_Component.inl:3649
Compression_Valence_Component::ComponentVolume
std::vector< double > ComponentVolume
The volume of each component.
Definition: Compression_Valence_Component.h:1442
Compression_Valence_Component::Barycenter_Patch_Before_Removal
Point3d Barycenter_Patch_Before_Removal(const halfedge_descriptor &h, const HalfedgeGraph &_pMesh, const PointMap *_pm)
gives the position of the barycenter of the patch for regulation conquest.
Definition: Compression_Valence_Component.inl:7756
Compression_Valence_Component::IsOneColor
bool IsOneColor
true if is one color
Definition: Compression_Valence_Component.h:1396
Compression_Valence_Component::Get_Vertex_Color
Color_Unit Get_Vertex_Color(const halfedge_descriptor &h, const HalfedgeGraph &_pMesh)
gets a color of front vertex of h.
Definition: Compression_Valence_Component.inl:7663
Compression_Valence_Component.inl
Compression_Valence_Component::Is_Geometric_Metric_Violated
bool Is_Geometric_Metric_Violated(const HalfedgeGraph &_pMesh, const PointMap *_pm, const halfedge_descriptor &h, const int &type, const unsigned int &valence, const float &Threshold)
Query if this object is geometric violated. Here, we define a geometric_metric to preserve maximum th...
Definition: Compression_Valence_Component.inl:7268
Compression_Valence_Component::Decompress_Each_Step
int Decompress_Each_Step(HalfedgeGraph &_pMesh, PointMap *_pm, VertexColorMap *_v_cm)
Decompress the each step to visualize intermediate meshes.
Definition: Compression_Valence_Component.inl:5921
Compression_Valence_Component::halfedge_descriptor
GraphTraits::halfedge_descriptor halfedge_descriptor
Definition: Compression_Valence_Component.h:218
Compression_Valence_Component::Frenet_Rotation
Point_Int Frenet_Rotation(const Point_Int &Dist, const Vector &T1, const Vector &T2, const Vector &normal)
finds a bijection through a rotation transformation in 3D with only integer coordinates.
Definition: Compression_Valence_Component.inl:8481
Point_Int::Point_Int
Point_Int()
Default constructor.
Definition: Compression_Valence_Component.h:44
Compression_Valence_Component::vertex_to_string
std::string vertex_to_string(const vertex_descriptor &v, const PointMap *_pm)
Definition: Compression_Valence_Component.inl:1263
Compression_Valence_Component::Normal_Patch
Vector Normal_Patch(const halfedge_descriptor &const_h, const unsigned int &valence, const HalfedgeGraph &_pMesh, const PointMap *_pm)
calculates a normal vector of a patch caused by a removal of a front vertex.
Definition: Compression_Valence_Component.inl:8226
Compression_Valence_Component::Adaptive_Quantization
void Adaptive_Quantization(HalfedgeGraph &pMesh, PointMap *_pm, VertexColorMap *_v_cm, 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 int &Qbit)
Adaptive quantization which not only decimates a input mesh but also adapts quantization precision fo...
Definition: Compression_Valence_Component.inl:875
Compression_Valence_Component::Prog
std::vector< float > Prog
Definition: Compression_Valence_Component.h:1596
Compression_Valence_Component::build_mesh
void build_mesh(HalfedgeGraph &_pMesh, PointMap *_pm, VertexColorMap *_v_cm, const std::vector< Point3d > &vlist, const std::vector< int > &flist, const std::vector< float > &clist, const std::vector< int > &Color_index_list)
Definition: Compression_Valence_Component.inl:9383
Compression_Valence_Component::Point3d
FEVV::Geometry_traits< HalfedgeGraph >::Point Point3d
Definition: Compression_Valence_Component.h:221
Compression_Valence_Component::Is_Border_Vertex
bool Is_Border_Vertex(const halfedge_descriptor &h, const HalfedgeGraph &mesh)
Query if 'h' is border vertex.
Definition: Compression_Valence_Component.inl:6731
Compression_Valence_Component::Color_2_Model
Adaptive_Data_Model Color_2_Model
The statistical model used for color_2.
Definition: Compression_Valence_Component.h:1518
Compression_Valence_Component::Decompress_count
int Decompress_count
Definition: Compression_Valence_Component.h:1534
Compression_Valence_Component::m_EmbeddingStrength
int m_EmbeddingStrength
Embedding strength for JCW.
Definition: Compression_Valence_Component.h:1545
Compression_Valence_Component::Remove_Last_Phase_Elements
void Remove_Last_Phase_Elements(const int &Component_ID)
When the last simplification operation has to be cancelled, we need to remove its elements in order n...
Definition: Compression_Valence_Component.inl:3520
Compression_Valence_Component::DBG_print_mesh_vertexcolor
void DBG_print_mesh_vertexcolor(const HalfedgeGraph &_pMesh, const VertexColorMap *_v_cm, const std::string &header=std::string())
Definition: Compression_Valence_Component.inl:9847
Compression_Valence_Component::C0_Min
float C0_Min
The C0 minimum.
Definition: Compression_Valence_Component.h:1467
Compression_Valence_Component::InterVertexColor
std::list< Color_Unit > InterVertexColor
The intermediate information vertex color.
Definition: Compression_Valence_Component.h:1465
Compression_Valence_Component::AlphaRange
std::vector< std::list< int > > AlphaRange
The range of alpha (Frenet coordinates) of each LoD.
Definition: Compression_Valence_Component.h:1421
Compression_Valence_Component::Diminush_Geometry_Quantization_Precision
void Diminush_Geometry_Quantization_Precision(HalfedgeGraph &pMesh, const int &Component_ID, PointMap *_pm)
Decreasing of quantization resolution based on the prediction of PENG. Opposite function is Augment_G...
Definition: Compression_Valence_Component.inl:5152
Compression_Valence_Component::Region_Color
std::vector< std::vector< float > > Region_Color
Color of each region.
Definition: Compression_Valence_Component.h:1574
Compression_Valence_Component::facet_tag
FEVV::Face_pmap< HalfedgeGraph, int > facet_tag
Definition: Compression_Valence_Component.h:1643
Compression_Valence_Component::Number_Save_Over_bins
int Number_Save_Over_bins
Number of empty bins to shift the current bins.
Definition: Compression_Valence_Component.h:1577
Compression_Valence_Component::Quantization_Step
std::vector< float > Quantization_Step
The quantization step.
Definition: Compression_Valence_Component.h:1436
Compression_Valence_Component::IsColored
bool IsColored
true if is colored
Definition: Compression_Valence_Component.h:1395
Compression_Valence_Component::N_Inserted_Watermarks
int N_Inserted_Watermarks
Number of inserted watermarks.
Definition: Compression_Valence_Component.h:1555
Compression_Valence_Component::Estimate_Geometry_Quantization
int Estimate_Geometry_Quantization(double volume, double area, int number_vertices)
Estimate geometry quantization.
Definition: Compression_Valence_Component.inl:9329
Compression_Valence_Component::File_name
std::string File_name
Filename of the file.
Definition: Compression_Valence_Component.h:1593
Compression_Valence_Component::m_JCW_Move_Error
std::list< std::vector< int > > m_JCW_Move_Error
Stock difference related to complete reversibility.
Definition: Compression_Valence_Component.h:1564
Compression_Valence_Component::GlobalCountOperation
int GlobalCountOperation
The global count operation.
Definition: Compression_Valence_Component.h:1539
Compression_Valence_Component::vertex_Region_Number
FEVV::Vertex_pmap< HalfedgeGraph, int > vertex_Region_Number
Definition: Compression_Valence_Component.h:1638
Compression_Valence_Component::OnlyColor
float OnlyColor[3]
The coordinates of color when there is only one color.
Definition: Compression_Valence_Component.h:1398
Compression_Valence_Component::Quantization
void Quantization(HalfedgeGraph &pMesh, const PointMap *pm)
Definition: Compression_Valence_Component.inl:568
Compression_Valence_Component::ymin
std::vector< float > ymin
The ymin.
Definition: Compression_Valence_Component.h:1431
Compression_Valence_Component::edge_to_string
std::string edge_to_string(const halfedge_descriptor &h, const HalfedgeGraph &_pMesh, const PointMap *_pm)
Definition: Compression_Valence_Component.inl:1315
Compression_Valence_Component::Smallest_C0
int Smallest_C0
Definition: Compression_Valence_Component.h:1474
Compression_Valence_Component::Compressed_file_size
unsigned Compressed_file_size
Size of the compressed file.
Definition: Compression_Valence_Component.h:1592
Compression_Valence_Component::Vertex_Sign
FEVV::Vertex_pmap< HalfedgeGraph, int > Vertex_Sign
Definition: Compression_Valence_Component.h:1632
Compression_Valence_Component::Augment_Geometry_Quantization_Precision
void Augment_Geometry_Quantization_Precision(HalfedgeGraph &pMesh, Arithmetic_Codec &Decoder, const int &Component_ID, PointMap *_pm)
Refines quantization precision of mesh geometry.
Definition: Compression_Valence_Component.inl:4869
Compression_Valence_Component::C2_Range
int C2_Range
The C2 range.
Definition: Compression_Valence_Component.h:1483
Compression_Valence_Component::NumberVertices
std::vector< std::list< int > > NumberVertices
Number of vertices of each simplification step.
Definition: Compression_Valence_Component.h:1413
Compression_Valence_Component::Calculate_Edge_Color_Difference
void Calculate_Edge_Color_Difference(HalfedgeGraph &pMesh, const int &Component_ID, double &Max_color, double &Mean_color, int &Number_of_vertices)
Calculates the edge color difference.
Definition: Compression_Valence_Component.inl:4305
Compression_Valence_Component::JCW_Connectivity
std::list< int > JCW_Connectivity
Stock connectivity information for JCW.
Definition: Compression_Valence_Component.h:1570
Compression_Valence_Component::Color_0_Model
Adaptive_Data_Model Color_0_Model
The statistical model used for color_0.
Definition: Compression_Valence_Component.h:1516
Compression_Valence_Component::GammaOffset
std::vector< std::list< int > > GammaOffset
The offset of gamma.
Definition: Compression_Valence_Component.h:1425
FEVV::Geometry_traits
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
Definition: Geometry_traits.h:162
Compression_Valence_Component::InterConnectivity
std::list< int > InterConnectivity
The intermediate information of connectivity.
Definition: Compression_Valence_Component.h:1418
Point_Int::x
int x
The x coordinate.
Definition: Compression_Valence_Component.h:34
Compression_Valence_Component::Color_Initialization
void Color_Initialization(HalfedgeGraph &pMesh, VertexColorMap *v_cm)
Color initialization.
Definition: Compression_Valence_Component.inl:672
Compression_Valence_Component::Un_Regulation
void Un_Regulation(HalfedgeGraph &_pMesh, Arithmetic_Codec &Decoder, const int &Component_ID, PointMap *_pm, VertexColorMap *_v_cm)
Decoding of the regulation conquest.
Definition: Compression_Valence_Component.inl:2283
Compression_Valence_Component::GammaRange
std::vector< std::list< int > > GammaRange
The range of gamma (Frenet coordinates) of each LoD.
Definition: Compression_Valence_Component.h:1424
Compression_Valence_Component::Dec_File_Info
std::string Dec_File_Info
File name to write decompression information for IHM.
Definition: Compression_Valence_Component.h:1614
Color_Unit::Color_Unit
Color_Unit(int _c0, int _c1, int _c2)
Definition: Compression_Valence_Component.h:128
Compression_Valence_Component::NumberChangeQuantization
std::vector< int > NumberChangeQuantization
Definition: Compression_Valence_Component.h:1524
Compression_Valence_Component::DM_JCW_MOVE_ERROR
Adaptive_Data_Model DM_JCW_MOVE_ERROR
Definition: Compression_Valence_Component.h:1568
Compression_Valence_Component::keep_intermediate_mesh
void keep_intermediate_mesh(const HalfedgeGraph &_pMesh, const VertexColorMap *_v_cm, std::vector< HalfedgeGraph * > *intermediate_meshes, std::vector< VertexColorMap * > *intermediate_vertexColorMaps)
Store a copy of the current mesh and vertex color map to be able to display all levels of decompressi...
Definition: Compression_Valence_Component.inl:6552
Compression_Valence_Component::Global_Initialization
void Global_Initialization(HalfedgeGraph &pMesh, const int &Quantization_bit, const char *File_name, const PointMap *pm, VertexColorMap *v_cm)
Global initialization to select the input gate.
Definition: Compression_Valence_Component.inl:224
Compression_Valence_Component::Qbit
std::vector< unsigned > Qbit
The Quantization bits.
Definition: Compression_Valence_Component.h:1429
Compression_Valence_Component::compute_normals
void compute_normals(const HalfedgeGraph &_pMesh, const PointMap *_pm)
Definition: Compression_Valence_Component.inl:9182
Compression_Valence_Component::m_Rmax
double m_Rmax
Distance of nearst vertex from mesh center for JCW.
Definition: Compression_Valence_Component.h:1549
Compression_Valence_Component::Ratio
std::vector< float > Ratio
Stock information of ration regarding size of the input file.
Definition: Compression_Valence_Component.h:1599
Compression_Valence_Component::Get_Coefficient_Up_Quantization
void Get_Coefficient_Up_Quantization(const int &Correct_symbol, int coeff[3])
Gets a coefficient up quantization.
Definition: Compression_Valence_Component.inl:9718
Compression_Valence_Component::Message
std::string Message
Message to be shown in the main window.
Definition: Compression_Valence_Component.h:1600
Compression_Valence_Component::Init
void Init(HalfedgeGraph &mesh)
Initialize all flags of verticeces and facets to FREE and give order to vertices (manifold property c...
Definition: Compression_Valence_Component.inl:1190
Color_Unit::c0
int c0
Definition: Compression_Valence_Component.h:120
Compression_Valence_Component::m_N_remained_vertices
std::vector< int > m_N_remained_vertices
Number of remained vertices in each region.
Definition: Compression_Valence_Component.h:1558
Compression_Valence_Component::Multiple_Components_Initialization
void Multiple_Components_Initialization(HalfedgeGraph &pMesh, const PointMap *pm, const int &Quantization_bit)
Definition: Compression_Valence_Component.inl:252
Compression_Valence_Component::NumberQuantizationLayer
std::vector< std::list< int > > NumberQuantizationLayer
Number of quantization layers.
Definition: Compression_Valence_Component.h:1451
Compression_Valence_Component::zmax
std::vector< float > zmax
The zmax.
Definition: Compression_Valence_Component.h:1435
FEVV::Face_pmap
typename Face_pmap_traits< MeshT, ValueT >::pmap_type Face_pmap
Definition: properties.h:610
Arithmetic_Codec::stop_decoder
void stop_decoder(void)
Definition: arithmetic_codec.inl:757
Compression_Valence_Component::Index_Model
Adaptive_Data_Model Index_Model
The index model.
Definition: Compression_Valence_Component.h:1520
Compression_Valence_Component::IsDecompress
bool IsDecompress
true if is decompress
Definition: Compression_Valence_Component.h:1587
Compression_Valence_Component::Calculate_T1_T2
Vector Calculate_T1_T2(const halfedge_descriptor &h, const Vector &normal, Vector &T2, const HalfedgeGraph &_pMesh, const PointMap *_pm)
Calculates the base vectors of new coordinates system which is frenet system.
Definition: Compression_Valence_Component.inl:8394
Compression_Valence_Component::vertex_iterator
GraphTraits::vertex_iterator vertex_iterator
Definition: Compression_Valence_Component.h:215
Compression_Valence_Component::Color_1_Model
Adaptive_Data_Model Color_1_Model
The statistical model used for color_1.
Definition: Compression_Valence_Component.h:1517
arithmetic_codec.hpp
Color_Unit::Color_Unit
Color_Unit()
Definition: Compression_Valence_Component.h:124
Compression_Valence_Component::compute_vertex_normal
void compute_vertex_normal(const vertex_descriptor &v, const HalfedgeGraph &_pMesh)
Definition: Compression_Valence_Component.inl:9290
Compression_Valence_Component::m_NumberRegion
int m_NumberRegion
Number of regions for JCW.
Definition: Compression_Valence_Component.h:1546
Point_Int::operator!=
bool operator!=(const Point_Int &Pt) const
Comparison operatior !=.
Definition: Compression_Valence_Component.h:107
Compression_Valence_Component::Compression_Valence_Component
Compression_Valence_Component(void)
Default Constructor.
Definition: Compression_Valence_Component.h:230
Compression_Valence_Component::face_descriptor
GraphTraits::face_descriptor face_descriptor
Definition: Compression_Valence_Component.h:216
Color_Unit::operator!=
bool operator!=(const Color_Unit &m_color) const
Comparison operatior !=.
Definition: Compression_Valence_Component.h:196
Compression_Valence_Component::C1_Min
float C1_Min
The C1 minimum.
Definition: Compression_Valence_Component.h:1468
Compression_Valence_Component::init_vertex_attributes
void init_vertex_attributes(const vertex_descriptor &v)
Definition: Compression_Valence_Component.inl:9774
Compression_Valence_Component::Write_Base_Mesh
void Write_Base_Mesh(const HalfedgeGraph &pMesh, Arithmetic_Codec &Enc, unsigned &Connectivity_size, unsigned &Color_size, const int &Num_color_base_mesh, const PointMap *_pm)
Writes a base mesh.
Definition: Compression_Valence_Component.inl:3543
Compression_Valence_Component::Un_Decimation_Conquest
void Un_Decimation_Conquest(HalfedgeGraph &pMesh, Arithmetic_Codec &Decoder, const int &Component_ID, PointMap *_pm, VertexColorMap *_v_cm)
Decoding of the decimation conquest.
Definition: Compression_Valence_Component.inl:2600
Compression_Valence_Component::vertex_Seed_Edge
FEVV::Vertex_pmap< HalfedgeGraph, int > vertex_Seed_Edge
Definition: Compression_Valence_Component.h:1624
Compression_Valence_Component::~Compression_Valence_Component
~Compression_Valence_Component()
Destructor.
Definition: Compression_Valence_Component.h:277
Compression_Valence_Component::m_N_treated_vertices
std::vector< int > m_N_treated_vertices
Number of treated vertices in each region.
Definition: Compression_Valence_Component.h:1560
Compression_Valence_Component::Recalculate_Component_Area
void Recalculate_Component_Area(HalfedgeGraph &pMesh, const PointMap *_pm, const int &Component_ID, int &Number_facets)
Update the area of each component.
Definition: Compression_Valence_Component.inl:4839
Compression_Valence_Component::C0_Range
int C0_Range
The C0 range.
Definition: Compression_Valence_Component.h:1481
Adaptive_Data_Model
Adaptive data model.
Definition: arithmetic_codec.hpp:120
Compression_Valence_Component::m_Number_Vertices_Per_Regions
std::vector< int > m_Number_Vertices_Per_Regions
Number of vertices in each region.
Definition: Compression_Valence_Component.h:1552
Compression_Valence_Component::Sequence
bool Sequence
Decompression mode (sequence mode or file mode) for IHM.
Definition: Compression_Valence_Component.h:1604
Compression_Valence_Component::Vertex_Flag
FEVV::Vertex_pmap< HalfedgeGraph, int > Vertex_Flag
Definition: Compression_Valence_Component.h:1628
Color_Unit::operator==
bool operator==(const Color_Unit &m_color) const
Comparison operatior ==.
Definition: Compression_Valence_Component.h:184
Compression_Valence_Component::Dec_Info
FILE * Dec_Info
File to write information of decompression for IHM.
Definition: Compression_Valence_Component.h:1611
Compression_Valence_Component::VertexColor
std::vector< std::list< Color_Unit > > VertexColor
Contain color error of all removed vertices.
Definition: Compression_Valence_Component.h:1463
Compression_Valence_Component::facet_normal
FEVV::Face_pmap< HalfedgeGraph, Vector > facet_normal
Definition: Compression_Valence_Component.h:1649
Compression_Valence_Component::Process_level
int Process_level
Level of processed LoD for IHM.
Definition: Compression_Valence_Component.h:1609
Compression_Valence_Component::write_intermediate_mesh
void write_intermediate_mesh(HalfedgeGraph &_pMesh, const VertexColorMap *_v_cm)
Write intermediate mesh to file.
Definition: Compression_Valence_Component.inl:6501
Compression_Valence_Component::Smallest_Gamma
int Smallest_Gamma
The smallest gamma.
Definition: Compression_Valence_Component.h:1439
Compression_Valence_Component::face_iterator
GraphTraits::face_iterator face_iterator
Definition: Compression_Valence_Component.h:217
Compression_Valence_Component::vertex_descriptor
GraphTraits::vertex_descriptor vertex_descriptor
Definition: Compression_Valence_Component.h:214
Compression_Valence_Component::Regulation
int Regulation(HalfedgeGraph &_pMesh, const bool Normal_flipping, const bool Use_metric, const float &Metric_thread, const bool Use_forget_metric, const int &Forget_value, const int &Component_ID, const PointMap *_pm)
Removal of a set of independent vertices.
Definition: Compression_Valence_Component.inl:8890
Compression_Valence_Component::compute_normals_per_vertex
void compute_normals_per_vertex(const HalfedgeGraph &_pMesh)
Definition: Compression_Valence_Component.inl:9213
Compression_Valence_Component::Smallest_C2
int Smallest_C2
Definition: Compression_Valence_Component.h:1478
Compression_Valence_Component::m_NumberBin
int m_NumberBin
Number of bins for JCW.
Definition: Compression_Valence_Component.h:1544
Compression_Valence_Component::C2_Min
float C2_Min
The C2 minimum.
Definition: Compression_Valence_Component.h:1469
Compression_Valence_Component::Barycenter_Patch_After_Removal
Point3d Barycenter_Patch_After_Removal(const halfedge_descriptor &h, const int &valence, const HalfedgeGraph &_pMesh, const PointMap *_pm)
gives the position of the barycenter of the patch for decimation conquest.
Definition: Compression_Valence_Component.inl:7790
Compression_Valence_Component::Connectivity
std::vector< std::list< int > > Connectivity
The information of connectivity to compress.
Definition: Compression_Valence_Component.h:1407
Compression_Valence_Component::NumberDecimation
std::vector< int > NumberDecimation
To stock number of Decimation operation.
Definition: Compression_Valence_Component.h:1523
Compression_Valence_Component::ComponentArea
std::vector< double > ComponentArea
The area of each component.
Definition: Compression_Valence_Component.h:1443
Point_Int::operator-
const Point_Int operator-(const Point_Int &Pt) const
Negation operator.
Definition: Compression_Valence_Component.h:74
Geometry_traits.h
Compression_Valence_Component::v_inf_to_v
bool v_inf_to_v(const vertex_descriptor &v1, const vertex_descriptor &v2, const PointMap *_pm)
Definition: Compression_Valence_Component.inl:1295
Compression_Valence_Component::Error_Projected_Surface
bool Error_Projected_Surface(const HalfedgeGraph &_pMesh, const PointMap *_pm, const halfedge_descriptor &_h, const int &_Component_ID, const double &Mean_color, const double &Mean_area)
Calculate an error cause by a vertex removal and decide in order not to remove an important vertex.
Definition: Compression_Valence_Component.inl:6312
Point_Int::z
int z
The z coordinate.
Definition: Compression_Valence_Component.h:36
Compression_Valence_Component::Inverse_Frenet_Rotation
Point_Int Inverse_Frenet_Rotation(const Point_Int &Frenet, const Vector &T1, const Vector &T2, const Vector &normal)
Inverse operation of frenet rotation. This permits to refind the original coordinates.
Definition: Compression_Valence_Component.inl:8644
Compression_Valence_Component::facet_Component_Number
FEVV::Face_pmap< HalfedgeGraph, int > facet_Component_Number
Definition: Compression_Valence_Component.h:1645
Compression_Valence_Component::Current_level
int Current_level
The current level.
Definition: Compression_Valence_Component.h:1589
Compression_Valence_Component::Retriangulation
void Retriangulation(HalfedgeGraph &pMesh, const halfedge_descriptor &ch, const unsigned &valence, const unsigned &Vertex_number, const int &Component_ID, const PointMap *_pm)
Retriangulates the hole left by a removal of a vertex.
Definition: Compression_Valence_Component.inl:7820
Compression_Valence_Component::halfedge_to_string
std::string halfedge_to_string(const halfedge_descriptor &h, const HalfedgeGraph &_pMesh, const PointMap *_pm)
Definition: Compression_Valence_Component.inl:1277
Compression_Valence_Component::GraphTraits
boost::graph_traits< HalfedgeGraph > GraphTraits
Definition: Compression_Valence_Component.h:213
Compression_Valence_Component::HighestLengthBB
std::vector< double > HighestLengthBB
The highest length bb.
Definition: Compression_Valence_Component.h:1441
Compression_Valence_Component::NumberColorQuantization
std::vector< int > NumberColorQuantization
Number of color quantizations.
Definition: Compression_Valence_Component.h:1472
Compression_Valence_Component::ListOperation
std::vector< std::list< int > > ListOperation
The list of operation.
Definition: Compression_Valence_Component.h:1405
Compression_Valence_Component::NumberProcessedVertices
std::vector< std::list< int > > NumberProcessedVertices
Number of processed vertices.
Definition: Compression_Valence_Component.h:1455
Compression_Valence_Component::Augment_Color_Quantization_Precision
void Augment_Color_Quantization_Precision(HalfedgeGraph &_pMesh, Arithmetic_Codec &Decoder, const int &Component_ID, VertexColorMap *_v_cm)
Refine quantization precision of mesh color coordinates.
Definition: Compression_Valence_Component.inl:6021
Compression_Valence_Component::JCW_Geometry
std::list< Point_Int > JCW_Geometry
Stock geometry information for JCW.
Definition: Compression_Valence_Component.h:1571
Point_Int
Point.
Definition: Compression_Valence_Component.h:32
Compression_Valence_Component::Compression
void Compression(HalfedgeGraph &pMesh, const char *File_Name, const int &Qbit, unsigned &Connectivity_size, unsigned &Color_size, unsigned &Total_size, const PointMap *_pm)
Compressions.
Definition: Compression_Valence_Component.inl:3903
Compression_Valence_Component::ColorChildcellIndex
std::vector< std::list< int > > ColorChildcellIndex
the color childcell index
Definition: Compression_Valence_Component.h:1457
Compression_Valence_Component::DBG_print_mesh_geometry
void DBG_print_mesh_geometry(const HalfedgeGraph &_pMesh, const PointMap *_pm, const std::string &header=std::string())
Definition: Compression_Valence_Component.inl:9825
Compression_Valence_Component::Is_Complete_Reversibility_Enabled
bool Is_Complete_Reversibility_Enabled
Definition: Compression_Valence_Component.h:1580
Color_Unit::operator+
const Color_Unit operator+(const Color_Unit &m_color) const
Addition operator.
Definition: Compression_Valence_Component.h:146
Compression_Valence_Component::m_Rmin
double m_Rmin
Distance of farthest vertex from mesh center for JCW.
Definition: Compression_Valence_Component.h:1548
Compression_Valence_Component::Is_Bijection_Enabled
bool Is_Bijection_Enabled
true if "bijection" option is seleted
Definition: Compression_Valence_Component.h:1582
FEVV::Vertex_pmap
typename Vertex_pmap_traits< MeshT, ValueT >::pmap_type Vertex_pmap
Definition: properties.h:607
Compression_Valence_Component::Geometry
std::vector< std::list< Point_Int > > Geometry
The geometry information to compress.
Definition: Compression_Valence_Component.h:1409
Compression_Valence_Component::Remove_Edges
bool Remove_Edges(HalfedgeGraph &_pMesh, const halfedge_descriptor &h, const int &type)
Remove edges to create a hole.
Definition: Compression_Valence_Component.inl:9456
Compression_Valence_Component::Get_Average_Vertex_Color_After_Removal
Color_Unit Get_Average_Vertex_Color_After_Removal(const halfedge_descriptor &h, const int &valence, const HalfedgeGraph &_pMesh)
Gets an average color of neighboring vertices ( After removal of front vertex of h)
Definition: Compression_Valence_Component.inl:8857
Compression_Valence_Component::AlphaOffset
std::vector< std::list< int > > AlphaOffset
The offset of alpha.
Definition: Compression_Valence_Component.h:1422
Compression_Valence_Component::DumpSymbolDecimation
int DumpSymbolDecimation
Definition: Compression_Valence_Component.h:1527
Compression_Valence_Component::Triangle_Normal
Vector Triangle_Normal(const HalfedgeGraph &_pMesh, const Point3d &P, const Point3d &Q, const Point3d &R)
Gives a normal vector of the triangle formed by three points P Q R in the counterclockwise way....
Compression_Valence_Component::m_Dist
double m_Dist
Distance of each bin.
Definition: Compression_Valence_Component.h:1550
Compression_Valence_Component::Total_layer
int Total_layer
The total number of layer.
Definition: Compression_Valence_Component.h:1590
Color_Unit::operator-
const Color_Unit operator-(const Color_Unit &m_color) const
Negation operator.
Definition: Compression_Valence_Component.h:165
Compression_Valence_Component::xmin
std::vector< float > xmin
The xmin.
Definition: Compression_Valence_Component.h:1430
Compression_Valence_Component::vertex_normal
FEVV::Vertex_pmap< HalfedgeGraph, Vector > vertex_normal
Definition: Compression_Valence_Component.h:1634
Arithmetic_Codec::calculate_current_decoded_size
unsigned calculate_current_decoded_size(void)
Definition: arithmetic_codec.hpp:192
Compression_Valence_Component::Triangle_Normal
Vector Triangle_Normal(const HalfedgeGraph &_pMesh, const PointMap *_pm, const halfedge_descriptor &h)
Gives a normal vector of the triangle containing the halfedge_handle h.
Definition: Compression_Valence_Component.inl:7208
Arithmetic_Codec
Arithmetic codec.
Definition: arithmetic_codec.hpp:154
Compression_Valence_Component::Visu_level
int Visu_level
Level of visualized LoD for IHM.
Definition: Compression_Valence_Component.h:1608
Point_Int::operator+
const Point_Int operator+(const Point_Int &Pt) const
Addition operator.
Definition: Compression_Valence_Component.h:55
Compression_Valence_Component::Smallest_C1
int Smallest_C1
Definition: Compression_Valence_Component.h:1476
Compression_Valence_Component::NumberComponents
int NumberComponents
Definition: Compression_Valence_Component.h:1536
Point_Int::y
int y
The y coordinate.
Definition: Compression_Valence_Component.h:35
Compression_Valence_Component::zmin
std::vector< float > zmin
The zmin.
Definition: Compression_Valence_Component.h:1432
Compression_Valence_Component::Division_Threshold
int Division_Threshold
Threshold of region division.
Definition: Compression_Valence_Component.h:1583
msdm2::vertex_descriptor
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
Definition: msdm2_surfacemesh.h:33
Compression_Valence_Component::print_vertex
void print_vertex(const std::string &title, const vertex_descriptor &v, const PointMap *_pm)
Definition: Compression_Valence_Component.inl:1251
Halfedge_handle
EnrichedPolyhedron::Halfedge_handle Halfedge_handle
Definition: boolops_cpolyhedron_builder.hpp:25
Color_Unit::c1
int c1
Definition: Compression_Valence_Component.h:121
Compression_Valence_Component::Write_Info
void Write_Info(HalfedgeGraph &pMesh)
Write information of each LoD at decompression in a file.
Definition: Compression_Valence_Component.inl:6678
Compression_Valence_Component::DumpSymbolRegulation
int DumpSymbolRegulation
Definition: Compression_Valence_Component.h:1530
Compression_Valence_Component::Number_non_reversible_vertices
int Number_non_reversible_vertices
Definition: Compression_Valence_Component.h:1575
Compression_Valence_Component::Get_Average_Vertex_Color_Lee
Color_Unit Get_Average_Vertex_Color_Lee(const halfedge_descriptor &h, const int &valence, const HalfedgeGraph &_pMesh)
Gets an average vertex color prediction using Lee's method.
Definition: Compression_Valence_Component.inl:7672
Compression_Valence_Component::Is_Division_Big_Regions_Enabled
bool Is_Division_Big_Regions_Enabled
Definition: Compression_Valence_Component.h:1578
Compression_Valence_Component::C1_Range
int C1_Range
The C1 range.
Definition: Compression_Valence_Component.h:1482
Point3d
EnrichedPolyhedron::Point_3 Point3d
Definition: boolops_cpolyhedron_builder.hpp:27
Compression_Valence_Component::Change_Real_Int
Point_Int Change_Real_Int(const Point3d &pt, const int &Component_ID)
Change from real to int point(related to quantization bit)
Definition: Compression_Valence_Component.inl:6233
Compression_Valence_Component::Is_Manifold_Property_Violated
bool Is_Manifold_Property_Violated(const HalfedgeGraph &_pMesh, const halfedge_descriptor &h, const int &type, const int &valence)
Query if removal of this vertex would violate the manifold_property or not.
Definition: Compression_Valence_Component.inl:6843
Compression_Valence_Component::Diminush_Color_Quantization_Precision
void Diminush_Color_Quantization_Precision(HalfedgeGraph &pMesh, const int Component_ID, VertexColorMap *_v_cm)
Reduces quantization precision of color coordinates.
Definition: Compression_Valence_Component.inl:4620
Compression_Valence_Component::m_Watermarks
std::list< int > m_Watermarks
watermark
Definition: Compression_Valence_Component.h:1553
Compression_Valence_Component::ComponentNumberVertices
std::vector< int > ComponentNumberVertices
The number of vertices of each components.
Definition: Compression_Valence_Component.h:1445
Compression_Valence_Component::Get_Correct_Vector
int Get_Correct_Vector(int i, int j, int k)
ADAPTIVE_QUANTIZATION : gets symbols to correct Vector of under_quantization.
Definition: Compression_Valence_Component.inl:9347
Compression_Valence_Component::QuantizationCorrectVector
std::vector< std::list< int > > QuantizationCorrectVector
The quantization correct vector.
Definition: Compression_Valence_Component.h:1449
Compression_Valence_Component::vertex_Q_Index
FEVV::Vertex_pmap< HalfedgeGraph, int > vertex_Q_Index
Definition: Compression_Valence_Component.h:1636
Compression_Valence_Component::Simplification
void Simplification(HalfedgeGraph &pMesh, const PointMap *_pm, 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)
Mesh Simplification which applies iteratively decimation and regulation in pair.
Definition: Compression_Valence_Component.inl:3797
Compression_Valence_Component::IsCompressed
bool IsCompressed
true if is compressed
Definition: Compression_Valence_Component.h:1588
Compression_Valence_Component::Decoder
Arithmetic_Codec Decoder
The arithmetic decoder.
Definition: Compression_Valence_Component.h:1514
Compression_Valence_Component::xmax
std::vector< float > xmax
The xmax.
Definition: Compression_Valence_Component.h:1433
properties.h
Compression_Valence_Component::Find_Type
int Find_Type(const HalfedgeGraph &_pMesh, const halfedge_descriptor &h, const int &valence)
To find a correspondent type to retriangulate.
Definition: Compression_Valence_Component.inl:6755
Compression_Valence_Component::Is_Normal_Flipping_Occured
bool Is_Normal_Flipping_Occured(const HalfedgeGraph &_pMesh, const PointMap *_pm, const halfedge_descriptor &h, const unsigned &valence)
Query if removal of the front vertex can cause a normal flipping problem.
Definition: Compression_Valence_Component.inl:7082
Compression_Valence_Component::Possible_change_sequence
bool Possible_change_sequence
Definition: Compression_Valence_Component.h:1605
Compression_Valence_Component::Vector
FEVV::Geometry_traits< HalfedgeGraph >::Vector Vector
Definition: Compression_Valence_Component.h:220
Compression_Valence_Component::halfedge_iterator
GraphTraits::halfedge_iterator halfedge_iterator
Definition: Compression_Valence_Component.h:219
Compression_Valence_Component::InterGeometry
std::list< Point_Int > InterGeometry
The intermediate information of geometry.
Definition: Compression_Valence_Component.h:1416
Compression_Valence_Component::ComponentOperations
std::vector< int > ComponentOperations
The operations of each component.
Definition: Compression_Valence_Component.h:1541
Compression_Valence_Component::Initial_file_size
unsigned Initial_file_size
Size of the initial file.
Definition: Compression_Valence_Component.h:1591
Compression_Valence_Component::m_Rad_decision
std::vector< double > m_Rad_decision
Definition: Compression_Valence_Component.h:1561
Compression_Valence_Component::Color_Quantization_Step
float Color_Quantization_Step
The color quantization step.
Definition: Compression_Valence_Component.h:1471
Compression_Valence_Component::Change_Int_Real
Point3d Change_Int_Real(const Point_Int &pt, const int &Component_ID)
Change from int to real point(related to quantization bit)
Definition: Compression_Valence_Component.inl:6278
Compression_Valence_Component::Facet_Flag
FEVV::Face_pmap< HalfedgeGraph, int > Facet_Flag
Definition: Compression_Valence_Component.h:1647
Compression_Valence_Component::print_halfedge
void print_halfedge(const std::string &title, const halfedge_descriptor &h, const HalfedgeGraph &_pMesh, const PointMap *_pm)
Definition: Compression_Valence_Component.inl:1226
Compression_Valence_Component::m_VC
double m_VC[3]
Mesh center position for JCW.
Definition: Compression_Valence_Component.h:1547
Compression_Valence_Component::Decompress_Init
void Decompress_Init(HalfedgeGraph &pMesh, PointMap *_pm, VertexColorMap *_v_cm, bool &has_color, const std::string &Input_File_Name)
Initialize the Decompression by loading the base mesh into pMesh. aka decompress the first (simplest)...
Definition: Compression_Valence_Component.inl:5471
Compression_Valence_Component::Area_Facet_Triangle
double Area_Facet_Triangle(const typename boost::graph_traits< HalfedgeGraph >::halfedge_descriptor &h, const HalfedgeGraph &mesh, const PointMap *pm)
Gives an area of the triangle which contain the halfedge_handle h.
Definition: Compression_Valence_Component.inl:7571
Compression_Valence_Component::compute_facet_normal
void compute_facet_normal(const face_descriptor &f, const HalfedgeGraph &_pMesh, const PointMap *_pm)
Definition: Compression_Valence_Component.inl:9227
Compression_Valence_Component::truncate_colors
void truncate_colors(const HalfedgeGraph &_pMesh, VertexColorMap *_v_cm)
Definition: Compression_Valence_Component.inl:9797
Compression_Valence_Component::copy_mesh
static void copy_mesh(const HalfedgeGraph &_pMesh, const VertexColorMap *_v_cm, HalfedgeGraph &mesh_copy, VertexColorMap *v_cm_copy)
Copy the current mesh and vertex-color map to a new mesh and vertex-color map. If v_cm_copy == nullpt...
Definition: Compression_Valence_Component.inl:6521
Compression_Valence_Component::m_N_Errors
std::list< int > m_N_Errors
Index of error related to complete reversibility.
Definition: Compression_Valence_Component.h:1566
Compression_Valence_Component::compute_normals_per_facet
void compute_normals_per_facet(const HalfedgeGraph &_pMesh, const PointMap *_pm)
Definition: Compression_Valence_Component.inl:9198
Compression_Valence_Component::vertex_Component_Number
FEVV::Vertex_pmap< HalfedgeGraph, int > vertex_Component_Number
Definition: Compression_Valence_Component.h:1626
Compression_Valence_Component::IsClosed
std::vector< bool > IsClosed
The is closed. To know if the mesh is open or closed.
Definition: Compression_Valence_Component.h:1393
Compression_Valence_Component::ymax
std::vector< float > ymax
The ymax.
Definition: Compression_Valence_Component.h:1434
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
Color_Unit::c2
int c2
Definition: Compression_Valence_Component.h:122
Compression_Valence_Component::Decimation_Conquest
int Decimation_Conquest(HalfedgeGraph &pMesh, const PointMap *_pm, 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 int &Component_ID)
Removal of a set of independent vertices.
Definition: Compression_Valence_Component.inl:1342
Compression_Valence_Component::ColorEncoderIndex
std::vector< std::list< int > > ColorEncoderIndex
the color encoder index
Definition: Compression_Valence_Component.h:1459
Compression_Valence_Component::Calculate_Current_File_Size
unsigned Calculate_Current_File_Size(void)
Calculates the current file size. Measure bits used for decompression.
Definition: Compression_Valence_Component.h:914
Compression_Valence_Component::vertex_Removal_Order
FEVV::Vertex_pmap< HalfedgeGraph, int > vertex_Removal_Order
Definition: Compression_Valence_Component.h:1640
Compression_Valence_Component::Decompression_All_From_File
std::string Decompression_All_From_File(HalfedgeGraph &_pMesh, PointMap *_pm, VertexColorMap *_v_cm, bool do_write_info, std::vector< HalfedgeGraph * > *intermediate_meshes, std::vector< VertexColorMap * > *intermediate_vertexColorMaps, int stop_level=-1, bool do_write_intermediate_meshes=false)
Decompression of all LoDs from file, or until a specified level. The finest LoD is visualized without...
Definition: Compression_Valence_Component.inl:6584
Compression_Valence_Component::Smallest_Alpha
int Smallest_Alpha
The smallest alpha.
Definition: Compression_Valence_Component.h:1438