mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
Filter uniqueID attribute
This commit is contained in:
parent
15e065a833
commit
5f332edf02
2 changed files with 21 additions and 8 deletions
|
@ -95,6 +95,9 @@ void SimulationLoader::basicPreprocessing(SimuData *d,
|
|||
}
|
||||
filteredCopy(d->Id, accepted, d->NumPart);
|
||||
filteredCopy(d->type, accepted, d->NumPart);
|
||||
|
||||
filterAttribute<long>(d, "uniqueID", accepted, d->NumPart);
|
||||
|
||||
d->NumPart = numAccepted;
|
||||
delete[] accepted;
|
||||
}
|
||||
|
|
|
@ -121,6 +121,16 @@ public:
|
|||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void filterAttribute(CosmoTool::SimuData *d, const std::string& attrname, bool *accepted, long NumPart)
|
||||
{
|
||||
if (d->attributes.find(attrname) == d->attributes.end())
|
||||
return;
|
||||
|
||||
long *l = d->as<T>(attrname);
|
||||
filteredCopy<T>(l, accepted, NumPart);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue