CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiEnvironmentTraitsData.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24
25#ifndef __OD_GI_ENVIRONMENT_TRAITS_DATA__
26#define __OD_GI_ENVIRONMENT_TRAITS_DATA__
27
28#include "TD_PackPush.h"
29
30#include "Gi/GiEnvironment.h"
31#include "Gi/GiLightTraits.h" // Define OdGiSkyParameters
32
38{
39protected:
41
42protected:
44 {
45 }
46
47public:
55
61 static void deleteBackgroundTraitsData(OdGiBackgroundTraitsData* pBackgroundTraits);
62
71 bool operator ==(const OdGiBackgroundTraitsData &data2) const
72 {
73 return m_type == data2.m_type;
74 }
75
84 bool operator !=(const OdGiBackgroundTraitsData &data2) const
85 {
86 return m_type != data2.m_type;
87 }
88};
89
95{
96 OdCmEntityColor m_color;
97
98public:
104
111 OdCmEntityColor color() const { return m_color; }
112
118 void setColor(const OdCmEntityColor& color) { m_color = color; }
119
129 {
130 return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
131 (m_color == data2.m_color));
132 }
133
143 {
144 return !(*this == data2);
145 }
146};
147
153{
154 OdCmEntityColor m_colorTop;
155 OdCmEntityColor m_colorMiddle;
156 OdCmEntityColor m_colorBottom;
157 double m_dHorizon;
158 double m_dHeight;
159 double m_dRotation;
160
161public:
166 OdGiGradientBackgroundTraitsData() : m_dHorizon(0.0), m_dHeight(0.0), m_dRotation(0.0) { m_type = OdGiDrawable::kGradientBackground; }
167
174 OdCmEntityColor colorTop() const { return m_colorTop; }
175
181 void setColorTop(const OdCmEntityColor& color) { m_colorTop = color; }
182
189 OdCmEntityColor colorMiddle() const { return m_colorMiddle; }
190
196 void setColorMiddle(const OdCmEntityColor& color) { m_colorMiddle = color; }
197
204 OdCmEntityColor colorBottom() const { return m_colorBottom; }
205
211 void setColorBottom(const OdCmEntityColor& color) { m_colorBottom = color; }
212
213
220 double horizon() const { return m_dHorizon; }
221
228 double height() const { return m_dHeight; }
229
236 double rotation() const { return m_dRotation; }
237
238
248 void setHorizon(double value) { m_dHorizon = value; }
249
259 void setHeight(double value) { m_dHeight = value; }
260
271 void setRotation(double value) { m_dRotation = value; }
272
273
290 {
291 return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
292 (m_colorTop == data2.m_colorTop) &&
293 (m_colorMiddle == data2.m_colorMiddle) &&
294 (m_colorBottom == data2.m_colorBottom) &&
295 OdEqual(m_dHorizon, data2.m_dHorizon) &&
296 OdEqual(m_dHeight, data2.m_dHeight) &&
297 OdEqual(m_dRotation, data2.m_dRotation));
298 }
299
316 {
317 return !(*this == data2);
318 }
319};
320
326{
327 OdString m_imageFileName;
328 bool m_bFitToScreen;
329 bool m_bMaintainAspect;
330 bool m_bUseTiling;
331 OdGeVector2d m_vOffset;
332 OdGeVector2d m_vScale;
333
334public:
335 OdGiImageBackgroundTraitsData() : m_bFitToScreen(false), m_bMaintainAspect(false), m_bUseTiling(false) { m_type = OdGiDrawable::kImageBackground; }
336
343 const OdString& imageFilename() const { return m_imageFileName; }
344
350 void setImageFilename(const OdString& filename) { m_imageFileName = filename; }
351
358 bool fitToScreen() const { return m_bFitToScreen; }
359
366 bool maintainAspectRatio() const { return m_bMaintainAspect; }
367
374 bool useTiling() const { return m_bUseTiling; }
375
381 void setFitToScreen(bool flag) { m_bFitToScreen = flag; }
382
389 void setMaintainAspectRatio(bool flag) { m_bMaintainAspect = flag; }
390
399 void setUseTiling(bool flag) { m_bUseTiling = flag; }
400
407 void setOffset(double x, double y);
408
415 double xOffset() const { return m_vOffset.x; }
416
423 double yOffset() const { return m_vOffset.y; }
424
430 void setXOffset(double xOffset) { m_vOffset.x = xOffset; }
431
437 void setYOffset(double yOffset) { m_vOffset.y = yOffset; }
438
445 void setScale(double x, double y);
446
454 double xScale() const { return m_vScale.x; }
455
463 double yScale() const { return m_vScale.y; }
464
470 void setXScale(double xScale) { m_vScale.x = xScale; }
471
477 void setYScale(double yScale) { m_vScale.y = yScale; }
478
495 {
496 return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
497 (m_imageFileName == data2.m_imageFileName) &&
498 (m_bFitToScreen == data2.m_bFitToScreen) &&
499 (m_bMaintainAspect == data2.m_bMaintainAspect) &&
500 (m_bUseTiling == data2.m_bUseTiling) &&
501 (m_vOffset == data2.m_vOffset) &&
502 (m_vScale == data2.m_vScale));
503 }
504
521 {
522 return !(*this == data2);
523 }
524};
525
527{
528 m_vOffset.set(x, y);
529}
530
531inline void OdGiImageBackgroundTraitsData::setScale(double x, double y)
532{
533 m_vScale.set(x, y);
534}
535
541{
542 OdCmEntityColor m_colorSkyZenith;
543 OdCmEntityColor m_colorSkyHorizon;
544 OdCmEntityColor m_colorUndergroundHorizon;
545 OdCmEntityColor m_colorUndergroundAzimuth;
546 OdCmEntityColor m_colorGroundPlaneNear;
547 OdCmEntityColor m_colorGroundPlaneFar;
548
549public:
555
556
563 OdCmEntityColor colorSkyZenith() const { return m_colorSkyZenith; }
564
570 void setColorSkyZenith(const OdCmEntityColor& color) { m_colorSkyZenith = color; }
571
578 OdCmEntityColor colorSkyHorizon() const { return m_colorSkyHorizon; }
579
585 void setColorSkyHorizon(const OdCmEntityColor& color) { m_colorSkyHorizon = color; }
586
593 OdCmEntityColor colorUndergroundHorizon() const { return m_colorUndergroundHorizon; }
594
600 void setColorUndergroundHorizon(const OdCmEntityColor& color) { m_colorUndergroundHorizon = color; }
601
608 OdCmEntityColor colorUndergroundAzimuth() const { return m_colorUndergroundAzimuth; }
609
615 void setColorUndergroundAzimuth(const OdCmEntityColor& color) { m_colorUndergroundAzimuth = color; }
616
623 OdCmEntityColor colorGroundPlaneNear() const { return m_colorGroundPlaneNear; }
624
630 void setColorGroundPlaneNear(const OdCmEntityColor& color) { m_colorGroundPlaneNear = color; }
631
638 OdCmEntityColor colorGroundPlaneFar() const { return m_colorGroundPlaneFar; }
639
645 void setColorGroundPlaneFar(const OdCmEntityColor& color) { m_colorGroundPlaneFar = color; }
646
663 {
664 return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
665 (m_colorSkyZenith == data2.m_colorSkyZenith) &&
666 (m_colorSkyHorizon == data2.m_colorSkyHorizon) &&
667 (m_colorUndergroundHorizon == data2.m_colorUndergroundHorizon) &&
668 (m_colorUndergroundAzimuth == data2.m_colorUndergroundAzimuth) &&
669 (m_colorGroundPlaneNear == data2.m_colorGroundPlaneNear) &&
670 (m_colorGroundPlaneFar == data2.m_colorGroundPlaneFar));
671 }
672
689 {
690 return !(*this == data2);
691 }
692};
693
699{
700 bool m_status;
701 double m_intensityFactor;
702 double m_haze;
703 double m_horizonHeight;
704 double m_horizonBlur;
705 OdCmEntityColor m_groundColor;
706 OdCmEntityColor m_nightColor;
707 bool m_aerialPerspective;
708 double m_visibilityDistance;
709 double m_diskScale;
710 double m_glowIntensity;
711 double m_diskIntensity;
712 OdUInt16 m_solarDiskSamples;
713 OdGeVector3d m_sunDirection;
714 double m_redBlueShift;
715 double m_saturation;
716public:
722
729
736
763 {
764 return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
765 (m_status == data2.m_status) &&
766 OdEqual(m_intensityFactor, data2.m_intensityFactor) &&
767 OdEqual(m_haze, data2.m_haze) &&
768 OdEqual(m_horizonHeight, data2.m_horizonHeight) &&
769 OdEqual(m_horizonBlur, data2.m_horizonBlur) &&
770 (m_groundColor == data2.m_groundColor) &&
771 (m_nightColor == data2.m_nightColor) &&
772 (m_aerialPerspective == data2.m_aerialPerspective) &&
773 OdEqual(m_visibilityDistance, data2.m_visibilityDistance) &&
774 OdEqual(m_diskScale, data2.m_diskScale) &&
775 OdEqual(m_glowIntensity, data2.m_glowIntensity) &&
776 OdEqual(m_diskIntensity, data2.m_diskIntensity) &&
777 (m_solarDiskSamples == data2.m_solarDiskSamples) &&
778 (m_sunDirection == data2.m_sunDirection) &&
779 OdEqual(m_redBlueShift, data2.m_redBlueShift) &&
780 OdEqual(m_saturation, data2.m_saturation));
781 }
782
809 {
810 return !(*this == data2);
811 }
812};
813
815{
816 params.setIllumination(m_status);
817 params.setIntensityFactor(m_intensityFactor);
818 params.setHaze(m_haze);
819 params.setHorizonHeight(m_horizonHeight);
820 params.setHorizonBlur(m_horizonBlur);
821 params.setGroundColor(m_groundColor);
822 params.setNightColor(m_nightColor);
823 params.setAerialPerspective(m_aerialPerspective);
824 params.setVisibilityDistance(m_visibilityDistance);
825 params.setDiskScale(m_diskScale);
826 params.setGlowIntensity(m_glowIntensity);
827 params.setDiskIntensity(m_diskIntensity);
828 params.setSolarDiskSamples(m_solarDiskSamples);
829 params.setSunDirection(m_sunDirection);
830 params.setRedBlueShift(m_redBlueShift);
831 params.setSaturation(m_saturation);
832}
833
835{
836 m_status = params.illumination();
837 m_intensityFactor = params.intensityFactor();
838 m_haze = params.haze();
839 m_horizonHeight = params.horizonHeight();
840 m_horizonBlur = params.horizonBlur();
841 m_groundColor = params.groundColor();
842 m_nightColor = params.nightColor();
843 m_aerialPerspective = params.aerialPerspective();
844 m_visibilityDistance = params.visibilityDistance();
845 m_diskScale = params.diskScale();
846 m_glowIntensity = params.glowIntensity();
847 m_diskIntensity = params.diskIntensity();
848 m_solarDiskSamples = params.solarDiskSamples();
849 m_sunDirection = params.sunDirection();
850 m_redBlueShift = params.redBlueShift();
851 m_saturation = params.saturation();
852}
853
859{
860 bool m_bEnable;
861 OdString m_iblFileName;
862 double m_rotation;
863 bool m_bDisplay;
864 OdDbStub *m_secBkgndId;
865
866public:
867
873
880 bool isEnabled() const { return m_bEnable; }
881
887 void enable(bool bSet) { m_bEnable = bSet; }
888
889
890
897 const OdString &IBLFileName() const { return m_iblFileName; }
898
904 void setIBLFileName(const OdString &iblFileName) { m_iblFileName = iblFileName; }
905
906
907
914 double rotation() const { return m_rotation; }
915
921 void setRotation(double angle) { m_rotation = angle; }
922
923
924
931 bool displayImage() const { return m_bDisplay; }
932
938 void setDisplayImage(bool bSet) { m_bDisplay = bSet; }
939
940
941
948 OdDbStub *secondaryBackground() const { return m_secBkgndId; }
949
955 void setSecondaryBackground(OdDbStub *secBkgndId) { m_secBkgndId = secBkgndId; }
956
957
958
974 {
975 return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
976 (m_bEnable == data2.m_bEnable) &&
977 (m_iblFileName == data2.m_iblFileName) &&
978 OdEqual(m_rotation, data2.m_rotation) &&
979 (m_bDisplay == data2.m_bDisplay) &&
980 (m_secBkgndId == data2.m_secBkgndId));
981 }
982
998 {
999 return !(*this == data2);
1000 }
1001};
1002
1003// Delete background traits data by background type
1004
1006{
1007 switch (pBackgroundTraits->type())
1008 {
1010 delete static_cast<OdGiSolidBackgroundTraitsData*>(pBackgroundTraits);
1011 break;
1013 delete static_cast<OdGiGradientBackgroundTraitsData*>(pBackgroundTraits);
1014 break;
1016 delete static_cast<OdGiImageBackgroundTraitsData*>(pBackgroundTraits);
1017 break;
1019 delete static_cast<OdGiGroundPlaneBackgroundTraitsData*>(pBackgroundTraits);
1020 break;
1022 delete static_cast<OdGiSkyBackgroundTraitsData*>(pBackgroundTraits);
1023 break;
1025 delete static_cast<OdGiIBLBackgroundTraitsData*>(pBackgroundTraits);
1026 break;
1027 default:
1028 ODA_FAIL();
1029 }
1030}
1031
1037{
1038 bool m_bEnable;
1039 bool m_bIsBackground;
1040 OdCmEntityColor m_FogColor;
1041 double m_dNearDist;
1042 double m_dFarDist;
1043 double m_dNearPerc;
1044 double m_dFarPerc;
1045 OdGiMaterialTexturePtr m_envMap;
1046public:
1047
1053 : m_bEnable(false)
1054 , m_bIsBackground(false)
1055 , m_FogColor(128, 128, 128)
1056 , m_dNearDist(0.0)
1057 , m_dFarDist(100.0)
1058 , m_dNearPerc(0.0)
1059 , m_dFarPerc(100.0)
1060 {
1061 }
1062
1068 void setEnable(bool bEnable) { m_bEnable = bEnable; }
1069
1076 bool enable() const { return m_bEnable; }
1077
1083 void setIsBackground(bool bEnable) { m_bIsBackground = bEnable; }
1084
1091 bool isBackground() const { return m_bIsBackground; }
1092
1098 void setFogColor(const OdCmEntityColor &color) { m_FogColor = color; }
1099
1106 const OdCmEntityColor &fogColor() const { return m_FogColor; }
1107
1113 void setNearDistance(double nearDist) { m_dNearDist = nearDist; }
1114
1121 double nearDistance() const { return m_dNearDist; }
1122
1128 void setFarDistance(double farDist) { m_dFarDist = farDist; }
1129
1136 double farDistance() const { return m_dFarDist; }
1137
1143 void setNearPercentage(double nearPct) { m_dNearPerc = nearPct; }
1144
1151 double nearPercentage() const { return m_dNearPerc; }
1152
1158 void setFarPercentage(double farPct) { m_dFarPerc = farPct; }
1159
1166 double farPercentage() const { return m_dFarPerc; }
1167
1174 {
1175 m_envMap.release();
1176 if (map)
1177 {
1178 m_envMap = OdGiMaterialTexture::cast(map->clone());
1179 }
1180 }
1181
1188 OdGiMaterialTexturePtr environmentMap() const { return m_envMap; }
1189
1206 {
1207 return ((m_bEnable == data2.m_bEnable) &&
1208 (m_bIsBackground == data2.m_bIsBackground) &&
1209 (m_FogColor == data2.m_FogColor) &&
1210 OdEqual(m_dNearDist, data2.m_dNearDist) &&
1211 OdEqual(m_dFarDist, data2.m_dFarDist) &&
1212 OdEqual(m_dNearPerc, data2.m_dNearPerc) &&
1213 OdEqual(m_dFarPerc, data2.m_dFarPerc) &&
1214 ((m_envMap.isNull() && data2.m_envMap.isNull()) ||
1215 (!m_envMap.isNull() && !data2.m_envMap.isNull() && (*m_envMap == *data2.m_envMap))));
1216 }
1217
1234 {
1235 return !(*this == data2);
1236 }
1237};
1238
1244{
1245 bool m_bMatEnable;
1246 bool m_bTextureSampling;
1247 bool m_bBackFaces;
1248 bool m_bShadows;
1249 bool m_bDiagnosticBack;
1250 double m_dScaleFactor;
1251public:
1265 : m_bMatEnable(true)
1266 , m_bTextureSampling(true)
1267 , m_bBackFaces(true)
1268 , m_bShadows(true)
1269 , m_bDiagnosticBack(false)
1270 , m_dScaleFactor(1.0)
1271 {
1272 }
1273
1277 virtual ~OdGiRenderSettingsTraitsData() { } // Exclude warnings in some compilers
1278
1287 void setMaterialEnabled(bool enabled) { m_bMatEnable = enabled; }
1288
1295 bool materialEnabled() const { return m_bMatEnable; }
1296
1302 void setTextureSampling(bool enabled) { m_bTextureSampling = enabled; }
1303
1313 bool textureSampling() const { return m_bTextureSampling; }
1314
1320 void setBackFacesEnabled(bool enabled) { m_bBackFaces = enabled; }
1321
1328 bool backFacesEnabled() const { return m_bBackFaces; }
1329
1335 void setShadowsEnabled(bool enabled) { m_bShadows = enabled; }
1336
1343 bool shadowsEnabled() const { return m_bShadows; }
1344
1350 void setDiagnosticBackgroundEnabled(bool enabled) { m_bDiagnosticBack = enabled; }
1351
1358 bool diagnosticBackgroundEnabled() const { return m_bDiagnosticBack; }
1359
1368 void setModelScaleFactor(double scaleFactor) { m_dScaleFactor = scaleFactor; }
1369
1376 double modelScaleFactor() const { return m_dScaleFactor; }
1377
1394 {
1395 return ((m_bMatEnable == data2.m_bMatEnable) &&
1396 (m_bTextureSampling == data2.m_bTextureSampling) &&
1397 (m_bBackFaces == data2.m_bBackFaces) &&
1398 (m_bShadows == data2.m_bShadows) &&
1399 (m_bDiagnosticBack == data2.m_bDiagnosticBack) &&
1400 OdEqual(m_dScaleFactor, data2.m_dScaleFactor));
1401 }
1402
1419 {
1420 return !(*this == data2);
1421 }
1422};
1423
1429{
1430 int m_iSamplingMin;
1431 int m_iSamplingMax;
1432 OdGiMrFilter m_SamplingFilter;
1433 double m_dSamplingWidth;
1434 double m_dSamplingHeight;
1435 float m_fContrastR;
1436 float m_fContrastG;
1437 float m_fContrastB;
1438 float m_fContrastA;
1439 OdGiMrShadowMode m_ShadowMode;
1440 bool m_bShadowMapEnabled;
1441 bool m_bRayTraceEnabled;
1442 int m_iRTReflection;
1443 int m_iRTRefraction;
1444 int m_iRTSum;
1445 bool m_bGlobalIllum;
1446 int m_iGISampleCount;
1447 bool m_bSampleRadEnabled;
1448 double m_dSampleRad;
1449 int m_iPhotonsPerLight;
1450 int m_iPhotonsReflection;
1451 int m_iPhotonsRefraction;
1452 int m_iPhotonsSum;
1453 bool m_bFGEnabled;
1454 int m_iFGRayCount;
1455 bool m_bFGRadMin;
1456 bool m_bFGRadMax;
1457 bool m_bFGPixels;
1458 double m_dFGSRadMin;
1459 double m_dFGSRadMax;
1460 double m_dLightLumScale;
1461 OdGiMrDiagnosticMode m_DiagMode;
1462 OdGiMrDiagnosticGridMode m_DiagGridMode;
1463 float m_fDiagGridSize;
1464 OdGiMrDiagnosticPhotonMode m_DiagPhtMode;
1465 OdGiMrDiagnosticBSPMode m_DiagBSPMode;
1466 bool m_bExportMIEnabled;
1467 OdString m_sMIFile;
1468 int m_iTileSize;
1469 OdGiMrTileOrder m_TileOrder;
1470 int m_iMemLimit;
1471 float m_fEnergyMult;
1472 void* m_pProgressMonitor;
1473 OdGiMrExposureType m_ExposureType;
1474 OdGiMrFinalGatheringMode m_FGMode;
1475 double m_dShadowMult;
1476 OdGiMrExportMIMode m_MIMode;
1477public:
1478
1534 , m_iSamplingMin(-1)
1535 , m_iSamplingMax(0)
1536 , m_SamplingFilter(krBox)
1537 , m_dSamplingWidth(1.0)
1538 , m_dSamplingHeight(1.0)
1539 , m_fContrastR(0.1f)
1540 , m_fContrastG(0.1f)
1541 , m_fContrastB(0.1f)
1542 , m_fContrastA(0.1f)
1543 , m_ShadowMode(krSimple)
1544 , m_bShadowMapEnabled(true)
1545 , m_bRayTraceEnabled(true)
1546 , m_iRTReflection(2)
1547 , m_iRTRefraction(2)
1548 , m_iRTSum(4)
1549 , m_bGlobalIllum(false)
1550 , m_iGISampleCount(500)
1551 , m_bSampleRadEnabled(false)
1552 , m_dSampleRad(1.0)
1553 , m_iPhotonsPerLight(10000)
1554 , m_iPhotonsReflection(5)
1555 , m_iPhotonsRefraction(5)
1556 , m_iPhotonsSum(5)
1557 , m_bFGEnabled(false)
1558 , m_iFGRayCount(1000)
1559 , m_bFGRadMin(false)
1560 , m_bFGRadMax(false)
1561 , m_bFGPixels(false)
1562 , m_dFGSRadMin(1.0)
1563 , m_dFGSRadMax(1.0)
1564 , m_dLightLumScale(1.0)
1565 , m_DiagMode(krOff)
1566 , m_DiagGridMode(krObject)
1567 , m_fDiagGridSize(10.0f)
1568 , m_DiagPhtMode(krDensity)
1569 , m_DiagBSPMode(krDepth)
1570 , m_bExportMIEnabled(false)
1571 , m_sMIFile()
1572 , m_iTileSize(32)
1573 , m_TileOrder(krHilbert)
1574 , m_iMemLimit(1048)
1575 , m_fEnergyMult(1.0f)
1576 , m_pProgressMonitor(NULL)
1577 , m_ExposureType(krAutomatic)
1578 , m_FGMode(krFinalGatherAuto)
1579 , m_dShadowMult(1.0)
1580 , m_MIMode(krExportMIOff)
1581 {
1582 }
1583
1590 void setSampling(int min, int max)
1591 {
1592 m_iSamplingMin = min;
1593 m_iSamplingMax = max;
1594 }
1595
1602 void sampling(int& min, int& max) const
1603 {
1604 min = m_iSamplingMin;
1605 max = m_iSamplingMax;
1606 }
1607
1615 void setSamplingFilter(OdGiMrFilter filter, double width, double height)
1616 {
1617 m_SamplingFilter = filter;
1618 m_dSamplingWidth = width;
1619 m_dSamplingHeight = height;
1620 }
1621
1629 void samplingFilter(OdGiMrFilter& filter, double& width, double& height) const
1630 {
1631 filter = m_SamplingFilter;
1632 width = m_dSamplingWidth;
1633 height = m_dSamplingHeight;
1634 }
1635
1647 void setSamplingContrastColor(float r, float g, float b, float a)
1648 {
1649 m_fContrastR = r;
1650 m_fContrastG = g;
1651 m_fContrastB = b;
1652 m_fContrastA = a;
1653 }
1654
1666 void samplingContrastColor(float& r, float& g, float& b, float& a) const
1667 {
1668 r = m_fContrastR;
1669 g = m_fContrastG;
1670 b = m_fContrastB;
1671 a = m_fContrastA;
1672 }
1673
1680 {
1681 m_ShadowMode = mode;
1682 }
1683
1691 {
1692 return m_ShadowMode;
1693 }
1694
1700 void setShadowMapEnabled(bool enabled)
1701 {
1702 m_bShadowMapEnabled = enabled;
1703 }
1704
1711 bool shadowMapEnabled() const
1712 {
1713 return m_bShadowMapEnabled;
1714 }
1715
1721 void setRayTraceEnabled(bool enabled)
1722 {
1723 m_bRayTraceEnabled = enabled;
1724 }
1725
1732 bool rayTraceEnabled() const
1733 {
1734 return m_bRayTraceEnabled;
1735 }
1736
1744 void setRayTraceDepth(int reflection, int refraction, int sum)
1745 {
1746 m_iRTReflection = reflection;
1747 m_iRTRefraction = refraction;
1748 m_iRTSum = sum;
1749 }
1750
1758 void rayTraceDepth(int& reflection, int& refraction, int& sum) const
1759 {
1760 reflection = m_iRTReflection;
1761 refraction = m_iRTRefraction;
1762 sum = m_iRTSum;
1763 }
1764
1771 {
1772 m_bGlobalIllum = enabled;
1773 }
1774
1782 {
1783 return m_bGlobalIllum;
1784 }
1785
1791 void setGISampleCount(int num)
1792 {
1793 m_iGISampleCount = num;
1794 }
1795
1802 int giSampleCount() const
1803 {
1804 return m_iGISampleCount;
1805 }
1806
1812 void setGISampleRadiusEnabled(bool enabled)
1813 {
1814 m_bSampleRadEnabled = enabled;
1815 }
1816
1824 {
1825 return m_bSampleRadEnabled;
1826 }
1827
1836 void setGISampleRadius(double radius)
1837 {
1838 m_dSampleRad = radius;
1839 }
1840
1847 double giSampleRadius() const
1848 {
1849 return m_dSampleRad;
1850 }
1851
1858 {
1859 m_iPhotonsPerLight = num;
1860 }
1861
1869 {
1870 return m_iPhotonsPerLight;
1871 }
1872
1880 void setPhotonTraceDepth(int reflection, int refraction, int sum)
1881 {
1882 m_iPhotonsReflection = reflection;
1883 m_iPhotonsRefraction = refraction;
1884 m_iPhotonsSum = sum;
1885 }
1886
1894 void photonTraceDepth(int& reflection, int& refraction, int& sum) const
1895 {
1896 reflection = m_iPhotonsReflection;
1897 refraction = m_iPhotonsRefraction;
1898 sum = m_iPhotonsSum;
1899 }
1900
1909 void setFinalGatheringEnabled(bool enabled)
1910 {
1911 m_bFGEnabled = enabled;
1912 }
1913
1924 {
1925 return m_bFGEnabled;
1926 }
1927
1936 void setFGRayCount(int num)
1937 {
1938 m_iFGRayCount = num;
1939 }
1940
1950 int fgRayCount() const
1951 {
1952 return m_iFGRayCount;
1953 }
1954
1962 void setFGRadiusState(bool bMin, bool bMax, bool bPixels)
1963 {
1964 m_bFGRadMin = bMin;
1965 m_bFGRadMax = bMax;
1966 m_bFGPixels = bPixels;
1967 }
1968
1976 void fgSampleRadiusState(bool& bMin, bool& bMax, bool& bPixels)
1977 {
1978 bMin = m_bFGRadMin;
1979 bMax = m_bFGRadMax;
1980 bPixels = m_bFGPixels;
1981 }
1982
1989 void setFGSampleRadius(double min, double max)
1990 {
1991 m_dFGSRadMin = min;
1992 m_dFGSRadMax = max;
1993 }
1994
2001 void fgSampleRadius(double& min, double& max) const
2002 {
2003 min = m_dFGSRadMin;
2004 max = m_dFGSRadMax;
2005 }
2006
2012 void setLightLuminanceScale(double luminance)
2013 {
2014 m_dLightLumScale = luminance;
2015 }
2016
2023 double lightLuminanceScale() const
2024 {
2025 return m_dLightLumScale;
2026 }
2027
2034 {
2035 m_DiagMode = mode;
2036 }
2037
2045 {
2046 return m_DiagMode;
2047 }
2048
2056 {
2057 m_DiagGridMode = mode;
2058 m_fDiagGridSize = fSize;
2059 }
2060
2067 void diagnosticGridMode(OdGiMrDiagnosticGridMode& mode, float& fSize) const
2068 {
2069 mode = m_DiagGridMode;
2070 fSize = m_fDiagGridSize;
2071 }
2072
2079 {
2080 m_DiagPhtMode = mode;
2081 }
2082
2090 {
2091 return m_DiagPhtMode;
2092 }
2093
2100 {
2101 m_DiagBSPMode = mode;
2102 }
2103
2111 {
2112 return m_DiagBSPMode;
2113 }
2114
2120 void setExportMIEnabled(bool enabled)
2121 {
2122 m_bExportMIEnabled = enabled;
2123 }
2124
2131 bool exportMIEnabled() const
2132 {
2133 return m_bExportMIEnabled;
2134 }
2135
2141 void setExportMIFileName(const OdString& miName)
2142 {
2143 m_sMIFile = miName;
2144 }
2145
2153 {
2154 return m_sMIFile;
2155 }
2156
2167 {
2168 m_iTileSize = size;
2169 }
2170
2177 int tileSize() const
2178 {
2179 return m_iTileSize;
2180 }
2181
2188 {
2189 m_TileOrder = order;
2190 }
2191
2199 {
2200 return m_TileOrder;
2201 }
2202
2208 void setMemoryLimit(int limit)
2209 {
2210 m_iMemLimit = limit;
2211 }
2212
2219 int memoryLimit() const
2220 {
2221 return m_iMemLimit;
2222 }
2223
2229 void setEnergyMultiplier(float fScale)
2230 {
2231 m_fEnergyMult = fScale;
2232 }
2233
2240 float energyMultiplier() const
2241 {
2242 return m_fEnergyMult;
2243 }
2244
2250 void setProgressMonitor(void* pMonitor)
2251 {
2252 m_pProgressMonitor = pMonitor;
2253 }
2254
2261 const void* progressMonitor() const
2262 {
2263 return m_pProgressMonitor;
2264 }
2265
2272 {
2273 m_ExposureType = type;
2274 }
2275
2283 {
2284 return m_ExposureType;
2285 }
2286
2296 {
2297 m_FGMode = mode;
2298 }
2299
2310 {
2311 return m_FGMode;
2312 }
2313
2319 void setShadowSamplingMultiplier(double multiplier)
2320 {
2321 m_dShadowMult = multiplier;
2322 }
2323
2331 {
2332 return m_dShadowMult;
2333 }
2334
2341 {
2342 m_MIMode = mode;
2343 }
2344
2352 {
2353 return m_MIMode;
2354 }
2355
2364 {
2365 return ((*static_cast<const OdGiRenderSettingsTraitsData*>(this) != static_cast<const OdGiRenderSettingsTraitsData&>(data2)) ||
2366 (m_iSamplingMin != data2.m_iSamplingMin) ||
2367 (m_iSamplingMax != data2.m_iSamplingMax) ||
2368 (m_SamplingFilter != data2.m_SamplingFilter) ||
2369 !OdEqual(m_dSamplingWidth, data2.m_dSamplingWidth) ||
2370 !OdEqual(m_dSamplingHeight, data2.m_dSamplingHeight) ||
2371 (m_fContrastR != data2.m_fContrastR) ||
2372 (m_fContrastG != data2.m_fContrastG) ||
2373 (m_fContrastB != data2.m_fContrastB) ||
2374 (m_fContrastA != data2.m_fContrastA) ||
2375 (m_ShadowMode != data2.m_ShadowMode) ||
2376 (m_bShadowMapEnabled != data2.m_bShadowMapEnabled) ||
2377 (m_bRayTraceEnabled != data2.m_bRayTraceEnabled) ||
2378 (m_iRTReflection != data2.m_iRTReflection) ||
2379 (m_iRTRefraction != data2.m_iRTRefraction) ||
2380 (m_iRTSum != data2.m_iRTSum) ||
2381 (m_bGlobalIllum != data2.m_bGlobalIllum) ||
2382 (m_iGISampleCount != data2.m_iGISampleCount) ||
2383 (m_bSampleRadEnabled != data2.m_bSampleRadEnabled) ||
2384 !OdEqual(m_dSampleRad, data2.m_dSampleRad) ||
2385 (m_iPhotonsPerLight != data2.m_iPhotonsPerLight) ||
2386 (m_iPhotonsReflection != data2.m_iPhotonsReflection) ||
2387 (m_iPhotonsRefraction != data2.m_iPhotonsRefraction) ||
2388 (m_iPhotonsSum != data2.m_iPhotonsSum) ||
2389 (m_bFGEnabled != data2.m_bFGEnabled) ||
2390 (m_iFGRayCount != data2.m_iFGRayCount) ||
2391 (m_bFGRadMin != data2.m_bFGRadMin) ||
2392 (m_bFGRadMax != data2.m_bFGRadMax) ||
2393 (m_bFGPixels != data2.m_bFGPixels) ||
2394 !OdEqual(m_dFGSRadMin, data2.m_dFGSRadMin) ||
2395 !OdEqual(m_dFGSRadMax, data2.m_dFGSRadMax) ||
2396 !OdEqual(m_dLightLumScale, data2.m_dLightLumScale) ||
2397 (m_DiagMode != data2.m_DiagMode) ||
2398 (m_DiagGridMode != data2.m_DiagGridMode) ||
2399 (m_fDiagGridSize != data2.m_fDiagGridSize) ||
2400 (m_DiagPhtMode != data2.m_DiagPhtMode) ||
2401 (m_DiagBSPMode != data2.m_DiagBSPMode) ||
2402 (m_bExportMIEnabled != data2.m_bExportMIEnabled) ||
2403 (m_sMIFile != data2.m_sMIFile) ||
2404 (m_iTileSize != data2.m_iTileSize) ||
2405 (m_TileOrder != data2.m_TileOrder) ||
2406 (m_iMemLimit != data2.m_iMemLimit) ||
2407 (m_fEnergyMult != data2.m_fEnergyMult) ||
2408 (m_pProgressMonitor != data2.m_pProgressMonitor) ||
2409 (m_ExposureType != data2.m_ExposureType) ||
2410 (m_FGMode != data2.m_FGMode) ||
2411 !OdEqual(m_dShadowMult, data2.m_dShadowMult) ||
2412 (m_MIMode != data2.m_MIMode));
2413 }
2414
2423 {
2424 return !(*this != data2);
2425 }
2426};
2427
2433{
2434 OdGiQuitCondition m_QuitCondition;
2435 int m_iRenderLevel;
2436 int m_iRenderTime;
2437 OdGiLightingMode m_LightingModel;
2438 OdGiFilterType m_FilterType;
2439 float m_fFilterWidth;
2440 float m_fFilterHeight;
2441public:
2442
2458 , m_QuitCondition(krEQuitByRenderLevel)
2459 , m_iRenderLevel(1)
2460 , m_iRenderTime(1)
2461 , m_LightingModel(krEBasic)
2462 , m_FilterType(krEBox)
2463 , m_fFilterWidth(1.0f)
2464 , m_fFilterHeight(1.0f)
2465 {
2466 }
2467
2474 {
2475 m_QuitCondition = condition;
2476 }
2477
2485 {
2486 return m_QuitCondition;
2487 }
2488
2495 {
2496 m_iRenderLevel = level;
2497 }
2498
2506 {
2507 return m_iRenderLevel;
2508 }
2509
2516 {
2517 m_iRenderTime = time;
2518 }
2519
2527 {
2528 return m_iRenderTime;
2529 }
2530
2542 {
2543 m_LightingModel = mode;
2544 }
2545
2558 {
2559 return m_LightingModel;
2560 }
2561
2568 {
2569 m_FilterType = type;
2570 }
2571
2579 {
2580 return m_FilterType;
2581 }
2582
2600 {
2601 m_fFilterWidth = width;
2602 }
2603
2610 float filterWidth() const
2611 {
2612 return m_fFilterWidth;
2613 }
2614
2632 {
2633 m_fFilterHeight = height;
2634 }
2635
2642 float filterHeight() const
2643 {
2644 return m_fFilterHeight;
2645 }
2646
2664 {
2665 return ((*static_cast<const OdGiRenderSettingsTraitsData*>(this) != static_cast<const OdGiRenderSettingsTraitsData&>(data2)) ||
2666 (m_QuitCondition != data2.m_QuitCondition) ||
2667 (m_iRenderLevel != data2.m_iRenderLevel) ||
2668 (m_iRenderTime != data2.m_iRenderTime) ||
2669 (m_LightingModel != data2.m_LightingModel) ||
2670 (m_FilterType != data2.m_FilterType) ||
2671 (m_fFilterWidth != data2.m_fFilterWidth) ||
2672 (m_fFilterHeight != data2.m_fFilterHeight));
2673 }
2674
2692 {
2693 return !(*this != data2);
2694 }
2695};
2696
2703{
2704 OdUInt32 m_kindOfRenderSettings;
2705public:
2710 : m_kindOfRenderSettings(0)
2711 {
2712 }
2713
2718 {
2724
2731 {
2732 m_kindOfRenderSettings = nFlags;
2733 }
2734
2742 {
2743 return m_kindOfRenderSettings;
2744 }
2745
2752 void modifyKindOfRenderSettings(OdUInt32 nFlags, bool bOp = true)
2753 {
2754 SETBIT(m_kindOfRenderSettings, nFlags, bOp);
2755 }
2756
2764 {
2765 return GETBIT(m_kindOfRenderSettings, kMentalRaySettings);
2766 }
2767
2775 {
2776 return GETBIT(m_kindOfRenderSettings, kRapidRTSettings);
2777 }
2778
2792 {
2793 return ((*static_cast<const OdGiMentalRayRenderSettingsTraitsData*>(this) != static_cast<const OdGiMentalRayRenderSettingsTraitsData&>(data2)) ||
2794 (*static_cast<const OdGiRapidRTRenderSettingsTraitsData*>(this) != static_cast<const OdGiRapidRTRenderSettingsTraitsData&>(data2)) ||
2795 (m_kindOfRenderSettings != data2.m_kindOfRenderSettings));
2796 }
2797
2811 {
2812 return !(*this != data2);
2813 }
2814};
2815
2816#include "TD_PackPop.h"
2817
2818#endif // __OD_GI_ENVIRONMENT_TRAITS_DATA__
#define ODA_FAIL()
Definition: DebugStuff.h:88
true
Definition: DimVarDefs.h:2046
false
Definition: DimVarDefs.h:165
enum OdGiLightingMode_ OdGiLightingMode
@ krSimple
@ krAutomatic
enum OdGiMrTileOrder_ OdGiMrTileOrder
@ krDensity
enum OdGiMrFilter_ OdGiMrFilter
@ krFinalGatherAuto
enum OdGiMrDiagnosticMode_ OdGiMrDiagnosticMode
enum OdGiMrDiagnosticPhotonMode_ OdGiMrDiagnosticPhotonMode
enum OdGiMrDiagnosticBSPMode_ OdGiMrDiagnosticBSPMode
enum OdGiMrShadowMode_ OdGiMrShadowMode
@ krBox
@ krObject
@ krEBox
enum OdGiMrDiagnosticGridMode_ OdGiMrDiagnosticGridMode
@ krHilbert
@ krEBasic
enum OdGiMrExportMIMode_ OdGiMrExportMIMode
enum OdGiMrExposureType_ OdGiMrExposureType
enum OdGiMrFinalGatheringMode_ OdGiMrFinalGatheringMode
@ krOff
@ krDepth
enum OdGiFilterType_ OdGiFilterType
@ krEQuitByRenderLevel
@ krExportMIOff
enum OdGiQuitCondition_ OdGiQuitCondition
unsigned int OdUInt32
unsigned short OdUInt16
bool OdEqual(double x, double y, double tol=1.e-10)
Definition: OdaDefs.h:542
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:516
#define GETBIT(flags, bit)
Definition: OdaDefs.h:517
bool isNull() const
Definition: BaseObjectPtr.h:86
OdGeVector2d & set(double xx, double yy)
Definition: GeVector2d.h:639
OdGiDrawable::DrawableType m_type
bool operator!=(const OdGiBackgroundTraitsData &data2) const
bool operator==(const OdGiBackgroundTraitsData &data2) const
static void deleteBackgroundTraitsData(OdGiBackgroundTraitsData *pBackgroundTraits)
OdGiDrawable::DrawableType type() const
void modifyKindOfRenderSettings(OdUInt32 nFlags, bool bOp=true)
bool operator==(const OdGiCombinedRenderSettingsTraitsData &data2) const
bool operator!=(const OdGiCombinedRenderSettingsTraitsData &data2) const
@ kSolidBackground
Definition: GiDrawable.h:97
@ kImageBackground
Definition: GiDrawable.h:99
@ kGroundPlaneBackground
Definition: GiDrawable.h:100
@ kGradientBackground
Definition: GiDrawable.h:98
@ kImageBasedLightingBackground
Definition: GiDrawable.h:104
bool operator==(const OdGiGradientBackgroundTraitsData &data2) const
void setColorBottom(const OdCmEntityColor &color)
void setColorTop(const OdCmEntityColor &color)
void setColorMiddle(const OdCmEntityColor &color)
bool operator!=(const OdGiGradientBackgroundTraitsData &data2) const
void setColorUndergroundHorizon(const OdCmEntityColor &color)
void setColorSkyHorizon(const OdCmEntityColor &color)
void setColorGroundPlaneFar(const OdCmEntityColor &color)
void setColorSkyZenith(const OdCmEntityColor &color)
void setColorUndergroundAzimuth(const OdCmEntityColor &color)
void setColorGroundPlaneNear(const OdCmEntityColor &color)
bool operator!=(const OdGiGroundPlaneBackgroundTraitsData &data2) const
bool operator==(const OdGiGroundPlaneBackgroundTraitsData &data2) const
bool operator!=(const OdGiIBLBackgroundTraitsData &data2) const
void setIBLFileName(const OdString &iblFileName)
const OdString & IBLFileName() const
void setSecondaryBackground(OdDbStub *secBkgndId)
bool operator==(const OdGiIBLBackgroundTraitsData &data2) const
void setOffset(double x, double y)
bool operator==(const OdGiImageBackgroundTraitsData &data2) const
const OdString & imageFilename() const
bool operator!=(const OdGiImageBackgroundTraitsData &data2) const
void setImageFilename(const OdString &filename)
bool operator!=(const OdGiMentalRayRenderSettingsTraitsData &data2) const
void samplingContrastColor(float &r, float &g, float &b, float &a) const
void setSamplingContrastColor(float r, float g, float b, float a)
void samplingFilter(OdGiMrFilter &filter, double &width, double &height) const
void setSamplingFilter(OdGiMrFilter filter, double width, double height)
void setDiagnosticMode(OdGiMrDiagnosticMode mode)
OdGiMrFinalGatheringMode finalGatheringMode() const
void setFGSampleRadius(double min, double max)
void setFGRadiusState(bool bMin, bool bMax, bool bPixels)
void setRayTraceDepth(int reflection, int refraction, int sum)
void setFinalGatheringMode(OdGiMrFinalGatheringMode mode)
void setExposureType(OdGiMrExposureType type)
void fgSampleRadiusState(bool &bMin, bool &bMax, bool &bPixels)
void setDiagnosticPhotonMode(OdGiMrDiagnosticPhotonMode mode)
OdGiMrDiagnosticPhotonMode diagnosticPhotonMode() const
void photonTraceDepth(int &reflection, int &refraction, int &sum) const
void fgSampleRadius(double &min, double &max) const
void setPhotonTraceDepth(int reflection, int refraction, int sum)
void diagnosticGridMode(OdGiMrDiagnosticGridMode &mode, float &fSize) const
void setDiagnosticBSPMode(OdGiMrDiagnosticBSPMode mode)
void setExportMIMode(OdGiMrExportMIMode mode)
bool operator==(const OdGiMentalRayRenderSettingsTraitsData &data2) const
void setDiagnosticGridMode(OdGiMrDiagnosticGridMode mode, float fSize)
OdGiMrDiagnosticBSPMode diagnosticBSPMode() const
void rayTraceDepth(int &reflection, int &refraction, int &sum) const
void setExportMIFileName(const OdString &miName)
bool operator==(const OdGiRapidRTRenderSettingsTraitsData &data2) const
void setLightingMode(OdGiLightingMode mode)
bool operator!=(const OdGiRapidRTRenderSettingsTraitsData &data2) const
void setQuitCondition(OdGiQuitCondition condition)
OdGiMaterialTexturePtr environmentMap() const
bool operator==(const OdGiRenderEnvironmentTraitsData &data2) const
void setFogColor(const OdCmEntityColor &color)
void setEnvironmentMap(const OdGiMaterialTexture *map)
const OdCmEntityColor & fogColor() const
bool operator!=(const OdGiRenderEnvironmentTraitsData &data2) const
bool operator==(const OdGiRenderSettingsTraitsData &data2) const
void setDiagnosticBackgroundEnabled(bool enabled)
void setModelScaleFactor(double scaleFactor)
bool operator!=(const OdGiRenderSettingsTraitsData &data2) const
bool operator==(const OdGiSkyBackgroundTraitsData &data2) const
bool operator!=(const OdGiSkyBackgroundTraitsData &data2) const
void setSkyParameters(const OdGiSkyParameters &params)
void skyParameters(OdGiSkyParameters &params) const
bool operator==(const OdGiSolidBackgroundTraitsData &data2) const
void setColor(const OdCmEntityColor &color)
bool operator!=(const OdGiSolidBackgroundTraitsData &data2) const
virtual OdRxObjectPtr clone() const
static OdRxObjectPtr cast(const OdRxObject *pointer)
Definition: RxObject.h:640
void release()
Definition: SmartPtr.h:269
GLenum GLint * params
Definition: gles2_ext.h:184
GLint level
Definition: gles2_ext.h:110
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
GLsizeiptr size
Definition: gles2_ext.h:182
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLfloat x
Definition: gles2_ext.h:314
GLint GLenum GLsizei GLsizei height
Definition: gles2_ext.h:110
GLfloat GLfloat y
Definition: gles2_ext.h:316
GLsizei const GLfloat * value
Definition: gles2_ext.h:302