convert line ends
[canaan.git] / prj / cam / src / motion / motdb.h
blobe87542cd71c7db6cd18fd4982860c20e510b3ca4
1 /*
2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
4 */
6 // $Header: r:/t2repos/thief2/src/motion/motdb.h,v 1.6 2000/01/29 13:22:13 adurant Exp $
7 #pragma once
9 #ifndef __MOTDB_H
10 #define __MOTDB_H
12 #include <tagfile.h>
13 #include <motschem.h>
14 #include <namemap.h>
15 #include <dynarray.h>
16 #include <fcytagdb.h>
17 #include <tagdbout.h>
18 #include <motdbtyp.h>
19 #include <tagremap.h>
21 #ifdef __cplusplus
23 typedef enum eMotDBMatchType
25 kMMT_AbsoluteBest,
26 kMMT_WeightedDither,
27 } eMotDBMatchType;
29 class cMotionDatabase
31 public:
32 cMotionDatabase();
33 virtual ~cMotionDatabase();
35 // database query
36 virtual BOOL GetBestMatch(int actor, cTagDBInput *pInput, cMotionSchema **ppSchema,eMotDBMatchType matchType=kMMT_AbsoluteBest);
37 virtual BOOL GetTagKeyID(const Label *pName, int *pID);
39 // get schema by index
40 virtual BOOL GetSchema(int index, cMotionSchema **ppSchema);
42 void Clear();
44 // save/load
45 virtual BOOL Load(ITagFile *pFile);
46 #ifdef EDITOR
47 virtual BOOL BuildFromAscii();
48 virtual BOOL Save(ITagFile *pFile);
49 #endif
51 // build utilities
52 virtual void CreateTagDatabase(int nActors);
53 virtual void RegisterTag(const Label *pName, const sTagInfo *pInfo);
54 virtual void AddSchema(const sMotSchemaDesc *pSchema);
56 // retokenization--these are passed into cTagDBDatabases
57 void TokenGlobalToLocal(cTagDBKey *pKey);
58 void TokenLocalToGlobal(cTagDBKey *pKey);
60 private:
61 cNameMap m_NameMap;
62 cNameMap m_TagNameMap;
63 cTagRemapper m_Remap;
64 cMotionSchemaSet m_SchemaSet;
65 int m_nActors;
66 IFancyTagDatabase *m_pDatabase;
67 cTagDBOutput m_RawResult;
70 inline BOOL cMotionDatabase::GetTagKeyID(const Label *pName, int *pID)
72 int index=m_TagNameMap.IDFromName(pName);
74 if(index==kNameMapIndexNotFound)
75 return FALSE;
76 *pID=index;
77 return TRUE;
80 #endif // cplusplus
82 #endif // motdb.h