Various functions can request the use and initialization of point data from within the kernel that does not use the standard attribute handle methods. This data can then be accessed after execution to perform post-processes such as adding new groups, adding new string attributes or updating positions.
More...
#include <openvdb_ax/codegen/PointLeafLocalData.h>
|
| PointLeafLocalData (const size_t count) |
| Construct a new data object to keep track of various data objects created per leaf by the point compute generator. More...
|
|
GroupHandleT * | getOrInsert (const std::string &name) |
| Group methods. More...
|
|
GroupHandleT * | get (const std::string &name) const |
| Return a group write handle to a specific group name if it exists. Returns a nullptr if no group exists of the given name. More...
|
|
bool | hasGroup (const std::string &name) const |
| Return true if a valid group handle exists. More...
|
|
void | getGroups (std::set< std::string > &groups) const |
| Populate a set with all the groups which have been inserted into this object. Used to compute a final set of all new groups which have been created across all leaf nodes. More...
|
|
void | compact () |
| Compact all arrays stored on this object. This does not invalidate any active write handles. More...
|
|
bool | getNewStringData (const points::AttributeArray *array, const uint64_t idx, std::string &data) const |
| String methods. More...
|
|
void | setNewStringData (points::AttributeArray *array, const uint64_t idx, const std::string &data) |
| Set new string data associated with a particular point on a particular string attribute array. More...
|
|
void | removeNewStringData (points::AttributeArray *array, const uint64_t idx) |
| Remove any new string data associated with a particular point on a particular string attribute array. Does nothing if no data exists. More...
|
|
bool | insertNewStrings (points::StringMetaInserter &inserter) const |
| Insert all new point strings stored across all collected string attribute arrays into a StringMetaInserter. Returns false if the inserter was not accessed and true if it was potentially modified. More...
|
|
const StringArrayMap & | getStringArrayMap () const |
| Returns a const reference to the string array map. More...
|
|
Various functions can request the use and initialization of point data from within the kernel that does not use the standard attribute handle methods. This data can then be accessed after execution to perform post-processes such as adding new groups, adding new string attributes or updating positions.
- Note
- Due to the way string handles work, string write attribute handles cannot be constructed in parallel, nor can read handles retrieve values in parallel if there is a chance the shared metadata is being written to (with set()). As the compiler allows for any arbitrary string setting/getting, leaf local maps are used for temporary storage per point. The maps use the string array pointers as a key for later synchronization.
using GroupArrayT = openvdb::points::GroupAttributeArray |
using LeafNode = openvdb::points::PointDataTree::LeafNodeType |
Construct a new data object to keep track of various data objects created per leaf by the point compute generator.
- Parameters
-
count | The number of points within the current leaf, used to initialize the size of new arrays |
Compact all arrays stored on this object. This does not invalidate any active write handles.
Return a group write handle to a specific group name if it exists. Returns a nullptr if no group exists of the given name.
- Parameters
-
void getGroups |
( |
std::set< std::string > & |
groups | ) |
const |
|
inline |
Populate a set with all the groups which have been inserted into this object. Used to compute a final set of all new groups which have been created across all leaf nodes.
- Parameters
-
groups | The set to populate |
String methods.
Get any new string data associated with a particular point on a particular string attribute array. Returns true if data was set, false if no data was found.
- Parameters
-
array | The array pointer to use as a key lookup |
idx | The point index |
data | The string to set if data is stored |
Group methods.
Return a group write handle to a specific group name, creating the group array if it doesn't exist. This includes either registering a new offset or allocating an entire array. The returned handle is guaranteed to be valid.
- Parameters
-
Returns a const reference to the string array map.
bool hasGroup |
( |
const std::string & |
name | ) |
const |
|
inline |
Return true if a valid group handle exists.
- Parameters
-
Insert all new point strings stored across all collected string attribute arrays into a StringMetaInserter. Returns false if the inserter was not accessed and true if it was potentially modified.
- Parameters
-
inserter | The string meta inserter to update |
Remove any new string data associated with a particular point on a particular string attribute array. Does nothing if no data exists.
- Parameters
-
array | The array pointer to use as a key lookup |
idx | The point index |
Set new string data associated with a particular point on a particular string attribute array.
- Parameters
-
array | The array pointer to use as a key lookup |
idx | The point index |
data | The string to set |