fix typos
This commit is contained in:
parent
8928fbbe6b
commit
2a5c9bfb61
|
@ -3,6 +3,9 @@
|
||||||
#include <vcg/complex/algorithms/align_pair.h>
|
#include <vcg/complex/algorithms/align_pair.h>
|
||||||
#include <vcg/space/index/grid_static_obj.h>
|
#include <vcg/space/index/grid_static_obj.h>
|
||||||
|
|
||||||
|
#include <wrap/ply/plystuff.h>
|
||||||
|
#include <wrap/io_trimesh/import.h>
|
||||||
|
|
||||||
#ifndef VCGLIB_OCCUPANCY_GRID_H
|
#ifndef VCGLIB_OCCUPANCY_GRID_H
|
||||||
#define VCGLIB_OCCUPANCY_GRID_H
|
#define VCGLIB_OCCUPANCY_GRID_H
|
||||||
|
|
||||||
|
@ -62,7 +65,7 @@ namespace vcg {
|
||||||
v.clear();
|
v.clear();
|
||||||
|
|
||||||
for (size_t i = 0; i < MeshCounter::MaxVal(); ++i) {
|
for (size_t i = 0; i < MeshCounter::MaxVal(); ++i) {
|
||||||
if (cnt.test(i) {
|
if (cnt.test(i)) {
|
||||||
v.push_back(i);
|
v.push_back(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,13 +140,31 @@ namespace vcg {
|
||||||
float norm_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, 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 {
|
bool operator < (const OGArcInfo &p) const {
|
||||||
return norm_area < p.norm_area;
|
return norm_area < p.norm_area;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GridStaticObj<MeshCounter, float> G;
|
||||||
|
|
||||||
|
int mn;
|
||||||
|
int TotalArea;
|
||||||
|
/**
|
||||||
|
* Maximum number of meshes that cross a cell
|
||||||
|
*/
|
||||||
|
int MaxCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SortedVisual Arcs
|
||||||
|
*/
|
||||||
|
std::vector<OGArcInfo> SVA; // SortedVirtual Arcs;
|
||||||
|
/**
|
||||||
|
* High level information for each mesh. Mapped by mesh id
|
||||||
|
*/
|
||||||
|
std::map<int, OGMeshInfo> VM;
|
||||||
|
|
||||||
bool Init(int _mn, Box3d bb, int size) {
|
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)
|
// 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;
|
AlignPair::A2Mesh M;
|
||||||
|
|
||||||
vcg::tri::io::Importer<A2Mesh>::Open(M,MeshName);
|
vcg::tri::io::Importer<AlignPair::A2Mesh>::Open(M, MeshName);
|
||||||
vcg::tri::Clean<A2Mesh>::RemoveUnreferencedVertex(M);
|
vcg::tri::Clean<AlignPair::A2Mesh>::RemoveUnreferencedVertex(M);
|
||||||
|
|
||||||
AddMesh(M,Tr,id);
|
AddMesh(M,Tr,id);
|
||||||
}
|
}
|
||||||
|
@ -179,7 +200,7 @@ namespace vcg {
|
||||||
std::fprintf(stdout, "OG::AddMesh:Scanning BBoxex\n");
|
std::fprintf(stdout, "OG::AddMesh:Scanning BBoxex\n");
|
||||||
|
|
||||||
for (std::size_t i = 0; i < names.size(); ++i) {
|
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);
|
totalbb.Add(trv[i], bb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +217,7 @@ namespace vcg {
|
||||||
Matrix44f Trf;
|
Matrix44f Trf;
|
||||||
Trf.Import(Tr);
|
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()) {
|
if (!(*vi).IsD()) {
|
||||||
G.Grid( Trf * Point3f::Construct((*vi).P()) ).Set(ind);
|
G.Grid( Trf * Point3f::Construct((*vi).P()) ).Set(ind);
|
||||||
|
@ -406,26 +427,6 @@ namespace vcg {
|
||||||
TotalArea = ccnt;
|
TotalArea = ccnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
GridStaticObj<MeshCounter, float> G;
|
|
||||||
|
|
||||||
int mn;
|
|
||||||
int TotalArea;
|
|
||||||
/**
|
|
||||||
* Maximum number of meshes that cross a cell
|
|
||||||
*/
|
|
||||||
int MaxCount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SortedVisual Arcs
|
|
||||||
*/
|
|
||||||
std::vector<OGArcInfo> SVA; // SortedVirtual Arcs;
|
|
||||||
/**
|
|
||||||
* High level information for each mesh. Mapped by mesh id
|
|
||||||
*/
|
|
||||||
std::map<int, OGMeshInfo> VM;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue