#ifndef NXS_FRAGMENT_H #define NXS_FRAGMENT_H #include #include #include "nexus.h" namespace nxs { class VoronoiPartition; struct BigLink { unsigned int start_vert; unsigned int end_patch; unsigned int end_vert; bool operator<(const BigLink &l) const { if(end_patch == l.end_patch) { if(start_vert == l.start_vert) { return end_vert < l.end_vert; } else return start_vert < l.start_vert; } else return end_patch < l.end_patch; } }; class NxsPatch { public: //this fields is the patch number in the infragment //and the seeds id in the outfragment unsigned int patch; std::vector vert; std::vector face; std::vector bord; void Write(pt::outstm *out); void Read(pt::instm *in); }; class Fragment { public: unsigned int id; float error; std::vector seeds; std::vector seeds_id; std::vector pieces; bool Write(pt::outstm *out); bool Read(pt::instm *in); //returns the index of the seed unsigned int Locate(const vcg::Point3f &p); }; void Join(Fragment &in, std::vector &newvert, std::vector &newface, std::vector &newbord); void Split(Fragment &out, std::vector &newvert, std::vector &newface, std::vector &newbord); } #endif