1 | <html> |
---|
2 | <head> |
---|
3 | <title>OgreMaterialSerializer.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
4 | <link type="text/css" rel="stylesheet" href="style.css"> |
---|
5 | </head> |
---|
6 | |
---|
7 | <body> |
---|
8 | <!-- Generated by Doxygen 1.3.6 --> |
---|
9 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div> |
---|
10 | <h1>OgreMaterialSerializer.h</h1><a href="OgreMaterialSerializer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> |
---|
11 | 00002 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
12 | 00003 <span class="comment">This source file is part of OGRE</span> |
---|
13 | 00004 <span class="comment"> (Object-oriented Graphics Rendering Engine)</span> |
---|
14 | 00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span> |
---|
15 | 00006 <span class="comment"></span> |
---|
16 | 00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span> |
---|
17 | 00008 <span class="comment">Also see acknowledgements in Readme.html</span> |
---|
18 | 00009 <span class="comment"></span> |
---|
19 | 00010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span> |
---|
20 | 00011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span> |
---|
21 | 00012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span> |
---|
22 | 00013 <span class="comment">version.</span> |
---|
23 | 00014 <span class="comment"></span> |
---|
24 | 00015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span> |
---|
25 | 00016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span> |
---|
26 | 00017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span> |
---|
27 | 00018 <span class="comment"></span> |
---|
28 | 00019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span> |
---|
29 | 00020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span> |
---|
30 | 00021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span> |
---|
31 | 00022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span> |
---|
32 | 00023 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
33 | 00024 <span class="comment">*/</span> |
---|
34 | 00025 <span class="preprocessor">#ifndef __MaterialSerializer_H__</span> |
---|
35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define __MaterialSerializer_H__</span> |
---|
36 | 00027 <span class="preprocessor"></span> |
---|
37 | 00028 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span> |
---|
38 | 00029 <span class="preprocessor">#include "<a class="code" href="OgreMaterial_8h.html">OgreMaterial.h</a>"</span> |
---|
39 | 00030 <span class="preprocessor">#include "<a class="code" href="OgreBlendMode_8h.html">OgreBlendMode.h</a>"</span> |
---|
40 | 00031 <span class="preprocessor">#include "<a class="code" href="OgreTextureUnitState_8h.html">OgreTextureUnitState.h</a>"</span> |
---|
41 | 00032 <span class="preprocessor">#include "<a class="code" href="OgreGpuProgram_8h.html">OgreGpuProgram.h</a>"</span> |
---|
42 | 00033 <span class="preprocessor">#include "<a class="code" href="OgreStringVector_8h.html">OgreStringVector.h</a>"</span> |
---|
43 | 00034 |
---|
44 | 00035 <span class="keyword">namespace </span>Ogre { |
---|
45 | 00036 |
---|
46 | <a name="l00038"></a><a class="code" href="namespaceOgre.html#a661">00038</a> <span class="keyword">enum</span> <a class="code" href="namespaceOgre.html#a661">MaterialScriptSection</a> |
---|
47 | 00039 { |
---|
48 | 00040 <a class="code" href="namespaceOgre.html#a661a315">MSS_NONE</a>, |
---|
49 | 00041 <a class="code" href="namespaceOgre.html#a661a316">MSS_MATERIAL</a>, |
---|
50 | 00042 <a class="code" href="namespaceOgre.html#a661a317">MSS_TECHNIQUE</a>, |
---|
51 | 00043 <a class="code" href="namespaceOgre.html#a661a318">MSS_PASS</a>, |
---|
52 | 00044 <a class="code" href="namespaceOgre.html#a661a319">MSS_TEXTUREUNIT</a>, |
---|
53 | 00045 <a class="code" href="namespaceOgre.html#a661a320">MSS_PROGRAM_REF</a>, |
---|
54 | 00046 <a class="code" href="namespaceOgre.html#a661a321">MSS_PROGRAM</a>, |
---|
55 | 00047 <a class="code" href="namespaceOgre.html#a661a322">MSS_DEFAULT_PARAMETERS</a>, |
---|
56 | 00048 <a class="code" href="namespaceOgre.html#a661a323">MSS_TEXTURESOURCE</a> |
---|
57 | 00049 }; |
---|
58 | <a name="l00051"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html">00051</a> <span class="keyword">struct </span><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html">MaterialScriptProgramDefinition</a> |
---|
59 | 00052 { |
---|
60 | <a name="l00053"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono0">00053</a> <a class="code" href="namespaceOgre.html#a426">String</a> name; |
---|
61 | <a name="l00054"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono1">00054</a> <a class="code" href="namespaceOgre.html#a653">GpuProgramType</a> <a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono1">progType</a>; |
---|
62 | <a name="l00055"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono2">00055</a> <a class="code" href="namespaceOgre.html#a426">String</a> <a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono2">language</a>; |
---|
63 | <a name="l00056"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono3">00056</a> <a class="code" href="namespaceOgre.html#a426">String</a> source; |
---|
64 | <a name="l00057"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono4">00057</a> <a class="code" href="namespaceOgre.html#a426">String</a> <a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono4">syntax</a>; |
---|
65 | <a name="l00058"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono5">00058</a> <span class="keywordtype">bool</span> <a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono5">supportsSkeletalAnimation</a>; |
---|
66 | <a name="l00059"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono6">00059</a> std::map<String, String> <a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono6">customParameters</a>; |
---|
67 | 00060 }; |
---|
68 | <a name="l00062"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html">00062</a> <span class="keyword">struct </span><a class="code" href="structOgre_1_1MaterialScriptContext.html">MaterialScriptContext</a> |
---|
69 | 00063 { |
---|
70 | <a name="l00064"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto0">00064</a> <a class="code" href="namespaceOgre.html#a661">MaterialScriptSection</a> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto0">section</a>; |
---|
71 | <a name="l00065"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto1">00065</a> <a class="code" href="namespaceOgre.html#a426">String</a> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto1">groupName</a>; |
---|
72 | <a name="l00066"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto2">00066</a> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto2">material</a>; |
---|
73 | <a name="l00067"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto3">00067</a> <a class="code" href="classOgre_1_1Technique.html">Technique</a>* <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto3">technique</a>; |
---|
74 | <a name="l00068"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto4">00068</a> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto4">pass</a>; |
---|
75 | <a name="l00069"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto5">00069</a> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a>* <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto5">textureUnit</a>; |
---|
76 | <a name="l00070"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto6">00070</a> <a class="code" href="classOgre_1_1GpuProgramPtr.html">GpuProgramPtr</a> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto6">program</a>; <span class="comment">// used when referencing a program, not when defining it</span> |
---|
77 | <a name="l00071"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto7">00071</a> <span class="keywordtype">bool</span> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto7">isProgramShadowCaster</a>; <span class="comment">// when referencing, are we in context of shadow caster</span> |
---|
78 | <a name="l00072"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto8">00072</a> <span class="keywordtype">bool</span> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto8">isProgramShadowReceiver</a>; <span class="comment">// when referencing, are we in context of shadow caster</span> |
---|
79 | <a name="l00073"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto9">00073</a> <a class="code" href="classOgre_1_1SharedPtr.html">GpuProgramParametersSharedPtr</a> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto9">programParams</a>; |
---|
80 | <a name="l00074"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto10">00074</a> <a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html">MaterialScriptProgramDefinition</a>* <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto10">programDef</a>; <span class="comment">// this is used while defining a program</span> |
---|
81 | 00075 |
---|
82 | <a name="l00076"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto11">00076</a> <span class="keywordtype">int</span> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto11">techLev</a>, <span class="comment">//Keep track of what tech, pass, and state level we are in</span> |
---|
83 | 00077 <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto12">passLev</a>, |
---|
84 | 00078 <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto13">stateLev</a>; |
---|
85 | <a name="l00079"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto14">00079</a> <a class="code" href="namespaceOgre.html#a535">StringVector</a> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto14">defaultParamLines</a>; |
---|
86 | 00080 |
---|
87 | 00081 <span class="comment">// Error reporting state</span> |
---|
88 | <a name="l00082"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto15">00082</a> size_t <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto15">lineNo</a>; |
---|
89 | <a name="l00083"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto16">00083</a> <a class="code" href="namespaceOgre.html#a426">String</a> filename; |
---|
90 | 00084 }; |
---|
91 | <a name="l00086"></a><a class="code" href="namespaceOgre.html#a314">00086</a> <span class="keyword">typedef</span> bool (*<a class="code" href="namespaceOgre.html#a314">ATTRIBUTE_PARSER</a>)(<a class="code" href="namespaceOgre.html#a426">String</a>& <a class="code" href="OgreGLPrerequisites_8h.html#a74">params</a>, <a class="code" href="structOgre_1_1MaterialScriptContext.html">MaterialScriptContext</a>& context); |
---|
92 | 00087 |
---|
93 | <a name="l00089"></a><a class="code" href="classOgre_1_1MaterialSerializer.html">00089</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> MaterialSerializer |
---|
94 | 00090 { |
---|
95 | 00091 <span class="keyword">protected</span>: |
---|
96 | <a name="l00093"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">00093</a> <span class="keyword">typedef</span> std::map<String, ATTRIBUTE_PARSER> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a>; |
---|
97 | 00094 |
---|
98 | <a name="l00095"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp0">00095</a> <a class="code" href="structOgre_1_1MaterialScriptContext.html">MaterialScriptContext</a> mScriptContext; |
---|
99 | 00096 |
---|
100 | 00100 <span class="keywordtype">bool</span> parseScriptLine(<a class="code" href="namespaceOgre.html#a426">String</a>& line); |
---|
101 | 00102 <span class="keywordtype">bool</span> invokeParser(<a class="code" href="namespaceOgre.html#a426">String</a>& line, <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a>& parsers); |
---|
102 | 00106 <span class="keywordtype">void</span> finishProgramDefinition(<span class="keywordtype">void</span>); |
---|
103 | <a name="l00108"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp1">00108</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mRootAttribParsers; |
---|
104 | <a name="l00110"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp2">00110</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mMaterialAttribParsers; |
---|
105 | <a name="l00112"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp3">00112</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mTechniqueAttribParsers; |
---|
106 | <a name="l00114"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp4">00114</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mPassAttribParsers; |
---|
107 | <a name="l00116"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp5">00116</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mTextureUnitAttribParsers; |
---|
108 | <a name="l00118"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp6">00118</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mProgramRefAttribParsers; |
---|
109 | <a name="l00120"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp7">00120</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mProgramAttribParsers; |
---|
110 | <a name="l00122"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp8">00122</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mProgramDefaultParamAttribParsers; |
---|
111 | 00123 |
---|
112 | 00124 <span class="keywordtype">void</span> writeMaterial(<span class="keyword">const</span> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a>& pMat); |
---|
113 | 00125 <span class="keywordtype">void</span> writeTechnique(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Technique.html">Technique</a>* pTech); |
---|
114 | 00126 <span class="keywordtype">void</span> writePass(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* pPass); |
---|
115 | 00127 <span class="keywordtype">void</span> writeTextureUnit(<span class="keyword">const</span> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a> *pTex); |
---|
116 | 00128 |
---|
117 | 00129 <span class="keywordtype">void</span> writeSceneBlendFactor(<span class="keyword">const</span> SceneBlendFactor sbf_src, <span class="keyword">const</span> SceneBlendFactor sbf_dest); |
---|
118 | 00130 <span class="keywordtype">void</span> writeSceneBlendFactor(<span class="keyword">const</span> SceneBlendFactor sbf); |
---|
119 | 00131 <span class="keywordtype">void</span> writeCompareFunction(<span class="keyword">const</span> CompareFunction cf); |
---|
120 | 00132 <span class="keywordtype">void</span> writeColourValue(<span class="keyword">const</span> <a class="code" href="classOgre_1_1ColourValue.html">ColourValue</a> &colour, <span class="keywordtype">bool</span> writeAlpha = <span class="keyword">false</span>); |
---|
121 | 00133 <span class="keywordtype">void</span> writeLayerBlendOperationEx(<span class="keyword">const</span> LayerBlendOperationEx op); |
---|
122 | 00134 <span class="keywordtype">void</span> writeLayerBlendSource(<span class="keyword">const</span> LayerBlendSource lbs); |
---|
123 | 00135 |
---|
124 | <a name="l00136"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx1">00136</a> <span class="keyword">typedef</span> std::multimap<TextureUnitState::TextureEffectType, TextureUnitState::TextureEffect> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx1">EffectMap</a>; |
---|
125 | 00137 |
---|
126 | 00138 <span class="keywordtype">void</span> writeRotationEffect(<span class="keyword">const</span> <a class="code" href="structOgre_1_1TextureUnitState_1_1TextureEffect.html">TextureUnitState::TextureEffect</a>& effect, <span class="keyword">const</span> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a> *pTex); |
---|
127 | 00139 <span class="keywordtype">void</span> writeTransformEffect(<span class="keyword">const</span> <a class="code" href="structOgre_1_1TextureUnitState_1_1TextureEffect.html">TextureUnitState::TextureEffect</a>& effect, <span class="keyword">const</span> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a> *pTex); |
---|
128 | 00140 <span class="keywordtype">void</span> writeScrollEffect(<span class="keyword">const</span> <a class="code" href="structOgre_1_1TextureUnitState_1_1TextureEffect.html">TextureUnitState::TextureEffect</a>& effect, <span class="keyword">const</span> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a> *pTex); |
---|
129 | 00141 <span class="keywordtype">void</span> writeEnvironmentMapEffect(<span class="keyword">const</span> <a class="code" href="structOgre_1_1TextureUnitState_1_1TextureEffect.html">TextureUnitState::TextureEffect</a>& effect, <span class="keyword">const</span> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a> *pTex); |
---|
130 | 00142 |
---|
131 | 00143 <a class="code" href="namespaceOgre.html#a426">String</a> convertFiltering(FilterOptions fo); |
---|
132 | 00144 <span class="keyword">public</span>: |
---|
133 | 00146 MaterialSerializer(); |
---|
134 | <a name="l00148"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializera1">00148</a> <span class="keyword">virtual</span> ~MaterialSerializer() {}; |
---|
135 | 00149 |
---|
136 | 00151 <span class="keywordtype">void</span> queueForExport(<span class="keyword">const</span> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a>& pMat, <span class="keywordtype">bool</span> clearQueued = <span class="keyword">false</span>, <span class="keywordtype">bool</span> exportDefaults = <span class="keyword">false</span>); |
---|
137 | 00153 <span class="keywordtype">void</span> exportQueued(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>& filename); |
---|
138 | 00155 <span class="keywordtype">void</span> exportMaterial(<span class="keyword">const</span> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a>& pMat, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>& filename, <span class="keywordtype">bool</span> exportDefaults = <span class="keyword">false</span>); |
---|
139 | 00157 <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a> &getQueuedAsString() <span class="keyword">const</span>; |
---|
140 | 00159 <span class="keywordtype">void</span> clearQueue(); |
---|
141 | 00160 |
---|
142 | 00163 <span class="keywordtype">void</span> parseScript(<a class="code" href="classOgre_1_1SharedPtr.html">DataStreamPtr</a>& stream, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>& groupName); |
---|
143 | 00164 |
---|
144 | 00165 |
---|
145 | 00166 |
---|
146 | 00167 <span class="keyword">private</span>: |
---|
147 | <a name="l00168"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerr0">00168</a> <a class="code" href="namespaceOgre.html#a426">String</a> mBuffer; |
---|
148 | <a name="l00169"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerr1">00169</a> <span class="keywordtype">bool</span> mDefaults; |
---|
149 | 00170 |
---|
150 | <a name="l00171"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerd0">00171</a> <span class="keywordtype">void</span> beginSection(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> level) |
---|
151 | 00172 { |
---|
152 | 00173 mBuffer += <span class="stringliteral">"\n"</span>; |
---|
153 | 00174 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> i = 0; i < level; ++i) |
---|
154 | 00175 { |
---|
155 | 00176 mBuffer += <span class="stringliteral">"\t"</span>; |
---|
156 | 00177 } |
---|
157 | 00178 mBuffer += <span class="stringliteral">"{"</span>; |
---|
158 | 00179 } |
---|
159 | <a name="l00180"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerd1">00180</a> <span class="keywordtype">void</span> endSection(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> level) |
---|
160 | 00181 { |
---|
161 | 00182 mBuffer += <span class="stringliteral">"\n"</span>; |
---|
162 | 00183 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> i = 0; i < level; ++i) |
---|
163 | 00184 { |
---|
164 | 00185 mBuffer += <span class="stringliteral">"\t"</span>; |
---|
165 | 00186 } |
---|
166 | 00187 mBuffer += <span class="stringliteral">"}"</span>; |
---|
167 | 00188 } |
---|
168 | 00189 |
---|
169 | <a name="l00190"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerd2">00190</a> <span class="keywordtype">void</span> writeAttribute(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> level, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>& att) |
---|
170 | 00191 { |
---|
171 | 00192 mBuffer += <span class="stringliteral">"\n"</span>; |
---|
172 | 00193 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> i = 0; i < level; ++i) |
---|
173 | 00194 { |
---|
174 | 00195 mBuffer += <span class="stringliteral">"\t"</span>; |
---|
175 | 00196 } |
---|
176 | 00197 mBuffer += att; |
---|
177 | 00198 } |
---|
178 | 00199 |
---|
179 | <a name="l00200"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerd3">00200</a> <span class="keywordtype">void</span> writeValue(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>& val) |
---|
180 | 00201 { |
---|
181 | 00202 mBuffer += (<span class="stringliteral">" "</span> + val); |
---|
182 | 00203 } |
---|
183 | 00204 |
---|
184 | <a name="l00205"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerd4">00205</a> <span class="keywordtype">void</span> writeComment(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> level, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>& comment) |
---|
185 | 00206 { |
---|
186 | 00207 mBuffer += <span class="stringliteral">"\n"</span>; |
---|
187 | 00208 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> i = 0; i < level; ++i) |
---|
188 | 00209 { |
---|
189 | 00210 mBuffer += <span class="stringliteral">"\t"</span>; |
---|
190 | 00211 } |
---|
191 | 00212 mBuffer += <span class="stringliteral">"// "</span> + comment; |
---|
192 | 00213 } |
---|
193 | 00214 |
---|
194 | 00215 }; |
---|
195 | 00216 } |
---|
196 | 00217 <span class="preprocessor">#endif</span> |
---|
197 | </pre></div><hr> |
---|
198 | <p> |
---|
199 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
200 | <!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/> |
---|
201 | This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/> |
---|
202 | <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> |
---|
203 | <Work rdf:about=""> |
---|
204 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
205 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
206 | </Work> |
---|
207 | <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> --> |
---|
208 | |
---|
209 | Last modified Sun Feb 12 12:59:47 2006 |
---|
210 | </p> |
---|
211 | </body> |
---|
212 | </html> |
---|