vcglib/apps/nexus/nexus.h

73 lines
1.5 KiB
C
Raw Normal View History

2004-07-02 15:00:02 +02:00
#ifndef NXS_NEXUS_H
#define NXS_NEXUS_H
#include <string>
#include <vector>
2004-08-27 02:38:34 +02:00
#include <set>
2004-07-05 17:49:39 +02:00
#include <vcg/space/point3.h>
2004-07-02 15:00:02 +02:00
#include <vcg/space/sphere3.h>
#include "vfile.h"
#include "patch.h"
#include "border.h"
namespace nxs {
class Nexus {
public:
class Entry {
public:
2004-07-04 16:26:46 +02:00
Entry(): patch_start(0xffffffff), border_start(0xffffffff),
patch_size(0), border_size(0),
nvert(0), nface(0), sphere(vcg::Sphere3f()) {}
unsigned int patch_start; //granularita' Chunk
unsigned int border_start; //granuralita' Link
2004-07-02 15:00:02 +02:00
unsigned short patch_size; //in cuhnks
unsigned short border_size; //in Links
2004-07-04 16:26:46 +02:00
unsigned short nvert;
unsigned short nface;
2004-07-02 15:00:02 +02:00
vcg::Sphere3f sphere;
};
Nexus();
~Nexus();
bool Create(const std::string &filename);
bool Load(const std::string &filename);
void Close();
Patch GetPatch(unsigned int patch);
2004-07-04 16:26:46 +02:00
Border GetBorder(unsigned int patch);
unsigned int AddPatch(unsigned int nvert, unsigned int nface,
unsigned int nbord);
// unsigned int Join(std::vector<unsigned int> &patches);
2004-08-27 02:38:34 +02:00
void Join(const std::set<unsigned int> &patches,
2004-07-05 17:49:39 +02:00
std::vector<vcg::Point3f> &vert,
2004-07-04 16:26:46 +02:00
std::vector<unsigned int> &faces,
std::vector<Link> &links);
2004-07-02 15:00:02 +02:00
2004-07-04 16:26:46 +02:00
//TODO implement theese
void CompactBorder(unsigned int patch);
void CompactBorders();
void CompactPatches();
2004-07-02 15:00:02 +02:00
unsigned int totvert;
unsigned int totface;
vcg::Sphere3f sphere;
std::vector<Entry> index;
VFile<Chunk> patches;
VFile<Link> borders;
2004-07-04 16:26:46 +02:00
private:
FILE *index_file;
2004-07-02 15:00:02 +02:00
};
}
#endif