From 30f0383fc60e0137715a20dc9bcfa4b13b2765aa Mon Sep 17 00:00:00 2001 From: gabryon99 Date: Tue, 14 Sep 2021 17:47:56 +0200 Subject: [PATCH] add ScalarType to OccupancyGrid and MeshTree --- vcg/complex/algorithms/meshtree.h | 22 +++++++++++----------- vcg/complex/algorithms/occupancy_grid.h | 12 ++++++------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/vcg/complex/algorithms/meshtree.h b/vcg/complex/algorithms/meshtree.h index 3bd18a9a..081c81b2 100644 --- a/vcg/complex/algorithms/meshtree.h +++ b/vcg/complex/algorithms/meshtree.h @@ -11,7 +11,7 @@ namespace vcg { - template + template class MeshTree { public: @@ -24,11 +24,11 @@ namespace vcg { MeshNode(MeshType *_m) : m{_m}, glued{false} {} - vcg::Matrix44d &tr() { + vcg::Matrix44 &tr() { return m->cm.Tr; } - const vcg::Box3d &bbox() const { + const vcg::Box3 &bbox() const { return m->cm.bbox; } @@ -47,7 +47,7 @@ namespace vcg { std::map nodeMap; std::vector resultList; - vcg::OccupancyGrid OG; + vcg::OccupancyGrid OG; vcg::CallBackPos * cb; MeshType *MM(unsigned int i) { @@ -137,12 +137,12 @@ namespace vcg { std::sprintf(buf, "Computing Overlaps %i glued meshes...\n", gluedNum()); cb(0, buf); - OG.Init(static_cast(nodeMap.size()), vcg::Box3d::Construct(gluedBBox()), mtp.OGSize); + OG.Init(static_cast(nodeMap.size()), vcg::Box3::Construct(gluedBBox()), mtp.OGSize); for(auto ni = std::begin(nodeMap); ni != std::end(nodeMap); ++ni) { MeshTree::MeshNode *mn = ni->second; if (mn->glued) { - OG.AddMesh(mn->m->cm, vcg::Matrix44d::Construct(mn->tr()), mn->Id()); + OG.AddMesh(mn->m->cm, vcg::Matrix44::Construct(mn->tr()), mn->Id()); } } @@ -357,22 +357,22 @@ namespace vcg { result.MovName=movId; } - inline vcg::Box3d bbox() { + inline vcg::Box3 bbox() { - vcg::Box3d FullBBox; + vcg::Box3 FullBBox; for (auto ni = std::begin(nodeMap); ni != std::end(nodeMap); ++ni) { FullBBox.Add(vcg::Matrix44d::Construct(ni->second->tr()),ni->second->bbox()); } return FullBBox; } - inline vcg::Box3d gluedBBox() { + inline vcg::Box3 gluedBBox() { - vcg::Box3d FullBBox; + vcg::Box3 FullBBox; for (auto ni = std::begin(nodeMap); ni != std::end(nodeMap); ++ni) { if (ni->second->glued) { - FullBBox.Add(vcg::Matrix44d::Construct(ni->second->tr()), ni->second->bbox()); + FullBBox.Add(vcg::Matrix44::Construct(ni->second->tr()), ni->second->bbox()); } } return FullBBox; diff --git a/vcg/complex/algorithms/occupancy_grid.h b/vcg/complex/algorithms/occupancy_grid.h index 1c74ae6f..6ddcfd9c 100644 --- a/vcg/complex/algorithms/occupancy_grid.h +++ b/vcg/complex/algorithms/occupancy_grid.h @@ -13,7 +13,7 @@ #define OG_MESH_INFO_MAX_STAT 64 namespace vcg { - template + template class OccupancyGrid { public: @@ -165,7 +165,7 @@ namespace vcg { */ std::map VM; - bool Init(int _mn, Box3d bb, int size) { + bool Init(int _mn, Box3 bb, int size) { // the number of meshes (including all the unused ones; eg it is the range of the possible id) mn = _mn; @@ -180,7 +180,7 @@ namespace vcg { return true; } - void Add(const char *MeshName, Matrix44d &Tr, int id) { + void Add(const char *MeshName, Matrix44 &Tr, int id) { AlignPair::A2Mesh M; @@ -190,9 +190,9 @@ namespace vcg { AddMesh(M,Tr,id); } - void AddMeshes(std::vector &names, std::vector &trv,int size) { + void AddMeshes(std::vector &names, std::vector> &trv,int size) { - Box3d bb, totalbb; + Box3 bb, totalbb; bb.SetNull(); totalbb.SetNull(); @@ -212,7 +212,7 @@ namespace vcg { } } - void AddMesh(MeshType &mesh, const Matrix44d &Tr, int ind) { + void AddMesh(MeshType &mesh, const Matrix44 &Tr, int ind) { Matrix44f Trf; Trf.Import(Tr);