Class handling associations between internal and external data.
You would use this data structure when creating something like per-component data; e.g. a piece of data you wish to attach to every vertex on a surface, every point in a cloud, every particle in a fluid simulation, etc.
It provides a generic interface to handle lists of data streams that can be associated with your own data.
Association types should be unique within the context of where this data is being stored. e.g. "mesh/vertex", "mesh/edge", and "mesh/face". There is no requirement of the naming convention. Associations are looked up by pointer first before string compares so using a const reference from the calling code is more efficient.
The classes are designed to each be simple to use at the expense of a little complexity in the hierarchy. Here's how the different levels break down using the namespace adsk::Data
Associations | | Associates type (e.g. per-vertex data) with channel | Channel | | Amalgamates all data streams (e.g. per-vertex data maintained | for an external simulation) into a single entity | Stream | | Keeps an efficient list of indexed data | (e.g. one set of simulation data per vertex) | Data The actual data with introspection capabilities so that you can find out what it is. At this level it's a single chunk of data, e.g. 3 floats for color, an int and a string as a version identifier, a collection of vectors and scalars for current simulation state, etc.
For example on a mesh with 8 vertices if a simulation engine wants to store the velocity and acceleration of every vertex the data would look like this:
adsk::Data::Associations { channelCount = 1 channel(0) = adsk::Data::Channel { name = "mesh/vertex" streamCount = 1 stream(0) = adsk::Data::Stream { indexCount = 8 streamData = adsk::Data::Handle[8] { "simulationData" : compoundType { "velocity" : compoundType { "velocityX" : float "velocityY" : float "velocityZ" : float } "acceleration" : compoundType { "accelerationX" : float "accelerationY" : float "accelerationZ" : float } } } } } }
Public Member Functions |
|
| ~Associations () |
| | Default destructor, release the implementation object.
|
|
| Associations () |
| | Default constructor, initializes the implementation object.
|
| | Associations (const Associations *) |
| | Copy constructor with pointer, shares a ref to internal data with the copy Used as a convenience function for passing in a metadata pointer without caring if it's null or not.
|
| | Associations (const Associations &) |
| | Copy constructor, shares a ref to internal data with the copy.
|
| Associations & | operator= (const Associations &) |
| | Assignment operator, shares implementation with the rhs.
|
| Channel | channel (const std::string &) |
| | Get the data channel with the given name, create if needed.
|
| void | setChannel (Channel) |
| | Set the data channel into the Association.
|
| const Channel * | findChannel (const std::string &) const |
| | Get the Channel with the given name, return NULL if it doesn't exist.
|
| Channel * | findChannel (const std::string &) |
| | Get the Channel with the given name, return NULL if it doesn't exist.
|
| bool | removeChannel (const std::string &) |
| | Remove the Channel with the given name from this metadata.
|
| bool | renameChannel (const std::string &, const std::string &) |
| | Rename a Channel.
|
| bool | makeUnique () |
| | Make the Association's data unique to this object.
|
| Associations::iterator | begin () const |
| | Get an iterator pointed to the beginning of the Channel list.
|
| Associations::iterator | end () const |
| | Get an iterator off the end of the Channel list.
|
| Associations::const_iterator | cbegin () const |
| | Get a read-only iterator pointed to the beginning of the Channel list.
|
| Associations::const_iterator | cend () const |
| | Get a read-only iterator off the end of the Channel list.
|
| unsigned int | size () const |
| | Get the number of currently associated Channels.
|
| bool | empty () const |
| | Check to see if the Channel list is empty.
|
| unsigned int | channelCount () const |
| | Get the count of currently associated channels.
|
| Channel | channelAt (unsigned int channelIndex) const |
| | Get one of the associated channels by index.
|
| const Channel * | operator[] (unsigned int channelIndex) const |
| | Get a pointer to one of the associated channels by index.
|
Static Public Member Functions |
| static Associations * | create () |
| | Associations creator.
|
| static bool | Debug (const Associations *me, Debug::Print &request) |
| | Answer a Print request for an Associations object.
|
| static bool | Debug (const Associations *me, Debug::Footprint &request) |
| | Answer a footprint request for an Associations object.
|