zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
#ifndef __OD_GI_LIGHT_TRAITS__
#define __OD_GI_LIGHT_TRAITS__
 
#include "TD_PackPush.h"
 
#include "OdaDefs.h"
#include "CmColor.h"
#include "OdString.h"
#include "Ge/GeVector3d.h"
#include "Gs/GsFiler.h"
 
/** \details
    Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiLightTraits : public OdGiDrawableTraits
{
public:
  ODRX_DECLARE_MEMBERS(OdGiLightTraits);
 
  virtual void setOn(bool on) = 0;
  virtual bool isOn() const = 0;
};
 
typedef OdSmartPtr<OdGiLightTraits> OdGiLightTraitsPtr;
 
/** \details
    Library: TD_Gi
    <group OdGi_Classes>
*/
struct OdGiColorRGB
{
  double red, green, blue;
 
  OdGiColorRGB() : red(0.0), green(0.0), blue(0.0) { }
  OdGiColorRGB(double _red, double _green, double _blue) : red(_red), green(_green), blue(_blue) { }
 
  friend OdGiColorRGB operator +(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
  {
    return OdGiColorRGB(c1.red + c2.red, c1.green + c2.green, c1.blue + c2.blue);
  }
  friend OdGiColorRGB operator +(const OdGiColorRGB &c, double s)
  {
    return OdGiColorRGB(c.red + s, c.green + s, c.blue + s);
  }
  friend OdGiColorRGB operator +(double s, const OdGiColorRGB &c)
  {
    return OdGiColorRGB(s + c.red, s + c.green, s + c.blue);
  }
 
  friend OdGiColorRGB operator -(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
  {
    return OdGiColorRGB(c1.red - c2.red, c1.green - c2.green, c1.blue - c2.blue);
  }
  friend OdGiColorRGB operator -(const OdGiColorRGB &c, double s)
  {
    return OdGiColorRGB(c.red - s, c.green - s, c.blue - s);
  }
  friend OdGiColorRGB operator -(double s, const OdGiColorRGB &c)
  {
    return OdGiColorRGB(s - c.red, s - c.green, s - c.blue);
  }
 
  friend OdGiColorRGB operator *(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
  {
    return OdGiColorRGB(c1.red * c2.red, c1.green * c2.green, c1.blue * c2.blue);
  }
  friend OdGiColorRGB operator *(const OdGiColorRGB &c, double s)
  {
    return OdGiColorRGB(c.red * s, c.green * s, c.blue * s);
  }
  friend OdGiColorRGB operator *(double s, const OdGiColorRGB &c)
  {
    return OdGiColorRGB(s * c.red, s * c.green, s * c.blue);
  }
 
  friend OdGiColorRGB operator /(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
  {
    return OdGiColorRGB(c1.red / c2.red, c1.green / c2.green, c1.blue / c2.blue);
  }
  friend OdGiColorRGB operator /(const OdGiColorRGB &c, double s)
  {
    return OdGiColorRGB(c.red / s, c.green / s, c.blue / s);
  }
  friend OdGiColorRGB operator /(double s, const OdGiColorRGB &c)
  {
    return OdGiColorRGB(s / c.red, s / c.green, s / c.blue);
  }
};
 
/** \details
    Library: TD_Gi
    <group OdGi_Classes>
*/
class OdGiShadowParameters
{
public:
  OdGiShadowParameters();
  OdGiShadowParameters(const OdGiShadowParameters &parms);
 
  OdGiShadowParameters &operator =(const OdGiShadowParameters &parms);
 
  bool operator ==(const OdGiShadowParameters &parms) const;
  bool operator !=(const OdGiShadowParameters &parms) const;
 
  enum ShadowType 
  {
    kShadowsRayTraced = 0,
    kShadowMaps,
    kAreaSampled
  };
 
  enum ExtendedLightShape {
    kLinear = 0,
    kRectangle,
    kDisk,
    kCylinder,
    kSphere
  };
 
  void setShadowsOn(bool on);
  bool shadowsOn() const;
 
  void setShadowType(ShadowType typ);
  ShadowType shadowType() const;
 
  bool setShadowMapSize(OdUInt16 sz);
  OdUInt16 shadowMapSize() const;
 
  bool setShadowMapSoftness(OdUInt8 soft);
  OdUInt8 shadowMapSoftness() const;
 
  bool setShadowSamples(OdUInt16 nSamples);
  OdUInt16 shadowSamples() const;
 
  void setShapeVisibility(bool bVisibility);
  bool shapeVisibility() const;
 
  void setExtendedLightShape(ExtendedLightShape lightShape);
  ExtendedLightShape extendedLightShape() const;
 
  bool setExtendedLightLength(double dLength);
  double extendedLightLength() const;
 
  bool setExtendedLightWidth(double dWidth);
  double extendedLightWidth() const;
 
  bool setExtendedLightRadius(double dRadius);
  double extendedLightRadius() const;
 
  inline void save(OdGsFiler * pFiler) const {
    pFiler->wrBool(shadowsOn());
    pFiler->wrUInt8((OdUInt8)shadowType());
    pFiler->wrUInt16(shadowMapSize());
    pFiler->wrUInt8(shadowMapSoftness());
    pFiler->wrBool(shapeVisibility());
    pFiler->wrUInt8((OdUInt8)extendedLightShape());
    pFiler->wrDouble(extendedLightLength());
    pFiler->wrDouble(extendedLightWidth());
    pFiler->wrDouble(extendedLightRadius());
  }
 
  void load(OdGsFiler * pFiler) {
    setShadowsOn(pFiler->rdBool());
    setShadowType((ShadowType)pFiler->rdUInt8());
    setShadowMapSize(pFiler->rdUInt16());
    setShadowMapSoftness(pFiler->rdUInt8());
    setShapeVisibility(pFiler->rdBool());
    setExtendedLightShape((ExtendedLightShape)pFiler->rdUInt8());
    setExtendedLightLength(pFiler->rdDouble());
    setExtendedLightWidth(pFiler->rdDouble());
    setExtendedLightRadius(pFiler->rdDouble());
  }
 
 
private:
  bool               m_bShadowsOn;
  OdUInt8            m_shadowMapSoftness;
  bool               m_bShapeVisible;
  ShadowType         m_shadowType;
  OdUInt16           m_shadowMapSize;
  OdUInt16           m_shadowSamples;
  ExtendedLightShape m_lightShape;
  double             m_lightLength;
  double             m_lightWidth;
  double             m_lightRadius;
};
 
inline OdGiShadowParameters::OdGiShadowParameters()
  : m_bShadowsOn(true)
  , m_shadowMapSoftness(1)
  , m_bShapeVisible(false)
  , m_shadowType(OdGiShadowParameters::kShadowsRayTraced)
  , m_shadowMapSize(256)
  , m_shadowSamples(16)
  , m_lightShape(kSphere)
  , m_lightLength(0.0)
  , m_lightWidth(0.0)
  , m_lightRadius(0.0)
{
}
 
inline OdGiShadowParameters::OdGiShadowParameters(const OdGiShadowParameters &parms)
  : m_bShadowsOn(parms.m_bShadowsOn)
  , m_shadowMapSoftness(parms.m_shadowMapSoftness)
  , m_bShapeVisible(parms.m_bShapeVisible)
  , m_shadowType(parms.m_shadowType)
  , m_shadowMapSize(parms.m_shadowMapSize)
  , m_shadowSamples(parms.m_shadowSamples)
  , m_lightShape(parms.m_lightShape)
  , m_lightLength(parms.m_lightLength)
  , m_lightWidth(parms.m_lightWidth)
  , m_lightRadius(parms.m_lightRadius)
{
}
 
inline OdGiShadowParameters &OdGiShadowParameters::operator =(const OdGiShadowParameters &parms)
{
  m_bShadowsOn        = parms.m_bShadowsOn;
  m_shadowType        = parms.m_shadowType;
  m_shadowMapSize     = parms.m_shadowMapSize;
  m_shadowMapSoftness = parms.m_shadowMapSoftness;
  m_shadowSamples     = parms.m_shadowSamples;
  m_bShapeVisible     = parms.m_bShapeVisible;
  m_lightShape        = parms.m_lightShape;
  m_lightLength       = parms.m_lightLength;
  m_lightWidth        = parms.m_lightWidth;
  m_lightRadius       = parms.m_lightRadius;
  return *this;
}
 
inline bool OdGiShadowParameters::operator ==(const OdGiShadowParameters &parms) const
{
  return (m_bShadowsOn        == parms.m_bShadowsOn)        &&
         (m_shadowType        == parms.m_shadowType)        &&
         (m_shadowMapSize     == parms.m_shadowMapSize)     &&
         (m_shadowMapSoftness == parms.m_shadowMapSoftness) &&
         (m_shadowSamples     == parms.m_shadowSamples)     &&
         (m_bShapeVisible     == parms.m_bShapeVisible)     &&
         (m_lightShape        == parms.m_lightShape)        &&
         OdEqual(m_lightLength , parms.m_lightLength)       &&
         OdEqual(m_lightWidth  , parms.m_lightWidth)        &&
         OdEqual(m_lightRadius , parms.m_lightRadius);
}
 
inline bool OdGiShadowParameters::operator !=(const OdGiShadowParameters &parms) const
{
  return (m_bShadowsOn        != parms.m_bShadowsOn)        ||
         (m_shadowType        != parms.m_shadowType)        ||
         (m_shadowMapSize     != parms.m_shadowMapSize)     ||
         (m_shadowMapSoftness != parms.m_shadowMapSoftness) ||
         (m_shadowSamples     != parms.m_shadowSamples)     ||
         (m_bShapeVisible     != parms.m_bShapeVisible)     ||
         (m_lightShape        != parms.m_lightShape)        ||
         !OdEqual(m_lightLength, parms.m_lightLength)       ||
         !OdEqual(m_lightWidth , parms.m_lightWidth)        ||
         !OdEqual(m_lightRadius, parms.m_lightRadius);
}
 
inline void OdGiShadowParameters::setShadowsOn(bool on)
{
  m_bShadowsOn = on;
}
 
inline bool OdGiShadowParameters::shadowsOn() const
{
  return m_bShadowsOn;
}
 
inline void OdGiShadowParameters::setShadowType(ShadowType typ)
{
  m_shadowType = typ;
}
 
inline OdGiShadowParameters::ShadowType OdGiShadowParameters::shadowType() const
{
  return m_shadowType;
}
 
inline bool OdGiShadowParameters::setShadowMapSize(OdUInt16 sz)
{
  if((sz & (sz-1)) == 0 && sz >= 64 && sz <= 4096) // valid values are 64, 128, 256, 512, 1024, 2048, and 4096
  {
    m_shadowMapSize = sz;    
    return true;
  }
  else
  {
    return false;
  }
}
 
inline OdUInt16 OdGiShadowParameters::shadowMapSize() const
{
  return m_shadowMapSize;
}
 
inline bool OdGiShadowParameters::setShadowMapSoftness(OdUInt8 soft)
{
  m_shadowMapSoftness = soft;
  return true;
}
 
inline OdUInt8 OdGiShadowParameters::shadowMapSoftness() const
{
  return m_shadowMapSoftness;
}
 
inline bool OdGiShadowParameters::setShadowSamples(OdUInt16 nSamples)
{
  m_shadowSamples = nSamples;
  return true;
}
 
inline OdUInt16 OdGiShadowParameters::shadowSamples() const
{
  return m_shadowSamples;
}
 
inline void OdGiShadowParameters::setShapeVisibility(bool bVisibility)
{
  m_bShapeVisible = bVisibility;
}
 
inline bool OdGiShadowParameters::shapeVisibility() const
{
  return m_bShapeVisible;
}
 
inline void OdGiShadowParameters::setExtendedLightShape(OdGiShadowParameters::ExtendedLightShape lightShape)
{
  m_lightShape = lightShape;
}
 
inline OdGiShadowParameters::ExtendedLightShape OdGiShadowParameters::extendedLightShape() const
{
  return m_lightShape;
}
 
inline bool OdGiShadowParameters::setExtendedLightLength(double dLength)
{
  m_lightLength = dLength;
  return true;
}
 
inline double OdGiShadowParameters::extendedLightLength() const
{
  return m_lightLength;
}
 
inline bool OdGiShadowParameters::setExtendedLightWidth(double dWidth)
{
  m_lightWidth = dWidth;
  return true;
}
 
inline double OdGiShadowParameters::extendedLightWidth() const
{
  return m_lightWidth;
}
 
inline bool OdGiShadowParameters::setExtendedLightRadius(double dRadius)
{
  m_lightRadius = dRadius;
  return true;
}
 
inline double OdGiShadowParameters::extendedLightRadius() const
{
  return m_lightRadius;
}
 
/** \details
    Library: TD_Gi
    <group OdGi_Classes>
*/
class OdGiLightAttenuation
{
public:
  OdGiLightAttenuation();
  
  enum AttenuationType 
  {
    kNone = 0,
    kInverseLinear,
    kInverseSquare
  };
  
  void setAttenuationType(AttenuationType typ);
  AttenuationType attenuationType() const;
  
  void setUseLimits(bool on);
  bool useLimits() const;
  
  void setLimits(double startlim, double endlim);
  double startLimit() const;
  double endLimit() const;
  
  void save(OdGsFiler *pFiler) const;
  void load(OdGsFiler *pFiler);
private:
  AttenuationType m_attenType;
  bool            m_bUseAttenLimits;
  double          m_dAttenStartLimit;
  double          m_dAttenEndLimit;
};
 
inline OdGiLightAttenuation::OdGiLightAttenuation()
: m_attenType(OdGiLightAttenuation::kNone)
, m_bUseAttenLimits(false)
, m_dAttenStartLimit(1.0)
, m_dAttenEndLimit(10.0)
{
}
 
inline void OdGiLightAttenuation::setAttenuationType(AttenuationType typ)
{
  m_attenType = typ;
}
 
inline OdGiLightAttenuation::AttenuationType OdGiLightAttenuation::attenuationType() const
{
  return m_attenType;
}
  
inline void OdGiLightAttenuation::setUseLimits(bool on)
{
  m_bUseAttenLimits = on;
}
 
inline bool OdGiLightAttenuation::useLimits() const
{
  return m_bUseAttenLimits;
}
 
inline void OdGiLightAttenuation::setLimits(double startlim, double endlim)
{
  m_dAttenStartLimit = startlim;
  m_dAttenEndLimit   = endlim;
}
 
inline double OdGiLightAttenuation::startLimit() const
{
  return m_dAttenStartLimit;
}
 
inline double OdGiLightAttenuation::endLimit() const
{
  return m_dAttenEndLimit;
}
 
inline void OdGiLightAttenuation::save(OdGsFiler * pFiler) const {
  pFiler->wrUInt8(OdUInt8(m_attenType));
  pFiler->wrBool(m_bUseAttenLimits);
  pFiler->wrDouble(m_dAttenStartLimit);
  pFiler->wrDouble(m_dAttenEndLimit);
}
 
inline void OdGiLightAttenuation::load(OdGsFiler * pFiler) {
  m_attenType = AttenuationType(pFiler->rdUInt8());
  m_bUseAttenLimits = pFiler->rdBool();
  m_dAttenStartLimit = pFiler->rdDouble();
  m_dAttenEndLimit = pFiler->rdDouble();
}
 
/** \details
    This class contains all sky properties for OdDbSun objects.
 
    \sa
    TD_Gi
 
    <group OdGi_Classes> 
*/
class OdGiSkyParameters
{
public:
  OdGiSkyParameters();
 
  bool operator==(const OdGiSkyParameters& params) const;
 
  void setIllumination(bool enable);
  bool illumination() const;
 
  void setIntensityFactor(double intensity);
  double intensityFactor() const;
 
  void setHaze(double haze);
  double haze() const;
 
  void setHorizonHeight(double height);
  double horizonHeight() const;
 
  void setHorizonBlur(double blur);
  double horizonBlur() const;
 
  void setGroundColor(const OdCmEntityColor& color);
  OdCmEntityColor groundColor() const;
 
  void setNightColor(const OdCmEntityColor& color);
  OdCmEntityColor nightColor() const;
 
  void setAerialPerspective(bool apply);
  bool aerialPerspective() const;
 
  void setVisibilityDistance(double distance);
  double visibilityDistance() const;
 
  void setDiskScale(double scale);
  double diskScale() const;
 
  void setGlowIntensity(double intensity);
  double glowIntensity() const;
 
  void setDiskIntensity(double intensity);
  double diskIntensity() const;
 
  void setSolarDiskSamples(OdUInt16 samples);
  OdUInt16 solarDiskSamples() const;
 
  void setSunDirection(const OdGeVector3d& sundir);
  const OdGeVector3d& sunDirection() const;
 
  void setRedBlueShift(double redBlueShift);
  double redBlueShift() const;
 
  void setSaturation(double saturation);
  double saturation() const;
private:
  bool            m_status;
  double          m_intensityFactor;
  double          m_haze;
  double          m_horizonHeight;
  double          m_horizonBlur;
  OdCmEntityColor m_groundColor;
  OdCmEntityColor m_nightColor;
  bool            m_aerialPerspective;
  double          m_visibilityDistance;
  double          m_diskScale;
  double          m_glowIntensity;
  double          m_diskIntensity;
  OdUInt16        m_solarDiskSamples;
  OdGeVector3d    m_sunDirection;
  double          m_redBlueShift;
  double          m_saturation;
};
 
inline OdGiSkyParameters::OdGiSkyParameters()
: m_status(false)
, m_intensityFactor(1.0)
, m_haze(0.0)
, m_horizonHeight(0.0)
, m_horizonBlur(0.1)
, m_aerialPerspective(false)
, m_visibilityDistance(10000.0)
, m_diskScale(4.0)
, m_glowIntensity(1.0)
, m_diskIntensity(1.0)
, m_solarDiskSamples(8)
, m_redBlueShift(0.0)
, m_saturation(1.0)
{
  m_groundColor.setColor(0xc2808080);
  m_nightColor.setColor(0xc2010205);
  m_sunDirection.set(0.35, 1.0, -0.25);
}
 
inline bool OdGiSkyParameters::operator==(const OdGiSkyParameters& params) const
{
  if (m_status             != params.m_status)             return false;
  if (m_intensityFactor    != params.m_intensityFactor)    return false;
  if (m_haze               != params.m_haze)               return false;
  if (m_horizonHeight      != params.m_horizonHeight)      return false;
  if (m_horizonBlur        != params.m_horizonBlur)        return false;
  if (m_groundColor        != params.m_groundColor)        return false;
  if (m_nightColor         != params.m_nightColor)         return false;
  if (m_aerialPerspective  != params.m_aerialPerspective)  return false;
  if (m_visibilityDistance != params.m_visibilityDistance) return false;
  if (m_diskScale          != params.m_diskScale)          return false;
  if (m_glowIntensity      != params.m_glowIntensity)      return false;
  if (m_diskIntensity      != params.m_diskIntensity)      return false;
  if (m_solarDiskSamples   != params.m_solarDiskSamples)   return false;
  if (m_sunDirection       != params.m_sunDirection)       return false;
  if (m_redBlueShift       != params.m_redBlueShift)       return false;
  if (m_saturation         != params.m_saturation)         return false;
  return true;
}
 
inline void OdGiSkyParameters::setIllumination(bool enable)
{
  m_status = enable;
}
inline bool OdGiSkyParameters::illumination() const
{
  return m_status;
}
inline void OdGiSkyParameters::setIntensityFactor(double intensity)
{
  m_intensityFactor = intensity;
}
inline double OdGiSkyParameters::intensityFactor() const
{
  return m_intensityFactor;
}
inline void OdGiSkyParameters::setHaze(double haze)
{
  m_haze = haze;
}
inline double OdGiSkyParameters::haze() const
{
  return m_haze;
}
inline void OdGiSkyParameters::setHorizonHeight(double height)
{
  m_horizonHeight = height;
}
inline double OdGiSkyParameters::horizonHeight() const
{
  return m_horizonHeight;
}
inline void OdGiSkyParameters::setHorizonBlur(double blur)
{
  m_horizonBlur = blur;
}
inline double OdGiSkyParameters::horizonBlur() const
{
  return m_horizonBlur;
}
inline void OdGiSkyParameters::setGroundColor(const OdCmEntityColor& color)
{
  m_groundColor = color;
}
inline OdCmEntityColor OdGiSkyParameters::groundColor() const
{
  return m_groundColor;
}
inline void OdGiSkyParameters::setNightColor(const OdCmEntityColor& color)
{
  m_nightColor = color;
}
inline OdCmEntityColor OdGiSkyParameters::nightColor() const
{
  return m_nightColor;
}
inline void OdGiSkyParameters::setAerialPerspective(bool apply)
{
  m_aerialPerspective = apply;
}
inline bool OdGiSkyParameters::aerialPerspective() const
{
  return m_aerialPerspective;
}
inline void OdGiSkyParameters::setVisibilityDistance(double distance)
{
  m_visibilityDistance = distance;
}
inline double OdGiSkyParameters::visibilityDistance() const
{
  return m_visibilityDistance;
}
inline void OdGiSkyParameters::setDiskScale(double scale)
{
  m_diskScale = scale;
}
inline double OdGiSkyParameters::diskScale() const
{
  return m_diskScale;
}
inline void OdGiSkyParameters::setGlowIntensity(double intensity)
{
  m_glowIntensity = intensity;
}
inline double OdGiSkyParameters::glowIntensity() const
{
  return m_glowIntensity;
}
inline void OdGiSkyParameters::setDiskIntensity(double intensity)
{
  m_diskIntensity = intensity;
}
inline double OdGiSkyParameters::diskIntensity() const
{
  return m_diskIntensity;
}
inline void OdGiSkyParameters::setSolarDiskSamples(OdUInt16 samples)
{
  m_solarDiskSamples = samples;
}
inline OdUInt16 OdGiSkyParameters::solarDiskSamples() const
{
  return m_solarDiskSamples;
}
inline void OdGiSkyParameters::setSunDirection(const OdGeVector3d& sundir)
{
  m_sunDirection = sundir;
}
inline const OdGeVector3d& OdGiSkyParameters::sunDirection() const
{
  return m_sunDirection;
}
inline void OdGiSkyParameters::setRedBlueShift(double redBlueShift)
{
  m_redBlueShift = redBlueShift;
}
inline double OdGiSkyParameters::redBlueShift() const
{
  return m_redBlueShift;
}
inline void OdGiSkyParameters::setSaturation(double saturation)
{
  m_saturation = saturation;
}
inline double OdGiSkyParameters::saturation() const
{
  return m_saturation;
}
 
/** \details
    Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiStandardLightTraits : public OdGiLightTraits
{
public:
  ODRX_DECLARE_MEMBERS(OdGiStandardLightTraits);
 
  virtual void setIntensity(double inten) = 0;
  virtual double intensity() const = 0;
 
  virtual void setLightColor(const OdCmEntityColor& color) = 0;
  virtual OdCmEntityColor lightColor() const = 0;
 
  virtual void setShadowParameters(const OdGiShadowParameters& params) = 0;
  virtual OdGiShadowParameters shadowParameters() const = 0;
};
 
typedef OdSmartPtr<OdGiStandardLightTraits> OdGiStandardLightTraitsPtr;
 
/** \details
    Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiPointLightTraits : public OdGiStandardLightTraits
{
public:
  ODRX_DECLARE_MEMBERS(OdGiPointLightTraits);
 
  virtual void setPosition(const OdGePoint3d& pos) = 0;
  virtual OdGePoint3d position() const = 0;
 
  virtual OdGiLightAttenuation lightAttenuation() const = 0;
  virtual void setAttenuation(const OdGiLightAttenuation& atten) = 0;
 
  virtual void setPhysicalIntensity(double fIntensity) = 0;
  virtual double physicalIntensity() const = 0;
 
  virtual void setLampColor(const OdGiColorRGB& color) = 0;
  virtual OdGiColorRGB lampColor() const = 0;
 
  virtual void setHasTarget(bool bTarget) = 0;
  virtual bool hasTarget() const = 0;
 
  virtual void setTargetLocation(const OdGePoint3d &loc) = 0;
  virtual OdGePoint3d targetLocation() const = 0;
};
 
typedef OdSmartPtr<OdGiPointLightTraits> OdGiPointLightTraitsPtr;
 
 
/** \details
    Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiSpotLightTraits : public OdGiStandardLightTraits
{
public:
  ODRX_DECLARE_MEMBERS(OdGiSpotLightTraits);
 
  virtual void setPosition(const OdGePoint3d& pos) = 0;
  virtual OdGePoint3d position() const = 0;
 
  virtual void setTargetLocation(const OdGePoint3d& loc) = 0;
  virtual OdGePoint3d targetLocation() const = 0;
 
  virtual bool setHotspotAndFalloff(double hotspot, double falloff) = 0;
  virtual double hotspot() const = 0;
  virtual double falloff() const = 0;
 
  virtual OdGiLightAttenuation lightAttenuation() const = 0;
  virtual void setAttenuation(const OdGiLightAttenuation& atten) = 0;
 
  virtual void setPhysicalIntensity(double fIntensity) = 0;
  virtual double physicalIntensity() const = 0;
 
  virtual void setLampColor(const OdGiColorRGB& color) = 0;
  virtual OdGiColorRGB lampColor() const = 0;
};
 
typedef OdSmartPtr<OdGiSpotLightTraits> OdGiSpotLightTraitsPtr;
 
 
/** \details
    Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiDistantLightTraits : public OdGiStandardLightTraits
{
public:
  ODRX_DECLARE_MEMBERS(OdGiDistantLightTraits);
  
  virtual void setLightDirection(const OdGeVector3d& vec) = 0;
  virtual OdGeVector3d lightDirection() const = 0;
  
  virtual void setIsSunlight(bool isSunlight) = 0;
  virtual bool isSunlight() const = 0;
 
  virtual void setPhysicalIntensity(double fIntensity) = 0;
  virtual double physicalIntensity() const = 0;
 
  virtual void setLampColor(const OdGiColorRGB& color) = 0;
  virtual OdGiColorRGB lampColor() const = 0;
 
  virtual void setSkyParameters(const OdGiSkyParameters &params) = 0;
  virtual void skyParameters(OdGiSkyParameters &params) const = 0;
};
 
typedef OdSmartPtr<OdGiDistantLightTraits> OdGiDistantLightTraitsPtr;
 
/** \details
    Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiWebLightTraits : public OdGiPointLightTraits
{
public:
  ODRX_DECLARE_MEMBERS(OdGiWebLightTraits);
 
  enum WebFileType
  {
    kTypeA = 3,
    kTypeB = 2,
    kTypeC = 1
  };
 
  enum WebSymmetry
  {
    kNoSymmetry = 0,
    kSingleSymmetry,
    kDoubleSymmetry,
    kAxialSymmetry
  };
 
  virtual void setWebFile(const OdString &fileName) = 0;
  virtual OdString webFile() const = 0;
 
  virtual void setWebRotation(OdGeVector3d fRot) = 0;
  virtual OdGeVector3d webRotation() const = 0;
 
  virtual void setWebFlux(double fFlux) = 0;
  virtual double webFlux() const = 0;
 
  virtual void setWebFileType(WebFileType type) = 0;
  virtual WebFileType webFileType() const = 0;
 
  virtual void setWebSymmetry(WebSymmetry sym) = 0;
  virtual WebSymmetry webSymmetry() const = 0;
 
  virtual void setWebHorzAng90to270(bool bFlag) = 0;
  virtual bool webHorzAng90to270() const = 0;
};
 
typedef OdSmartPtr<OdGiWebLightTraits> OdGiWebLightTraitsPtr;
 
#include "TD_PackPop.h"
 
#endif // __OD_GI_LIGHT_TRAITS__