Imported Upstream version 2.81
[platform/upstream/libbullet.git] / Extras / Serialize / BlenderSerialize / bMain.h
1 /*
2 bParse
3 Copyright (c) 2006-2009 Charlie C & Erwin Coumans  http://gamekit.googlecode.com
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15
16 #ifndef __BMAIN_H__
17 #define __BMAIN_H__
18
19 #include "bCommon.h"
20 #include "bChunk.h"
21 #include "LinearMath/btHashMap.h"
22
23
24 namespace bParse
25 {
26         class bDNA;
27
28         class bBlenderFile;
29 };
30
31
32
33 namespace bParse {
34
35
36         // ----------------------------------------------------- //
37         
38         typedef btHashMap<btHashInt,bListBasePtr> bMainDataMap;
39
40
41
42         // ----------------------------------------------------- //
43         class bMain
44         {
45         //private:
46         public:
47                 bBlenderFile*                   mFP;
48                 bListBasePtr    mPool;
49
50                 int                             mVersion;
51                 const char*             mName;
52
53                 bMainDataMap    mData;
54
55         
56
57
58                 bListBasePtr *_findCode(int code);
59
60         public:
61                 bMain(bBlenderFile  *filePtr, const char *baseName, int fileVersion);
62                 ~bMain();
63
64                 int getVersion();
65                 const char *getName();
66
67                 bListBasePtr *getListBasePtr(int listBaseCode);
68
69
70                 bListBasePtr *getScene();
71                 bListBasePtr *getLibrary();
72                 bListBasePtr *getObject();
73                 bListBasePtr *getMesh();
74                 bListBasePtr *getCurve();
75                 bListBasePtr *getMball();
76                 bListBasePtr *getMat();
77                 bListBasePtr *getTex();
78                 bListBasePtr *getImage();
79                 bListBasePtr *getWave();
80                 bListBasePtr *getLatt();
81                 bListBasePtr *getLamp();
82                 bListBasePtr *getCamera();
83                 bListBasePtr *getIpo();
84                 bListBasePtr *getKey();
85                 bListBasePtr *getWorld();
86                 bListBasePtr *getScreen();
87                 bListBasePtr *getScript();
88                 bListBasePtr *getVfont();
89                 bListBasePtr *getText();
90                 bListBasePtr *getSound();
91                 bListBasePtr *getGroup();
92                 bListBasePtr *getArmature();
93                 bListBasePtr *getAction();
94                 bListBasePtr *getNodetree();
95                 bListBasePtr *getBrush();
96
97
98                 
99                 // tracking allocated memory
100                 void addDatablock(void *allocated);
101
102
103                 // --
104                 
105                 void linkList(void *listBasePtr);
106         };
107 }
108
109
110 #endif//__BMAIN_H__