~ubuntu-branches/debian/sid/ember/sid

« back to all changes in this revision

Viewing changes to src/components/ogre/environment/meshtree/TParameters.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2009-07-23 07:46:40 UTC
  • Revision ID: james.westby@ubuntu.com-20090723074640-wh0ukzis0kda36qv
Tags: upstream-0.5.6
ImportĀ upstreamĀ versionĀ 0.5.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "TParameters.h"
 
2
 
 
3
//---------------------------------------------------------------------------
 
4
 
 
5
/*
 
6
   Based "The Creation and Rendering of Realistic Trees" article by Jason Weber and Joseph Penn
 
7
   Based on a port of Delphi code from TReal project by Ton van den Heuvel
 
8
   For further information go see:
 
9
   http://members.chello.nl/~l.vandenheuvel2/TReal/
 
10
   Copyright (c) 2002-2003, Ton van den Heuvel
 
11
   Copyright (c) 2004, Nicolas Chauvin
 
12
 
 
13
   ==================================
 
14
   Tree generation classes for Ogre3D
 
15
   ==================================
 
16
 
 
17
*/
 
18
 
 
19
namespace Ogre {
 
20
 
 
21
 
 
22
//===========================================================================
 
23
// Class TParameters
 
24
//===========================================================================
 
25
 
 
26
TParameters::TParameters(uchar u8Levels)
 
27
{
 
28
 
 
29
  mu8Levels = u8Levels;
 
30
 
 
31
  // The array length of the Stem parameters is equal to u8Levels. So, the total
 
32
  // length of the stem parameter arrays is u8Levels - 1, because the last level
 
33
  // of recursion is reserved for the leaves.
 
34
 
 
35
  mafNDownAngle = new Real[u8Levels];
 
36
  mafNDownAngleV = new Real[u8Levels];
 
37
  mafNRotate = new Real[u8Levels];
 
38
  mafNRotateV = new Real[u8Levels];
 
39
  mafNLength = new Real[u8Levels];
 
40
  mafNLengthV = new Real[u8Levels];
 
41
  mafNTaper = new Real[u8Levels];
 
42
  maiNBranches = new int[u8Levels];
 
43
  mafNSegSplits = new Real[u8Levels];
 
44
  mafNSplitAngle = new Real[u8Levels];
 
45
  mafNSplitAngleV = new Real[u8Levels];
 
46
  maiNCurveRes = new int[u8Levels];
 
47
  mafNCurve = new Real[u8Levels];
 
48
  mafNCurveBack = new Real[u8Levels];
 
49
  mafNCurveV = new Real[u8Levels];
 
50
  maiNVertices = new int[u8Levels];
 
51
 
 
52
  mu8LeafAlpha = 0xFF;
 
53
}
 
54
 
 
55
//---------------------------------------------------------------------------
 
56
 
 
57
TParameters::~TParameters()
 
58
{
 
59
  delete []mafNDownAngle;
 
60
  delete []mafNDownAngleV;
 
61
  delete []mafNRotate;
 
62
  delete []mafNRotateV;
 
63
  delete []mafNLength;
 
64
  delete []mafNLengthV;
 
65
  delete []mafNTaper;
 
66
  delete []maiNBranches;
 
67
  delete []mafNSegSplits;
 
68
  delete []mafNSplitAngle;
 
69
  delete []mafNSplitAngleV;
 
70
  delete []maiNCurveRes;
 
71
  delete []mafNCurve;
 
72
  delete []mafNCurveBack;
 
73
  delete []mafNCurveV;
 
74
  delete []maiNVertices;
 
75
}
 
76
 
 
77
//---------------------------------------------------------------------------
 
78
 
 
79
void TParameters::Set(TreeType eType)
 
80
{
 
81
  mTreeType = eType;
 
82
 
 
83
  switch(eType)
 
84
  { 
 
85
    case Simple:
 
86
      SetLevels(3);
 
87
      SetShape(4); 
 
88
      SetBaseSize(0.3);
 
89
      SetScale(10.0);
 
90
      SetScaleV(0.0);
 
91
      SetZScale(1.0);
 
92
      SetZScaleV(0.0);
 
93
      SetRatio(0.015);
 
94
      SetRatioPower(1.2);
 
95
      SetLobes(0);
 
96
      SetLobeDepth(0.0);
 
97
      SetFlare(0.0);
 
98
      SetLeaves(0);
 
99
      SetLeafShape(0);
 
100
      SetLeafScale(1.0);
 
101
      SetLeafScaleX(1.0);
 
102
      SetLeafQuality(0.0);
 
103
      SetAttractionUp(0.0);
 
104
      SetScale0(1.0);
 
105
      SetScaleV0(0.0);
 
106
 
 
107
      SetnLength(0, 1.0);
 
108
      SetnLengthV(0, 0.0);
 
109
      SetnTaper(0, 1.8);        
 
110
      SetnSegSplits(0, 0.0);
 
111
      SetnSplitAngle(0, 0.0);
 
112
      SetnSplitAngleV(0, 0.0);
 
113
      SetnVertices(0, 6);
 
114
      SetnCurveRes(0, 4);
 
115
      SetnCurve(0, 0.0);
 
116
      SetnCurveV(0, 0.0);
 
117
      SetnCurveBack(0, 0.0);
 
118
     
 
119
      SetnBranches(1, 4);
 
120
      SetnVertices(1, 4);
 
121
      SetnLength(1, 0.4);
 
122
      SetnLengthV(1, 0.0);
 
123
      SetnTaper(1, 1.8);        
 
124
      SetnDownAngle(1, 45.0);
 
125
      SetnDownAngleV(1, 0.0);
 
126
      SetnRotate(1, 90.0);
 
127
      SetnRotateV(1, 0.0);
 
128
      SetnSegSplits(1, 0.0);
 
129
      SetnSplitAngle(1, 0.0);
 
130
      SetnSplitAngleV(1, 0.0);
 
131
      SetnCurveRes(1, 4);
 
132
      SetnCurve(1, 60.0);
 
133
      SetnCurveV(1, 0.0);
 
134
      SetnCurveBack(1, 0.0);
 
135
 
 
136
      SetnBranches(2, 6);
 
137
      SetnVertices(2, 4);
 
138
      SetnLength(2, 1.0);
 
139
      SetnLengthV(2, 0.0);
 
140
      SetnTaper(2, 1.3);        
 
141
      SetnDownAngle(2, 20.0);
 
142
      SetnDownAngleV(2, 0.0);
 
143
      SetnRotate(2, 120.0);
 
144
      SetnRotateV(2, 0.0);
 
145
      SetnSegSplits(2, 0.0);
 
146
      SetnSplitAngle(2, 0.0);
 
147
      SetnSplitAngleV(2, 0.0);
 
148
      SetnCurveRes(2, 3);
 
149
      SetnCurve(2, 90.0);
 
150
      SetnCurveV(2, 0.0);
 
151
      SetnCurveBack(2, 0.0);
 
152
    break;
 
153
 
 
154
    case Black_Tupelo:
 
155
      SetLevels(4);
 
156
      SetShape(4); 
 
157
      SetBaseSize(0.2);
 
158
      SetScale(23.0);
 
159
      SetScaleV(5.0);
 
160
      SetZScale(1.0);
 
161
      SetZScaleV(0.0);
 
162
      SetRatio(0.015);
 
163
      SetRatioPower(1.3);
 
164
      SetLobes(3);
 
165
      SetLobeDepth(0.1);
 
166
      SetFlare(1.0);
 
167
      SetLeaves(6);
 
168
      SetLeafShape(0);
 
169
      SetLeafScale(0.3);
 
170
      SetLeafScaleX(0.5);
 
171
      SetLeafQuality(1.25);
 
172
      SetAttractionUp(0.5);
 
173
      SetScale0(1.0);
 
174
      SetScaleV0(0.0);
 
175
 
 
176
      SetnLength(0, 1.0);
 
177
      SetnLengthV(0, 0.0);
 
178
      SetnTaper(0, 1.1);        
 
179
      SetnSegSplits(0, 0.0);
 
180
      SetnSplitAngle(0, 0.0);
 
181
      SetnSplitAngleV(0, 0.0);
 
182
      SetnVertices(0, 24);
 
183
      SetnCurveRes(0, 10);
 
184
      SetnCurve(0, 0.0);
 
185
      SetnCurveV(0, 40.0);
 
186
      SetnCurveBack(0, 0.0);
 
187
   
 
188
      SetnBranches(1, 50);
 
189
      SetnVertices(1, 6);
 
190
      SetnLength(1, 0.3);
 
191
      SetnLengthV(1, 0.05);
 
192
      SetnTaper(1, 1.0);        
 
193
      SetnDownAngle(1, 60.0);
 
194
      SetnDownAngleV(1, -40.0);
 
195
      SetnRotate(1, 140.0);
 
196
      SetnRotateV(1, 0.0);
 
197
      SetnSegSplits(1, 0.0);
 
198
      SetnSplitAngle(1, 0.0);
 
199
      SetnSplitAngleV(1, 0.0);
 
200
      SetnCurveRes(1, 10);
 
201
      SetnCurve(1, 0.0);
 
202
      SetnCurveV(1, 90.0);
 
203
      SetnCurveBack(1, 0.0); 
 
204
    
 
205
      SetnBranches(2, 25);
 
206
      SetnVertices(2, 6);
 
207
      SetnLength(2, 0.6);
 
208
      SetnLengthV(2, 0.1);
 
209
      SetnTaper(2, 1.0);        
 
210
      SetnDownAngle(2, 30.0);
 
211
      SetnDownAngleV(2, 10.0);
 
212
      SetnRotate(2, 140.0);
 
213
      SetnRotateV(2, 0.0);
 
214
      SetnSegSplits(2, 0.0);
 
215
      SetnSplitAngle(2, 0.0);
 
216
      SetnSplitAngleV(2, 0.0);
 
217
      SetnCurveRes(2, 10);
 
218
      SetnCurve(2, 10.0);
 
219
      SetnCurveV(2, 150.0);
 
220
      SetnCurveBack(2, 0.0); 
 
221
    
 
222
      SetnBranches(3, 12);
 
223
      SetnVertices(3, 3);
 
224
      SetnLength(3, 0.4);
 
225
      SetnLengthV(3, 0.0);
 
226
      SetnTaper(3, 1.0);        
 
227
      SetnDownAngle(3, 45.0);
 
228
      SetnDownAngleV(3, 10.0);
 
229
      SetnRotate(3, 140.0);
 
230
      SetnRotateV(3, 0.0);
 
231
      SetnSegSplits(3, 0.0);
 
232
      SetnSplitAngle(3, 0.0);
 
233
      SetnSplitAngleV(3, 0.0);
 
234
      SetnCurveRes(3, 1);
 
235
      SetnCurve(3, 0.0);
 
236
      SetnCurveV(3, 0.0);
 
237
      SetnCurveBack(3, 0.0); 
 
238
          break;
 
239
 
 
240
        case Weeping_Willow:
 
241
          SetLevels(4);
 
242
      SetShape(3); 
 
243
      SetBaseSize(0.05);
 
244
      SetScale(15.0);
 
245
      SetScaleV(5.0);
 
246
      SetZScale(1.0);
 
247
      SetZScaleV(0.0);
 
248
      SetRatio(0.03);
 
249
      SetRatioPower(2.0);
 
250
      SetLobes(9);
 
251
      SetLobeDepth(0.03);
 
252
      SetFlare(0.75);
 
253
      SetLeaves(10);
 
254
      SetLeafShape(0);
 
255
      SetLeafScale(0.2);
 
256
      SetLeafScaleX(0.2);
 
257
      SetLeafQuality(1.0);
 
258
      SetAttractionUp(-2.0);
 
259
      SetScale0(1.0);
 
260
      SetScaleV0(0.0);
 
261
 
 
262
      SetnLength(0, 0.8);
 
263
      SetnLengthV(0, 0.0);
 
264
      SetnTaper(0, 1.0);        
 
265
      SetnSegSplits(0, 0.1);
 
266
      SetnSplitAngle(0, 3.0);
 
267
      SetnSplitAngleV(0, 0.0);
 
268
      SetnVertices(0, 24);
 
269
      SetnCurveRes(0, 8);
 
270
      SetnCurve(0, 0.0);
 
271
      SetnCurveV(0, 120.0);
 
272
      SetnCurveBack(0, 20.0);
 
273
   
 
274
      SetnBranches(1, 25);
 
275
      SetnVertices(1, 6);
 
276
      SetnLength(1, 0.5);
 
277
      SetnLengthV(1, 0.1);
 
278
      SetnTaper(1, 1.0);        
 
279
      SetnDownAngle(1, 20.0);
 
280
      SetnDownAngleV(1, 10.0);
 
281
      SetnRotate(1, -120.0);
 
282
      SetnRotateV(1, 30.0);
 
283
      SetnSegSplits(1, 0.2);
 
284
      SetnSplitAngle(1, 30.0);
 
285
      SetnSplitAngleV(1, 10.0);
 
286
      SetnCurveRes(1, 16);
 
287
      SetnCurve(1, 40.0);
 
288
      SetnCurveV(1, 90.0);
 
289
      SetnCurveBack(1, 80.0); 
 
290
    
 
291
      SetnBranches(2, 10);
 
292
      SetnVertices(2, 6);
 
293
      SetnLength(2, 1.5);
 
294
      SetnLengthV(2, 0.0);
 
295
      SetnTaper(2, 1.0);        
 
296
      SetnDownAngle(2, 30.0);
 
297
      SetnDownAngleV(2, 10.0);
 
298
      SetnRotate(2, -120.0);
 
299
      SetnRotateV(2, 30.0);
 
300
      SetnSegSplits(2, 0.2);
 
301
      SetnSplitAngle(2, 45.0);
 
302
      SetnSplitAngleV(2, 20.0);
 
303
      SetnCurveRes(2, 12);
 
304
      SetnCurve(2, 0.0);
 
305
      SetnCurveV(2, 0.0);
 
306
      SetnCurveBack(2, 0.0); 
 
307
    
 
308
      SetnBranches(3, 100);
 
309
      SetnVertices(3, 3);
 
310
      SetnLength(3, 0.1);
 
311
      SetnLengthV(3, 0.0);
 
312
      SetnTaper(3, 1.0);        
 
313
      SetnDownAngle(3, 20.0);
 
314
      SetnDownAngleV(3, 10.0);
 
315
      SetnRotate(3, 140.0);
 
316
      SetnRotateV(3, 0.0);
 
317
      SetnSegSplits(3, 0.0);
 
318
      SetnSplitAngle(3, 0.0);
 
319
      SetnSplitAngleV(3, 0.0);
 
320
      SetnCurveRes(3, 1);
 
321
      SetnCurve(3, 0.0);
 
322
      SetnCurveV(3, 0.0);
 
323
      SetnCurveBack(3, 0.0); 
 
324
          break;
 
325
 
 
326
        case Lombardy_Poplar:
 
327
          SetLevels(3);
 
328
      SetShape(2); 
 
329
      SetBaseSize(0.0);
 
330
      SetScale(25.0);
 
331
      SetScaleV(5.0);
 
332
      SetZScale(1.0);
 
333
      SetZScaleV(0.0);
 
334
      SetRatio(0.015);
 
335
      SetRatioPower(1.3);
 
336
      SetLobes(7);
 
337
      SetLobeDepth(0.05);
 
338
      SetFlare(0.8);
 
339
      SetLeaves(25);
 
340
      SetLeafShape(0);
 
341
      SetLeafScale(0.25);
 
342
      SetLeafScaleX(1.0);
 
343
      SetLeafQuality(1.0);
 
344
      SetAttractionUp(0.5);
 
345
      SetScale0(0.8);
 
346
      SetScaleV0(0.0);
 
347
 
 
348
      SetnLength(0, 1.0);
 
349
      SetnLengthV(0, 0.0);
 
350
      SetnTaper(0, 1.0);        
 
351
      SetnSegSplits(0, 0.0);
 
352
      SetnSplitAngle(0, 0.0);
 
353
      SetnSplitAngleV(0, 0.0);
 
354
      SetnVertices(0, 24);
 
355
      SetnCurveRes(0, 1);
 
356
      SetnCurve(0, 0.0);
 
357
      SetnCurveV(0, 15.0);
 
358
      SetnCurveBack(0, 0.0);
 
359
   
 
360
      SetnBranches(1, 40);
 
361
      SetnVertices(1, 6);
 
362
      SetnLength(1, 0.3);
 
363
      SetnLengthV(1, 0.0);
 
364
      SetnTaper(1, 1.0);        
 
365
      SetnDownAngle(1, 30.0);
 
366
      SetnDownAngleV(1, 0.0);
 
367
      SetnRotate(1, 77.0);
 
368
      SetnRotateV(1, 0.0);
 
369
      SetnSegSplits(1, 0.0);
 
370
      SetnSplitAngle(1, 0.0);
 
371
      SetnSplitAngleV(1, 0.0);
 
372
      SetnCurveRes(1, 3);
 
373
      SetnCurve(1, -20.0);
 
374
      SetnCurveV(1, 0.0);
 
375
      SetnCurveBack(1, 0.0); 
 
376
    
 
377
      SetnBranches(2, 30);
 
378
      SetnVertices(2, 4);
 
379
      SetnLength(2, 0.4);
 
380
      SetnLengthV(2, 0.0);
 
381
      SetnTaper(2, 1.0);        
 
382
      SetnDownAngle(2, 30.0);
 
383
      SetnDownAngleV(2, 10.0);
 
384
      SetnRotate(2, 77.0);
 
385
      SetnRotateV(2, 0.0);
 
386
      SetnSegSplits(2, 0.0);
 
387
      SetnSplitAngle(2, 0.0);
 
388
      SetnSplitAngleV(2, 0.0);
 
389
      SetnCurveRes(2, 3);
 
390
      SetnCurve(2, -20.0);
 
391
      SetnCurveV(2, 40.0);
 
392
      SetnCurveBack(2, 0.0); 
 
393
          break;
 
394
 
 
395
        case Palm:
 
396
      SetLevels(2);
 
397
      SetShape(4); 
 
398
      SetBaseSize(0.95);
 
399
      SetScale(12.0);
 
400
      SetScaleV(10.0);
 
401
      SetZScale(1.0);
 
402
      SetZScaleV(0.0);
 
403
      SetRatio(0.015);
 
404
      SetRatioPower(2.0);
 
405
      SetLobes(0);
 
406
      SetLobeDepth(0.0);
 
407
      SetFlare(0.0);
 
408
      SetLeaves(250);
 
409
      SetLeafShape(0);
 
410
      SetLeafScale(0.6);
 
411
      SetLeafScaleX(0.06);
 
412
      SetLeafQuality(1.0);
 
413
      SetAttractionUp(0.0);
 
414
      SetScale0(1.0);
 
415
      SetScaleV0(0.0);
 
416
 
 
417
      SetnLength(0, 1.0);
 
418
      SetnLengthV(0, 0.0);
 
419
      SetnTaper(0, 2.1);        
 
420
      SetnSegSplits(0, 0.0);
 
421
      SetnSplitAngle(0, 0.0);
 
422
      SetnSplitAngleV(0, 0.0);
 
423
      SetnVertices(0, 16);
 
424
      SetnCurveRes(0, 60);
 
425
      SetnCurve(0, 20.0);
 
426
      SetnCurveV(0, 10.0);
 
427
      SetnCurveBack(0, -5.0);
 
428
 
 
429
      SetnBranches(1, 33);
 
430
      SetnVertices(1, 8);
 
431
      SetnLength(1, 0.4);
 
432
      SetnLengthV(1, 0.05);
 
433
      SetnTaper(1, 1.0);        
 
434
      SetnDownAngle(1, 70.0);
 
435
      SetnDownAngleV(1, -80.0);
 
436
      SetnRotate(1, 120.0);
 
437
      SetnRotateV(1, 60.0);
 
438
      SetnSegSplits(1, 0.0);
 
439
      SetnSplitAngle(1, 0.0);
 
440
      SetnSplitAngleV(1, 0.0);
 
441
      SetnCurveRes(1, 9);
 
442
      SetnCurve(1, 50.0);
 
443
      SetnCurveV(1, 20.0);
 
444
      SetnCurveBack(1, 0.0); 
 
445
          break;
 
446
 
 
447
        case European_Larch:
 
448
      SetLevels(3);
 
449
      SetShape(0); 
 
450
      SetBaseSize(0.25);
 
451
      SetScale(15.0);
 
452
      SetScaleV(7.0);
 
453
      SetZScale(1.0);
 
454
      SetZScaleV(0.0);
 
455
      SetRatio(0.015);
 
456
      SetRatioPower(1.3);
 
457
      SetLobes(0);
 
458
      SetLobeDepth(0.0);
 
459
      SetFlare(0.3);
 
460
      SetLeaves(100);
 
461
      SetLeafShape(0);
 
462
      SetLeafScale(0.15  /*0.03*/);
 
463
      SetLeafScaleX(0.2);
 
464
      SetLeafQuality(0.5);
 
465
      SetAttractionUp(-2.0);
 
466
      SetScale0(1.0);
 
467
      SetScaleV0(0.0);
 
468
 
 
469
      SetnLength(0, 1.0);
 
470
      SetnLengthV(0, 0.0);
 
471
      SetnTaper(0, 1.0);            
 
472
      SetnSegSplits(0, 0.0);
 
473
      SetnSplitAngle(0, 0.0);
 
474
      SetnSplitAngleV(0, 0.0);
 
475
      SetnVertices(0, 24);
 
476
      SetnCurveRes(0, 20);
 
477
      SetnCurve(0, 0.0);
 
478
      SetnCurveV(0, 20.0);
 
479
      SetnCurveBack(0, 0.0);
 
480
   
 
481
      SetnBranches(1, 60);
 
482
      SetnVertices(1, 6);
 
483
      SetnLength(1, 0.25);
 
484
      SetnLengthV(1, 0.15);
 
485
      SetnTaper(1, 1.0);            
 
486
      SetnDownAngle(1, 60.0);
 
487
      SetnDownAngleV(1, -50.0);
 
488
      SetnRotate(1, 70.0);
 
489
      SetnRotateV(1, 30.0);
 
490
      SetnSegSplits(1, 0.0);
 
491
      SetnSplitAngle(1, 0.0);
 
492
      SetnSplitAngleV(1, 0.0);
 
493
      SetnCurveRes(1, 17);
 
494
      SetnCurve(1, 20.0);
 
495
      SetnCurveV(1, 120.0);
 
496
      SetnCurveBack(1, /*-100.0*/ -20.0); 
 
497
      
 
498
      SetnBranches(2, 50);
 
499
      SetnVertices(2, 4);
 
500
      SetnLength(2, 0.3);
 
501
      SetnLengthV(2, 0.1);
 
502
      SetnTaper(2, 1.0);            
 
503
      SetnDownAngle(2, 70.0);
 
504
      SetnDownAngleV(2, 30.0);
 
505
      SetnRotate(2, 70.0);
 
506
      SetnRotateV(2, 30.0);
 
507
      SetnSegSplits(2, 0.15);
 
508
      SetnSplitAngle(2, 40.0);
 
509
      SetnSplitAngleV(2, 10.0);
 
510
      SetnCurveRes(2, 7);
 
511
      SetnCurve(2, 0.0);
 
512
      SetnCurveV(2, 0.0);
 
513
      break;
 
514
 
 
515
        case Quaking_Aspen:
 
516
        default:
 
517
      SetLevels(3);
 
518
      SetShape(7);
 
519
      SetBaseSize(0.3);
 
520
      SetScale(13);
 
521
      SetScaleV(3);
 
522
      SetZScale(1);
 
523
      SetZScaleV(0);
 
524
      SetRatio(0.015);
 
525
      SetRatioPower(1.2);
 
526
      SetLobes(5);
 
527
      SetLobeDepth(0.07);
 
528
      SetFlare(0.6);
 
529
 
 
530
      SetScale0(1);
 
531
      SetScaleV0(0);
 
532
      SetnBranches(0, 1);
 
533
      SetnVertices(0, 6);
 
534
      SetnLength(0, 1);
 
535
      SetnLengthV(0, 0);
 
536
      SetnTaper(0, 1);
 
537
      SetnSegSplits(0, 0);
 
538
      SetnSplitAngle(0, 0);
 
539
      SetnSplitAngleV(0, 0);
 
540
      SetnCurveRes(0, 3);
 
541
      SetnCurve(0, 0);
 
542
      SetnCurveBack(0, 0);
 
543
      SetnCurveV(0, 20);
 
544
 
 
545
      SetnBranches(1, 50);
 
546
      SetnVertices(1, 6);
 
547
      SetnDownAngle(1, 60);
 
548
      SetnDownAngleV(1, -50);
 
549
      SetnRotate(1, 140);
 
550
      SetnRotateV(1, 0);
 
551
      SetnLength(1, 0.3);
 
552
      SetnLengthV(1, 0);
 
553
      SetnTaper(1, 1);
 
554
      SetnSegSplits(1, 0);
 
555
      SetnSplitAngle(1, 0);
 
556
      SetnSplitAngleV(1, 0);
 
557
      SetnCurveRes(1, 5);
 
558
      SetnCurve(1, -40);
 
559
      SetnCurveBack(1, 0);
 
560
      SetnCurveV(1, 50);
 
561
 
 
562
      SetnBranches(2, 35);
 
563
      SetnVertices(2, 4);
 
564
      SetnDownAngle(2, 45);
 
565
      SetnDownAngleV(2, 10);
 
566
      SetnRotate(2, 140);
 
567
      SetnRotateV(2, 0);
 
568
      SetnLength(2, 0.6);
 
569
      SetnLengthV(2, 0);
 
570
      SetnTaper(2, 1);
 
571
      SetnSegSplits(2, 0);
 
572
      SetnSplitAngle(2, 0);
 
573
      SetnSplitAngleV(2, 0);
 
574
      SetnCurveRes(2, 3);
 
575
      SetnCurve(2, -40);
 
576
      SetnCurveBack(2, 0);
 
577
      SetnCurveV(2, 75);
 
578
 
 
579
      SetLeaves(25);
 
580
      SetLeafQuality(1.0);
 
581
      // SetLeafShape(0);  // not implemented yet
 
582
      SetLeafScale(0.25);
 
583
      SetLeafScaleX(1);
 
584
      SetAttractionUp(0.5);
 
585
      SetPruneRatio(0);
 
586
      // SetPruneWidth(0.5);      // not implemented yet
 
587
      // SetPruneWidthPeak(0.5);  // not implemented yet
 
588
      // SetPrunePowerLow(0.5);   // not implemented yet
 
589
      // SetPrunePowerHigh(0.5);  // not implemented yet
 
590
          break;
 
591
          
 
592
        case Fir:
 
593
          SetZScale(1);
 
594
      SetZScaleV(0);
 
595
      
 
596
          SetShape(0);
 
597
      SetLevels(3);
 
598
      SetScale(2);
 
599
      SetScaleV(1);
 
600
      SetBaseSize(0.1);
 
601
      SetRatio(0.012);
 
602
      SetRatioPower(1.0);
 
603
      SetFlare(0.2);
 
604
      SetLobes(0);
 
605
      SetLobeDepth(0.0);
 
606
      SetLeaves(70);
 
607
          SetLeafShape(0);
 
608
      SetLeafScale(0.03  /*0.03*/);
 
609
      SetLeafScaleX(0.03);
 
610
      SetLeafQuality(1.0);
 
611
      SetAttractionUp(0.5);
 
612
      SetPruneRatio(0);
 
613
      SetPrunePowerLow(0.5);   // not implemented yet
 
614
      SetPrunePowerHigh(0.5);  // not implemented yet
 
615
          SetPruneWidth(0.5);      // not used yet !!!!
 
616
      SetPruneWidthPeak(0.5);  // not used yet !!!!
 
617
      SetScale0(1.0);
 
618
      SetScaleV0(0.0);
 
619
      SetBaseSplits(0);
 
620
 
 
621
      SetnDownAngle(0, 0);
 
622
      SetnDownAngleV(0, 0);
 
623
      SetnRotate(0, 0);
 
624
      SetnRotateV(0, 0);
 
625
      SetnBranches(0, 1);
 
626
      SetnVertices(0, 4);
 
627
      SetnLength(0, 1);
 
628
      SetnLengthV(0, 0);
 
629
      SetnTaper(0, 1);
 
630
      SetnSegSplits(0, 0);
 
631
      SetnSplitAngle(0, 0);
 
632
      SetnSplitAngleV(0, 0);
 
633
      SetnCurveRes(0, 7);
 
634
      SetnCurve(0, 0);
 
635
      SetnCurveBack(0, 0);
 
636
      SetnCurveV(0, 20);
 
637
          
 
638
      SetnDownAngle(1, 70);
 
639
      SetnDownAngleV(1, -20);
 
640
      SetnRotate(1, 60);
 
641
      SetnRotateV(1, 20);
 
642
      SetnBranches(1, 80);
 
643
      SetnVertices(1, 4);
 
644
      SetnLength(1, 0.25);
 
645
      SetnLengthV(1, 0.2);
 
646
      SetnTaper(1, 0.8);
 
647
      SetnSegSplits(1, 0);
 
648
      SetnSplitAngle(1, 0);
 
649
      SetnSplitAngleV(1, 0);
 
650
      SetnCurveRes(1, 5);
 
651
      SetnCurve(1, -20);
 
652
      SetnCurveBack(1, 0);
 
653
      SetnCurveV(1, 40);
 
654
 
 
655
      SetnDownAngle(2, 70);
 
656
      SetnDownAngleV(2, 20);
 
657
      SetnRotate(2, -90);
 
658
      SetnRotateV(2, 40);
 
659
      SetnBranches(2, 20);
 
660
      SetnVertices(2, 4);
 
661
      SetnLength(2, 0.4);
 
662
      SetnLengthV(2, 0.2);
 
663
      SetnTaper(2, 0.7);
 
664
      SetnSegSplits(2, 0.1);
 
665
      SetnSplitAngle(2, 70);
 
666
      SetnSplitAngleV(2, 20);
 
667
      SetnCurveRes(2, 3);
 
668
      SetnCurve(2, 0);
 
669
      SetnCurveBack(2, 0);
 
670
      SetnCurveV(2, 30);
 
671
                  
 
672
      SetnDownAngle(3, 45);
 
673
      SetnDownAngleV(3, 40);
 
674
      SetnRotate(3, 77);
 
675
      SetnRotateV(3, 0);
 
676
          break;
 
677
          
 
678
  }
 
679
}
 
680
//---------------------------------------------------------------------------
 
681
 
 
682
TParameters::TreeType TParameters::GetTreeType(void)
 
683
{
 
684
  return mTreeType;
 
685
}
 
686
//---------------------------------------------------------------------------
 
687
 
 
688
String TParameters::GetTreeTypeString(void)
 
689
{
 
690
  String sTreeName;
 
691
  switch (mTreeType)
 
692
  {
 
693
    case Simple:
 
694
      sTreeName = "Simple";
 
695
    break;
 
696
    case Quaking_Aspen:
 
697
      sTreeName = "Quaking Aspen";
 
698
    break;
 
699
    case Black_Tupelo:
 
700
      sTreeName = "Black Tupelo";
 
701
    break;
 
702
    case Weeping_Willow:
 
703
      sTreeName = "Weeping Willow";
 
704
    break;
 
705
    case Lombardy_Poplar:
 
706
      sTreeName = "Lombardy Poplar";
 
707
    break;
 
708
    case Palm:
 
709
      sTreeName = "Palm";
 
710
    break;
 
711
    case European_Larch:
 
712
      sTreeName = "European Larch";
 
713
    break;
 
714
    case Fir:
 
715
      sTreeName = "Fir";
 
716
    break;
 
717
  }
 
718
  
 
719
  return sTreeName;
 
720
}
 
721
//---------------------------------------------------------------------------
 
722
 
 
723
uchar TParameters::GetShape(void)
 
724
{
 
725
  return mu8Shape;
 
726
}
 
727
 
 
728
//---------------------------------------------------------------------------
 
729
 
 
730
Real TParameters::GetBaseSize(void)
 
731
{
 
732
  return mfBaseSize;
 
733
}
 
734
 
 
735
//---------------------------------------------------------------------------
 
736
 
 
737
uchar TParameters::GetBaseSplits(void)
 
738
{
 
739
  return mu8BaseSplits;
 
740
}
 
741
 
 
742
//---------------------------------------------------------------------------
 
743
 
 
744
Real TParameters::GetScale(void)
 
745
{
 
746
  return mfScale;
 
747
}
 
748
 
 
749
//---------------------------------------------------------------------------
 
750
 
 
751
Real TParameters::GetScaleV(void)
 
752
{
 
753
  return mfScaleV;
 
754
}
 
755
 
 
756
//---------------------------------------------------------------------------
 
757
 
 
758
Real TParameters::GetZScale(void)
 
759
{
 
760
  return mfZScale;
 
761
}
 
762
 
 
763
//---------------------------------------------------------------------------
 
764
 
 
765
Real TParameters::GetZScaleV(void)
 
766
{
 
767
  return mfZScaleV;
 
768
}
 
769
 
 
770
//---------------------------------------------------------------------------
 
771
 
 
772
Real TParameters::GetRatio(void)
 
773
{
 
774
  return mfRatio;
 
775
}
 
776
 
 
777
//---------------------------------------------------------------------------
 
778
 
 
779
Real TParameters::GetRatioPower(void)
 
780
{
 
781
  return mfRatioPower;
 
782
}
 
783
 
 
784
//---------------------------------------------------------------------------
 
785
 
 
786
uchar TParameters::GetLobes(void)
 
787
{
 
788
  return mu8Lobes;
 
789
}
 
790
 
 
791
//---------------------------------------------------------------------------
 
792
 
 
793
Real TParameters::GetLobeDepth(void)
 
794
{
 
795
  return mfLobeDepth;
 
796
}
 
797
 
 
798
//---------------------------------------------------------------------------
 
799
 
 
800
Real TParameters::GetFlare(void)
 
801
{
 
802
  return mfFlare;
 
803
}
 
804
 
 
805
//---------------------------------------------------------------------------
 
806
 
 
807
int TParameters::GetLeaves(void)
 
808
{
 
809
  return miLeaves;
 
810
}
 
811
 
 
812
//---------------------------------------------------------------------------
 
813
 
 
814
TLeafShape TParameters::GetLeafShape(void)
 
815
{
 
816
  return mu8LeafShape;
 
817
}
 
818
 
 
819
//---------------------------------------------------------------------------
 
820
 
 
821
Real TParameters::GetLeafScale(void)
 
822
{
 
823
  return mfLeafScale;
 
824
}
 
825
 
 
826
//---------------------------------------------------------------------------
 
827
 
 
828
Real TParameters::GetLeafScaleX(void)
 
829
{
 
830
  return mfLeafScaleX;
 
831
}
 
832
 
 
833
//---------------------------------------------------------------------------
 
834
 
 
835
Real TParameters::GetLeafQuality(void)
 
836
{
 
837
  return mfLeafQuality;
 
838
}
 
839
 
 
840
//---------------------------------------------------------------------------
 
841
 
 
842
uint TParameters::GetLeafColor(void)
 
843
{
 
844
  return mu16LeafColor;
 
845
}
 
846
 
 
847
//---------------------------------------------------------------------------
 
848
 
 
849
bool TParameters::GetLeafColorVariation(void)
 
850
{
 
851
  return mbLeafColorVariation;
 
852
}
 
853
 
 
854
//---------------------------------------------------------------------------
 
855
 
 
856
uchar TParameters::GetLeafAlpha(void)
 
857
{
 
858
  return mu8LeafAlpha;
 
859
}
 
860
//---------------------------------------------------------------------------
 
861
 
 
862
Real TParameters::GetAttractionUp(void)
 
863
{
 
864
  return mfAttractionUp;
 
865
}
 
866
 
 
867
//---------------------------------------------------------------------------
 
868
 
 
869
Real TParameters::GetPruneRatio(void)
 
870
{
 
871
  return mfPruneRatio;
 
872
}
 
873
 
 
874
//---------------------------------------------------------------------------
 
875
 
 
876
Real TParameters::GetPruneWidth(void)
 
877
{
 
878
  return mfPruneWidth;
 
879
}
 
880
 
 
881
//---------------------------------------------------------------------------
 
882
 
 
883
Real TParameters::GetPruneWidthPeak(void)
 
884
{
 
885
  return mfPruneWidthPeak;
 
886
}
 
887
 
 
888
//---------------------------------------------------------------------------
 
889
 
 
890
Real TParameters::GetPrunePowerLow(void)
 
891
{
 
892
  return mfPrunePowerLow;
 
893
}
 
894
 
 
895
//---------------------------------------------------------------------------
 
896
 
 
897
Real TParameters::GetPrunePowerHigh(void)
 
898
{
 
899
  return mfPrunePowerHigh;
 
900
}
 
901
 
 
902
//---------------------------------------------------------------------------
 
903
 
 
904
Real TParameters::GetScale0(void)
 
905
{
 
906
  return mfScale0;
 
907
}
 
908
 
 
909
//---------------------------------------------------------------------------
 
910
 
 
911
Real TParameters::GetScaleV0(void)
 
912
{
 
913
  return mfScaleV0;
 
914
}
 
915
 
 
916
//---------------------------------------------------------------------------
 
917
 
 
918
 
 
919
Real TParameters::GetnDownAngle(uchar u8Index)
 
920
{
 
921
  return mafNDownAngle[u8Index];
 
922
}
 
923
 
 
924
//---------------------------------------------------------------------------
 
925
 
 
926
Real TParameters::GetnDownAngleV(uchar u8Index)
 
927
{
 
928
  return mafNDownAngleV[u8Index];
 
929
}
 
930
 
 
931
//---------------------------------------------------------------------------
 
932
 
 
933
Real TParameters::GetnRotate(uchar u8Index)
 
934
{
 
935
  return mafNRotate[u8Index];
 
936
}
 
937
 
 
938
//---------------------------------------------------------------------------
 
939
 
 
940
Real TParameters::GetnRotateV(uchar u8Index)
 
941
{
 
942
  return mafNRotateV[u8Index];
 
943
}
 
944
 
 
945
//---------------------------------------------------------------------------
 
946
 
 
947
Real TParameters::GetnLength(uchar u8Index)
 
948
{
 
949
  return mafNLength[u8Index];
 
950
}
 
951
 
 
952
//---------------------------------------------------------------------------
 
953
 
 
954
Real TParameters::GetnLengthV(uchar u8Index)
 
955
{
 
956
  return mafNLengthV[u8Index];
 
957
}
 
958
 
 
959
//---------------------------------------------------------------------------
 
960
 
 
961
Real TParameters::GetnTaper(uchar u8Index)
 
962
{
 
963
  return mafNTaper[u8Index];
 
964
}
 
965
 
 
966
//---------------------------------------------------------------------------
 
967
 
 
968
int TParameters::GetnBranches(uchar u8Index)
 
969
{
 
970
  return maiNBranches[u8Index];
 
971
}
 
972
 
 
973
//---------------------------------------------------------------------------
 
974
 
 
975
Real TParameters::GetnSegSplits(uchar u8Index)
 
976
{
 
977
  return mafNSegSplits[u8Index];
 
978
}
 
979
 
 
980
//---------------------------------------------------------------------------
 
981
 
 
982
Real TParameters::GetnSplitAngle(uchar u8Index)
 
983
{
 
984
  return mafNSplitAngle[u8Index];
 
985
}
 
986
 
 
987
//---------------------------------------------------------------------------
 
988
 
 
989
Real TParameters::GetnSplitAngleV(uchar u8Index)
 
990
{
 
991
  return mafNSplitAngleV[u8Index];
 
992
}
 
993
 
 
994
//---------------------------------------------------------------------------
 
995
 
 
996
int TParameters::GetnCurveRes(uchar u8Index)
 
997
{
 
998
  return maiNCurveRes[u8Index];
 
999
}
 
1000
 
 
1001
//---------------------------------------------------------------------------
 
1002
 
 
1003
Real TParameters::GetnCurve(uchar u8Index)
 
1004
{
 
1005
  return mafNCurve[u8Index];
 
1006
}
 
1007
 
 
1008
//---------------------------------------------------------------------------
 
1009
 
 
1010
Real TParameters::GetnCurveV(uchar u8Index)
 
1011
{
 
1012
  return mafNCurveV[u8Index];
 
1013
}
 
1014
 
 
1015
//---------------------------------------------------------------------------
 
1016
 
 
1017
Real TParameters::GetnCurveBack(uchar u8Index)
 
1018
{
 
1019
  return mafNCurveBack[u8Index];
 
1020
}
 
1021
 
 
1022
//---------------------------------------------------------------------------
 
1023
 
 
1024
int TParameters::GetnVertices(uchar u8Index)
 
1025
{
 
1026
  return maiNVertices[u8Index];
 
1027
}
 
1028
 
 
1029
//---------------------------------------------------------------------------
 
1030
 
 
1031
void TParameters::SetLevels(uchar u8Value)
 
1032
{
 
1033
  if (u8Value == mu8Levels)
 
1034
    return;
 
1035
 
 
1036
  uchar i;
 
1037
 
 
1038
  Real* afTempNDownAngle = mafNDownAngle;
 
1039
  Real* afTempNDownAngleV = mafNDownAngleV;
 
1040
  Real* afTempNRotate = mafNRotate;
 
1041
  Real* afTempNRotateV = mafNRotateV;
 
1042
  Real* afTempNLength = mafNLength;
 
1043
  Real* afTempNLengthV = mafNLengthV;
 
1044
  Real* afTempNTaper = mafNTaper;
 
1045
  int*  aiTempNBranches = maiNBranches;
 
1046
  Real* afTempNSegSplits = mafNSegSplits;
 
1047
  Real* afTempNSplitAngle = mafNSplitAngle;
 
1048
  Real* afTempNSplitAngleV = mafNSplitAngleV;
 
1049
  int*  aiTempNCurveRes = maiNCurveRes;
 
1050
  Real* afTempNCurve = mafNCurve;
 
1051
  Real* afTempNCurveBack = mafNCurveBack;
 
1052
  Real* afTempNCurveV = mafNCurveV;
 
1053
  int*  aiTempNVertices = maiNVertices; 
 
1054
 
 
1055
  mafNDownAngle = new Real[u8Value];
 
1056
  mafNDownAngleV = new Real[u8Value];
 
1057
  mafNRotate = new Real[u8Value];
 
1058
  mafNRotateV = new Real[u8Value];
 
1059
  mafNLength = new Real[u8Value];
 
1060
  mafNLengthV = new Real[u8Value];
 
1061
  mafNTaper = new Real[u8Value];
 
1062
  maiNBranches = new int[u8Value];
 
1063
  mafNSegSplits = new Real[u8Value];
 
1064
  mafNSplitAngle = new Real[u8Value];
 
1065
  mafNSplitAngleV = new Real[u8Value];
 
1066
  maiNCurveRes = new int[u8Value];
 
1067
  mafNCurve = new Real[u8Value];
 
1068
  mafNCurveBack = new Real[u8Value];
 
1069
  mafNCurveV = new Real[u8Value];
 
1070
  maiNVertices = new int[u8Value];
 
1071
 
 
1072
  if (u8Value > mu8Levels)
 
1073
  {
 
1074
    for (i=0; i<mu8Levels; i++)
 
1075
    {
 
1076
      mafNDownAngle[i] = afTempNDownAngle[i];
 
1077
      mafNDownAngleV[i] = afTempNDownAngleV[i];
 
1078
      mafNRotate[i] = afTempNRotate[i];
 
1079
      mafNRotateV[i] = afTempNRotateV[i];
 
1080
      mafNLength[i] = afTempNLength[i];
 
1081
      mafNLengthV[i] = afTempNLengthV[i];
 
1082
      mafNTaper[i] = afTempNTaper[i];
 
1083
      maiNBranches[i] = aiTempNBranches[i];
 
1084
      mafNSegSplits[i] = afTempNSegSplits[i];
 
1085
      mafNSplitAngle[i] = afTempNSplitAngle[i];
 
1086
      mafNSplitAngleV[i] = afTempNSplitAngleV[i];
 
1087
      maiNCurveRes[i] = aiTempNCurveRes[i];
 
1088
      mafNCurve[i] = afTempNCurve[i];
 
1089
      mafNCurveBack[i] = afTempNCurveBack[i];
 
1090
      mafNCurveV[i] = afTempNCurveV[i];
 
1091
      maiNVertices[i] = aiTempNVertices[i]; 
 
1092
    }
 
1093
    for (i=mu8Levels; i<u8Value; i++)
 
1094
    {
 
1095
      mafNDownAngle[i] = 0.0;
 
1096
      mafNDownAngleV[i] = 0.0;
 
1097
      mafNRotate[i] = 0.0;
 
1098
      mafNRotateV[i] = 0.0;
 
1099
      mafNLength[i] = 0.0;
 
1100
      mafNLengthV[i] = 0.0;
 
1101
      mafNTaper[i] = 0.0;
 
1102
      maiNBranches[i] = 0;
 
1103
      mafNSegSplits[i] = 0.0;
 
1104
      mafNSplitAngle[i] = 0.0;
 
1105
      mafNSplitAngleV[i] = 0.0;
 
1106
      maiNCurveRes[i] = 0;
 
1107
      mafNCurve[i] = 0.0;
 
1108
      mafNCurveBack[i] = 0.0;
 
1109
      mafNCurveV[i] = 0.0;
 
1110
      maiNVertices[i] = 0;
 
1111
    }
 
1112
  }
 
1113
  else
 
1114
  {
 
1115
    for (i=0; i<u8Value; i++)
 
1116
    {
 
1117
      mafNDownAngle[i] = afTempNDownAngle[i];
 
1118
      mafNDownAngleV[i] = afTempNDownAngleV[i];
 
1119
      mafNRotate[i] = afTempNRotate[i];
 
1120
      mafNRotateV[i] = afTempNRotateV[i];
 
1121
      mafNLength[i] = afTempNLength[i];
 
1122
      mafNLengthV[i] = afTempNLengthV[i];
 
1123
      mafNTaper[i] = afTempNTaper[i];
 
1124
      maiNBranches[i] = aiTempNBranches[i];
 
1125
      mafNSegSplits[i] = afTempNSegSplits[i];
 
1126
      mafNSplitAngle[i] = afTempNSplitAngle[i];
 
1127
      mafNSplitAngleV[i] = afTempNSplitAngleV[i];
 
1128
      maiNCurveRes[i] = aiTempNCurveRes[i];
 
1129
      mafNCurve[i] = afTempNCurve[i];
 
1130
      mafNCurveBack[i] = afTempNCurveBack[i];
 
1131
      mafNCurveV[i] = afTempNCurveV[i];
 
1132
      maiNVertices[i] = aiTempNVertices[i]; 
 
1133
    }
 
1134
  }
 
1135
 
 
1136
  mu8Levels = u8Value;
 
1137
 
 
1138
  delete[] afTempNDownAngle;
 
1139
  delete[] afTempNDownAngleV;
 
1140
  delete[] afTempNRotate;
 
1141
  delete[] afTempNRotateV;
 
1142
  delete[] afTempNLength;
 
1143
  delete[] afTempNLengthV;
 
1144
  delete[] afTempNTaper;
 
1145
  delete[] aiTempNBranches;
 
1146
  delete[] afTempNSegSplits;
 
1147
  delete[] afTempNSplitAngle;
 
1148
  delete[] afTempNSplitAngleV;
 
1149
  delete[] aiTempNCurveRes;
 
1150
  delete[] afTempNCurve;
 
1151
  delete[] afTempNCurveBack;
 
1152
  delete[] afTempNCurveV;
 
1153
  delete[] aiTempNVertices;
 
1154
}
 
1155
 
 
1156
//---------------------------------------------------------------------------
 
1157
 
 
1158
void TParameters::SetShape(uchar u8Value)
 
1159
{
 
1160
  mu8Shape = u8Value;
 
1161
}
 
1162
 
 
1163
//---------------------------------------------------------------------------
 
1164
 
 
1165
void TParameters::SetBaseSize(Real fValue)
 
1166
{
 
1167
  mfBaseSize = fValue;
 
1168
}
 
1169
 
 
1170
//---------------------------------------------------------------------------
 
1171
 
 
1172
void TParameters::SetBaseSplits(uchar u8Value)
 
1173
{
 
1174
  mu8BaseSplits = u8Value;
 
1175
}
 
1176
 
 
1177
//---------------------------------------------------------------------------
 
1178
 
 
1179
void TParameters::SetScale(Real fValue)
 
1180
{
 
1181
  mfScale = fValue;
 
1182
}
 
1183
 
 
1184
//---------------------------------------------------------------------------
 
1185
 
 
1186
void TParameters::SetScaleV(Real fValue)
 
1187
{
 
1188
  mfScaleV = fValue;
 
1189
}
 
1190
 
 
1191
//---------------------------------------------------------------------------
 
1192
 
 
1193
void TParameters::SetZScale(Real fValue)
 
1194
{
 
1195
  mfZScale = fValue;
 
1196
}
 
1197
 
 
1198
//---------------------------------------------------------------------------
 
1199
 
 
1200
void TParameters::SetZScaleV(Real fValue)
 
1201
{
 
1202
  mfZScaleV = fValue;
 
1203
}
 
1204
 
 
1205
//---------------------------------------------------------------------------
 
1206
 
 
1207
void TParameters::SetRatio(Real fValue)
 
1208
{
 
1209
  mfRatio = fValue;
 
1210
}
 
1211
 
 
1212
//---------------------------------------------------------------------------
 
1213
 
 
1214
void TParameters::SetRatioPower(Real fValue)
 
1215
{
 
1216
  mfRatioPower = fValue;
 
1217
}
 
1218
 
 
1219
//---------------------------------------------------------------------------
 
1220
 
 
1221
void TParameters::SetLobes(uchar u8Value)
 
1222
{
 
1223
  mu8Lobes = u8Value;
 
1224
}
 
1225
 
 
1226
//---------------------------------------------------------------------------
 
1227
 
 
1228
void TParameters::SetLobeDepth(Real fValue)
 
1229
{
 
1230
  mfLobeDepth = fValue;
 
1231
}
 
1232
 
 
1233
//---------------------------------------------------------------------------
 
1234
 
 
1235
void TParameters::SetFlare(Real fValue)
 
1236
{
 
1237
  mfFlare = fValue;
 
1238
}
 
1239
 
 
1240
//---------------------------------------------------------------------------
 
1241
 
 
1242
void TParameters::SetLeaves(int iValue)
 
1243
{
 
1244
  miLeaves = iValue;
 
1245
}
 
1246
 
 
1247
//---------------------------------------------------------------------------
 
1248
 
 
1249
void TParameters::SetLeafShape(TLeafShape u8Value)
 
1250
{
 
1251
  mu8LeafShape = u8Value;
 
1252
}
 
1253
 
 
1254
//---------------------------------------------------------------------------
 
1255
 
 
1256
void TParameters::SetLeafScale(Real fValue)
 
1257
{
 
1258
  mfLeafScale = fValue;
 
1259
}
 
1260
 
 
1261
//---------------------------------------------------------------------------
 
1262
 
 
1263
void TParameters::SetLeafScaleX(Real fValue)
 
1264
{
 
1265
  mfLeafScaleX = fValue;
 
1266
}
 
1267
 
 
1268
//---------------------------------------------------------------------------
 
1269
 
 
1270
void TParameters::SetLeafQuality(Real fValue)
 
1271
{
 
1272
  mfLeafQuality = fValue;
 
1273
}
 
1274
 
 
1275
//---------------------------------------------------------------------------
 
1276
 
 
1277
void TParameters::SetLeafColor(uint u16Value)
 
1278
{
 
1279
  mu16LeafColor = u16Value;
 
1280
}
 
1281
 
 
1282
//---------------------------------------------------------------------------
 
1283
 
 
1284
void TParameters::SetLeafColorVariation(bool bValue)
 
1285
{
 
1286
  mbLeafColorVariation = bValue;
 
1287
}
 
1288
 
 
1289
//---------------------------------------------------------------------------
 
1290
 
 
1291
void TParameters::SetLeafAlpha(uchar u8Value)
 
1292
{
 
1293
  mu8LeafAlpha = u8Value;
 
1294
}
 
1295
 
 
1296
//---------------------------------------------------------------------------
 
1297
 
 
1298
void TParameters::SetAttractionUp(Real fValue)
 
1299
{
 
1300
   mfAttractionUp = fValue;
 
1301
}
 
1302
 
 
1303
//---------------------------------------------------------------------------
 
1304
 
 
1305
void TParameters::SetPruneRatio(Real fValue)
 
1306
{
 
1307
   mfPruneRatio = fValue;
 
1308
}
 
1309
 
 
1310
//---------------------------------------------------------------------------
 
1311
 
 
1312
void TParameters::SetPruneWidth(Real fValue)
 
1313
{
 
1314
   mfPruneWidth = fValue;
 
1315
}
 
1316
 
 
1317
//---------------------------------------------------------------------------
 
1318
 
 
1319
void TParameters::SetPruneWidthPeak(Real fValue)
 
1320
{
 
1321
   mfPruneWidthPeak = fValue;
 
1322
}
 
1323
 
 
1324
//---------------------------------------------------------------------------
 
1325
 
 
1326
void TParameters::SetPrunePowerLow(Real fValue)
 
1327
{
 
1328
   mfPrunePowerLow = fValue;
 
1329
}
 
1330
 
 
1331
//---------------------------------------------------------------------------
 
1332
 
 
1333
void TParameters::SetPrunePowerHigh(Real fValue)
 
1334
{
 
1335
   mfPrunePowerHigh = fValue;
 
1336
}
 
1337
 
 
1338
//---------------------------------------------------------------------------
 
1339
 
 
1340
 
 
1341
void TParameters::SetScale0(Real fValue)
 
1342
{
 
1343
  mfScale0 = fValue;
 
1344
}
 
1345
 
 
1346
//---------------------------------------------------------------------------
 
1347
 
 
1348
void TParameters::SetScaleV0(Real fValue)
 
1349
{
 
1350
  mfScaleV0 = fValue;
 
1351
}
 
1352
 
 
1353
//---------------------------------------------------------------------------
 
1354
 
 
1355
 
 
1356
void TParameters::SetnDownAngle(uchar u8Index, Real fValue)
 
1357
{
 
1358
  mafNDownAngle[u8Index] = fValue;
 
1359
}
 
1360
 
 
1361
//---------------------------------------------------------------------------
 
1362
 
 
1363
void TParameters::SetnDownAngleV(uchar u8Index, Real fValue)
 
1364
{
 
1365
  mafNDownAngleV[u8Index] = fValue;
 
1366
}
 
1367
 
 
1368
//---------------------------------------------------------------------------
 
1369
 
 
1370
void TParameters::SetnRotate(uchar u8Index, Real fValue)
 
1371
{
 
1372
  mafNRotate[u8Index] = fValue;
 
1373
}
 
1374
 
 
1375
//---------------------------------------------------------------------------
 
1376
 
 
1377
void TParameters::SetnRotateV(uchar u8Index, Real fValue)
 
1378
{
 
1379
  mafNRotateV[u8Index] = fValue;
 
1380
}
 
1381
 
 
1382
//---------------------------------------------------------------------------
 
1383
 
 
1384
void TParameters::SetnLength(uchar u8Index, Real fValue)
 
1385
{
 
1386
  mafNLength[u8Index] = fValue;
 
1387
}
 
1388
 
 
1389
//---------------------------------------------------------------------------
 
1390
 
 
1391
void TParameters::SetnLengthV(uchar u8Index, Real fValue)
 
1392
{
 
1393
  mafNLengthV[u8Index] = fValue;
 
1394
}
 
1395
 
 
1396
//---------------------------------------------------------------------------
 
1397
 
 
1398
void TParameters::SetnTaper(uchar u8Index, Real fValue)
 
1399
{
 
1400
  mafNTaper[u8Index] = fValue;
 
1401
}
 
1402
 
 
1403
//---------------------------------------------------------------------------
 
1404
 
 
1405
void TParameters::SetnBranches(uchar u8Index, int iValue)
 
1406
{
 
1407
  maiNBranches[u8Index] = iValue;
 
1408
}
 
1409
 
 
1410
//---------------------------------------------------------------------------
 
1411
 
 
1412
void TParameters::SetnSegSplits(uchar u8Index, Real fValue)
 
1413
{
 
1414
  mafNSegSplits[u8Index] = fValue;
 
1415
}
 
1416
 
 
1417
//---------------------------------------------------------------------------
 
1418
 
 
1419
void TParameters::SetnSplitAngle(uchar u8Index, Real fValue)
 
1420
{
 
1421
  mafNSplitAngle[u8Index] = fValue;
 
1422
}
 
1423
 
 
1424
//---------------------------------------------------------------------------
 
1425
 
 
1426
void TParameters::SetnSplitAngleV(uchar u8Index, Real fValue)
 
1427
{
 
1428
  mafNSplitAngleV[u8Index] = fValue;
 
1429
}
 
1430
 
 
1431
//---------------------------------------------------------------------------
 
1432
 
 
1433
void TParameters::SetnCurveRes(uchar u8Index, int iValue)
 
1434
{
 
1435
  maiNCurveRes[u8Index] = iValue;
 
1436
}
 
1437
 
 
1438
//---------------------------------------------------------------------------
 
1439
 
 
1440
void TParameters::SetnCurve(uchar u8Index, Real fValue)
 
1441
{
 
1442
  mafNCurve[u8Index] = fValue;
 
1443
}
 
1444
 
 
1445
//---------------------------------------------------------------------------
 
1446
 
 
1447
void TParameters::SetnCurveV(uchar u8Index, Real fValue)
 
1448
{
 
1449
  mafNCurveV[u8Index] = fValue;
 
1450
}
 
1451
 
 
1452
//---------------------------------------------------------------------------
 
1453
 
 
1454
void TParameters::SetnCurveBack(uchar u8Index, Real fValue)
 
1455
{
 
1456
  mafNCurveBack[u8Index] = fValue;
 
1457
}
 
1458
 
 
1459
//---------------------------------------------------------------------------
 
1460
 
 
1461
void TParameters::SetnVertices(uchar u8Index, int iValue)
 
1462
{
 
1463
  maiNVertices[u8Index] = iValue;
 
1464
}
 
1465
 
 
1466
//---------------------------------------------------------------------------
 
1467
 
 
1468
TParameters* TParameters::Clone(void)
 
1469
{
 
1470
  int i;
 
1471
  TParameters *pClonedParameters = new TParameters(mu8Levels);
 
1472
 
 
1473
  pClonedParameters->mTreeType = mTreeType;
 
1474
  pClonedParameters->mu8Shape = mu8Shape;
 
1475
  pClonedParameters->mfBaseSize = mfBaseSize;
 
1476
  pClonedParameters->mu8BaseSplits = mu8BaseSplits;
 
1477
  pClonedParameters->mfScale = mfScale;
 
1478
  pClonedParameters->mfScaleV = mfScaleV;
 
1479
  pClonedParameters->mfZScale = mfZScale;
 
1480
  pClonedParameters->mfZScaleV = mfZScaleV;
 
1481
  pClonedParameters->mfRatio = mfRatio;
 
1482
  pClonedParameters->mfRatioPower = mfRatioPower;
 
1483
  pClonedParameters->mu8Lobes = mu8Lobes;
 
1484
  pClonedParameters->mfLobeDepth = mfLobeDepth;
 
1485
  pClonedParameters->mfFlare = mfFlare;
 
1486
  pClonedParameters->miLeaves = miLeaves;
 
1487
  pClonedParameters->mu8LeafShape = mu8LeafShape;
 
1488
  pClonedParameters->mfLeafScale = mfLeafScale;
 
1489
  pClonedParameters->mfLeafScaleX = mfLeafScaleX;
 
1490
  pClonedParameters->mfLeafQuality = mfLeafQuality;
 
1491
  pClonedParameters->mu16LeafColor = mu16LeafColor;
 
1492
  pClonedParameters->mbLeafColorVariation = mbLeafColorVariation;
 
1493
  pClonedParameters->mu8LeafAlpha = mu8LeafAlpha;
 
1494
  pClonedParameters->mfAttractionUp = mfAttractionUp;
 
1495
  pClonedParameters->mfPruneRatio = mfPruneRatio;
 
1496
  pClonedParameters->mfPruneWidth = mfPruneWidth;
 
1497
  pClonedParameters->mfPruneWidthPeak = mfPruneWidthPeak;
 
1498
  pClonedParameters->mfPrunePowerLow = mfPrunePowerLow;
 
1499
  pClonedParameters->mfPrunePowerHigh = mfPrunePowerHigh;
 
1500
  pClonedParameters->mfScale0 = mfScale0;
 
1501
  pClonedParameters->mfScaleV0 = mfScaleV0;
 
1502
  
 
1503
  for (i=0; i<mu8Levels; i++)
 
1504
  {
 
1505
    pClonedParameters->mafNDownAngle[i] = mafNDownAngle[i];
 
1506
    pClonedParameters->mafNDownAngleV[i] = mafNDownAngleV[i];
 
1507
    pClonedParameters->mafNRotate[i] = mafNRotate[i];
 
1508
    pClonedParameters->mafNRotateV[i] = mafNRotateV[i];
 
1509
    pClonedParameters->mafNLength[i] = mafNLength[i];
 
1510
    pClonedParameters->mafNLengthV[i] = mafNLengthV[i];
 
1511
    pClonedParameters->mafNTaper[i] = mafNTaper[i];
 
1512
    pClonedParameters->maiNBranches[i] = maiNBranches[i];
 
1513
    pClonedParameters->mafNSegSplits[i] = mafNSegSplits[i];
 
1514
    pClonedParameters->mafNSplitAngle[i] = mafNSplitAngle[i];
 
1515
    pClonedParameters->mafNSplitAngleV[i] = mafNSplitAngleV[i];
 
1516
    pClonedParameters->maiNCurveRes[i] = maiNCurveRes[i];
 
1517
    pClonedParameters->mafNCurve[i] = mafNCurve[i];
 
1518
    pClonedParameters->mafNCurveBack[i] = mafNCurveBack[i];
 
1519
    pClonedParameters->mafNCurveV[i] = mafNCurveV[i];
 
1520
    pClonedParameters->maiNVertices[i] = maiNVertices[i];
 
1521
  }
 
1522
  
 
1523
  return pClonedParameters; 
 
1524
}
 
1525
 
 
1526
//---------------------------------------------------------------------------
 
1527
 
 
1528
} // namespace