Partio
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Friends | List of all members
Partio::ParticlesData Class Referenceabstract

Particle Data Interface. More...

#include <Partio.h>

Inheritance diagram for Partio::ParticlesData:
Partio::ParticlesInfo Partio::ParticlesDataMutable

Public Types

typedef ParticleIterator< true > const_iterator
 

Public Member Functions

template<class T >
void data (const ParticleAttribute &attribute, const int indexCount, const ParticleIndex *particleIndices, const bool sorted, T *values)
 
template<class T >
const T * data (const ParticleAttribute &attribute, const ParticleIndex particleIndex) const
 
template<class T >
const T * fixedData (const FixedAttribute &attribute) const
 
virtual const std::vector< std::string > & indexedStrs (const ParticleAttribute &attr) const =0
 All indexed strings for an attribute. More...
 
virtual const std::vector< std::string > & fixedIndexedStrs (const FixedAttribute &attr) const =0
 All indexed strings for an attribute. More...
 
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. More...
 
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. More...
 
virtual void dataAsFloat (const ParticleAttribute &attribute, const int indexCount, const ParticleIndex *particleIndices, const bool sorted, float *values) const =0
 
virtual void findPoints (const float bboxMin[3], const float bboxMax[3], std::vector< ParticleIndex > &points) 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 findNPoints (const float center[3], int nPoints, const float maxRadius, ParticleIndex *points, float *pointDistancesSquared, float *finalRadius2) const =0
 
virtual const_iterator setupConstIterator (const int index=0) const =0
 Produce a const iterator. More...
 
const_iterator begin () const
 Produce a beginning iterator for the particles. More...
 
const_iterator end () const
 Produce a ending iterator for the particles. More...
 
- Public Member Functions inherited from Partio::ParticlesInfo
virtual void release ()=0
 
virtual int numParticles () const =0
 Number of particles in the structure. More...
 
virtual int numAttributes () const =0
 Number of per-particle attributes. More...
 
virtual int numFixedAttributes () const =0
 Number of fixed attributes. More...
 
virtual bool attributeInfo (const char *attributeName, ParticleAttribute &attribute) const =0
 Lookup an attribute by name and store a handle to the attribute. More...
 
virtual bool fixedAttributeInfo (const char *attributeName, FixedAttribute &attribute) const =0
 Lookup an attribute by name and store a handle to the attribute. More...
 
virtual bool attributeInfo (const int index, ParticleAttribute &attribute) const =0
 Lookup an attribute by index and store a handle to the attribute. More...
 
virtual bool fixedAttributeInfo (const int index, FixedAttribute &attribute) const =0
 Lookup an attribute by index and store a handle to the attribute. More...
 

Protected Member Functions

virtual ~ParticlesData ()
 
- Protected Member Functions inherited from Partio::ParticlesInfo
virtual ~ParticlesInfo ()
 

Private Member Functions

virtual void * dataInternal (const ParticleAttribute &attribute, const ParticleIndex particleIndex) const =0
 
virtual void * fixedDataInternal (const FixedAttribute &attribute) const =0
 
virtual void dataInternalMultiple (const ParticleAttribute &attribute, const int indexCount, const ParticleIndex *particleIndices, const bool sorted, char *values) const =0
 

Friends

void freeCached (ParticlesData *particles)
 

Detailed Description

Particle Data Interface.

This interface provides the ability to read data attributes for given particles and search for nearest neighbors using KD-Trees.

Member Typedef Documentation

◆ const_iterator

Constructor & Destructor Documentation

◆ ~ParticlesData()

virtual Partio::ParticlesData::~ParticlesData ( )
inlineprotectedvirtual

Member Function Documentation

◆ begin()

const_iterator Partio::ParticlesData::begin ( ) const
inline

Produce a beginning iterator for the particles.

References setupConstIterator().

◆ data() [1/2]

template<class T >
void Partio::ParticlesData::data ( const ParticleAttribute attribute,
const int  indexCount,
const ParticleIndex particleIndices,
const bool  sorted,
T *  values 
)
inline

Fill the user supplied values array with data corresponding to the given list of particles. Specify whether or not your indices are sorted. note if T is void, then type checking is disabled.

References dataInternalMultiple(), and Partio::ParticleAttribute::type.

Referenced by Partio::ParticlesDataMutable::set(), and Partio::ParticlesDataMutable::setFixed().

◆ data() [2/2]

template<class T >
const T* Partio::ParticlesData::data ( const ParticleAttribute attribute,
const ParticleIndex  particleIndex 
) const
inline

References dataInternal().

◆ dataAsFloat()

virtual void Partio::ParticlesData::dataAsFloat ( const ParticleAttribute attribute,
const int  indexCount,
const ParticleIndex particleIndices,
const bool  sorted,
float *  values 
) const
pure virtual

Fill the user supplied values array with data corresponding to the given list of particles. Specify whether or not your indices are sorted. Attributes that are not floating types are automatically casted before being placed in values.

◆ dataInternal()

virtual void* Partio::ParticlesData::dataInternal ( const ParticleAttribute attribute,
const ParticleIndex  particleIndex 
) const
privatepure virtual

Implemented in Partio::ParticlesDataMutable.

Referenced by data().

◆ dataInternalMultiple()

virtual void Partio::ParticlesData::dataInternalMultiple ( const ParticleAttribute attribute,
const int  indexCount,
const ParticleIndex particleIndices,
const bool  sorted,
char *  values 
) const
privatepure virtual

Referenced by data().

◆ end()

const_iterator Partio::ParticlesData::end ( ) const
inline

Produce a ending iterator for the particles.

◆ findNPoints() [1/2]

virtual int Partio::ParticlesData::findNPoints ( const float  center[3],
int  nPoints,
const float  maxRadius,
ParticleIndex points,
float *  pointDistancesSquared,
float *  finalRadius2 
) const
pure virtual

Find the N nearest neighbors that are within maxRadius distance using POD types NOTE: returns the number of found points and leaves in finalRadius2 the square of the final search radius used

◆ findNPoints() [2/2]

virtual float Partio::ParticlesData::findNPoints ( const float  center[3],
int  nPoints,
const float  maxRadius,
std::vector< ParticleIndex > &  points,
std::vector< float > &  pointDistancesSquared 
) const
pure virtual

Find the N nearest neighbors that are within maxRadius distance using STL types (measured in standard 2-norm). If less than N are found within the radius, the search radius is not increased. NOTE: points/pointsDistancesSquared are cleared before use. Must call sort() before using this function

◆ findPoints()

virtual void Partio::ParticlesData::findPoints ( const float  bboxMin[3],
const float  bboxMax[3],
std::vector< ParticleIndex > &  points 
) const
pure virtual

Find the points within the bounding box specified. Must call sort() before using this function NOTE: points array is not pre-cleared.

◆ fixedData()

template<class T >
const T* Partio::ParticlesData::fixedData ( const FixedAttribute attribute) const
inline

References fixedDataInternal().

◆ fixedDataInternal()

virtual void* Partio::ParticlesData::fixedDataInternal ( const FixedAttribute attribute) const
privatepure virtual

Implemented in Partio::ParticlesDataMutable.

Referenced by fixedData().

◆ fixedIndexedStrs()

virtual const std::vector<std::string>& Partio::ParticlesData::fixedIndexedStrs ( const FixedAttribute attr) const
pure virtual

All indexed strings for an attribute.

◆ indexedStrs()

virtual const std::vector<std::string>& Partio::ParticlesData::indexedStrs ( const ParticleAttribute attr) const
pure virtual

All indexed strings for an attribute.

◆ lookupFixedIndexedStr()

virtual int Partio::ParticlesData::lookupFixedIndexedStr ( const FixedAttribute attribute,
const char *  str 
) const
pure virtual

Looks up the index for a given string for a given attribute, returns -1 if not found.

◆ lookupIndexedStr()

virtual int Partio::ParticlesData::lookupIndexedStr ( const ParticleAttribute attribute,
const char *  str 
) const
pure virtual

Looks up the index for a given string for a given attribute, returns -1 if not found.

◆ setupConstIterator()

virtual const_iterator Partio::ParticlesData::setupConstIterator ( const int  index = 0) const
pure virtual

Produce a const iterator.

Referenced by begin().

Friends And Related Function Documentation

◆ freeCached

void freeCached ( ParticlesData particles)
friend

The documentation for this class was generated from the following file: