mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
Structured the void center extraction
This commit is contained in:
parent
5c9500628c
commit
36aa91c064
2 changed files with 23 additions and 3 deletions
|
@ -9,11 +9,12 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
bool loadZobov(const char *descName, const char *adjName, const char *volName, ZobovRep& z)
|
bool loadZobov(const char *descName, const char *adjName, const char *voidsName,
|
||||||
|
const char *volName, ZobovRep& z)
|
||||||
{
|
{
|
||||||
ifstream descFile(descName);
|
ifstream descFile(descName);
|
||||||
ifstream adjFile(adjName);
|
ifstream adjFile(adjName);
|
||||||
ifstream volFile(volName);
|
ifstream volFile(voidsName);
|
||||||
int32_t numParticles, numZones, numPinZone;
|
int32_t numParticles, numZones, numPinZone;
|
||||||
int32_t totalParticles;
|
int32_t totalParticles;
|
||||||
int32_t numVoids;
|
int32_t numVoids;
|
||||||
|
@ -77,6 +78,23 @@ bool loadZobov(const char *descName, const char *adjName, const char *volName, Z
|
||||||
delete[] zId;
|
delete[] zId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (volName != 0)
|
||||||
|
{
|
||||||
|
cout << "Loading particle volumes (requested)" << endl;
|
||||||
|
ifstream f(volName);
|
||||||
|
int numParticles;
|
||||||
|
|
||||||
|
if (!f)
|
||||||
|
{
|
||||||
|
cerr << "No such file " << volName << endl;
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
f.read((char *)&numParticles, sizeof(int));
|
||||||
|
z.particleVolume.resize(numParticles);
|
||||||
|
f.read((char *)&z.particleVolume[0], sizeof(float)*numParticles);
|
||||||
|
}
|
||||||
|
|
||||||
cout << "Loading description" << endl;
|
cout << "Loading description" << endl;
|
||||||
|
|
||||||
string line;
|
string line;
|
||||||
|
|
|
@ -20,9 +20,11 @@ struct ZobovRep
|
||||||
{
|
{
|
||||||
std::vector<ZobovZone> allZones;
|
std::vector<ZobovZone> allZones;
|
||||||
std::vector<ZobovVoid> allVoids;
|
std::vector<ZobovVoid> allVoids;
|
||||||
|
std::vector<float> particleVolume;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool loadZobov(const char *descName,
|
bool loadZobov(const char *descName,
|
||||||
const char *adjName, const char *volName, ZobovRep& z);
|
const char *adjName, const char *voidName,
|
||||||
|
const char *volName, ZobovRep& z);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue