11 #ifndef __GU_AgentRig__
12 #define __GU_AgentRig__
75 int64 getMemoryUsage(
bool inclusive)
const;
98 bool checkValid()
const;
102 {
return myTransforms.entries(); }
105 {
return myTransforms(i); }
108 {
return myParents(i); }
112 return myChildStarts(i+1) - myChildStarts(i);
118 return myChildren(myChildStarts(transform) + child);
129 {
return myRestLocalXforms[i]; }
132 {
return myRestWorldXforms[i]; }
150 : myRig(rig), myIndex(0), myEnd(0), myQueue(rig.transformCount())
162 for(
int i : myRig.roots())
163 myQueue[myEnd++] = i;
166 myQueue[myEnd++] =
start;
171 const int i = myQueue[myIndex];
174 for (
int child = 0,
n = myRig.childCount(i); child <
n; ++child)
176 myQueue[myEnd++] = myRig.childIndex(i, child);
185 return myIndex == myEnd;
189 inline int operator*()
const {
return myQueue[myIndex]; }
233 NameMapType myTransformsMap;
246 NameMapType myChannelMap;
262 if (it == myTransformsMap.end())
270 auto it = myChannelMap.find(name);
271 return it != myChannelMap.end() ? it->second : -1;
277 return myChannelDefaultValues[i];
283 return myChannelTransforms[i];
exint findTransform(const UT_StringRef &name) const
Find a transform by name. Returns -1 for an invalid name.
NameMapType::const_iterator NameMapConstIter
const_iterator & operator++()
Pre-increment operator.
void rewind(int start=-1)
GT_API const UT_StringHolder filename
const Xform & restLocalTransform(exint i) const
Returns the rest local transform for the specified joint.
exint childCount(exint i) const
Return the number of children for the given transform.
const UT_StringHolder & transformName(exint i) const
Return the name of the given transform.
FloatType channelDefaultValue(exint i) const
Returns the default value of the specified channel.
JSON reader class which handles parsing of JSON or bJSON files.
exint channelTransform(exint i) const
Returns the transform index associated with the channel, or -1.
exint getUniqueId() const
Unique ID of the rig.
Class which writes ASCII or binary JSON streams.
exint childIndex(exint transform, exint child) const
Return the Nth child for the given transform.
A reference counter base class for use with UT_IntrusivePtr.
NameMapType::iterator NameMapIter
Parent::iterator iterator
exint findChannel(const UT_StringRef &name) const
exint parentIndex(exint i) const
Return the parent of the given transform (or -1 for the root)
A rig for the agent primitive.
exint channelCount() const
Returns the number of channels.
const UT_IntArray & roots() const
Return the root transform(s) of the rig.
Wrapper around hboost::intrusive_ptr.
GLuint const GLchar * name
UT_Matrix4T< FloatType > Matrix4
GA_API const UT_StringHolder transform
Parent::const_iterator const_iterator
void setName(const UT_StringHolder &name)
int operator*() const
Returns the transform index.
GU_AgentXformT< FloatType > Xform
UT_StringMap< exint > NameMapType
UT_IntrusivePtr< GU_AgentRig > GU_AgentRigPtr
bool isFile() const
Return whether the rig was loaded from disk.
UT_IntrusivePtr< const GU_AgentRig > GU_AgentRigConstPtr
const_iterator(const GU_AgentRig &rig, int start=-1)
GLubyte GLubyte GLubyte GLubyte w
const UT_StringHolder & name() const
const UT_StringHolder & channelName(exint i) const
Returns the name of the specified channel.
exint transformCount() const
Return number of transforms.
const Matrix4 & restWorldTransform(exint i) const
Returns the rest world transform for the specified joint.