#ifndef NXS_NEXUS_H #define NXS_NEXUS_H #include #include #include #include #include #include "vfile.h" #include "patch.h" #include "border.h" namespace nxs { class Nexus { public: struct Entry { Entry(): patch_start(0xffffffff), border_start(0xffffffff), patch_size(0), border_size(0), border_used(0), nvert(0), nface(0), sphere(vcg::Sphere3f()) {} unsigned int patch_start; //granularita' Chunk unsigned int border_start; //granuralita' Link unsigned short patch_size; //in cuhnks unsigned short border_size; //in Links unsigned short border_used; //in Links //Data used for extraction unsigned short nvert; unsigned short nface; vcg::Sphere3f sphere; float error; unsigned short ram; unsigned short agp; }; struct Update { std::vector erased; std::vector created; }; Nexus(); ~Nexus(); bool Create(const std::string &filename, Signature signature); bool Load(const std::string &filename); void Close(); Patch GetPatch(unsigned int patch); Border GetBorder(unsigned int patch); //MOVE to nexus_build.cpp unsigned int AddPatch(unsigned int nvert, unsigned int nface, unsigned int nbord); // unsigned int Join(std::vector &patches); void Join(const std::set &patches, std::vector &vert, std::vector &faces, std::vector &links); void Unify(float threshold = 0.0f); //TODO implement theese void CompactBorder(unsigned int patch); void CompactBorders(); void CompactPatches(); Signature signature; unsigned int totvert; unsigned int totface; vcg::Sphere3f sphere; std::vector index; VFile patches; VFile borders; std::vector history; private: FILE *index_file; }; } #endif