当前位置: 首页>>代码示例>>C++>>正文


C++ CAnimation::getIdTrackByName方法代码示例

本文整理汇总了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);
//.........这里部分代码省略.........
开发者ID:mixxit,项目名称:solinia,代码行数:101,代码来源:animation_set_dlg.cpp


注:本文中的CAnimation::getIdTrackByName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。