11 #ifndef __GU_AgentShapeLib__
12 #define __GU_AgentShapeLib__
55 typedef void (*ShapeRemovedCallback)(
void *
data,
int shape_id);
73 bool keep_external_ref);
77 static void registerShapeRemovedCallback(
78 ShapeRemovedCallback cb,
void *
data = 0);
79 static void unregisterShapeRemovedCallback(
80 ShapeRemovedCallback cb,
void *
data = 0);
91 int64 getMemoryUsage(
bool inclusive)
const;
105 bool replace_existing=
true);
110 bool replace_existing=
true);
118 {
return myShapeCache.empty(); }
120 {
return myShapeCache.size(); }
151 void dump(std::ostream& os,
152 const char* save_file = 0)
const;
156 void getDanglingShapes(
161 const_iterator
begin()
const;
162 const_iterator
end()
const;
174 CycleDetect &cycle_detect,
179 CycleDetect &cycle_detect);
185 void includeShapeLib(
189 void destroyShape(const_iterator &it);
190 bool replaceExistingShape(
192 bool replace_existing);
198 bool loadShapesFromDetail(CycleDetect &cycle_detect,
205 ShapeMap myShapeCache;
222 int64 getMemoryUsage(
bool inclusive)
const;
223 int uniqueId()
const {
return myUniqueId; }
231 getLinearSkinDeformerSourceWeights(
235 ShapeData(
const ShapeData &) =
delete;
245 Shape(
const Shape &shape);
247 int64 getMemoryUsage(
bool inclusive)
const;
251 int uniqueId()
const {
return myShapeData->uniqueId(); }
262 return myShapeData->getLinearSkinDeformerSourceWeights(gdh);
268 return getLinearSkinDeformerSourceWeights(shapeGeometry(shapelib));
273 ShapeDataPtr myShapeData;
GT_API const UT_StringHolder filename
const GU_LinearSkinDeformerSourceWeights & getLinearSkinDeformerSourceWeights(const GU_ConstDetailHandle &gdh) const
JSON reader class which handles parsing of JSON or bJSON files.
Class which writes ASCII or binary JSON streams.
GLuint const GLchar * name
A reference counter base class for use with UT_IntrusivePtr.
UT_IntrusivePtr< GU_AgentShapeLib > GU_AgentShapeLibPtr
GU_ConstDetailHandle detail() const
Get a reference to the underlying geometry (which holds all the shapes)
const UT_StringHolder & name() const
Parent::iterator iterator
GLubyte GLubyte GLubyte GLubyte w
void setOffset(GA_Offset offset)
UT_StringMap< ShapePtr > ShapeMap
UT_Array< GU_AgentShapeLibConstPtr > GU_AgentShapeLibArray
GLuint GLsizei const GLchar * label
const GU_LinearSkinDeformerSourceWeights & getLinearSkinDeformerSourceWeights(const GU_AgentShapeLib &shapelib) const
Wrapper around hboost::intrusive_ptr.
GLuint const GLuint * names
ShapeMap::const_iterator const_iterator
bool isFile() const
Return whether the library was loaded from disk.
ShapeMap::iterator iterator
Parent::const_iterator const_iterator
UT_IntrusivePtr< const GU_AgentShapeLib > GU_AgentShapeLibConstPtr
UT_IntrusivePtr< const Shape > ShapePtr
void setName(const UT_StringHolder &name)
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.