Partio

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

Particle Mutable Data Interface. More...

`#include <Partio.h>`

Inheritance diagram for Partio::ParticlesDataMutable:

## Public Types
typedef ParticleIterator< false > | iterator
Public Types inherited from Partio::ParticlesData
typedef ParticleIterator< true > | const_iterator

## Public Member Functions
template<class T >
T * | dataWrite (const ParticleAttribute &attribute, const ParticleIndex particleIndex) const
template<class T >
T * | fixedDataWrite (const FixedAttribute &attribute) const
template<class T >
void | set (const ParticleAttribute &attribute, const ParticleIndex particleIndex, const T *data)
| Set particle value for attribute.
template<class T >
void | setFixed (const FixedAttribute &attribute, const T *data)
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 int | registerFixedIndexedStr (const FixedAttribute &attribute, const char *str)=0
| Returns a token for the given string. This allows efficient storage of string data.
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.
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 void | sort ()=0
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.
virtual FixedAttribute | addFixedAttribute (const char *attribute, ParticleAttributeType type, const int count)=0
| Adds a fixed attribute with the provided name, type and count.
virtual ParticleIndex | addParticle ()=0
| Add a particle to the particle set. Returns the offset to the particle.
virtual iterator | addParticles (const int count)=0
iterator | begin ()
| Produce a beginning iterator for the particles.
iterator | end ()
| Produce a ending iterator for the particles.
virtual iterator | setupIterator (const int index=0)=0
| Produce a const iterator.
Public Member Functions inherited from Partio::ParticlesData
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.
virtual const std::vector< std::string > & | fixedIndexedStrs (const FixedAttribute &attr) const =0
| All indexed strings for an attribute.
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.
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 | 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.
const_iterator | begin () const
| Produce a beginning iterator for the particles.
const_iterator | end () const
| Produce a ending iterator for the particles.
Public Member Functions inherited from Partio::ParticlesInfo
virtual void | release ()=0
virtual int | numParticles () const =0
| Number of particles in the structure.
virtual int | numAttributes () const =0
| Number of per-particle attributes.
virtual int | numFixedAttributes () const =0
| Number of fixed attributes.
virtual bool | attributeInfo (const char *attributeName, ParticleAttribute &attribute) const =0
| Lookup an attribute by name and store a handle to the attribute.
virtual bool | fixedAttributeInfo (const char *attributeName, FixedAttribute &attribute) const =0
| Lookup an attribute by name and store a handle to the attribute.
virtual bool | attributeInfo (const int index, ParticleAttribute &attribute) const =0
| Lookup an attribute by index and store a handle to the attribute.
virtual bool | fixedAttributeInfo (const int index, FixedAttribute &attribute) const =0
| Lookup an attribute by index and store a handle to the attribute.

## Protected Member Functions
virtual | ~ParticlesDataMutable ()
Protected Member Functions inherited from Partio::ParticlesData
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

## Detailed Description

Particle Mutable Data Interface.

This interface provides the ability to write data attributes, add attributes, add particles, etc.

## Member Typedef Documentation

## ◆ iterator

typedef ParticleIterator<false> Partio::ParticlesDataMutable::iterator

## Constructor & Destructor Documentation

## ◆ ~ParticlesDataMutable()

virtual Partio::ParticlesDataMutable::~ParticlesDataMutable | ( |  | ) |
| inline protected virtual

## Member Function Documentation

## ◆ addAttribute()

virtual ParticleAttribute Partio::ParticlesDataMutable::addAttribute | ( | const char * | attribute,
|  | ParticleAttributeType | type,
|  | const int | count )
| pure virtual

Adds an attribute to the particle with the provided name, type and count.

## ◆ addFixedAttribute()

virtual FixedAttribute Partio::ParticlesDataMutable::addFixedAttribute | ( | const char * | attribute,
|  | ParticleAttributeType | type,
|  | const int | count )
| pure virtual

Adds a fixed attribute with the provided name, type and count.

## ◆ addParticle()

virtual ParticleIndex Partio::ParticlesDataMutable::addParticle | ( |  | ) |
| pure virtual

Add a particle to the particle set. Returns the offset to the particle.

## ◆ addParticles()

virtual iterator Partio::ParticlesDataMutable::addParticles | ( | const int | count | ) |
| pure virtual

Add a set of particles to the particle set. Returns the offset to the first particle

## ◆ begin()

iterator Partio::ParticlesDataMutable::begin | ( |  | ) |
| inline

Produce a beginning iterator for the particles.

References setupIterator().

## ◆ dataInternal()

virtual void * Partio::ParticlesDataMutable::dataInternal | ( | const ParticleAttribute & | attribute,
|  | const ParticleIndex | particleIndex ) const
| private pure virtual

Implements Partio::ParticlesData.

Referenced by dataWrite(), and set().

## ◆ dataWrite()

template<class T >

T * Partio::ParticlesDataMutable::dataWrite | ( | const ParticleAttribute & | attribute,
|  | const ParticleIndex | particleIndex ) const
| inline

Get a pointer to the data corresponding to the given particleIndex and attribute given by the attribute handle.

References dataInternal(), and Partio::typeCheck().

## ◆ end()

iterator Partio::ParticlesDataMutable::end | ( |  | ) |
| inline

Produce a ending iterator for the particles.

## ◆ fixedDataInternal()

virtual void * Partio::ParticlesDataMutable::fixedDataInternal | ( | const FixedAttribute & | attribute | ) | const
| private pure virtual

Implements Partio::ParticlesData.

Referenced by fixedDataWrite(), and setFixed().

## ◆ fixedDataWrite()

template<class T >

T * Partio::ParticlesDataMutable::fixedDataWrite | ( | const FixedAttribute & | attribute | ) | const
| inline

Get a pointer to the data corresponding to the attribute given by the fixed attribute handle.

References fixedDataInternal(), and Partio::typeCheck().

## ◆ registerFixedIndexedStr()

virtual int Partio::ParticlesDataMutable::registerFixedIndexedStr | ( | const FixedAttribute & | attribute,
|  | const char * | str )
| pure virtual

Returns a token for the given string. This allows efficient storage of string data.

## ◆ registerIndexedStr()

virtual int Partio::ParticlesDataMutable::registerIndexedStr | ( | const ParticleAttribute & | attribute,
|  | const char * | str )
| pure virtual

Returns a token for the given string. This allows efficient storage of string data.

## ◆ set()

template<class T >

void Partio::ParticlesDataMutable::set | ( | const ParticleAttribute & | attribute,
|  | const ParticleIndex | particleIndex,
|  | const T * | data )
| inline

Set particle value for attribute.

References Partio::ParticlesData::data(), dataInternal(), Partio::typeCheck(), and Partio::TypeSize().

## ◆ setFixed()

template<class T >

void Partio::ParticlesDataMutable::setFixed | ( | const FixedAttribute & | attribute,
|  | const T * | data )
| inline

References Partio::ParticlesData::data(), fixedDataInternal(), Partio::typeCheck(), and Partio::TypeSize().

## ◆ setFixedIndexedStr()

virtual void Partio::ParticlesDataMutable::setFixedIndexedStr | ( | const FixedAttribute & | attribute,
|  | int | indexedStringToken,
|  | const char * | str )
| pure virtual

Returns a token for the given string. This allows efficient storage of string data.

## ◆ setIndexedStr()

virtual void Partio::ParticlesDataMutable::setIndexedStr | ( | const ParticleAttribute & | attribute,
|  | int | indexedStringToken,
|  | const char * | str )
| pure virtual

Returns a token for the given string. This allows efficient storage of string data.

## ◆ setupIterator()

virtual iterator Partio::ParticlesDataMutable::setupIterator | ( | const int | index = 0 | ) |
| pure virtual

Produce a const iterator.

Referenced by begin().

## ◆ sort()

virtual void Partio::ParticlesDataMutable::sort | ( |  | ) |
| pure virtual

Preprocess the data for finding nearest neighbors by sorting into a KD-Tree. Note: all particle pointers are invalid after this call.

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

- src/lib/Partio.h