|
HDK
|
#include <GU_AgentShapeLib.h>
Inheritance diagram for GU_AgentShapeLib:Public Types | |
| typedef UT_IntrusivePtr< const Shape > | ShapePtr |
| typedef UT_StringMap< ShapePtr > | ShapeMap |
| typedef ShapeMap::const_iterator | const_iterator |
| typedef ShapeMap::iterator | iterator |
| typedef void(* | ShapeRemovedCallback )(void *data, int shape_id) |
Public Member Functions | |
| ~GU_AgentShapeLib () | |
| int64 | getMemoryUsage (bool inclusive) const |
| bool | save (UT_JSONWriter &w) const |
| Save the shape library. More... | |
| bool | load (UT_JSONParser &p) |
| Load a shape library from disk or a stream. More... | |
| bool | load (GU_DetailHandle gdh, UT_StringArray &errors) |
| Load a shape library from the provided geometry. More... | |
| bool | addShape (const UT_StringHolder &key, const GU_ConstDetailHandle &gdp, bool replace_existing=true) |
| Add entire geometry as a shape in the library. More... | |
| bool | addShape (const UT_StringHolder &key, const char *filename, bool replace_existing=true) |
| Add a disk file as a shape. More... | |
| bool | removeShape (const UT_StringRef &key) |
| Remove a shape from the library. More... | |
| GU_ConstDetailHandle | detail () const |
| Get a reference to the underlying geometry (which holds all the shapes) More... | |
| ShapePtr | findShape (const UT_StringRef &key) const |
| Find a shape. More... | |
| bool | isFile () const |
| Return whether the library was loaded from disk. More... | |
| void | clearIsFile () |
| Clear the flag marking that the library references a file on disk. More... | |
| void | dump (std::ostream &os, const char *save_file=0) const |
| void | getDanglingShapes (UT_SortedStringSet &names) const |
| Shape (GA_Offset offset) | |
| Shape (const Shape &shape) | |
| int64 | getMemoryUsage (bool inclusive) const |
| GA_Offset | offset () const |
| void | setOffset (GA_Offset offset) |
| int | uniqueId () const |
| GU_ConstDetailHandle | shapeGeometry (const GU_AgentShapeLib &lib) const |
| Given its owner shape library, return the geometry for this shape. More... | |
| const GU_LinearSkinDeformerSourceWeights & | getLinearSkinDeformerSourceWeights (const GU_ConstDetailHandle &gdh) const |
| const GU_LinearSkinDeformerSourceWeights & | getLinearSkinDeformerSourceWeights (const GU_AgentShapeLib &shapelib) const |
| bool | isEmpty () const |
| exint | entries () const |
| const UT_StringHolder & | name () const |
| void | setName (const UT_StringHolder &name) |
| const UT_StringHolder & | label () const |
| void | setLabel (const UT_StringHolder &label) |
| const_iterator | begin () const |
| const_iterator | end () const |
| iterator | begin () |
| iterator | end () |
Public Member Functions inherited from UT_IntrusiveRefCounter< GU_AgentShapeLib > | |
| SYS_FORCE_INLINE | UT_IntrusiveRefCounter () noexcept |
| Default constructor: Sets counter to 0. More... | |
| SYS_FORCE_INLINE | UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept |
| Copy constructor: Sets counter to 0. More... | |
| UT_IntrusiveRefCounter & | operator= (const UT_IntrusiveRefCounter &) noexcept |
| Assignment operator: Does not modify counter. More... | |
| SYS_FORCE_INLINE uint32 | use_count () const noexcept |
| Return current counter. More... | |
| SYS_FORCE_INLINE bool | conditionalAddRef () noexcept |
Static Public Member Functions | |
| static GU_AgentShapeLibPtr | addLibrary (const UT_StringHolder &name) |
| Create a new library using the given name. More... | |
| static GU_AgentShapeLibPtr | addLibraryFromFile (const UT_StringHolder &filename, UT_StringArray &errors) |
| static GU_AgentShapeLibPtr | addLibraryCopy (const GU_AgentShapeLib &src, bool keep_external_ref) |
| static void | registerShapeRemovedCallback (ShapeRemovedCallback cb, void *data=0) |
| static void | unregisterShapeRemovedCallback (ShapeRemovedCallback cb, void *data=0) |
Additional Inherited Members | |
Protected Member Functions inherited from UT_IntrusiveRefCounter< GU_AgentShapeLib > | |
| SYS_FORCE_INLINE | ~UT_IntrusiveRefCounter () |
| Destructor: Only derived classes can destruct this. More... | |
Library for Agent Shapes
An agent shape library stores multiple shapes. There are various ways to add shapes to the library (add a full piece of geometry, add geometry and a range of primitives, etc.).
Shapes are identified by "name" which must be unique within the library.
Definition at line 45 of file GU_AgentShapeLib.h.
Definition at line 52 of file GU_AgentShapeLib.h.
Definition at line 53 of file GU_AgentShapeLib.h.
Definition at line 51 of file GU_AgentShapeLib.h.
| typedef UT_IntrusivePtr<const Shape> GU_AgentShapeLib::ShapePtr |
Definition at line 48 of file GU_AgentShapeLib.h.
Definition at line 54 of file GU_AgentShapeLib.h.
| GU_AgentShapeLib::~GU_AgentShapeLib | ( | ) |
|
static |
Create a new library using the given name.
|
static |
Create a clone of a library for modification. The clone will have isFile() return false. If keep_external_ref is true and the source library was a file reference, the source library will be marked as an included file of the new library. Otherwise, the new library will be standalone.
|
static |
Load a new library from disk, named using the filename. Returns NULL if failed to load.
| bool GU_AgentShapeLib::addShape | ( | const UT_StringHolder & | key, |
| const GU_ConstDetailHandle & | gdp, | ||
| bool | replace_existing = true |
||
| ) |
Add entire geometry as a shape in the library.
| bool GU_AgentShapeLib::addShape | ( | const UT_StringHolder & | key, |
| const char * | filename, | ||
| bool | replace_existing = true |
||
| ) |
Add a disk file as a shape.
| const_iterator GU_AgentShapeLib::begin | ( | ) | const |
Iterators
| iterator GU_AgentShapeLib::begin | ( | ) |
Iterators
| void GU_AgentShapeLib::clearIsFile | ( | ) |
Clear the flag marking that the library references a file on disk.
|
inline |
Get a reference to the underlying geometry (which holds all the shapes)
Definition at line 123 of file GU_AgentShapeLib.h.
| void GU_AgentShapeLib::dump | ( | std::ostream & | os, |
| const char * | save_file = 0 |
||
| ) | const |
Dump the contents of this shape library for debugging purposes. If save_file is supplied, the shape library's geometry will be saved using that name.
| const_iterator GU_AgentShapeLib::end | ( | ) | const |
Iterators
| iterator GU_AgentShapeLib::end | ( | ) |
Iterators
|
inline |
Query information
Definition at line 118 of file GU_AgentShapeLib.h.
| ShapePtr GU_AgentShapeLib::findShape | ( | const UT_StringRef & | key | ) | const |
Find a shape.
| void GU_AgentShapeLib::getDanglingShapes | ( | UT_SortedStringSet & | names | ) | const |
Get the names of each dangling shape in the shape library. A dangling shape is a shape that is only referenced by the shape library.
|
inline |
Get a GU_LinearSkinDeformerSourceWeights given the detail handle for this shape.
Definition at line 259 of file GU_AgentShapeLib.h.
|
inline |
Definition at line 265 of file GU_AgentShapeLib.h.
| int64 GU_AgentShapeLib::getMemoryUsage | ( | bool | inclusive | ) | const |
| int64 GU_AgentShapeLib::getMemoryUsage | ( | bool | inclusive | ) | const |
|
inline |
Query information
Definition at line 116 of file GU_AgentShapeLib.h.
|
inline |
Return whether the library was loaded from disk.
Definition at line 136 of file GU_AgentShapeLib.h.
| const UT_StringHolder& GU_AgentShapeLib::label | ( | ) | const |
Set a user defined label for the library. This doesn't have to be unique across libraries.
| bool GU_AgentShapeLib::load | ( | UT_JSONParser & | p | ) |
Load a shape library from disk or a stream.
| bool GU_AgentShapeLib::load | ( | GU_DetailHandle | gdh, |
| UT_StringArray & | errors | ||
| ) |
Load a shape library from the provided geometry.
|
inline |
The name of the shape library (or filename, if loaded from disk).
Definition at line 130 of file GU_AgentShapeLib.h.
|
inline |
Definition at line 248 of file GU_AgentShapeLib.h.
|
static |
Register a callback to be invoked when a shape is no longer referenced by any shape library.
| bool GU_AgentShapeLib::removeShape | ( | const UT_StringRef & | key | ) |
Remove a shape from the library.
| bool GU_AgentShapeLib::save | ( | UT_JSONWriter & | w | ) | const |
Save the shape library.
| void GU_AgentShapeLib::setLabel | ( | const UT_StringHolder & | label | ) |
Set a user defined label for the library. This doesn't have to be unique across libraries.
|
inline |
The name of the shape library (or filename, if loaded from disk).
Definition at line 131 of file GU_AgentShapeLib.h.
Definition at line 249 of file GU_AgentShapeLib.h.
| GU_AgentShapeLib::Shape | ( | GA_Offset | offset | ) |
| GU_AgentShapeLib::Shape | ( | const Shape & | shape | ) |
| GU_ConstDetailHandle GU_AgentShapeLib::shapeGeometry | ( | const GU_AgentShapeLib & | lib | ) | const |
Given its owner shape library, return the geometry for this shape.
|
inline |
Definition at line 250 of file GU_AgentShapeLib.h.
|
static |