115 const int indexCount,
const ParticleIndex* particleIndices,
const bool sorted,T* values)
125 return static_cast<T*
>(
dataInternal(attribute,particleIndex));
149 const ParticleIndex* particleIndices,
const bool sorted,
float* values)
const=0;
154 virtual void findPoints(
const float bboxMin[3],
const float bboxMax[3],
155 std::vector<ParticleIndex>& points)
const=0;
162 virtual float findNPoints(
const float center[3],
int nPoints,
const float maxRadius,
163 std::vector<ParticleIndex>& points,std::vector<float>& pointDistancesSquared)
const=0;
168 virtual int findNPoints(
const float center[3],
int nPoints,
const float maxRadius,
169 ParticleIndex *points,
float *pointDistancesSquared,
float *finalRadius2)
const=0;
186 const ParticleIndex* particleIndices,
const bool sorted,
char* values)
const=0;
210 return static_cast<T*
>(
dataInternal(attribute,particleIndex));
224 T* ptr =
static_cast<T*
>(
dataInternal(attribute, particleIndex));
304void write(
const char* filename,
const ParticlesData&,
const bool forceCompressed=
false,
bool verbose=
true,std::ostream& errorStream=std::cerr);
Fixed Attribute Interface.
Definition PartioAttribute.h:124
ParticleAttributeType type
Type of attribute.
Definition PartioAttribute.h:127
int count
Number of entries, should be 3 if type is VECTOR.
Definition PartioAttribute.h:130
Particle Collection Interface.
Definition PartioAttribute.h:97
int count
Number of entries, should be 3 if type is VECTOR.
Definition PartioAttribute.h:103
ParticleAttributeType type
Type of attribute.
Definition PartioAttribute.h:100
Definition PartioIterator.h:125
Particle Mutable Data Interface.
Definition Partio.h:196
virtual ParticleIndex addParticle()=0
Add a particle to the particle set. Returns the offset to the particle.
void set(const ParticleAttribute &attribute, const ParticleIndex particleIndex, const T *data)
Set particle value for attribute.
Definition Partio.h:222
virtual FixedAttribute addFixedAttribute(const char *attribute, ParticleAttributeType type, const int count)=0
Adds a fixed attribute with the provided name, type and count.
void setFixed(const FixedAttribute &attribute, const T *data)
Definition Partio.h:228
virtual void setFixedIndexedStr(const FixedAttribute &attribute, int indexedStringToken, const char *str)=0
Returns a token for the given string. This allows efficient storage of string data.
virtual ParticleAttribute addAttribute(const char *attribute, ParticleAttributeType type, const int count)=0
Adds an attribute to the particle with the provided name, type and count.
iterator end()
Produce a ending iterator for the particles.
Definition Partio.h:267
ParticleIterator< false > iterator
Definition Partio.h:202
virtual int registerFixedIndexedStr(const FixedAttribute &attribute, const char *str)=0
Returns a token for the given string. This allows efficient storage of string data.
iterator begin()
Produce a beginning iterator for the particles.
Definition Partio.h:263
virtual void * dataInternal(const ParticleAttribute &attribute, const ParticleIndex particleIndex) const =0
T * dataWrite(const ParticleAttribute &attribute, const ParticleIndex particleIndex) const
Definition Partio.h:206
virtual iterator setupIterator(const int index=0)=0
Produce a const iterator.
virtual int registerIndexedStr(const ParticleAttribute &attribute, const char *str)=0
Returns a token for the given string. This allows efficient storage of string data.
virtual ~ParticlesDataMutable()
Definition Partio.h:198
virtual void * fixedDataInternal(const FixedAttribute &attribute) const =0
virtual iterator addParticles(const int count)=0
T * fixedDataWrite(const FixedAttribute &attribute) const
Definition Partio.h:215
virtual void setIndexedStr(const ParticleAttribute &attribute, int indexedStringToken, const char *str)=0
Returns a token for the given string. This allows efficient storage of string data.
Particle Data Interface.
Definition Partio.h:103
virtual void findPoints(const float bboxMin[3], const float bboxMax[3], std::vector< ParticleIndex > &points) const =0
virtual const std::vector< std::string > & fixedIndexedStrs(const FixedAttribute &attr) const =0
All indexed strings for an attribute.
virtual const std::vector< std::string > & indexedStrs(const ParticleAttribute &attr) const =0
All indexed strings for an attribute.
friend void freeCached(ParticlesData *particles)
virtual const_iterator setupConstIterator(const int index=0) const =0
Produce a const iterator.
const_iterator begin() const
Produce a beginning iterator for the particles.
Definition Partio.h:175
const_iterator end() const
Produce a ending iterator for the particles.
Definition Partio.h:179
ParticleIterator< true > const_iterator
Definition Partio.h:109
const T * data(const ParticleAttribute &attribute, const ParticleIndex particleIndex) const
Definition Partio.h:121
virtual int lookupFixedIndexedStr(const FixedAttribute &attribute, const char *str) const =0
Looks up the index for a given string for a given attribute, returns -1 if not found.
virtual void * fixedDataInternal(const FixedAttribute &attribute) const =0
virtual ~ParticlesData()
Definition Partio.h:105
virtual void dataInternalMultiple(const ParticleAttribute &attribute, const int indexCount, const ParticleIndex *particleIndices, const bool sorted, char *values) const =0
virtual void * dataInternal(const ParticleAttribute &attribute, const ParticleIndex particleIndex) const =0
virtual float findNPoints(const float center[3], int nPoints, const float maxRadius, std::vector< ParticleIndex > &points, std::vector< float > &pointDistancesSquared) const =0
virtual int lookupIndexedStr(const ParticleAttribute &attribute, const char *str) const =0
Looks up the index for a given string for a given attribute, returns -1 if not found.
void data(const ParticleAttribute &attribute, const int indexCount, const ParticleIndex *particleIndices, const bool sorted, T *values)
Definition Partio.h:114
virtual void dataAsFloat(const ParticleAttribute &attribute, const int indexCount, const ParticleIndex *particleIndices, const bool sorted, float *values) const =0
const T * fixedData(const FixedAttribute &attribute) const
Definition Partio.h:128
virtual int findNPoints(const float center[3], int nPoints, const float maxRadius, ParticleIndex *points, float *pointDistancesSquared, float *finalRadius2) const =0
Particle Collection Interface.
Definition Partio.h:67
virtual bool attributeInfo(const int index, ParticleAttribute &attribute) const =0
Lookup an attribute by index and store a handle to the attribute.
virtual bool attributeInfo(const char *attributeName, ParticleAttribute &attribute) const =0
Lookup an attribute by name and store a handle to the attribute.
virtual int numAttributes() const =0
Number of per-particle attributes.
virtual bool fixedAttributeInfo(const int index, FixedAttribute &attribute) const =0
Lookup an attribute by index and store a handle to the attribute.
virtual ~ParticlesInfo()
Definition Partio.h:69
virtual int numFixedAttributes() const =0
Number of fixed attributes.
virtual int numParticles() const =0
Number of particles in the structure.
virtual bool fixedAttributeInfo(const char *attributeName, FixedAttribute &attribute) const =0
Lookup an attribute by name and store a handle to the attribute.
void beginCachedAccess(ParticlesData *particles)
Begin accessing data in a cached file.
ParticlesDataMutable * computeClustering(ParticlesDataMutable *particles, const int numNeighbors, const double radiusSearch, const double radiusInside, const int connections, const double density)
bool typeCheck(const ParticleAttributeType &type)
Definition PartioAttribute.h:61
ParticlesInfo * readHeaders(const char *filename, const bool verbose=true, std::ostream &errorStream=std::cerr)
ParticlesDataMutable * create()
Provides an empty particle instance, freed with p->release()
void merge(ParticlesDataMutable &base, const ParticlesData &delta, const std::string &identifier=std::string())
Merges one particle set into another.
uint64_t ParticleIndex
Opaque random access method to a single particle. No number is implied or guaranteed.
Definition Partio.h:55
ParticlesDataMutable * clone(const ParticlesData &, bool particles=true, const std::map< std::string, std::string > *attrNameMap=nullptr)
int TypeSize(ParticleAttributeType attrType)
Definition PartioAttribute.h:75
ParticleAttributeType
Definition PartioAttribute.h:47
ParticlesData * readCached(const char *filename, const bool sort, const bool verbose=true, std::ostream &errorStream=std::cerr)
Cached (only one copy) read only way to read a particle file.
void write(const char *filename, const ParticlesData &, const bool forceCompressed=false, bool verbose=true, std::ostream &errorStream=std::cerr)
ParticlesDataMutable * createInterleave()
ParticlesDataMutable * cloneSchema(const ParticlesData &, const std::map< std::string, std::string > *attrNameMap=nullptr)
void print(const ParticlesData *particles)
Prints a subset of particle data in a textual form.
void endCachedAccess(ParticlesData *particles)
End accessing data in a cached file.
ParticlesDataMutable * read(const char *filename, const bool verbose=true, std::ostream &errorStream=std::cerr)