AL_USDMaya
0.29.4
USD to Maya Bridge
|
Stores layers, in a way that they may be looked up by the layer ref ptr, or by identifier Also, unlike boost::multi_index, we can have multiple identifiers per layer You can add non-dirty layers to the database, but the query operations will "hide" them - ie, iteration will skip by them, and findLayer will return an invalid ptr if it's not dirty We allow adding non-dirty items because if we want to guarantee we always have all the latest items, we need to deal with the situation where the current edit target starts out not dirty... and it's easiest to just add it then filter it if it's not dirty. More...
#include <LayerManager.h>
Public Types | |
typedef std::map < SdfLayerRefPtr, std::vector < std::string > > | LayerToIdsMap |
typedef std::map< std::string, SdfLayerRefPtr > | IdToLayerMap |
typedef DirtyOnlyIterator < LayerToIdsMap::iterator > | iterator |
typedef DirtyOnlyIterator < LayerToIdsMap::const_iterator > | const_iterator |
Public Member Functions | |
bool | addLayer (SdfLayerRefPtr layer, const std::string &identifier=std::string()) |
Add the given layer to the set of layers in this LayerDatabase, if not already present, and optionally add an extra identifier as a key to it. More... | |
bool | removeLayer (SdfLayerRefPtr layer) |
Remove the given layer to the list of layers managed by this node, if present. More... | |
SdfLayerHandle | findLayer (std::string identifier) const |
Find the layer in the set of layers managed by this node, by identifier. More... | |
operator _UnspecifiedBoolType () const | |
size_t | max_size () const |
Upper bound for the number of non-dirty layers in this object This is the count of all tracked layers, dirty-and-non-dirty; If it is zero, it can be guaranteed that there are no dirty layers, but if it is non-zero, we cannot guarantee that there are any non-dirty layers. Use boolean conversion above to test that. | |
iterator | begin () |
returns start of layer range | |
const_iterator | begin () const |
returns start of layer range | |
const_iterator | cbegin () const |
returns start of layer range | |
iterator | end () |
returns end of layer range | |
const_iterator | end () const |
returns end of layer range | |
const_iterator | cend () const |
returns end of layer range | |
Stores layers, in a way that they may be looked up by the layer ref ptr, or by identifier Also, unlike boost::multi_index, we can have multiple identifiers per layer You can add non-dirty layers to the database, but the query operations will "hide" them - ie, iteration will skip by them, and findLayer will return an invalid ptr if it's not dirty We allow adding non-dirty items because if we want to guarantee we always have all the latest items, we need to deal with the situation where the current edit target starts out not dirty... and it's easiest to just add it then filter it if it's not dirty.
bool AL::usdmaya::nodes::LayerDatabase::addLayer | ( | SdfLayerRefPtr | layer, |
const std::string & | identifier = std::string() |
||
) |
Add the given layer to the set of layers in this LayerDatabase, if not already present, and optionally add an extra identifier as a key to it.
layer | What layer to add to this database |
identifier | Extra identifier to add as a key to this layer; note that the "canonical" identifier, as returned by layer.GetIdentifier(), is ALWAYS added as an identifier key for this layer so this is intended as a way to provide a second identifier for the same layer (or third or more, if you call it repeatedly). This is useful both because multiple identifiers may resolve to the same underlying layer (especially when considering asset resolution), and for serializing and deserializing anonymous layers, the "canonical" identifier will change every time it is serialized and deserialized (and it can be necessary to refer to the layer both by it's "old" and "new" ids). If this is an empty string, it is ignored. |
SdfLayerHandle AL::usdmaya::nodes::LayerDatabase::findLayer | ( | std::string | identifier | ) | const |
Find the layer in the set of layers managed by this node, by identifier.
identifier | the identifier the full identifier of the layer to locate |
bool AL::usdmaya::nodes::LayerDatabase::removeLayer | ( | SdfLayerRefPtr | layer | ) |
Remove the given layer to the list of layers managed by this node, if present.