From 2a5c9bfb6177bf24707fd90b299f2da8f2e60643 Mon Sep 17 00:00:00 2001 From: gabryon99 Date: Mon, 13 Sep 2021 20:28:45 +0200 Subject: [PATCH] fix typos --- vcg/complex/algorithms/occupancy_grid.h | 55 +++++++++++++------------ 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/vcg/complex/algorithms/occupancy_grid.h b/vcg/complex/algorithms/occupancy_grid.h index 6bb15067..e3742246 100644 --- a/vcg/complex/algorithms/occupancy_grid.h +++ b/vcg/complex/algorithms/occupancy_grid.h @@ -3,6 +3,9 @@ #include #include +#include +#include + #ifndef VCGLIB_OCCUPANCY_GRID_H #define VCGLIB_OCCUPANCY_GRID_H @@ -62,7 +65,7 @@ namespace vcg { v.clear(); for (size_t i = 0; i < MeshCounter::MaxVal(); ++i) { - if (cnt.test(i) { + if (cnt.test(i)) { v.push_back(i); } } @@ -132,18 +135,36 @@ namespace vcg { DEGREE }; - int s,t; // source and target (come indici nel gruppo corrente) + int s, t; // source and target (come indici nel gruppo corrente) int area; // float norm_area; OGArcInfo(int _s, int _t, int _area, float _n) : s{_s}, t{_t}, area{_area}, norm_area{_n} {} - OGArcInfo(int _s, int _t, int _area) s{_s}, t{_t}, area{_area} {} + OGArcInfo(int _s, int _t, int _area) : s{_s}, t{_t}, area{_area} {} bool operator < (const OGArcInfo &p) const { return norm_area < p.norm_area; } }; + GridStaticObj G; + + int mn; + int TotalArea; + /** + * Maximum number of meshes that cross a cell + */ + int MaxCount; + + /** + * SortedVisual Arcs + */ + std::vector SVA; // SortedVirtual Arcs; + /** + * High level information for each mesh. Mapped by mesh id + */ + std::map VM; + bool Init(int _mn, Box3d bb, int size) { // the number of meshes (including all the unused ones; eg it is the range of the possible id) @@ -163,8 +184,8 @@ namespace vcg { AlignPair::A2Mesh M; - vcg::tri::io::Importer::Open(M,MeshName); - vcg::tri::Clean::RemoveUnreferencedVertex(M); + vcg::tri::io::Importer::Open(M, MeshName); + vcg::tri::Clean::RemoveUnreferencedVertex(M); AddMesh(M,Tr,id); } @@ -179,7 +200,7 @@ namespace vcg { std::fprintf(stdout, "OG::AddMesh:Scanning BBoxex\n"); for (std::size_t i = 0; i < names.size(); ++i) { - ply::ScanBBox(names[i].c_str(),bb); + vcg::ply::ScanBBox(names[i].c_str(),bb); totalbb.Add(trv[i], bb); } @@ -196,7 +217,7 @@ namespace vcg { Matrix44f Trf; Trf.Import(Tr); - for (auto vi = std::begin(M.vert); vi != std::end(M.vert); ++vi) { + for (auto vi = std::begin(mesh.vert); vi != std::end(mesh.vert); ++vi) { if (!(*vi).IsD()) { G.Grid( Trf * Point3f::Construct((*vi).P()) ).Set(ind); @@ -406,26 +427,6 @@ namespace vcg { TotalArea = ccnt; } - private: - - GridStaticObj G; - - int mn; - int TotalArea; - /** - * Maximum number of meshes that cross a cell - */ - int MaxCount; - - /** - * SortedVisual Arcs - */ - std::vector SVA; // SortedVirtual Arcs; - /** - * High level information for each mesh. Mapped by mesh id - */ - std::map VM; - }; }