// // Created by 14727 on 2022/12/24. // #ifndef GAUSSMAP_GAUSS_MAP_H #define GAUSSMAP_GAUSS_MAP_H #include "vector" #include "tinynurbs/tinynurbs.h" #include "glm/glm.hpp" #include "aabb.h" #include "map" // 一个节点就表示一个球上矩形面片 struct GaussMapNode { // 四个顶点的法向量值确定一个平面的法向量值 AABB nBound; int level, firstChild; }; class GaussMap { int maxLevel; int leafSampleCnt; std::vector> normals; tinynurbs::RationalSurface srf; void recursiveBuild(int level, int idx, int idx_u, int idx_v); public: std::vector tree; GaussMap(int maxLevel, tinynurbs::RationalSurface srf_); void build(); void normalInit(); }; std::vector> getOverlapLeafNodes(const GaussMap& gm1, const GaussMap& gm2); void recursiveGetOverlapLeafNodes(const GaussMap& gm1, const GaussMap& gm2, int idx1, int idx2, std::vector>& pairs); #endif //GAUSSMAP_GAUSS_MAP_H