本文整理汇总了C++中CAnimation::getIdTrackByName方法的典型用法代码示例。如果您正苦于以下问题:C++ CAnimation::getIdTrackByName方法的具体用法?C++ CAnimation::getIdTrackByName怎么用?C++ CAnimation::getIdTrackByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAnimation
的用法示例。
在下文中一共展示了CAnimation::getIdTrackByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refresh
void CAnimationSetDlg::refresh (BOOL update)
{
if (update)
{
CDialog::UpdateData (update);
// Clear the combo box
EditedObject.ResetContent ();
// Set edited object list
uint i;
for (i=0; i<_ObjView->getNumInstance (); i++)
{
char name[512];
_splitpath (_ObjView->getInstance (i)->Saved.ShapeFilename.c_str(), NULL, NULL, name, NULL);
EditedObject.InsertString (-1, name);
}
// Get edited object
uint instance = _ObjView->getEditedObject ();
// Selection combo box
EditedObject.SetCurSel ((instance==0xffffffff)?-1:(int)instance);
// Clear the tree
Tree.DeleteAllItems ();
// Clear the tree
SkelTree.DeleteAllItems ();
// Clear the playlist
PlayList.ResetContent ();
if (instance != 0xffffffff)
{
// Get the instance
CInstanceInfo *object = _ObjView->getInstance (instance);
// For all tracks in the animation
uint i;
for (i=0; i<object->Saved.AnimationFileName.size(); i++)
{
// Get the animation name
char name[512];
_splitpath (object->Saved.AnimationFileName[i].c_str(), NULL, NULL, name, NULL);
// Get the animation pointer
CAnimation *anim = object->AnimationSet.getAnimation (object->AnimationSet.getAnimationIdByName (name));
// Insert an intem
HTREEITEM item=Tree.InsertItem (name);
Tree.SetItemData (item, i);
nlassert (item!=NULL);
// For all tracks in the animation
std::set<std::string> setString;
anim->getTrackNames (setString);
std::set<std::string>::iterator ite=setString.begin();
while (ite!=setString.end())
{
// Add this string
HTREEITEM newItem = Tree.InsertItem (ite->c_str(), item);
Tree.SetItemData (newItem, 0xffffffff);
// Get the track
ITrack *track=anim->getTrack (anim->getIdTrackByName (*ite));
// Keyframer ?
UTrackKeyframer *keyTrack=dynamic_cast<UTrackKeyframer *>(track);
if (keyTrack)
{
// Get number of keys
std::vector<TAnimationTime> keys;
keyTrack->getKeysInRange (track->getBeginTime ()-1, track->getEndTime ()+1, keys);
// Print track info
char name[512];
_snprintf (name, 512, "%s (%f - %f) %d keys", typeid(*track).name(), track->getBeginTime (), track->getEndTime (), keys.size());
HTREEITEM keyItem = Tree.InsertItem (name, newItem);
Tree.SetItemData (keyItem, 0xffffffff);
}
else
{
// Print track info
char name[512];
_snprintf (name, 512, "%s (%f - %f)", typeid(*track).name(), track->getBeginTime (), track->getEndTime ());
HTREEITEM keyItem = Tree.InsertItem (name, newItem);
Tree.SetItemData (keyItem, 0xffffffff);
}
ite++;
}
}
// For all tracks in the animation
for (i=0; i<object->Saved.SWTFileName.size(); i++)
{
// Get the animation name
char name[512];
_splitpath (object->Saved.SWTFileName[i].c_str(), NULL, NULL, name, NULL);
//.........这里部分代码省略.........