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
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
/////////////////////////////////////////////////////////////////////////////// 
// 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 __ODGIMATERIAL_H__
#define __ODGIMATERIAL_H__
 
#include "TD_PackPush.h"
#include "RootExport.h"
#include "GiExport.h"
 
#include "CmColor.h"
#include "Ge/GeMatrix3d.h"
#include "Gi/GiDrawable.h"
#include "Gi/GiVariant.h"
 
class OdGiMaterialColor;
class OdGiMaterialMap;
class OdGiRasterImage;
 
/** \details
    This class defines the interface to material traits for the vectorization process.
    Library: TD_Gi
    <group OdGi_Classes>
*/
class ODRX_ABSTRACT FIRSTDLL_EXPORT OdGiMaterialTraits : public OdGiDrawableTraits
{
public:
  ODRX_DECLARE_MEMBERS(OdGiMaterialTraits);
 
  enum IlluminationModel {
    kBlinnShader = 0,
    kMetalShader
  };
 
  enum ChannelFlags
  {
    kNone           = 0x00000,
    kUseDiffuse     = 0x00001,
    kUseSpecular    = 0x00002,
    kUseReflection  = 0x00004,
    kUseOpacity     = 0x00008,
    kUseBump        = 0x00010,
    kUseRefraction  = 0x00020,
    kUseNormalMap   = 0x00040,
    kUseEmission    = 0x00080,
 
    kUseAll         = (kUseDiffuse | kUseSpecular | kUseReflection |
                       kUseOpacity | kUseBump | kUseRefraction | kUseNormalMap),
    kUseAllInternal = (kUseAll | kUseEmission)
  };
 
  enum Mode {
    kRealistic = 0,
    kAdvanced
  };
 
  // Returned via subSetAttributes()
  enum
  {
    kByBlock    = (OdGiDrawable::kLastFlag << 1),
    kByLayer    = (OdGiDrawable::kLastFlag << 2)
  };
 
  // Extended material traits enumerations
 
  enum LuminanceMode
  {
    kSelfIllumination = 0,
    kLuminance,
    kEmissionColor
  };
 
  enum NormalMapMethod
  {
    kTangentSpace
  };
 
  enum GlobalIlluminationMode
  {
    kGlobalIlluminationNone,
    kGlobalIlluminationCast,
    kGlobalIlluminationReceive,
    kGlobalIlluminationCastAndReceive
  };
 
  enum FinalGatherMode
  {
    kFinalGatherNone,
    kFinalGatherCast,
    kFinalGatherReceive,
    kFinalGatherCastAndReceive
  };
 
  /** \details
    Returns the ambient color component of this MaterialTraits object.
 
    \param ambientColor [out]  Receives the ambient color.
 
    \remarks
    The ambient component component is most apparent when there is no direct illumination on the entity.
  */
  virtual void ambient(OdGiMaterialColor& ambientColor) const = 0;
 
  /** \details
    Returns the diffuse component of this MaterialTraits object.
 
    \param diffuseColor [out]  Receives the diffuse color.
    \param diffuseMap [out]  Receives the diffuse map.
 
    \remarks
    The diffuse component is most apparent when there is direct illumination on the entity.
  */
  virtual void diffuse(OdGiMaterialColor& diffuseColor, OdGiMaterialMap& diffuseMap) const = 0;
 
  /** \details
    Returns the specular component of this MaterialTraits object.
 
    \param specularColor [out]  Receives the specular color.
    \param specularMap [out]  Receives the specular map.
    \param glossFactor [out]  Receives the gloss factor.
 
    \remarks
    The specular component is viewpoint dependent, and most apparent when the entity is highlighted.
  */
  virtual void specular(OdGiMaterialColor& specularColor, OdGiMaterialMap& specularMap, double& glossFactor) const = 0;
 
  /** \details
    Returns the reflection component of this MaterialTraits object.
 
    \param reflectionMap [out]  Receives the reflection map.
 
    \remarks
    The reflection component creates a mirror finish on the entity .
  */
  virtual void reflection(OdGiMaterialMap& reflectionMap) const = 0;
 
  /** \details
    Returns the opacity component of this MaterialTraits object.
 
    \param opacityPercentage [out]  Receives the opacity percentage.
    \param opacityMap [out]  Receives the opacity map.
  */
  virtual void opacity(double& opacityPercentage, OdGiMaterialMap& opacityMap) const = 0;
 
  /** \details
    Returns the bump component of this MaterialTraits object.
 
    \param bumpMap [out]  Receives the bump map.
  */
  virtual void bump(OdGiMaterialMap& bumpMap) const = 0;
 
  /** \details
    Returns the refraction component of this MaterialTraits object.
 
    \param refractionIndex [out]  Receives the refraction index.
    \param refractionMap [out]  Receives the refraction map.
  */
  virtual void refraction(double& refractionIndex, OdGiMaterialMap& refractionMap) const = 0;
 
  /** \details
    Returns the translucence of this MaterialTraits object.
  */
  virtual double translucence() const = 0;
 
  /** \details
    Returns the self illumination of this MaterialTraits object.
  */
  virtual double selfIllumination() const = 0;
 
  /** \details
    Returns the reflectivity of this MaterialTraits object.
  */
  virtual double reflectivity() const = 0;
 
  /** \details
    Returns the illumination model of this MaterialTraits object.
  */
  virtual IlluminationModel illuminationModel() const = 0;
 
  /** \details
    Returns the channel flags of this MaterialTraits object.
  */
  virtual ChannelFlags channelFlags() const = 0;
 
  /** \details
    Returns the mode of this MaterialTraits object.
  */
  virtual Mode mode() const = 0;
 
  /** \details
    Sets the ambient color component of this MaterialTraits object.
 
    \param ambientColor [in]  Ambient color.
 
    \remarks
    The ambient component component is most apparent when there is no direct illumination on the entity.
  */
  virtual void setAmbient(const OdGiMaterialColor& ambientColor) = 0;
 
  /** \details
    Sets the diffuse component of this MaterialTraits object.
 
    \param diffuseColor [in]  Diffuse color.
    \param diffuseMap [in]  Diffuse map.
 
    \remarks
    The diffuse component is most apparent when there is direct illumination on the entity.
  */
  virtual void setDiffuse(const OdGiMaterialColor& diffuseColor, const OdGiMaterialMap& diffuseMap) = 0;
 
  /** \details
    Sets the specular component of this MaterialTraits object.
 
    \param specularColor [in]  Specular color.
    \param specularMap [in]  Specular map.
    \param glossFactor [in]  Gloss factor.
 
    \remarks
    The specular component is viewpoint dependent, and most apparent when the entity is highlighted.
  */
  virtual void setSpecular(const OdGiMaterialColor& specularColor, const OdGiMaterialMap& specularMap, double glossFactor) = 0;
 
  /** \details
    Sets the reflection component of this MaterialTraits object.
 
    \param reflectionMap [in]  Reflection map.
 
    \remarks
    The reflection component creates a mirror finish on the entity.
  */
  virtual void setReflection(const OdGiMaterialMap& reflectionMap) = 0;
 
  /** \details
    Sets the opacity component of this MaterialTraits object.
 
    \param opacityPercentage [in]  Opacity percentage.
    \param opacityMap [in]  Opacity map.
  */
  virtual void setOpacity(double opacityPercentage, const OdGiMaterialMap& opacityMap) = 0;
 
  /** \details
    Sets the bump component of this MaterialTraits object.
 
    \param bumpMap [in]  Bump map.
  */
  virtual void setBump(const OdGiMaterialMap& bumpMap) = 0;
 
  /** \details
    Sets the refraction component of this MaterialTraits object.
 
    \param refractionIndex [in]  Refraction index.
    \param refractionMap [in]  Refraction map.
  */
  virtual void setRefraction(double refractionIndex, const OdGiMaterialMap& refractionMap) = 0;
 
  /** \details
    Sets the translucence of this MaterialTraits object.
 
    \param value [in]  Translucence value.
  */
  virtual void setTranslucence(double value) = 0;
 
  /** \details
    Sets the self illumination of this MaterialTraits object.
 
    \param value [in]  Self illumination level.
  */
  virtual void setSelfIllumination(double value) = 0;
 
  /** \details
    Sets the reflectivity of this MaterialTraits object.
 
    \param value [in]  Reflectivity value.
  */
  virtual void setReflectivity(double value) = 0;
 
  /** \details
    Sets the illumination model of this MaterialTraits object.
 
    \param model [in]  Illumination model.
  */
  virtual void setIlluminationModel(IlluminationModel model) = 0;
 
  /** \details
    Sets the channel flags of this MaterialTraits object.
 
    \param value [in]  Channel flags.
  */
  virtual void setChannelFlags(ChannelFlags flags) = 0;
 
  /** \details
    Sets the mode of this MaterialTraits object.
 
    \param value [in]  Mode value.
  */
  virtual void setMode(Mode value) = 0;
 
  // Extended material properties
 
  /** \details
    Sets the color bleed scale of this MaterialTraits object.
 
    \param scale [in]  Color bleed scale.
  */
  virtual void setColorBleedScale(double scale) = 0;
  /** \details
    Returns the color bleed scale of this MaterialTraits object.
  */
  virtual double colorBleedScale() const = 0;
 
  /** \details
    Sets the indirect bump scale of this MaterialTraits object.
 
    \param scale [in]  Indirect bump scale.
  */
  virtual void setIndirectBumpScale(double scale) = 0;
  /** \details
    Returns the indirect bump scale of this MaterialTraits object.
  */
  virtual double indirectBumpScale() const = 0;
 
  /** \details
    Sets the reflectance scale of this MaterialTraits object.
 
    \param scale [in]  Reflectance scale.
  */
  virtual void setReflectanceScale(double scale) = 0;
  /** \details
    Returns the reflectance scale of this MaterialTraits object.
  */
  virtual double reflectanceScale() const = 0;
 
  /** \details
    Sets the transmittance scale of this MaterialTraits object.
 
    \param scale [in]  Transmittance scale.
  */
  virtual void setTransmittanceScale(double scale) = 0;
  /** \details
    Returns the transmittance scale of this MaterialTraits object.
  */
  virtual double transmittanceScale() const = 0;
 
  /** \details
    Sets the two sided mode of this MaterialTraits object.
 
    \param flag [in]  Two sided mode flag.
  */
  virtual void setTwoSided(bool flag) = 0;
  /** \details
    Returns the two sided mode of this MaterialTraits object.
  */
  virtual bool twoSided() const = 0;
 
  /** \details
    Sets the luminance mode of this MaterialTraits object.
 
    \param mode [in]  Luminance mode.
  */
  virtual void setLuminanceMode(LuminanceMode mode) = 0;
  /** \details
    Returns the luminance mode of this MaterialTraits object.
  */
  virtual LuminanceMode luminanceMode() const = 0;
 
  /** \details
    Sets the luminance of this MaterialTraits object.
 
    \param value [in]  Luminance value.
  */
  virtual void setLuminance(double value) = 0;
  /** \details
    Returns the luminance of this MaterialTraits object.
  */
  virtual double luminance() const = 0;
 
  /** \details
    Sets the normalMap component of this MaterialTraits object.
 
    \param normalMap [in]  Normal map.
    \param method [in]  Normal map method.
    \param strength [in]  Strength factor.
  */
  virtual void setNormalMap(const OdGiMaterialMap &normalMap, NormalMapMethod method, double strength) = 0;
  /** \details
    Returns the normalMap component of this MaterialTraits object.
 
    \param normalMap [out]  Receives the normal map.
    \param method [out]  Receives the normal map method.
    \param strength [out]  Receives the normal map strength factor.
  */
  virtual void normalMap(OdGiMaterialMap &normalMap, NormalMapMethod &method, double &strength) const = 0;
 
  /** \details
    Sets the global illumination mode of this MaterialTraits object.
 
    \param mode [in]  Global illumination mode.
  */
  virtual void setGlobalIllumination(GlobalIlluminationMode mode) = 0;
  /** \details
    Returns the global illumination mode of this MaterialTraits object.
  */
  virtual GlobalIlluminationMode globalIllumination() const = 0;
 
  /** \details
    Sets the final gather mode of this MaterialTraits object.
 
    \param mode [in]  Final gather mode.
  */
  virtual void setFinalGather(FinalGatherMode mode) = 0;
  /** \details
    Returns the final gather mode of this MaterialTraits object.
  */
  virtual FinalGatherMode finalGather() const = 0;
 
  /** \details
    Sets the emission component of this MaterialTraits object.
 
    \param emissionColor [in]  Emission color.
    \param emissionMap [in]  Emission map.
  */
  virtual void setEmission(const OdGiMaterialColor& emissionColor, const OdGiMaterialMap& emissionMap) = 0;
  /** \details
    Returns the emission component of this MaterialTraits object.
 
    \param emissionColor [out]  Receives the emission color.
    \param emissionMap [out]  Receives the emission map.
  */
  virtual void emission(OdGiMaterialColor& emissionColor, OdGiMaterialMap& emissionMap) const = 0;
};
 
/** \details
    This template class is a specialization of the OdSmartPtr class for OdGiMaterialTraits object pointers.
*/
typedef OdSmartPtr<OdGiMaterialTraits> OdGiMaterialTraitsPtr;
 
 
/** \details
    This class implements material colors by color method and value.
 
    \sa
    TD_Gi
 
    <group OdGi_Classes>
*/
class ODGI_EXPORT OdGiMaterialColor
{
public:
  enum Method
  {
    kInherit  = 0, // Uses the current drawing *color*.
    kOverride = 1  // Uses the *color* set with setColor.
  };
 
  ODGI_EXPORT_STATIC static const OdGiMaterialColor kNull;
 
  OdGiMaterialColor();
 
  /** \details
    Sets the color method for this MaterialColor object.
 
    \param method [in]  Color method.
 
    \remarks
    method must be one of the following:
 
    <table>
    Name          Value    Description
    kInherit      0        Uses the current drawing color.
    kOverride     1        Uses the color set with setColor.
    </table>
  */
  void setMethod(Method method);
 
  /** \details
    Sets the color factor for this MaterialColor object.
    \param factor [in]  Color factor.
    \remarks
    A color factor of 0.0 makes all colors black; a color factor of 1.0 leaves them unchanged.
  */
  void setFactor(double factor);
 
  /** \details
    Returns a reference to, or a copy of, the color of this MaterialColor object as
    an OdCmEntityColor instance.
  */
  OdCmEntityColor& color();
 
 
  /** \details
    Returns the color method for this MaterialColor object.
 
    \remarks
    method() returns one of the following:
 
    <table>
    Name          Value    Description
    kInherit      0        Uses the current drawing color.
    kOverride     1        Uses the color set with setColor.
    </table>
  */
  Method method() const;
 
  /** \details
    Returns the color factor for this MaterialColor object.
 
 
    \remarks
    A color factor of 0.0 makes all colors black; a color factor of 1.0 leaves them unchanged.
  */
  double factor() const;
 
  /** \details
    Returns a constant reference to, or a copy of, the color of this MaterialColor object as
    an constant OdCmEntityColor instance.
  */
  const OdCmEntityColor& color() const;
 
  bool operator ==(const OdGiMaterialColor &other) const
  {
    return (m_method == other.m_method) &&
           (m_factor == other.m_factor) &&
           (m_color  == other.m_color);      
  }
  bool operator != (const OdGiMaterialColor &other) const
  {
    return (m_method != other.m_method) ||
           (m_factor != other.m_factor) ||
           (m_color  != other.m_color);      
  }
 
  /** \details
    Sets the color for this MaterialColor object.
    \param color [in]  New color for this MaterialColor object.
  */
  void setColor(const OdCmEntityColor &color);
 
private:
  Method          m_method;
  double          m_factor;
  OdCmEntityColor m_color;
};
 
 
/** \details
    This class defines material textures.
    Library: TD_Gi
    <group OdGi_Classes>
*/
class ODRX_ABSTRACT FIRSTDLL_EXPORT OdGiMaterialTexture : public OdRxObject
{
public:
  ODRX_DECLARE_MEMBERS(OdGiMaterialTexture);
  virtual bool operator==(const OdGiMaterialTexture & texture)const;
protected:
  OdGiMaterialTexture() { }
  ~OdGiMaterialTexture() { }
};
 
inline bool OdGiMaterialTexture::operator==(const OdGiMaterialTexture & texture) const {
  return (texture.isA() == isA());
}
 
/** \details
This template class is a specialization of the OdSmartPtr class for OdGiMaterialTexture object pointers.
*/
typedef OdSmartPtr<OdGiMaterialTexture> OdGiMaterialTexturePtr;
 
/** \details
     This class defines image based material textures.
     Library: TD_Gi
    <group OdGi_Classes>
*/
class ODRX_ABSTRACT FIRSTDLL_EXPORT OdGiImageTexture : public OdGiMaterialTexture
{
public:
  ODRX_DECLARE_MEMBERS(OdGiImageTexture);
protected:
  OdGiImageTexture() { }
  ~OdGiImageTexture() { }
};
 
/** \details
This template class is a specialization of the OdSmartPtr class for OdGiImageTexture object pointers.
*/
typedef OdSmartPtr<OdGiImageTexture> OdGiImageTexturePtr;
 
/** \details
     This class defines image file based material texture.
     Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiImageFileTexture : public OdGiImageTexture
{
public:
  ODRX_DECLARE_MEMBERS(OdGiImageFileTexture);
 
  virtual void setSourceFileName(const OdString& fileName);
  virtual const OdString sourceFileName() const;
 
  virtual bool operator==(const OdGiMaterialTexture & texture) const;
  OdGiImageFileTexture &operator =(const OdGiImageFileTexture &texture);
 
  // OdRxObject overrides
  void copyFrom(const OdRxObject* pSource);
private:
  OdString m_sourceFileName;
};
 
/** \details
This template class is a specialization of the OdSmartPtr class for OdGiImageFileTexture object pointers.
*/
typedef OdSmartPtr<OdGiImageFileTexture> OdGiImageFileTexturePtr;
 
/** \details
     This class defines raster image based material texture.
     Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiRasterImageTexture : public OdGiImageTexture
{
public:
  ODRX_DECLARE_MEMBERS(OdGiRasterImageTexture);
 
  virtual void setRasterImage(const OdGiRasterImage *pRasterImage);
  virtual const OdGiRasterImage *rasterImage() const;
 
  virtual bool operator==(const OdGiMaterialTexture & texture) const;
  OdGiRasterImageTexture &operator =(const OdGiRasterImageTexture &texture);
 
  // OdRxObject overrides
  void copyFrom(const OdRxObject* pSource);
private:
  OdRxObjectPtr m_pRasterImage;
};
 
/** \details
This template class is a specialization of the OdSmartPtr class for OdGiImageFileTexture object pointers.
*/
typedef OdSmartPtr<OdGiRasterImageTexture> OdGiRasterImageTexturePtr;
 
/** \details
     This class defines procedural material textures.
     Library: TD_Gi
    <group OdGi_Classes>
*/
class ODRX_ABSTRACT FIRSTDLL_EXPORT OdGiProceduralTexture : public OdGiMaterialTexture
{
public:
  ODRX_DECLARE_MEMBERS(OdGiProceduralTexture);
 
  enum Type
  {
    kWood    = 0,
    kMarble  = 1,
    kGeneric = 2
  };
 
  virtual Type type() const = 0;
protected:
  OdGiProceduralTexture() { }
  ~OdGiProceduralTexture() { }
};
 
/** \details
This template class is a specialization of the OdSmartPtr class for OdGiProceduralTexture object pointers.
*/
typedef OdSmartPtr<OdGiProceduralTexture> OdGiProceduralTexturePtr;
 
/** \details
    This class defines wood procedural material textures.
    Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiWoodTexture : public OdGiProceduralTexture
{
public:
  ODRX_DECLARE_MEMBERS(OdGiWoodTexture);
 
  OdGiWoodTexture();
 
  virtual Type type() const  {return kWood;}
 
  // wood properties
 
  virtual void setColor1(const OdGiMaterialColor &woodColor1);
  virtual const OdGiMaterialColor& color1(void) const;
 
  virtual void setColor2(const OdGiMaterialColor &woodColor2);
  virtual const OdGiMaterialColor& color2(void) const;
 
  virtual void setRadialNoise(double radialNoise);
  virtual double radialNoise(void) const;
 
  virtual void setAxialNoise(double axialNoise);
  virtual double axialNoise(void) const;
 
  virtual void setGrainThickness(double grainThickness);
  virtual double grainThickness(void) const;
 
  virtual bool operator==(const OdGiMaterialTexture & texture) const;
  OdGiWoodTexture &operator =(const OdGiWoodTexture &texture);
 
  // OdRxObject overrides
  void copyFrom(const OdRxObject* pSource);
private:
  OdGiMaterialColor m_color1;
  OdGiMaterialColor m_color2;
  double            m_radialNoise;
  double            m_axialNoise;
  double            m_grainThickness;
};
 
/** \details
This template class is a specialization of the OdSmartPtr class for OdGiWoodTexture object pointers.
*/
typedef OdSmartPtr<OdGiWoodTexture> OdGiWoodTexturePtr;
 
/** \details
    This class defines marble procedural material texture.
    Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiMarbleTexture : public OdGiProceduralTexture
{
public:
  ODRX_DECLARE_MEMBERS(OdGiMarbleTexture);
 
  OdGiMarbleTexture();
 
  virtual Type type() const  {return kMarble;}
 
  virtual void setStoneColor(const OdGiMaterialColor &stoneColor);
  virtual const OdGiMaterialColor& stoneColor(void) const;
 
  virtual void setVeinColor(const OdGiMaterialColor &veinColor);
  virtual const OdGiMaterialColor& veinColor(void) const;
 
  virtual void setVeinSpacing(double veinSpacing);
  virtual double veinSpacing(void) const;
 
  virtual void setVeinWidth(double veinWidth);
  virtual double veinWidth(void) const;
 
  virtual bool operator==(const OdGiMaterialTexture & texture) const;
  OdGiMarbleTexture &operator =(const OdGiMarbleTexture &texture);
 
  // OdRxObject overrides
  void copyFrom(const OdRxObject* pSource);
private:
  OdGiMaterialColor m_stoneColor;
  OdGiMaterialColor m_veinColor;
  double            m_veinSpacing;
  double            m_veinWidth;
};
 
/** \details
This template class is a specialization of the OdSmartPtr class for OdGiMarbleTexture object pointers.
*/
typedef OdSmartPtr<OdGiMarbleTexture> OdGiMarbleTexturePtr;
 
/** \details
    This class defines generic procedural material texture.
    Library: TD_Gi
    <group OdGi_Classes>
*/
class FIRSTDLL_EXPORT OdGiGenericTexture : public OdGiProceduralTexture
{
public:
  ODRX_DECLARE_MEMBERS(OdGiGenericTexture);
 
  OdGiGenericTexture();
 
  virtual Type type() const  {return kGeneric;}
 
  virtual void setDefinition(const OdGiVariant &definition);
  virtual OdGiVariantPtr definition() const;
  virtual void definition(OdGiVariantPtr &pDefinition) const;
 
  virtual bool operator==(const OdGiMaterialTexture & texture) const;
  OdGiGenericTexture &operator =(const OdGiGenericTexture &texture);
 
  // OdRxObject overrides
  void copyFrom(const OdRxObject* pSource);
private:
  OdGiVariantPtr    m_definition;
};
 
/** \details
This template class is a specialization of the OdSmartPtr class for OdGiGenericTexture object pointers.
*/
typedef OdSmartPtr<OdGiGenericTexture> OdGiGenericTexturePtr;
 
 
/** \details
    This class implements mappers.
 
 
    \remarks
    Mappers determine how an OdGiMaterialMap is mapped to an object surface.
 
    \sa
    TD_Gi
 
    <group OdGi_Classes>
*/
class ODGI_EXPORT OdGiMapper
{
public:
  enum Projection
  {
    kInheritProjection   = 0, // Inherits *projection* from the current material's mapper.
    kPlanar              = 1, // Maps directly to XY coordinates.
    kBox                 = 2, // Maps to planes perpendicular to major axes.
    kCylinder            = 3, // Maps to cylinder aligned with Z-axis.
    kSphere              = 4, // Maps to sphere aligned with Z-axis
 
    kDgnParametric       = 0x32, // Maps directly to surface coordinates. For dgn materials.
    kDgnPlanar           = 0x33, // Maps directly to surface coordinates. For dgn materials.
    kDgnCylinder         = 0x34, // Maps to cylinder aligned with Z-axis. For dgn materials.
    kDgnCylinderCapped   = 0x35, // Maps to cylinder aligned with Z-axis. If normal to surface same as Z-axis
                                 // then used planar mapping. For dgn materials.
    kDgnSphere           = 0x36  // Maps to sphere aligned with Z-axis. For dgn materials.
  };
 
  enum Tiling
  {
    kInheritTiling    = 0, // Inherits *tiling* from the current material's mapper.
    kTile             = 1, // Repeats map along image axes.
    kCrop             = 2, // Crops map < 0.0 or > 1.0 on image axes.
    kClamp            = 3, // Clamps (stretches) map between 0.0 and 1.0 on image axes.
    kMirror           = 4  // Mirror the material map at every integer boundary.
  };
 
  enum AutoTransform
  {
    kInheritAutoTransform = 0x0, // Inherits automatic *transform* from the current material/s mapper.
    kNone                 = 0x1, // No automatic *transform*.
    kObject               = 0x2, // Adjusts the mapper *transform* to align with and fit the current object.
    kModel                = 0x4  // Multiples the mapper *transform* by the current block *transform*.
  };
 
  ODGI_EXPORT_STATIC static const OdGiMapper kIdentity;
 
  OdGiMapper()
    : m_projection(kPlanar)
    , m_uTiling(kTile)
    , m_vTiling(kTile)
    , m_autoTransform(kNone)
  {
  }
 
  OdGiMapper (const OdGiMapper& mapper);
  OdGiMapper& operator=(const OdGiMapper& mapper);
  bool operator==(const OdGiMapper& mapper) const;
  bool operator!=(const OdGiMapper& mapper) const;
 
  /** \details
    Sets the type of projection for this Mapper object.
 
    \param projection [in]  Projection type.
 
    \remarks
    projection must be one of the following:
 
    <table>
    Name                  Value   Description
    kInheritProjection    0       Inherits projection from the current material's mapper.
    kPlanar               1       Maps directly to XY coordinates.
    kBox                  2       Maps to planes perpendicular to major axes.
    kCylinder             3       Maps to cylinder aligned with Z-axis.
    kSphere               4       Maps to sphere aligned with Z-axis
    </table>
  */
  void setProjection(Projection projection);
 
  /** \details
    Sets the type of X-axis tiling for this Mapper object.
 
    \param tiling [in]  Tiling type.
 
    \remarks
    tiling must be one of the following:
 
    <table>
    Name                  Value   Description
    kInheritTiling        0       Inherits tiling from the current material's mapper.
    kTile                 1       Repeats map along image axes.
    kCrop                 2       Crops map < 0.0 or > 1.0 on image axes.
    kClamp                3       Clamps (stretches) map between 0.0 and 1.0 on image axes.
    kMirror               4       Mirror the material map at every integer boundary.
    </table>
  */
  void setUTiling(Tiling tiling);
 
  /** \details
    Sets the type of Y-axis tiling for this Mapper object.
 
    \param tiling [in]  Tiling type.
 
    \remarks
    tiling must be one of the following:
 
    <table>
    Name                  Value   Description
    kInheritTiling        0       Inherits tiling from the current material's mapper.
    kTile                 1       Repeats map along image axes.
    kCrop                 2       Crops map < 0.0 or > 1.0 on image axes.
    kClamp                3       Clamps (stretches) map between 0.0 and 1.0 on image axes.
    kMirror               4       Mirror the material map at every integer boundary.
    </table>
  */
  void setVTiling(Tiling tiling);
 
  /** \details
    Sets the type of automatic transform for this Mapper object.
 
    \param autoTransform [in]  Automatic transform type.
 
    \remarks
    autoTransform must be a one of the following:
 
    <table>
    Name                      Value   Description
    kInheritAutoTransform     0x0     Inherits automatic transform from the current material/s mapper.
    kNone                     0x1     No automatic transform.
    kObject                   0x2     Adjusts the mapper transform to align with and fit the current object.
    kModel                    0x4     Multiples the mapper transform by the current block transform.
    </table>
  */
  void setAutoTransform(AutoTransform autoTransform);
 
  /** \details
    Returns a reference to the transformation matrix for this Mapper object.
 
    \remarks
    The transform matrix defines mapping of an OdGiMaterialMap image when applied to the surface of an object.
  */
  OdGeMatrix3d& transform();
 
  /** \details
    Returns the type of projection for this Mapper object.
 
    \remarks
    projection() returns one of the following:
 
    <table>
    Name                  Value   Description
    kInheritProjection    0       Inherits projection from the current material's mapper.
    kPlanar               1       Maps directly to XY coordinates.
    kBox                  2       Maps to planes perpendicular to major axes.
    kCylinder             3       Maps to cylinder aligned with Z-axis.
    kSphere               4       Maps to sphere aligned with Z-axis
    </table>
  */
  Projection projection() const;
 
  /** \details
    Returns the type of X-axis tiling for this Mapper object.
 
    \remarks
    tiling() returns one of the following:
 
    <table>
    Name                  Value   Description
    kInheritTiling        0       Inherits tiling from the current material's mapper.
    kTile                 1       Repeats map along image axes.
    kCrop                 2       Crops map < 0.0 or > 1.0 on image axes.
    kClamp                3       Clamps (stretches) map between 0.0 and 1.0 on image axes.
    kMirror               4       Mirror the material map at every integer boundary.
    </table>
  */
  Tiling uTiling() const;
 
  /** \details
    Returns the type of Y-axis tiling for this Mapper object.
 
    \remarks
    tiling() returns one of the following:
 
    <table>
    Name                  Value   Description
    kInheritTiling        0       Inherits tiling from the current material's mapper.
    kTile                 1       Repeats map along image axes.
    kCrop                 2       Crops map < 0.0 or > 1.0 on image axes.
    kClamp                3       Clamps (stretches) map between 0.0 and 1.0 on image axes.
    kMirror               4       Mirror the material map at every integer boundary.
    </table>
  */
  Tiling vTiling() const;
 
  /** \details
    Returns the type of automatic transform for this Mapper object.
 
    \remarks
    autoTransform() returns a combination of one or more of the following:
 
    <table>
    Name                      Value   Description
    kInheritAutoTransform     0x0     Inherits automatic transform from the current material's mapper.
    kNone                     0x1     No automatic transform.
    kObject                   0x2     Adjusts the mapper transform to align with and fit the current object.
    kModel                    0x4     Multiples the mapper transform by the current block transform.
    </table>
  */
  AutoTransform autoTransform() const;
 
  const OdGeMatrix3d& transform() const;
 
  void setTransform(const OdGeMatrix3d &tm);
 
private:
  Projection    m_projection;
  Tiling        m_uTiling;
  Tiling        m_vTiling;
  AutoTransform m_autoTransform;
  OdGeMatrix3d  m_transform;
};
 
 
/** \details
  This class implements material maps.
 
  \remarks
  Material maps define bitmapped images which are applied to object surfaces.
 
  <group OdGi_Classes>
*/
class ODGI_EXPORT OdGiMaterialMap
{
public:
  enum Source
  {
    kScene      = 0,  // Map is created from the current scene.
    kFile       = 1,  // Map is from a file.
    kProcedural = 2   // Map is procedural.
  };
 
  ODGI_EXPORT_STATIC static const OdGiMaterialMap kNull;
 
  OdGiMaterialMap();
 
  /** \details
    Sets the image source for this MaterialMap object.
 
    \param source [in]  Image source.
 
    \remarks
    source must be one of the following:
 
    <table>
    Name      Value   Description
    kScene    0,      Image is created from the current scene.
    kFile     1       Image is from a file.
    </table>
  */
  void setSource(Source source);
 
  /** \details
    Sets the source filename for this MaterialMap object.
    \param filename [in]  Source filename.
  */
  void setSourceFileName(const OdString& filename);
 
  /** \details
    Sets the blend factor for this MaterialMap object.
    \param blendFactor [in]  Blend factor.
    \remarks
    A blend factor of 0.0 makes the MaterialMap invisible. A blend factor of 1.0 makes it opaque.
    In between, the MaterialMap is transparent.
  */
  void setBlendFactor(double blendFactor);
 
  /** \details
    Sets the Material texture for this MaterialMap object.
  */
  void setTexture(OdGiMaterialTexturePtr pTexture);
 
  /** \details
    Returns a reference to, or a copy of, the OdGiMapper for this MaterialMap object.
 
    \remarks
    The transform matrix defines mapping of an OdGiMaterialMap image when applied to the surface of an object.
  */
  OdGiMapper& mapper();
 
  /** \details
    Returns the image source for this MaterialMap object.
 
    \remarks
    source must be one of the following:
 
    <table>
    Name      Value   Description
    kScene    0,      Image is created from the current scene.
    kFile     1       Image is from a file.
    </table>
  */
  Source source() const;
 
  /** \details
    Returns the source filename for this MaterialMap object.
  */
  OdString sourceFileName() const;
 
  /** \details
    Returns the blend factor for this MaterialMap object.
 
    \remarks
    A blend factor of 0.0 makes the MaterialMap invisible. A blend factor of 1.0 makes it opaque.
    In between, the MaterialMap is transparent.
  */
  double blendFactor() const;
 
  /** \details
    Returns a reference to the OdGiMapper for this MaterialMap object.
  */
  const OdGiMapper& mapper() const;
 
  /** \details
    Sets the OdGiMapper for this MaterialMap object.
    \param mapper [in]  OdGiMapper reference.
  */
  void setMapper(const OdGiMapper &mapper);
 
  /** \details
  Returns the material texture for this MaterialMap object.
  */
  const OdGiMaterialTexturePtr  texture(void) const;
 
  bool operator ==(const OdGiMaterialMap &other) const
  {
    if ((m_source      == other.m_source)      &&
        (m_fileName    == other.m_fileName)    &&
        (m_blendFactor == other.m_blendFactor) &&
        (m_mapper      == other.m_mapper))
    {
      if (m_texture.isNull() && other.m_texture.isNull())
        return true;
      if (!m_texture.isNull() && !other.m_texture.isNull())
        return (*m_texture == *(other.m_texture));
    }
    return false;
  }
  bool operator !=(const OdGiMaterialMap &other) const
  {
    return !(*this == other);
  }
 
  OdGiMaterialMap &operator =(const OdGiMaterialMap& mmap)
  {
    m_source = mmap.m_source;
    m_fileName = mmap.m_fileName;
    m_blendFactor = mmap.m_blendFactor;
    m_mapper = mmap.m_mapper;
    m_texture = mmap.m_texture;
    return *this;
  }
private:
  Source     m_source;
  OdString   m_fileName;
  double     m_blendFactor;
  OdGiMapper m_mapper;
  OdGiMaterialTexturePtr m_texture;
};
 
// OdGiMaterialColor inline implementations
 
inline
OdGiMaterialColor::OdGiMaterialColor()
  : m_method(kInherit)
  , m_factor(1.0)
{
}
 
inline void
OdGiMaterialColor::setMethod(Method method)
{
  m_method = method;
}
 
inline void
OdGiMaterialColor::setFactor(double factor)
{
  m_factor = factor;
}
 
inline OdCmEntityColor&
OdGiMaterialColor::color()
{
  return m_color;
}
 
inline OdGiMaterialColor::Method
OdGiMaterialColor::method() const
{
  return m_method;
}
 
inline double
OdGiMaterialColor::factor() const
{
  return m_factor;
}
 
inline const OdCmEntityColor&
OdGiMaterialColor::color() const
{
  return m_color;
}
 
inline void
OdGiMaterialColor::setColor(const OdCmEntityColor &color)
{
  m_color = color;
}
 
// OdGiMaterialMap inline implementations
 
inline
OdGiMaterialMap::OdGiMaterialMap()
  : m_source(kFile)
  , m_blendFactor(1.0)
{
}
 
inline void
OdGiMaterialMap::setSource(Source source)
{
  m_source = source;
}
 
inline void
OdGiMaterialMap::setSourceFileName(const OdString& filename)
{
  m_fileName = filename;
}
 
inline void
OdGiMaterialMap::setBlendFactor(double blendFactor)
{
  m_blendFactor = blendFactor;
}
 
inline OdGiMapper&
OdGiMaterialMap::mapper()
{
  return m_mapper;
}
 
inline OdGiMaterialMap::Source
OdGiMaterialMap::source() const
{
  return m_source;
}
 
inline OdString
OdGiMaterialMap::sourceFileName() const
{
  return m_fileName;
}
 
inline double
OdGiMaterialMap::blendFactor() const
{
  return m_blendFactor;
}
 
inline const OdGiMapper&
OdGiMaterialMap::mapper() const
{
  return m_mapper;
}
 
inline void
OdGiMaterialMap::setMapper(const OdGiMapper &mapper)
{
  m_mapper = mapper;
}
 
inline void
OdGiMaterialMap::setTexture(OdGiMaterialTexturePtr pTexture)
{
  m_texture = pTexture;
}
 
inline const OdGiMaterialTexturePtr
OdGiMaterialMap::texture(void) const
{
  return m_texture;
}
 
// OdGiMapper inline implementations
 
inline
OdGiMapper::OdGiMapper(const OdGiMapper& mapper)
  : m_projection(mapper.m_projection)
  , m_uTiling(mapper.m_uTiling)
  , m_vTiling(mapper.m_vTiling)
  , m_autoTransform(mapper.m_autoTransform)
  , m_transform(mapper.m_transform)
{
}
 
inline OdGiMapper&
OdGiMapper::operator=(const OdGiMapper& mapper)
{
  if (&mapper != this)
  {
    m_projection = mapper.m_projection;
    m_uTiling = mapper.m_uTiling;
    m_vTiling = mapper.m_vTiling;
    m_autoTransform = mapper.m_autoTransform;
    m_transform = mapper.m_transform;
  }
  return *this;
}
 
inline bool
OdGiMapper::operator==(const OdGiMapper& mapper) const
{
  return m_projection == mapper.m_projection
    && m_uTiling == mapper.m_uTiling
    && m_vTiling == mapper.m_vTiling
    && m_autoTransform == mapper.m_autoTransform
    && m_transform == mapper.m_transform;
}
 
inline bool
OdGiMapper::operator!=(const OdGiMapper& mapper) const
{
  return !(*this == mapper);
}
 
inline void
OdGiMapper::setProjection(Projection projection)
{
  m_projection = projection;
}
 
inline void
OdGiMapper::setUTiling(Tiling tiling)
{
  m_uTiling = tiling;
}
 
inline void
OdGiMapper::setVTiling(Tiling tiling)
{
  m_vTiling = tiling;
}
 
inline void
OdGiMapper::setAutoTransform(AutoTransform autoTransform)
{
  m_autoTransform = autoTransform;
}
 
inline OdGiMapper::Projection
OdGiMapper::projection() const
{
  return m_projection;
}
 
inline OdGiMapper::Tiling
OdGiMapper::uTiling() const
{
  return m_uTiling;
}
 
inline OdGiMapper::Tiling
OdGiMapper::vTiling() const
{
  return m_vTiling;
}
 
inline OdGiMapper::AutoTransform
OdGiMapper::autoTransform() const
{
  return m_autoTransform;
}
 
inline const OdGeMatrix3d&
OdGiMapper::transform() const
{
  return m_transform;
}
 
inline OdGeMatrix3d&
OdGiMapper::transform()
{
  return m_transform;
}
 
inline void
OdGiMapper::setTransform(const OdGeMatrix3d &tm)
{
  transform() = tm;
}
 
// OdGiImageFileTexture inline implementations
 
inline void
OdGiImageFileTexture::setSourceFileName(const OdString& fileName)
{
  m_sourceFileName = fileName;
}
 
inline const OdString
OdGiImageFileTexture::sourceFileName() const
{
  return m_sourceFileName;
}
 
inline bool
OdGiImageFileTexture::operator==(const OdGiMaterialTexture & texture) const
{
  if (!(texture.isA() == isA()))
    return false;
  const OdGiImageFileTexture &refTexture = static_cast<const OdGiImageFileTexture&>(texture);
  return m_sourceFileName == refTexture.m_sourceFileName;
}
 
inline OdGiImageFileTexture &
OdGiImageFileTexture::operator =(const OdGiImageFileTexture &texture)
{
  m_sourceFileName = texture.m_sourceFileName;
  return *this;
}
 
inline void OdGiImageFileTexture::copyFrom(const OdRxObject* pSource)
{
  OdGiImageFileTexturePtr pSrcTex = OdGiImageFileTexture::cast(pSource);
  if (!pSrcTex.isNull())
  {
    setSourceFileName(pSrcTex->sourceFileName());
  }
  else
  {
    throw OdError(eNotApplicable);
  }
}
 
// OdGiRasterImageTexture inline implementations
 
inline void
OdGiRasterImageTexture::setRasterImage(const OdGiRasterImage *pRasterImage)
{
  m_pRasterImage = reinterpret_cast<const OdRxObject*>(pRasterImage);
}
 
inline const OdGiRasterImage *
OdGiRasterImageTexture::rasterImage() const
{
  return reinterpret_cast<const OdGiRasterImage*>(m_pRasterImage.get());
}
 
inline bool
OdGiRasterImageTexture::operator==(const OdGiMaterialTexture & texture) const
{
  if (!(texture.isA() == isA()))
    return false;
  const OdGiRasterImageTexture &refTexture = static_cast<const OdGiRasterImageTexture&>(texture);
  return m_pRasterImage.get() == refTexture.m_pRasterImage.get();
}
 
inline OdGiRasterImageTexture &
OdGiRasterImageTexture::operator =(const OdGiRasterImageTexture &texture)
{
  m_pRasterImage = texture.m_pRasterImage;
  return *this;
}
 
inline void OdGiRasterImageTexture::copyFrom(const OdRxObject* pSource)
{
  OdGiRasterImageTexturePtr pSrcTex = OdGiRasterImageTexture::cast(pSource);
  if (!pSrcTex.isNull())
  {
    setRasterImage(pSrcTex->rasterImage());
  }
  else
  {
    throw OdError(eNotApplicable);
  }
}
 
// OdGiWoodTexture inline implementations
 
inline
OdGiWoodTexture::OdGiWoodTexture()
  : m_radialNoise(0.)
  , m_axialNoise(0.)
  , m_grainThickness(0.)
{
}
 
inline void
OdGiWoodTexture::setColor1(const OdGiMaterialColor &woodColor1)
{
  m_color1 = woodColor1;
}
 
inline const OdGiMaterialColor&
OdGiWoodTexture::color1(void) const
{
  return m_color1;
}
 
inline void
OdGiWoodTexture::setColor2(const OdGiMaterialColor &woodColor2)
{
  m_color2 = woodColor2;
}
 
inline const OdGiMaterialColor&
OdGiWoodTexture::color2(void) const
{
  return m_color2;
}
 
inline void
OdGiWoodTexture::setRadialNoise(double radialNoise)
{
  m_radialNoise = radialNoise;
}
 
inline double
OdGiWoodTexture::radialNoise(void) const
{
  return m_radialNoise;
}
 
inline void
OdGiWoodTexture::setAxialNoise(double axialNoise)
{
  m_axialNoise = axialNoise;
}
 
inline double
OdGiWoodTexture::axialNoise(void) const
{
  return m_axialNoise;
}
 
inline void
OdGiWoodTexture::setGrainThickness(double grainThickness)
{
  m_grainThickness = grainThickness;
}
 
inline double
OdGiWoodTexture::grainThickness(void) const
{
  return m_grainThickness;
}
 
inline bool
OdGiWoodTexture::operator==(const OdGiMaterialTexture & texture) const
{
  if (!(texture.isA() == isA()))
    return false;
  const OdGiWoodTexture &refTexture = static_cast<const OdGiWoodTexture&>(texture);
  return (m_color1 == refTexture.m_color1) &&
         (m_color2 == refTexture.m_color2) &&
         (m_radialNoise == refTexture.m_radialNoise) &&
         (m_axialNoise == refTexture.m_axialNoise) &&
         (m_grainThickness == refTexture.m_grainThickness);
}
 
inline OdGiWoodTexture &
OdGiWoodTexture::operator =(const OdGiWoodTexture &texture)
{
  m_color1 = texture.m_color1;
  m_color2 = texture.m_color2;
  m_radialNoise = texture.m_radialNoise;
  m_axialNoise = texture.m_axialNoise;
  m_grainThickness = texture.m_grainThickness;
  return *this;
}
 
inline void OdGiWoodTexture::copyFrom(const OdRxObject* pSource)
{
  OdGiWoodTexturePtr pSrcTex = OdGiWoodTexture::cast(pSource);
  if (!pSrcTex.isNull())
  {
    setColor1(pSrcTex->color1());
    setColor2(pSrcTex->color2());
    setRadialNoise(pSrcTex->radialNoise());
    setAxialNoise(pSrcTex->axialNoise());
    setGrainThickness(pSrcTex->grainThickness());
  }
  else
  {
    throw OdError(eNotApplicable);
  }
}
 
// OdGiMarbleTexture inline implementations
 
inline
OdGiMarbleTexture::OdGiMarbleTexture()
  : m_veinSpacing(0.)
  , m_veinWidth(0.)
{
}
 
inline void
OdGiMarbleTexture::setStoneColor(const OdGiMaterialColor &stoneColor)
{
  m_stoneColor = stoneColor;
}
 
inline const OdGiMaterialColor&
OdGiMarbleTexture::stoneColor(void) const
{
  return m_stoneColor;
}
 
inline void
OdGiMarbleTexture::setVeinColor(const OdGiMaterialColor &veinColor)
{
  m_veinColor = veinColor;
}
 
inline const OdGiMaterialColor&
OdGiMarbleTexture::veinColor(void) const
{
  return m_veinColor;
}
 
inline void
OdGiMarbleTexture::setVeinSpacing(double veinSpacing)
{
  m_veinSpacing = veinSpacing;
}
 
inline double
OdGiMarbleTexture::veinSpacing(void) const
{
  return m_veinSpacing;
}
 
inline void
OdGiMarbleTexture::setVeinWidth(double veinWidth)
{
  m_veinWidth = veinWidth;
}
 
inline double
OdGiMarbleTexture::veinWidth(void) const
{
  return m_veinWidth;
}
 
inline bool
OdGiMarbleTexture::operator==(const OdGiMaterialTexture & texture) const
{
  if (!(texture.isA() == isA()))
    return false;
  const OdGiMarbleTexture &refTexture = static_cast<const OdGiMarbleTexture&>(texture);
  return (m_stoneColor == refTexture.m_stoneColor) &&
         (m_veinColor == refTexture.m_veinColor) &&
         (m_veinSpacing == refTexture.m_veinSpacing) &&
         (m_veinWidth == refTexture.m_veinWidth);
}
 
inline OdGiMarbleTexture &
OdGiMarbleTexture::operator =(const OdGiMarbleTexture &texture)
{
  m_stoneColor = texture.m_stoneColor;
  m_veinColor = texture.m_veinColor;
  m_veinSpacing = texture.m_veinSpacing;
  m_veinWidth = texture.m_veinWidth;
  return *this;
}
 
inline void OdGiMarbleTexture::copyFrom(const OdRxObject* pSource)
{
  OdGiMarbleTexturePtr pSrcTex = OdGiMarbleTexture::cast(pSource);
  if (!pSrcTex.isNull())
  {
    setStoneColor(pSrcTex->stoneColor());
    setVeinColor(pSrcTex->veinColor());
    setVeinSpacing(pSrcTex->veinSpacing());
    setVeinWidth(pSrcTex->veinWidth());
  }
  else
  {
    throw OdError(eNotApplicable);
  }
}
 
// OdGiGenericTexture inline implementations
 
inline
OdGiGenericTexture::OdGiGenericTexture()
{
}
 
inline void
OdGiGenericTexture::setDefinition(const OdGiVariant &definition)
{
  if (m_definition.isNull())
  {
    m_definition = OdGiVariant::createObject(definition);
  }
  else
  {
    *m_definition = definition;
  }
}
 
inline OdGiVariantPtr
OdGiGenericTexture::definition() const
{
  return m_definition;
}
 
inline void
OdGiGenericTexture::definition(OdGiVariantPtr &pDefinition) const
{
  if (m_definition.isNull())
  {
    pDefinition = OdGiVariant::createObject();
  }
  else
  {
    pDefinition = OdGiVariant::createObject(*m_definition);
  }
}
 
inline bool
OdGiGenericTexture::operator==(const OdGiMaterialTexture & texture) const
{
  if (!(texture.isA() == isA()))
    return false;
  const OdGiGenericTexture &refTexture = static_cast<const OdGiGenericTexture&>(texture);
  if (m_definition.isNull() && refTexture.m_definition.isNull())
    return true;
  if (!m_definition.isNull() && !refTexture.m_definition.isNull())
    return (*m_definition == *(refTexture.m_definition));
  return false;
}
 
inline OdGiGenericTexture &
OdGiGenericTexture::operator =(const OdGiGenericTexture &texture)
{
  if (!texture.m_definition.isNull())
    m_definition = OdGiVariant::createObject(*(texture.m_definition));
  else
    m_definition.release();
  return *this;
}
 
inline void OdGiGenericTexture::copyFrom(const OdRxObject* pSource)
{
  OdGiGenericTexturePtr pSrcTex = OdGiGenericTexture::cast(pSource);
  if (!pSrcTex.isNull())
  {
    setDefinition(*(pSrcTex->definition()));
  }
  else
  {
    throw OdError(eNotApplicable);
  }
}
 
#include "TD_PackPop.h"
 
#endif //#ifndef __ODGIMATERIAL_H__