Subversion Repositories spk

Rev

Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 114
Line 1... Line 1...
1
/*
1
/*
2
  defines bob_dom_bob - class that can manipulate the BOB1 format and all the 
2
  defines bob_bob - class that can manipulate the BOB1 format and all the
3
  underlying objects
3
  underlying objects
4
*/
4
*/
5
 
5
 
6
#ifndef BOB_DOM_BOB_INCLUDED
6
#ifndef BOB_BOB_INCLUDED
7
#define BOB_DOM_BOB_INCLUDED
7
#define BOB_BOB_INCLUDED
8
 
8
 
9
#include "bob_dom_base.h"
9
#include "bob_dom_base.h"
10
#include "settings.h"
10
#include "settings.h"
11
#include "../common/ext_utils.h"
11
#include "../common/ext_utils.h"
12
#include "../common/ext_array.h"
12
#include "../common/ext_array.h"
13
#include "../common/ext_simple_list.h"
13
#include "../common/ext_simple_list.h"
14
#include "../common/strutils.h"
14
#include "../common/strutils.h"
-
 
15
#include "../common/ptr_list.h"
-
 
16
 
-
 
17
#include "conversion.h"
15
 
18
 
16
class bob_dom_bob;
19
class bob_dom_bob;
17
 
20
 
18
class bob_dom_bodies;
21
class bob_bodies;
19
class bob_dom_body;
22
class bob_body;
20
 
23
 
21
class bob_dom_materials;
24
class bob_materials;
22
class bob_dom_material3;
25
class bob_material3;
23
class bob_dom_material5;
26
class bob_material5;
24
 
27
 
25
class bob_dom_points;
28
class bob_points;
26
class bob_dom_point;
29
class bob_vertex;
27
 
30
 
28
class bob_dom_part;
31
class bob_part;
29
class bob_dom_face;
32
class bob_face;
30
 
33
 
31
class bob_point_map;
34
class bob_point_map;
32
 
35
 
33
enum X2BobType
36
enum X2BobType
34
{
37
{
35
	bobX2,
38
	bobX2,
36
	bobX3
39
	bobX3
37
};
40
};
38
 
41
 
39
 
42
 
40
class bob_dom_weight
43
class bob_weight
41
{
44
{
42
	public:
45
	public:
43
		struct value
46
		struct value
44
		{
47
		{
45
			static const int multiplier = 65536;
48
			static const int MULTIPLIER = 65536;
46
		
49
 
47
			short boneIdx;
50
			short boneIdx;
48
			int boneCoefficient;
51
			int boneCoefficient;
49
			
52
 
50
			void toFile(bob_dom_otextfilestream& os)
53
			void toFile(otextfilestream& os)
51
			{
54
			{
52
				os << boneIdx << (float)(boneCoefficient / (double)multiplier);
55
				os << boneIdx << (boneCoefficient / (double)MULTIPLIER);
53
			}
56
			}
54
 
57
 
55
		};
58
		};
56
	
59
 
57
	private:
60
	private:
58
		
61
 
59
	public:
62
	public:
60
		typedef ext::list<value>::iterator iterator;
63
		typedef ext::list<value>::iterator iterator;
61
		typedef ext::list<value>::const_iterator const_iterator;
64
		typedef ext::list<value>::const_iterator const_iterator;
62
		
65
 
63
		bob_error_codes errorCode;
66
		bob_error_codes errorCode;
64
		ext::list<value> values;
67
		ext::list<value> values;
65
		
68
 
66
		bob_dom_weight() { errorCode=e_noError; }
69
		bob_weight() { errorCode=e_noError; }
67
		bob_dom_weight(const bob_dom_weight& other) 
70
		bob_weight(const bob_weight& other)
68
		{ 
71
		{
69
			errorCode=other.errorCode; 
72
			errorCode=other.errorCode;
70
			for(const_iterator &it=other.values.begin(); it!=other.values.end(); ++it){
73
			for(const_iterator &it=other.values.begin(); it!=other.values.end(); ++it){
71
				values.push_back(*it);
74
				values.push_back(*it);
72
			}
75
			}
73
		}
76
		}
74
		
77
 
75
		bool load(bob_dom_ibinaryfilestream& is);
78
		bool load(ibinaryfilestream& is);
76
		
79
 
77
		bool toFile(bob_dom_obinaryfilestream& os);
80
		bool toFile(obinaryfilestream& os);
78
		bool toFile(bob_dom_otextfilestream& os, int idx);
81
		bool toFile(otextfilestream& os, int idx);
79
};
82
};
80
 
83
 
81
class bob_dom_weights : public bob_dom_section, public ext::array&lt;bob_dom_weight*>
84
class bob_weights : public bob_section, public ptr_list<ext::array&lt;bob_weight*> >
82
{
85
{
83
	public:
86
	public:
84
		static const int hdr_begin=BOB_SECTION_NAME_WEIGHT_BEGIN;
87
		static const int HDR_BEGIN = BOB_SECTION_NAME_WEIGHT_BEGIN;
85
		static const int hdr_end=BOB_SECTION_NAME_WEIGHT_END;
88
		static const int HDR_END = BOB_SECTION_NAME_WEIGHT_END;
86
		
89
 
87
		typedef ext::simple_list&lt;bob_dom_weight*> WeightList;
90
		typedef ptr_list<ext::simple_list&lt;bob_weight*> > WeightList;
88
		
91
 
89
		WeightList new_weights;
92
		WeightList new_weights;
90
		
93
 
91
		bool load(bob_dom_ibinaryfilestream& is);
94
		bool load(ibinaryfilestream& is);
92
		
95
 
93
		bool toFile(bob_dom_obinaryfilestream& os);
96
		bool toFile(obinaryfilestream& os);
94
		bool toFile(bob_dom_otextfilestream& os, const bob_point_map *pointMap);
97
		bool toFile(otextfilestream& os, const bob_point_map *pointMap);
95
		
-
 
96
		~bob_dom_weights()
-
 
97
		{
-
 
98
			for(iterator &it=begin(); it!=end(); ++it){
-
 
99
				delete *it;
-
 
100
			}
-
 
101
			for(WeightList::iterator &it=new_weights.begin(); it!=new_weights.end(); ++it){
-
 
102
				delete *it;
-
 
103
			}
-
 
104
		}
-
 
105
};
98
};
106
 
99
 
107
class bob_dom_bones : public bob_dom_section, public ext::list&lt;char*>
100
class bob_bones : public bob_section, public ptr_list<ext::list&lt;char*> >
108
{
101
{
109
	public:
102
	public:
110
		static const int hdr_begin=BOB_SECTION_NAME_BONE_BEGIN;
103
		static const int HDR_BEGIN = BOB_SECTION_NAME_BONE_BEGIN;
111
		static const int hdr_end=BOB_SECTION_NAME_BONE_END;
104
		static const int HDR_END = BOB_SECTION_NAME_BONE_END;
112
		
105
 
113
		bool load(bob_dom_ibinaryfilestream &is);
106
		bool load(ibinaryfilestream &is);
114
		
107
 
115
		bool toFile(bob_dom_obinaryfilestream& os);
108
		bool toFile(obinaryfilestream& os);
116
		bool toFile(bob_dom_otextfilestream& os);
109
		bool toFile(otextfilestream& os);
117
		
110
 
118
		~bob_dom_bones()
-
 
119
		{
-
 
120
			for(iterator &it=begin(); it!=end(); ++it){
-
 
121
				delete *it;
-
 
122
			}
-
 
123
		}
-
 
124
};
111
};
125
 
112
 
126
class bob_dom_material
113
class bob_material
127
{
114
{
128
	public:
115
	public:
129
		enum materialType
116
		enum materialType
130
		{
117
		{
131
			mat1,
118
			mat1,
132
			mat3,
119
			mat3,
133
			mat5,
120
			mat5,
134
			mat6
121
			mat6
135
		};
122
		};
136
		
123
 
137
		materialType type;
124
		materialType type;
138
		short index;
125
		short index;
139
		
126
 
140
		bob_error_codes errorCode;
127
		bob_error_codes errorCode;
141
		
-
 
142
		bob_dom_material() { index=0; }
-
 
143
		virtual ~bob_dom_material() { }
-
 
144
 
128
 
-
 
129
		bob_material() { index=0; }
-
 
130
		virtual ~bob_material() { }
-
 
131
 
145
		virtual bool load(bob_dom_ibinaryfilestream& is) = 0;
132
		virtual bool load(ibinaryfilestream& is) = 0;
146
		
133
 
147
		virtual bool toFile(bob_dom_obinaryfilestream& os) = 0;
134
		virtual bool toFile(obinaryfilestream& os) = 0;
148
		virtual bool toFile(bob_dom_otextfilestream& os) = 0;
135
		virtual bool toFile(otextfilestream& os) = 0;
149
};
136
};
150
 
137
 
151
class bob_dom_material1 : public bob_dom_material
138
class bob_material1 : public bob_material
152
{
139
{
153
	public:
140
	public:
154
		struct rgb
141
		struct rgb
155
		{
142
		{
156
			short r, g, b;
143
			short r, g, b;
157
			rgb() { r=g=b=0; }
144
			rgb() { r=g=b=0; }
158
		};
145
		};
159
		
146
 
160
		struct pair
147
		struct pair
161
		{
148
		{
162
			short value;
149
			short value;
163
			short strength;
150
			short strength;
164
			pair() { value=0; strength=0; }
151
			pair() { value=0; strength=0; }
165
		};
152
		};
166
		
153
 
167
		short textureID;
154
		short textureID;
168
		rgb ambient;
155
		rgb ambient;
169
		rgb diffuse;
156
		rgb diffuse;
170
		rgb specular;
157
		rgb specular;
171
		
158
 
172
		bob_dom_material1()
159
		bob_material1()
173
		{
160
		{
174
			type=mat1;
161
			type=mat1;
175
			index=0; textureID=0; errorCode=e_noError;
162
			index=0; textureID=0; errorCode=e_noError;
176
		}
163
		}
177
		
164
 
178
		bool load(bob_dom_ibinaryfilestream& is);
165
		bool load(ibinaryfilestream& is);
179
		
166
 
180
		bool toFile(bob_dom_obinaryfilestream& os);
167
		bool toFile(obinaryfilestream& os);
181
		bool toFile(bob_dom_otextfilestream& os);
168
		bool toFile(otextfilestream& os);
182
};
169
};
183
 
170
 
184
inline
171
inline
185
bob_dom_ibinaryfilestream& operator >> (bob_dom_ibinaryfilestream& is, bob_dom_material1::pair& right)
172
ibinaryfilestream& operator >> (ibinaryfilestream& is, bob_material1::pair& right)
186
{
173
{
187
	is >> right.value >> right.strength;
174
	is >> right.value >> right.strength;
188
	return is;
175
	return is;
189
}
176
}
190
 
177
 
191
inline
178
inline
192
bob_dom_obinaryfilestream& operator << (bob_dom_obinaryfilestream& os, bob_dom_material1::pair& right)
179
obinaryfilestream& operator << (obinaryfilestream& os, bob_material1::pair& right)
193
{
180
{
194
	os << right.value << right.strength;
181
	os << right.value << right.strength;
195
	return os;
182
	return os;
196
}
183
}
197
 
184
 
198
inline
185
inline
199
bob_dom_ibinaryfilestream& operator >> (bob_dom_ibinaryfilestream& is, bob_dom_material1::rgb& r)
186
ibinaryfilestream& operator >> (ibinaryfilestream& is, bob_material1::rgb& r)
200
{
187
{
201
	is >> r.r >> r.g >> r.b;
188
	is >> r.r >> r.g >> r.b;
202
	return is;
189
	return is;
203
}
190
}
204
 
191
 
205
inline
192
inline
206
bob_dom_obinaryfilestream& operator << (bob_dom_obinaryfilestream& os, bob_dom_material1::rgb& right)
193
obinaryfilestream& operator << (obinaryfilestream& os, bob_material1::rgb& right)
207
{
194
{
208
	os << right.r << right.g << right.b;
195
	os << right.r << right.g << right.b;
209
	return os;
196
	return os;
210
}
197
}
211
 
198
 
212
inline
199
inline
213
bob_dom_otextfilestream& operator << (bob_dom_otextfilestream& os, bob_dom_material1::pair& right)
200
otextfilestream& operator << (otextfilestream& os, bob_material1::pair& right)
214
{
201
{
215
	int f=os.flags();
202
	int f=os.flags();
216
	os << noSemicolons;
203
	os << noSemicolons;
217
	os << right.value << ';' << right.strength << "; ";
204
	os << right.value << ';' << right.strength << "; ";
218
	os.flags(f);
205
	os.flags(f);
219
	return os;
206
	return os;
220
}
207
}
221
 
208
 
222
inline
209
inline
223
bob_dom_otextfilestream& operator << (bob_dom_otextfilestream& os, bob_dom_material1::rgb& right)
210
otextfilestream& operator << (otextfilestream& os, bob_material1::rgb& right)
224
{
211
{
225
	int f=os.flags();
212
	int f=os.flags();
226
	os << noSemicolons;
213
	os << noSemicolons;
227
	os << right.r << ';' << right.g << ';' << right.b << "; ";
214
	os << right.r << ';' << right.g << ';' << right.b << "; ";
228
	os.flags(f);
215
	os.flags(f);
229
	return os;
216
	return os;
230
}
217
}
231
 
218
 
232
class bob_dom_material3 : public bob_dom_material1
219
class bob_material3 : public bob_material1
233
{
220
{
234
	public:
221
	public:
235
		int transparency;
222
		int transparency;
236
		short selfIllumination;
223
		short selfIllumination;
237
		pair shininess;
224
		pair shininess;
Line 239... Line 226...
239
		bool twoSided;
226
		bool twoSided;
240
		bool wireframe;
227
		bool wireframe;
241
		short textureValue;
228
		short textureValue;
242
		pair enviromentMap;
229
		pair enviromentMap;
243
		pair bumpMap;
230
		pair bumpMap;
244
		
231
 
245
		typedef bob_dom_material1 base;
232
		typedef bob_material1 base;
246
		
233
 
247
		bob_dom_material3() {
234
		bob_material3() {
248
			type=mat3;
235
			type=mat3;
249
			transparency=0; selfIllumination=0; destinationBlend=0;
236
			transparency=0; selfIllumination=0; destinationBlend=0;
250
			twoSided=0; wireframe=0; textureValue=0; 
237
			twoSided=0; wireframe=0; textureValue=0;
251
		}
238
		}
252
		
239
 
253
		bool load(bob_dom_ibinaryfilestream& is);
240
		bool load(ibinaryfilestream& is);
254
		
241
 
255
		bool toFile(bob_dom_obinaryfilestream& os);
242
		bool toFile(obinaryfilestream& os);
256
		bool toFile(bob_dom_otextfilestream& os);
243
		bool toFile(otextfilestream& os);
257
};
244
};
258
 
245
 
259
class bob_dom_material5 : public bob_dom_material3
246
class bob_material5 : public bob_material3
260
{
247
{
261
	private:
248
	private:
262
		
249
 
263
	public:
250
	public:
264
		typedef bob_dom_material3 base;
251
		typedef bob_material3 base;
265
		
252
 
266
		pair lightMap;
253
		pair lightMap;
267
		
254
 
268
		bob_dom_material5() { type=mat5; }
255
		bob_material5() { type=mat5; }
269
		
256
 
270
		bool load(bob_dom_ibinaryfilestream& is);
257
		bool load(ibinaryfilestream& is);
271
		
258
 
272
		bool toFile(bob_dom_obinaryfilestream& os);
259
		bool toFile(obinaryfilestream& os);
273
		bool toFile(bob_dom_otextfilestream& os);
260
		bool toFile(otextfilestream& os);
274
		
261
 
275
};
262
};
276
 
263
 
277
class material6_value
264
class material6_value
278
{
265
{
279
	private:
266
	private:
280
		static char *m_stringTypes[];
267
		static char *m_stringTypes[];
281
		static int m_stringTypesCount;
268
		static int m_stringTypesCount;
282
		
269
 
283
	public:
270
	public:
284
		enum Type 
271
		enum Type
285
		{
272
		{
286
			typeLong=0,
273
			typeLong=0,
287
			typeBool=1,
274
			typeBool=1,
288
			typeFloat=2,
275
			typeFloat=2,
289
			typeFloat4=5,
276
			typeFloat4=5,
290
			typeString=8
277
			typeString=8
291
		};
278
		};
292
		
279
 
293
		struct float4
280
		struct float4
294
		{
281
		{
295
			float f[4];
282
			float f[4];
296
		};
283
		};
297
		
284
 
298
		union TagValue
285
		union TagValue
299
		{
286
		{
300
			bool b;
287
			bool b;
301
			int i;
288
			int i;
302
			char *psz;
289
			char *psz;
Line 304... Line 291...
304
			float4 f4;
291
			float4 f4;
305
		} val;
292
		} val;
306
 
293
 
307
		Type type;
294
		Type type;
308
		char *name;
295
		char *name;
309
		
296
 
310
		material6_value() { val.i=0; type=typeLong; name=0; }
297
		material6_value() { val.i=0; type=typeLong; name=0; }
311
		material6_value(Type type) { val.i=0; this->type=type; name=0; }
298
		material6_value(Type type) { val.i=0; this->type=type; name=0; }
312
 
299
 
313
		~material6_value() { delete name; if(type==typeString) delete val.psz; }
300
		~material6_value() { delete name; if(type==typeString) delete val.psz; }
314
		
301
 
315
		static const char * typeName(int type) { return type < m_stringTypesCount ? m_stringTypes[type] : ""; }
302
		static const char * typeName(int type) { return type < m_stringTypesCount ? m_stringTypes[type] : ""; }
316
		const char * typeName() const { return typeName(type); }
303
		const char * typeName() const { return typeName(type); }
317
		static int typeNameCount() { return m_stringTypesCount; }
304
		static int typeNameCount() { return m_stringTypesCount; }
318
		
305
 
319
		bob_error_codes load(bob_dom_ibinaryfilestream& is);
306
		bob_error_codes load(ibinaryfilestream& is);
320
		bool toFile(bob_dom_otextfilestream& os);
307
		bool toFile(otextfilestream& os);
321
		bool toFile(bob_dom_obinaryfilestream& os);
308
		bool toFile(obinaryfilestream& os);
322
};
309
};
323
 
310
 
324
inline bob_dom_ibinaryfilestream& operator >> (bob_dom_ibinaryfilestream& is, material6_value::float4 &val)
311
inline ibinaryfilestream& operator >> (ibinaryfilestream& is, material6_value::float4 &val)
325
{
312
{
326
	for(int i=0; i < 4; i++){
313
	for(int i=0; i < 4; i++){
327
		is >> val.f[i];
314
		is >> val.f[i];
328
	}
315
	}
329
	return is;
316
	return is;
330
}
317
}
331
 
318
 
332
inline bob_dom_obinaryfilestream& operator << (bob_dom_obinaryfilestream& os, material6_value::float4 &val)
319
inline obinaryfilestream& operator << (obinaryfilestream& os, material6_value::float4 &val)
333
{
320
{
334
	for(int i=0; i < 4; i++){
321
	for(int i=0; i < 4; i++){
335
		os << val.f[i];
322
		os << val.f[i];
336
	}
323
	}
337
	return os;
324
	return os;
338
}
325
}
339
 
326
 
340
class bob_dom_material6_values : public ext::simple_list&lt;material6_value*>
327
class bob_material6_values : public ptr_list<ext::simple_list&lt;material6_value*> >
341
{
328
{
342
	public:
329
	public:
343
		typedef ext::simple_list<material6_value*> base;
330
		typedef ext::simple_list<material6_value*> base;
344
		typedef base::iterator iterator;
331
		typedef base::iterator iterator;
345
		
332
 
346
	public:
333
	public:
347
		~bob_dom_material6_values()
-
 
348
		{
-
 
349
			for(iterator it=begin(); it!=end(); ++it){
-
 
350
				delete *it;
-
 
351
			}
-
 
352
		}
-
 
353
		
-
 
354
		bob_error_codes load(bob_dom_ibinaryfilestream& is);
334
		bob_error_codes load(ibinaryfilestream& is);
355
		
335
 
356
		bool toFile(bob_dom_otextfilestream& os);
336
		bool toFile(otextfilestream& os);
357
		bool toFile(bob_dom_obinaryfilestream& os);
337
		bool toFile(obinaryfilestream& os);
358
};
338
};
359
 
339
 
360
class bob_dom_material6 : public bob_dom_material
340
class bob_material6 : public bob_material
361
{
341
{
362
	public:
342
	public:
363
		class Big
343
		class Big
364
		{
344
		{
365
			public:
345
			public:
366
				static const int flag=0x2000000;
346
				static const int flag=0x2000000;
367
				
347
 
368
				char *effect;
348
				char *effect;
369
				short technique;
349
				short technique;
370
				
350
 
371
				bob_dom_material6_values values;
351
				bob_material6_values values;
372
				
352
 
373
				Big() { effect=0; technique=0; }
353
				Big() { effect=0; technique=0; }
374
				~Big() { delete[] effect; }
354
				~Big() { delete[] effect; }
375
				
355
 
376
				bob_error_codes load(bob_dom_ibinaryfilestream& is);
356
				bob_error_codes load(ibinaryfilestream& is);
377
				
357
 
378
				bool toFile(bob_dom_otextfilestream& os);
358
				bool toFile(otextfilestream& os);
379
				bool toFile(bob_dom_obinaryfilestream& os);
359
				bool toFile(obinaryfilestream& os);
380
		};
360
		};
381
		
361
 
382
		class Small
362
		class Small
383
		{
363
		{
384
			public:	
364
			public:
385
				struct pair
365
				struct pair
386
				{
366
				{
387
					char *texture;
367
					char *texture;
388
					short strength;
368
					short strength;
389
					
369
 
390
					pair() { texture=0; }
370
					pair() { texture=0; }
391
					~pair() { delete[] texture; }
371
					~pair() { delete[] texture; }
392
					
372
 
393
					pair& operator = (const pair& other) 
373
					pair& operator = (const pair& other)
394
					{ 
374
					{
395
						strcreate(texture, other.texture); strength=other.strength; return *this; 
375
						strcreate(texture, other.texture); strength=other.strength; return *this;
396
					}
376
					}
397
				};
377
				};
398
				
378
 
399
				char *textureFile;
379
				char *textureFile;
400
				bob_dom_material1::rgb ambient, diffuse, specular;
380
				bob_material1::rgb ambient, diffuse, specular;
401
				int transparency;
381
				int transparency;
402
				short selfIllumination;
382
				short selfIllumination;
403
				bob_dom_material1::pair shininess;
383
				bob_material1::pair shininess;
404
				bool destinationBlend;
384
				bool destinationBlend;
405
				bool twoSided;
385
				bool twoSided;
406
				bool wireframe;
386
				bool wireframe;
407
				short textureValue;
387
				short textureValue;
408
				pair enviromentMap;
388
				pair enviromentMap;
409
				pair bumpMap;
389
				pair bumpMap;
410
				pair lightMap;
390
				pair lightMap;
411
				pair map4, map5;
391
				pair map4, map5;
412
				
392
 
413
				Small() { 
393
				Small() {
414
					textureFile=0; transparency=0; selfIllumination=0; destinationBlend=false; twoSided=false; wireframe=false;
394
					textureFile=0; transparency=0; selfIllumination=0; destinationBlend=false; twoSided=false; wireframe=false;
415
					textureValue=0;
395
					textureValue=0;
416
				}
396
				}
417
				~Small() 
397
				~Small()
418
				{ 
398
				{
419
					delete[] textureFile; 
399
					delete[] textureFile;
420
				}
400
				}
421
				
401
 
422
				bob_error_codes load(bob_dom_ibinaryfilestream& is, int flags);
402
				bob_error_codes load(ibinaryfilestream& is, int flags);
423
				
403
 
424
				bool toFile(bob_dom_otextfilestream& os);
404
				bool toFile(otextfilestream& os);
425
				bool toFile(bob_dom_obinaryfilestream& os);
405
				bool toFile(obinaryfilestream& os);
426
		};
406
		};
427
		
407
 
428
	public:
408
	public:
429
#ifdef small // some fucking definition from RPC (god knows where it's included)
409
#ifdef small // some fucking definition from RPC (god knows where it's included)
430
	#undef small
410
	#undef small
431
#endif
411
#endif
432
		int flags;
412
		int flags;
433
		Small *small;
413
		Small *small;
434
		Big *big;
414
		Big *big;
435
		
415
 
436
		bob_dom_material6() { type=mat6; flags=0; small=0; big=0; }
416
		bob_material6() { type=mat6; flags=0; small=0; big=0; }
437
		~bob_dom_material6() { delete small; delete big; }
417
		~bob_material6() { delete small; delete big; }
438
		
418
 
439
		bool load(bob_dom_ibinaryfilestream& is);
419
		bool load(ibinaryfilestream& is);
440
		
420
 
441
		bool toFile(bob_dom_obinaryfilestream& os);
421
		bool toFile(obinaryfilestream& os);
442
		bool toFile(bob_dom_otextfilestream& os);
422
		bool toFile(otextfilestream& os);
443
};
423
};
444
 
424
 
445
inline
425
inline
446
bob_dom_ibinaryfilestream& operator >> (bob_dom_ibinaryfilestream& is, bob_dom_material6::Small::pair& right)
426
ibinaryfilestream& operator >> (ibinaryfilestream& is, bob_material6::Small::pair& right)
447
{
427
{
448
	is >> right.texture >> right.strength;
428
	is >> right.texture >> right.strength;
449
	return is;
429
	return is;
450
}
430
}
451
 
431
 
452
inline
432
inline
453
bob_dom_obinaryfilestream& operator << (bob_dom_obinaryfilestream& os, bob_dom_material6::Small::pair& right)
433
obinaryfilestream& operator << (obinaryfilestream& os, bob_material6::Small::pair& right)
454
{
434
{
455
	static char *empty="";
435
	static char *empty="";
456
	os << (right.texture ? right.texture : empty) << right.strength;
436
	os << (right.texture ? right.texture : empty) << right.strength;
457
	return os;
437
	return os;
458
}
438
}
459
 
439
 
460
inline
440
inline
461
bob_dom_otextfilestream& operator << (bob_dom_otextfilestream& os, bob_dom_material6::Small::pair& right)
441
otextfilestream& operator << (otextfilestream& os, bob_material6::Small::pair& right)
462
{
442
{
463
	int old=os.flags();
443
	int old=os.flags();
464
	os << noSemicolons << (*(right.texture)==0 ? "NULL" : right.texture) << ';' << autoSemicolons << right.strength;
444
	os << noSemicolons << (*(right.texture)==0 ? "NULL" : right.texture) << ';' << autoSemicolons << right.strength;
465
	os.flags(old);
445
	os.flags(old);
466
	return os;
446
	return os;
467
}
447
}
468
 
448
 
469
class bob_dom_materials : public bob_dom_section, public ext::list&lt;bob_dom_material*>
449
class bob_materials : public bob_section, public ptr_list<ext::list&lt;bob_material*> >
470
{
450
{
471
	private:
451
	private:
472
		
-
 
473
	public:
-
 
474
		static const int hdr_mat6_begin=BOB_SECTION_NAME_MAT6_BEGIN;
-
 
475
		static const int hdr_mat5_begin=BOB_SECTION_NAME_MAT5_BEGIN;
-
 
476
		static const int hdr_end=BOB_SECTION_NAME_MAT_END;
-
 
477
		
-
 
478
		bob_dom_materials() { }
-
 
479
		~bob_dom_materials() 
-
 
480
		{ 
-
 
481
			for(iterator &it=begin(); it!=end(); ++it) {
-
 
482
				delete *it;
-
 
483
			}
-
 
484
		}
-
 
485
		
-
 
486
		bool toFile(bob_dom_obinaryfilestream& os);
-
 
487
		bool toFile(bob_dom_otextfilestream& os);
-
 
488
		
-
 
489
		bool load(bob_dom_ibinaryfilestream& is);
-
 
490
};
-
 
491
 
452
 
492
class bob_dom_point
-
 
493
{
-
 
494
	public:
453
	public:
-
 
454
		static const int HDR_MAT6_BEGIN = BOB_SECTION_NAME_MAT6_BEGIN;
-
 
455
		static const int HDR_MAT5_BEGIN = BOB_SECTION_NAME_MAT5_BEGIN;
-
 
456
		static const int HDR_END = BOB_SECTION_NAME_MAT_END;
-
 
457
 
-
 
458
		bool toFile(obinaryfilestream& os);
-
 
459
		bool toFile(otextfilestream& os);
-
 
460
 
495
		static double multiplier;
461
		bool load(ibinaryfilestream& is);
-
 
462
};
-
 
463
 
-
 
464
#include "geometry_bob.h"
-
 
465
 
-
 
466
class bob_vertex : public vertex
-
 
467
{
-
 
468
	public:
496
		typedef ext::list<int>::iterator iterator;
469
		typedef point2d<double> uv_coord;
-
 
470
 
497
		typedef ext::list<int>::const_iterator const_iterator;
471
		static const int FLAG_DEFAULT = 0x19;
498
		typedef ext::pair<int, int>  pair;
472
		static const int FLAG_UV = 2;
-
 
473
		static const int FLAG_WEIRD_STUFF = 4;
499
		
474
 
500
		short type;
475
	private:
-
 
476
 
-
 
477
	public:
501
		ext::list<int> values;
478
		short flags;
502
		bob_error_codes errorCode;
479
		bob_error_codes errorCode;
503
		
-
 
504
		int x;
480
		uv_coord textureCoords;
505
		int y;
481
		point2d<double> weirdCoords;
506
		int z;
482
		int sgbits;
507
		pair textureCoords;
483
		normal_vector normalVector;
508
		
-
 
509
		bob_dom_point() { errorCode=e_noError; }
484
		normal_vector tangentVector;
510
		
485
 
511
		bool load(bob_dom_ibinaryfilestream& is);
-
 
512
		
486
	public:
513
		bool toFile(bob_dom_obinaryfilestream& os);
487
		bob_vertex() { errorCode=e_noError; flags=0; }
514
		bool toFile(bob_dom_otextfilestream& os, int idx);
488
		bob_vertex(int x, int y, int z)
515
		
-
 
516
		bool operator ==(const bob_dom_point& right) const
489
			: vertex(x,y,z)
517
		{
490
		{
518
			return x==right.x && y==right.y && z==right.z;
491
			errorCode=e_noError;
-
 
492
			flags=0;
519
		}
493
		}
520
};
-
 
521
 
494
 
522
// must be included AFTER the bob_dom_point is defined
495
		bool hasTextureCoords() const { return (flags & FLAG_UV) > 0; }
-
 
496
 
-
 
497
		bool load(ibinaryfilestream& is);
-
 
498
 
-
 
499
		bool toFile(obinaryfilestream& os);
523
#include &quot;../x2bc_common/bob_point_map.h";
500
		bool toFile(otextfilestream&amp; os, int idx);
524
 
501
 
525
class bob_dom_points : public bob_dom_section
-
 
526
{
-
 
527
	public:
-
 
528
		static const int hdr_begin=BOB_SECTION_NAME_POINT_BEGIN;
-
 
529
		static const int hdr_end=BOB_SECTION_NAME_POINT_END;
-
 
530
		
-
 
531
		bob_point_map map;
-
 
532
		
-
 
533
		ext::simple_list<bob_dom_point*> new_points;
-
 
534
		typedef ext::simple_list<bob_dom_point*>::iterator PointIterator;
-
 
535
		
-
 
536
		bool load(bob_dom_ibinaryfilestream& is);
-
 
537
		
-
 
538
		bool toFile(bob_dom_obinaryfilestream& os);
-
 
539
		bool toFile(bob_dom_otextfilestream& os);
502
		void getBodCoords(int *coords)
540
		
-
 
541
		~bob_dom_points()
-
 
542
		{
503
		{
543
			for(PointIterator &;it=new_points.begin(); it!=new_points.end(); ++it){
504
			coords[0]=conversion::vertex_bob2bod(x);
544
				delete *it;
505
			coords[1]=conversion::vertex_bob2bod(y);
545
			}
506
			coords[2]=conversion::vertex_bob2bod(z);
546
		}
507
		}
547
};
508
};
548
 
509
 
549
class bob_x3uv
-
 
550
{
-
 
551
	public:
-
 
552
		int idx; // ??
-
 
553
		float values[6];
-
 
554
		
-
 
555
		bool load(bob_dom_ibinaryfilestream& is);
510
// must be included AFTER the bob_vertex is defined
556
		
511
 
557
		bool toFile(bob_dom_otextfilestream& os, int matIdx);
-
 
558
		bool toFile(bob_dom_obinaryfilestream&amp; os);
512
#include &quot;../x2bc_common/bob_point_map.h";
559
};
-
 
560
 
513
 
561
class bob_x3uv_list : public ext::array<bob_x3uv*>
514
class bob_vertices : public bob_section
562
{
515
{
563
	public:
516
	public:
-
 
517
		static const int HDR_BEGIN = BOB_SECTION_NAME_POINT_BEGIN;
-
 
518
		static const int HDR_END = BOB_SECTION_NAME_POINT_END;
-
 
519
 
-
 
520
		typedef ptr_list<ext::array<bob_vertex*> > VertexArray;
-
 
521
		typedef VertexArray::iterator VertexIterator;
-
 
522
 
-
 
523
	public:
564
		~bob_x3uv_list() 
524
		bob_point_map map;
-
 
525
		VertexArray new_vertices;
565
		{
526
 
-
 
527
	private:
-
 
528
		bool outputRaw(otextfilestream& os);
566
			for(iterator &it=begin(); it!=end(); ++it) {
529
		bool outputBOD(otextfilestream& os);
-
 
530
 
567
				delete *it;
531
	public:
-
 
532
		bool load(ibinaryfilestream& is);
-
 
533
 
-
 
534
		bool toFile(obinaryfilestream& os);
-
 
535
		bool toFile(otextfilestream& os, const Settings& settings);
568
			}
536
};
-
 
537
 
-
 
538
class bob_x3vertex_data_record
569
		}
539
{
-
 
540
	public:
-
 
541
		int pointIndex; // index of BOB point
-
 
542
		vector tangent;
-
 
543
		vector unk;
570
		
544
 
571
		bool load(bob_dom_ibinaryfilestream& is);
545
		bool load(ibinaryfilestream& is);
-
 
546
		bool toFile(obinaryfilestream& os);
572
		
547
};
-
 
548
 
-
 
549
class bob_x3vertex_data : public ptr_list<ext::array<bob_x3vertex_data_record*> >
-
 
550
{
-
 
551
	public:
573
		bool toFile(bob_dom_otextfilestream& os, int matIdx);
552
		bool load(ibinaryfilestream& is);
-
 
553
 
574
		bool toFile(bob_dom_obinaryfilestream& os);
554
		bool toFile(obinaryfilestream& os);
575
		
555
 
576
		iterator search(int faceIdx)
556
		iterator search(int pointIndex)
577
		{
557
		{
578
			int min=0, mid, res, max=(int)size() - 1;
558
			int min=0, mid, res, max=(int)size() - 1;
-
 
559
 
-
 
560
			if(max==-1) return end();
-
 
561
			do {
-
 
562
				mid=(max + min) / 2;
-
 
563
				res=pointIndex - at(mid)->pointIndex;
-
 
564
				if(res <= 0) max=mid - 1;
-
 
565
				if(res >= 0) min=mid + 1;
-
 
566
			}
-
 
567
			while(min <= (int)max);
-
 
568
			return pointIndex==at(mid)->pointIndex ? (m_first + mid) : end();
-
 
569
		}
579
		
570
		
-
 
571
		const_iterator search(int pointIndex) const
-
 
572
		{
-
 
573
			int min=0, mid, res, max=(int)size() - 1;
-
 
574
 
580
			if(max==-1) return end();
575
			if(max==-1) return end();
581
			do {
576
			do {
582
				mid=((int)max + min) / 2;
577
				mid=(max + min) / 2;
583
				res=faceIdx - at(mid)->idx;
578
				res=pointIndex - at(mid)->pointIndex;
584
				if(res <= 0) max=mid - 1;
579
				if(res <= 0) max=mid - 1;
585
				if(res >= 0) min=mid + 1;
580
				if(res >= 0) min=mid + 1;
586
			}
581
			}
587
			while(min <= (int)max);
582
			while(min <= (int)max);
588
			return faceIdx==at(mid)->idx ? (m_first + mid) : end();
583
			return pointIndex==at(mid)->pointIndex ? (m_first + mid) : end();
589
		}
584
		}
590
};
585
};
591
 
586
 
592
class bob_dom_face
587
class bob_face
593
{
588
{
594
	public:
589
	public:
595
		int values[4];
590
		int values[3];
-
 
591
		int flags;
596
		bob_error_codes errorCode;
592
		bob_error_codes errorCode;
597
	
593
 
598
		bob_dom_face() { errorCode=e_noError; }
594
		bob_face() { errorCode=e_noError; }
599
		bool load(bob_dom_ibinaryfilestream& is);
595
		bool load(ibinaryfilestream& is);
600
		
596
 
601
		bool toFile(bob_dom_obinaryfilestream& os);
597
		bool toFile(obinaryfilestream& os);
602
};
598
};
603
 
599
 
604
class bob_face_list : public ext::list&lt;bob_dom_face*>, public bob_with_errors
600
class bob_face_list : public ptr_list<ext::list&lt;bob_face*> >, public bob_with_errors
605
{
601
{
-
 
602
	private:
-
 
603
		bool saveVertexTangents(obinaryfilestream& os, const bob_vertices& vertices);
-
 
604
		
606
	public:
605
	public:
607
		int materialIndex;
606
		int materialIndex;
608
		bob_x3uv_list x3uvlist;
607
		bob_x3vertex_data x3vertexData;
609
 
608
 
610
		bob_face_list() { materialIndex=0; }
609
		bob_face_list() { materialIndex=0; }
611
		~bob_face_list() 
-
 
612
		{ 
-
 
613
			for(iterator &it=begin(); it!=end(); ++it) {
-
 
614
				delete *it;
-
 
615
			}
-
 
616
		}
-
 
617
		
-
 
618
		bool load(bob_dom_ibinaryfilestream& is, bool x3data);
-
 
619
		bool toFile(bob_dom_obinaryfilestream& os, bool x3data);
-
 
620
};
-
 
621
 
-
 
622
class bob_dom_part_x3vals
-
 
623
{
-
 
624
	private:
-
 
625
		int m_values[10];
-
 
626
		
610
		
-
 
611
		bool load(ibinaryfilestream& is, bool x3data);
-
 
612
		bool toFile(obinaryfilestream& os, const bob_vertices& vertices, bool x3data);
627
	public:
613
 
628
		bob_dom_part_x3vals() { memset(m_values, 0, sizeof(m_values)); }
614
		bool outputX3VertexDataRaw(otextfilestream& os);
629
		
615
		
-
 
616
		//bool computeAndOutputTangents(otextfilestream& os, const bob_point_map& pointMap);
-
 
617
};
-
 
618
 
-
 
619
class bob_part_collision_box
-
 
620
{
-
 
621
	public:
630
		bool load(bob_dom_ibinaryfilestream&amp; is);
622
		point3d<double&gt; sphereOffset;
-
 
623
		double sphereDiameter;
631
		bool toFile(bob_dom_otextfilestream&amp; os, bool bCommentItself);
624
		point3d&lt;double>; boxOffset;
632
		bool toFile(bob_dom_obinaryfilestream&amp; os);
625
		point3d<double&gt; boxSize;
-
 
626
 
-
 
627
	public:
-
 
628
		bob_part_collision_box() 
-
 
629
		{ 
-
 
630
			sphereDiameter = 0;
633
		
631
		}
-
 
632
 
-
 
633
		bool load(ibinaryfilestream& is);
634
		int&; operator [] (int idx) { return m_values[idx]; }
634
		bool toFile(otextfilestream&; os);
-
 
635
		bool toFile(obinaryfilestream& os);
635
};
636
};
636
 
637
 
637
class bob_dom_part : public bob_with_errors, public ext::list&lt;bob_face_list*>
638
class bob_part : public bob_with_errors, public ptr_list<ext::list&lt;bob_face_list*> >
638
{
639
{
639
	public:
640
	public:
640
		static const double multiplier;
-
 
641
		static const int x3flag=0x10000000;
641
		static const int FLAG_X3 = 0x10000000;
642
		
-
 
643
		int flags;
-
 
644
		
-
 
645
		bob_dom_part_x3vals values;
-
 
646
 
642
 
-
 
643
		static const int BOD_FLAG_UV = 8;
-
 
644
		static const int BOD_FLAG_SGBITS = 16;
-
 
645
 
-
 
646
		int flags;
-
 
647
		bob_part_collision_box collisionBox;
-
 
648
 
-
 
649
	private:
-
 
650
		bool outputX3VertexData(otextfilestream& os, const bob_point_map& pointMap);
-
 
651
		void outputExtraPtInfo(otextfilestream& os, const bob_vertex *points[]);
-
 
652
		void outputNormals(otextfilestream& os, const bob_vertex *points[]);
-
 
653
		bool outputRaw(otextfilestream& os, const bob_point_map& pointMap, int idx);
-
 
654
		bool outputBOD(otextfilestream& os, const Settings& settings, const bob_materials *materials, const bob_point_map& pointMap, int idx);
-
 
655
 
-
 
656
	public:
647
		bob_dom_part()	{ flags=0; }
657
		bob_part()	{ flags=0; }
648
		
658
 
649
		~bob_dom_part()
659
		size_t numFaces() const
650
		{
660
		{
-
 
661
			size_t count=0;
651
			for(iterator &it=begin(); it!=end(); ++it){
662
			for(const_iterator &it=begin(); it!=end(); ++it){
652
				delete *it;
663
				count+=it->size();
653
			}
664
			}
-
 
665
			return count;
654
		}
666
		}
655
		
667
 
656
		// find the appropriate face list based on material index
668
		// find the appropriate face list based on material index
657
		bob_face_list * operator[] (int matIdx)
669
		bob_face_list * operator[] (int matIdx)
658
		{
670
		{
659
			for(reverse_iterator &it=rbegin(); it!=rend(); ++it){
671
			for(reverse_iterator &it=rbegin(); it!=rend(); ++it){
660
				if(it->materialIndex==matIdx)
672
				if(it->materialIndex==matIdx)
661
					return *it;
673
					return *it;
662
			}
674
			}
663
			return NULL;
675
			return NULL;
664
		}
676
		}
665
		
677
 
666
		// find or create an appropriate face list based on material index
678
		// find or create an appropriate face list based on material index
667
		bob_face_list * facelist(int matIdx)
679
		bob_face_list * facelist(int matIdx)
668
		{
680
		{
669
			bob_face_list *p=(*this)[matIdx];
681
			bob_face_list *p=(*this)[matIdx];
670
			if(p==NULL){
682
			if(p==NULL){
671
				p=new bob_face_list();
683
				p=new bob_face_list();
672
				push_back(p);
684
				push_back(p);
673
				p->materialIndex=matIdx;
685
				p->materialIndex=matIdx;
674
			}
686
			}
675
			return p;
687
			return p;
676
		}
688
		}
677
		
689
 
678
		bool load(bob_dom_ibinaryfilestream& is);
690
		bool load(ibinaryfilestream& is);
679
		
691
 
680
		bool toFile(bob_dom_obinaryfilestream& os);
692
		bool toFile(obinaryfilestream& os, const bob_vertices& vertices);
681
		bool toFile(bob_dom_otextfilestream& os, const Settings *settings, const bob_dom_materials *materials, const bob_point_map *pointMap, int idx);
693
		bool toFile(otextfilestream& os, const Settings& settings, const bob_materials *materials, const bob_point_map& pointMap, int idx);
682
		
694
 
683
};
695
};
-
 
696
 
-
 
697
class bob_parts : public bob_section, public ext::list<bob_part*>
-
 
698
{
-
 
699
	public:
-
 
700
		static const int HDR_BEGIN = BOB_SECTION_NAME_PART_BEGIN;
-
 
701
		static const int HDR_END = BOB_SECTION_NAME_PART_END;
-
 
702
 
-
 
703
		bool load(ibinaryfilestream& is);
684
 
704
 
685
class bob_dom_parts : public bob_dom_section, public ext::list<bob_dom_part*>
-
 
686
{
-
 
687
	public:
-
 
688
		static const int hdr_begin=BOB_SECTION_NAME_PART_BEGIN;
-
 
689
		static const int hdr_end=BOB_SECTION_NAME_PART_END;
-
 
690
		
-
 
691
		bool load(bob_dom_ibinaryfilestream& is);
-
 
692
		
-
 
693
		bool toFile(bob_dom_obinaryfilestream& os);
705
		bool toFile(obinaryfilestream& os, const bob_vertices& vertices);
694
		bool toFile(bob_dom_otextfilestream& os, const Settings *settings, const bob_dom_materials *materials, const bob_point_map *pointMap);
706
		bool toFile(otextfilestream& os, const Settings& settings, const bob_materials *materials, const bob_point_map *pointMap);
695
		
707
 
696
		~bob_dom_parts()
708
		~bob_parts()
697
		{
709
		{
698
			for(iterator &it=begin(); it!=end(); ++it){
710
			for(iterator &it=begin(); it!=end(); ++it){
699
				delete *it;
711
				delete *it;
700
			}
712
			}
701
		}
713
		}
702
};
714
};
703
 
715
 
704
class bob_dom_body : public bob_with_errors
716
class bob_body : public bob_with_errors
705
{
717
{
706
	public:
718
	public:
707
		bob_dom_bones bones;
719
		bob_bones bones;
708
		bob_dom_points points;
720
		bob_vertices vertices;
709
		bob_dom_parts parts;
721
		bob_parts parts;
710
		bob_dom_weights weights;
722
		bob_weights weights;
711
		
723
 
712
		int bodySize;
724
		int bodySize;
713
		int bodyFlags;
725
		int bodyFlags;
714
		
-
 
715
		bob_dom_body() { bodySize=0; bodyFlags=0; }
-
 
716
		
-
 
717
		bool load(bob_dom_ibinaryfilestream& is);
-
 
718
		
-
 
719
		bool toFile(bob_dom_obinaryfilestream& os);
-
 
720
		bool toFile(bob_dom_otextfilestream& os, const Settings *settings, const bob_dom_materials *materials, int idx);
-
 
721
};
-
 
722
 
726
 
-
 
727
		bob_body() { bodySize=0; bodyFlags=0; }
-
 
728
 
-
 
729
		bool load(ibinaryfilestream& is);
-
 
730
 
-
 
731
		bool toFile(obinaryfilestream& os);
-
 
732
		bool toFile(otextfilestream& os, const Settings& settings, const bob_materials *materials, int idx);
-
 
733
};
-
 
734
 
723
class bob_dom_bodies : public bob_dom_section, public bob_dom_cantainer<bob_dom_body>
735
class bob_bodies : public bob_section, public bob_cantainer<bob_body>
724
{
736
{
725
	public:
737
	public:
726
		static const int hdr_begin=BOB_SECTION_NAME_BODY_BEGIN;
738
		static const int HDR_BEGIN = BOB_SECTION_NAME_BODY_BEGIN;
727
		static const int hdr_end=BOB_SECTION_NAME_BODY_END;
739
		static const int HDR_END = BOB_SECTION_NAME_BODY_END;
728
		
740
 
729
		bool load(bob_dom_ibinaryfilestream& is);
741
		bool load(ibinaryfilestream& is);
730
		
-
 
731
		bool toFile(bob_dom_obinaryfilestream& os);
-
 
732
		bool toFile(bob_dom_otextfilestream& os, const Settings *settings, const bob_dom_materials *materials);
-
 
733
};
-
 
734
 
742
 
-
 
743
		bool toFile(obinaryfilestream& os);
-
 
744
		bool toFile(otextfilestream& os, const Settings& settings, const bob_materials *materials);
-
 
745
};
-
 
746
 
735
class bob_dom_bob : public bob_dom_section
747
class bob_dom_bob : public bob_section
736
{
748
{
737
	private:
749
	private:
738
		const Settings *m_settings;
750
		const Settings *m_settings;
739
		
751
 
740
	public:
752
	public:
741
		typedef bob_dom_bodies::iterator BodyIterator;
753
		typedef bob_bodies::iterator BodyIterator;
742
		
754
 
743
		bob_dom_info info;
755
		bob_info info;
744
		bob_dom_materials materials;
756
		bob_materials materials;
745
		bob_dom_bodies bodies;
757
		bob_bodies bodies;
746
		
758
 
747
		static const int hdr_begin=BOB_SECTION_NAME_BOB_BEGIN;
759
		static const int HDR_BEGIN = BOB_SECTION_NAME_BOB_BEGIN;
748
		static const int hdr_end=BOB_SECTION_NAME_BOB_END;
760
		static const int HDR_END = BOB_SECTION_NAME_BOB_END;
749
		
761
 
750
		bob_dom_bob(const Settings *settings) { m_settings=settings; }
762
		bob_dom_bob(const Settings *settings) { m_settings=settings; }
751
		
763
 
752
		bool toFile(bob_dom_obinaryfilestream& os);
764
		bool toFile(obinaryfilestream& os);
753
		bool toFile(bob_dom_otextfilestream& os);
765
		bool toFile(otextfilestream& os);
754
		
766
 
755
		bool load(bob_dom_ibinaryfilestream& is);
767
		bool load(ibinaryfilestream& is);
756
		bool load(unsigned char *data, size_t size);
-
 
-
 
768
 
757
};
769
};
758
 
770
 
759
inline
-
 
760
bob_dom_otextfilestream& operator <<(bob_dom_otextfilestream& os, bob_dom_bob& right)
-
 
761
{
-
 
762
	right.toFile(os);
-
 
763
	return os;
-
 
764
}
-
 
765
 
-
 
766
#endif // !defined(BOB_DOM_BOB_INCLUDED)
771
#endif // !defined(BOB_BOB_INCLUDED)