#ifndef NXS_REMAPPING_H #define NXS_REMAPPING_H #include #include #include "nxstypes.h" #include "vchain.h" #include "nexus.h" #include "vfile.h" namespace nxs { struct BlockEntry { BlockEntry(int64 o = 0, unsigned int s = 0): offset(o), size(s) {} int64 offset; unsigned int size; }; class BlockIndex: public std::vector { public: bool Save(const std::string &file); bool Load(const std::string &file); }; void Remap(VChain &chain, VFile &points, VFile &remap, BlockIndex &index, unsigned int target_size, unsigned int min_size, unsigned int max_size, float scaling, int step); void BuildPartition(VPartition &part, VFile &points, unsigned int target_size, unsigned int min_size, unsigned int max_size, int steps); void BuildLevel(VChain &chain, Nexus &nexus, unsigned int offset, float scaling, unsigned int target_size, unsigned int min_size, unsigned int max_size, int steps); //removes small or really big patches. bool Optimize(VPartition &part, unsigned int target_cells, unsigned int target_size, unsigned int min_size, unsigned int max_size, std::vector ¢roids, std::vector &counts, bool join); int GetBest(VPartition &part, unsigned int seed, std::vector &mark, std::vector &counts); } #endif