CFx SDK Documentation  2022 SP0
GiEnvironmentTraitsData.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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 {
39 protected:
41 
42 protected:
44  {
45  }
46 
47 public:
49 
50  static void deleteBackgroundTraitsData(OdGiBackgroundTraitsData* pBackgroundTraits);
51 
52  bool operator ==(const OdGiBackgroundTraitsData &data2) const
53  {
54  return m_type == data2.m_type;
55  }
56  bool operator !=(const OdGiBackgroundTraitsData &data2) const
57  {
58  return m_type != data2.m_type;
59  }
60 };
61 
67 {
68  OdCmEntityColor m_color;
69 
70 public:
72 
73  OdCmEntityColor color() const { return m_color; }
74  void setColor(const OdCmEntityColor& color) { m_color = color; }
75 
76  bool operator ==(const OdGiSolidBackgroundTraitsData &data2) const
77  {
78  return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
79  (m_color == data2.m_color));
80  }
81  bool operator !=(const OdGiSolidBackgroundTraitsData &data2) const
82  {
83  return !(*this == data2);
84  }
85 };
86 
92 {
93  OdCmEntityColor m_colorTop;
94  OdCmEntityColor m_colorMiddle;
95  OdCmEntityColor m_colorBottom;
96  double m_dHorizon;
97  double m_dHeight;
98  double m_dRotation;
99 
100 public:
101  OdGiGradientBackgroundTraitsData() : m_dHorizon(0.0), m_dHeight(0.0), m_dRotation(0.0) { m_type = OdGiDrawable::kGradientBackground; }
102 
103  OdCmEntityColor colorTop() const { return m_colorTop; }
104  void setColorTop(const OdCmEntityColor& color) { m_colorTop = color; }
105  OdCmEntityColor colorMiddle() const { return m_colorMiddle; }
106  void setColorMiddle(const OdCmEntityColor& color) { m_colorMiddle = color; }
107  OdCmEntityColor colorBottom() const { return m_colorBottom; }
108  void setColorBottom(const OdCmEntityColor& color) { m_colorBottom = color; }
109 
110  double horizon() const { return m_dHorizon; }
111  double height() const { return m_dHeight; }
112  double rotation() const { return m_dRotation; }
113 
114  void setHorizon(double value) { m_dHorizon = value; }
115  void setHeight(double value) { m_dHeight = value; }
116  void setRotation(double value) { m_dRotation = value; }
117 
119  {
120  return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
121  (m_colorTop == data2.m_colorTop) &&
122  (m_colorMiddle == data2.m_colorMiddle) &&
123  (m_colorBottom == data2.m_colorBottom) &&
124  OdEqual(m_dHorizon, data2.m_dHorizon) &&
125  OdEqual(m_dHeight, data2.m_dHeight) &&
126  OdEqual(m_dRotation, data2.m_dRotation));
127  }
129  {
130  return !(*this == data2);
131  }
132 };
133 
139 {
140  OdString m_imageFileName;
141  bool m_bFitToScreen;
142  bool m_bMaintainAspect;
143  bool m_bUseTiling;
144  OdGeVector2d m_vOffset;
145  OdGeVector2d m_vScale;
146 
147 public:
148  OdGiImageBackgroundTraitsData() : m_bFitToScreen(false), m_bMaintainAspect(false), m_bUseTiling(false) { m_type = OdGiDrawable::kImageBackground; }
149 
150  const OdString& imageFilename() const { return m_imageFileName; }
151  void setImageFilename(const OdString& filename) { m_imageFileName = filename; }
152 
153  bool fitToScreen() const { return m_bFitToScreen; }
154  bool maintainAspectRatio() const { return m_bMaintainAspect; }
155  bool useTiling() const { return m_bUseTiling; }
156 
157  void setFitToScreen(bool flag) { m_bFitToScreen = flag; }
158  void setMaintainAspectRatio(bool flag) { m_bMaintainAspect = flag; }
159  void setUseTiling(bool flag) { m_bUseTiling = flag; }
160 
161  void setOffset(double x, double y);
162 
163  double xOffset() const { return m_vOffset.x; }
164  double yOffset() const { return m_vOffset.y; }
165 
166  void setXOffset(double xOffset) { m_vOffset.x = xOffset; }
167  void setYOffset(double yOffset) { m_vOffset.y = yOffset; }
168 
169  void setScale(double x, double y);
170 
171  double xScale() const { return m_vScale.x; }
172  double yScale() const { return m_vScale.y; }
173 
174  void setXScale(double xScale) { m_vScale.x = xScale; }
175  void setYScale(double yScale) { m_vScale.y = yScale; }
176 
178  {
179  return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
180  (m_imageFileName == data2.m_imageFileName) &&
181  (m_bFitToScreen == data2.m_bFitToScreen) &&
182  (m_bMaintainAspect == data2.m_bMaintainAspect) &&
183  (m_bUseTiling == data2.m_bUseTiling) &&
184  (m_vOffset == data2.m_vOffset) &&
185  (m_vScale == data2.m_vScale));
186  }
188  {
189  return !(*this == data2);
190  }
191 };
192 
193 inline void OdGiImageBackgroundTraitsData::setOffset(double x, double y)
194 {
195  m_vOffset.set(x, y);
196 }
197 
198 inline void OdGiImageBackgroundTraitsData::setScale(double x, double y)
199 {
200  m_vScale.set(x, y);
201 }
202 
208 {
209  OdCmEntityColor m_colorSkyZenith;
210  OdCmEntityColor m_colorSkyHorizon;
211  OdCmEntityColor m_colorUndergroundHorizon;
212  OdCmEntityColor m_colorUndergroundAzimuth;
213  OdCmEntityColor m_colorGroundPlaneNear;
214  OdCmEntityColor m_colorGroundPlaneFar;
215 
216 public:
218 
219  OdCmEntityColor colorSkyZenith() const { return m_colorSkyZenith; }
220  void setColorSkyZenith(const OdCmEntityColor& color) { m_colorSkyZenith = color; }
221  OdCmEntityColor colorSkyHorizon() const { return m_colorSkyHorizon; }
222  void setColorSkyHorizon(const OdCmEntityColor& color) { m_colorSkyHorizon = color; }
223  OdCmEntityColor colorUndergroundHorizon() const { return m_colorUndergroundHorizon; }
224  void setColorUndergroundHorizon(const OdCmEntityColor& color) { m_colorUndergroundHorizon = color; }
225  OdCmEntityColor colorUndergroundAzimuth() const { return m_colorUndergroundAzimuth; }
226  void setColorUndergroundAzimuth(const OdCmEntityColor& color) { m_colorUndergroundAzimuth = color; }
227  OdCmEntityColor colorGroundPlaneNear() const { return m_colorGroundPlaneNear; }
228  void setColorGroundPlaneNear(const OdCmEntityColor& color) { m_colorGroundPlaneNear = color; }
229  OdCmEntityColor colorGroundPlaneFar() const { return m_colorGroundPlaneFar; }
230  void setColorGroundPlaneFar(const OdCmEntityColor& color) { m_colorGroundPlaneFar = color; }
231 
233  {
234  return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
235  (m_colorSkyZenith == data2.m_colorSkyZenith) &&
236  (m_colorSkyHorizon == data2.m_colorSkyHorizon) &&
237  (m_colorUndergroundHorizon == data2.m_colorUndergroundHorizon) &&
238  (m_colorUndergroundAzimuth == data2.m_colorUndergroundAzimuth) &&
239  (m_colorGroundPlaneNear == data2.m_colorGroundPlaneNear) &&
240  (m_colorGroundPlaneFar == data2.m_colorGroundPlaneFar));
241  }
243  {
244  return !(*this == data2);
245  }
246 };
247 
253 {
254  bool m_status;
255  double m_intensityFactor;
256  double m_haze;
257  double m_horizonHeight;
258  double m_horizonBlur;
259  OdCmEntityColor m_groundColor;
260  OdCmEntityColor m_nightColor;
261  bool m_aerialPerspective;
262  double m_visibilityDistance;
263  double m_diskScale;
264  double m_glowIntensity;
265  double m_diskIntensity;
266  OdUInt16 m_solarDiskSamples;
267  OdGeVector3d m_sunDirection;
268  double m_redBlueShift;
269  double m_saturation;
270 public:
272 
275 
276  bool operator ==(const OdGiSkyBackgroundTraitsData &data2) const
277  {
278  return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
279  (m_status == data2.m_status) &&
280  OdEqual(m_intensityFactor, data2.m_intensityFactor) &&
281  OdEqual(m_haze, data2.m_haze) &&
282  OdEqual(m_horizonHeight, data2.m_horizonHeight) &&
283  OdEqual(m_horizonBlur, data2.m_horizonBlur) &&
284  (m_groundColor == data2.m_groundColor) &&
285  (m_nightColor == data2.m_nightColor) &&
286  (m_aerialPerspective == data2.m_aerialPerspective) &&
287  OdEqual(m_visibilityDistance, data2.m_visibilityDistance) &&
288  OdEqual(m_diskScale, data2.m_diskScale) &&
289  OdEqual(m_glowIntensity, data2.m_glowIntensity) &&
290  OdEqual(m_diskIntensity, data2.m_diskIntensity) &&
291  (m_solarDiskSamples == data2.m_solarDiskSamples) &&
292  (m_sunDirection == data2.m_sunDirection) &&
293  OdEqual(m_redBlueShift, data2.m_redBlueShift) &&
294  OdEqual(m_saturation, data2.m_saturation));
295  }
296  bool operator !=(const OdGiSkyBackgroundTraitsData &data2) const
297  {
298  return !(*this == data2);
299  }
300 };
301 
303 {
304  params.setIllumination(m_status);
305  params.setIntensityFactor(m_intensityFactor);
306  params.setHaze(m_haze);
307  params.setHorizonHeight(m_horizonHeight);
308  params.setHorizonBlur(m_horizonBlur);
309  params.setGroundColor(m_groundColor);
310  params.setNightColor(m_nightColor);
311  params.setAerialPerspective(m_aerialPerspective);
312  params.setVisibilityDistance(m_visibilityDistance);
313  params.setDiskScale(m_diskScale);
314  params.setGlowIntensity(m_glowIntensity);
315  params.setDiskIntensity(m_diskIntensity);
316  params.setSolarDiskSamples(m_solarDiskSamples);
317  params.setSunDirection(m_sunDirection);
318  params.setRedBlueShift(m_redBlueShift);
319  params.setSaturation(m_saturation);
320 }
321 
323 {
324  m_status = params.illumination();
325  m_intensityFactor = params.intensityFactor();
326  m_haze = params.haze();
327  m_horizonHeight = params.horizonHeight();
328  m_horizonBlur = params.horizonBlur();
329  m_groundColor = params.groundColor();
330  m_nightColor = params.nightColor();
331  m_aerialPerspective = params.aerialPerspective();
332  m_visibilityDistance = params.visibilityDistance();
333  m_diskScale = params.diskScale();
334  m_glowIntensity = params.glowIntensity();
335  m_diskIntensity = params.diskIntensity();
336  m_solarDiskSamples = params.solarDiskSamples();
337  m_sunDirection = params.sunDirection();
338  m_redBlueShift = params.redBlueShift();
339  m_saturation = params.saturation();
340 }
341 
347 {
348  bool m_bEnable;
349  OdString m_iblFileName;
350  double m_rotation;
351  bool m_bDisplay;
352  OdDbStub *m_secBkgndId;
353 
354 public:
356 
357  bool isEnabled() const { return m_bEnable; }
358  void enable(bool bSet) { m_bEnable = bSet; }
359 
360  const OdString &IBLFileName() const { return m_iblFileName; }
361  void setIBLFileName(const OdString &iblFileName) { m_iblFileName = iblFileName; }
362 
363  double rotation() const { return m_rotation; }
364  void setRotation(double angle) { m_rotation = angle; }
365 
366  bool displayImage() const { return m_bDisplay; }
367  void setDisplayImage(bool bSet) { m_bDisplay = bSet; }
368 
369  OdDbStub *secondaryBackground() const { return m_secBkgndId; }
370  void setSecondaryBackground(OdDbStub *secBkgndId) { m_secBkgndId = secBkgndId; }
371 
372  bool operator ==(const OdGiIBLBackgroundTraitsData &data2) const
373  {
374  return ((*static_cast<const OdGiBackgroundTraitsData*>(this) == static_cast<const OdGiBackgroundTraitsData&>(data2)) &&
375  (m_bEnable == data2.m_bEnable) &&
376  (m_iblFileName == data2.m_iblFileName) &&
377  OdEqual(m_rotation, data2.m_rotation) &&
378  (m_bDisplay == data2.m_bDisplay) &&
379  (m_secBkgndId == data2.m_secBkgndId));
380  }
381  bool operator !=(const OdGiIBLBackgroundTraitsData &data2) const
382  {
383  return !(*this == data2);
384  }
385 };
386 
387 // Delete background traits data by background type
388 
390 {
391  switch (pBackgroundTraits->type())
392  {
394  delete static_cast<OdGiSolidBackgroundTraitsData*>(pBackgroundTraits);
395  break;
397  delete static_cast<OdGiGradientBackgroundTraitsData*>(pBackgroundTraits);
398  break;
400  delete static_cast<OdGiImageBackgroundTraitsData*>(pBackgroundTraits);
401  break;
403  delete static_cast<OdGiGroundPlaneBackgroundTraitsData*>(pBackgroundTraits);
404  break;
406  delete static_cast<OdGiSkyBackgroundTraitsData*>(pBackgroundTraits);
407  break;
409  delete static_cast<OdGiIBLBackgroundTraitsData*>(pBackgroundTraits);
410  break;
411  default:
412  ODA_FAIL();
413  }
414 }
415 
421 {
422  bool m_bEnable;
423  bool m_bIsBackground;
424  OdCmEntityColor m_FogColor;
425  double m_dNearDist;
426  double m_dFarDist;
427  double m_dNearPerc;
428  double m_dFarPerc;
429  OdGiMaterialTexturePtr m_envMap;
430 public:
432  : m_bEnable(false)
433  , m_bIsBackground(false)
434  , m_FogColor(128, 128, 128)
435  , m_dNearDist(0.0)
436  , m_dFarDist(100.0)
437  , m_dNearPerc(0.0)
438  , m_dFarPerc(100.0)
439  {
440  }
441 
442  void setEnable(bool bEnable) { m_bEnable = bEnable; }
443  bool enable() const { return m_bEnable; }
444  void setIsBackground(bool bEnable) { m_bIsBackground = bEnable; }
445  bool isBackground() const { return m_bIsBackground; }
446  void setFogColor(const OdCmEntityColor &color) { m_FogColor = color; }
447  const OdCmEntityColor &fogColor() const { return m_FogColor; }
448  void setNearDistance(double nearDist) { m_dNearDist = nearDist; }
449  double nearDistance() const { return m_dNearDist; }
450  void setFarDistance(double farDist) { m_dFarDist = farDist; }
451  double farDistance() const { return m_dFarDist; }
452  void setNearPercentage(double nearPct) { m_dNearPerc = nearPct; }
453  double nearPercentage() const { return m_dNearPerc; }
454  void setFarPercentage(double farPct) { m_dFarPerc = farPct; }
455  double farPercentage() const { return m_dFarPerc; }
457  {
458  m_envMap.release();
459  if (map)
460  {
461  m_envMap = OdGiMaterialTexture::cast(map->clone());
462  }
463  }
464  OdGiMaterialTexturePtr environmentMap() const { return m_envMap; }
465 
467  {
468  return ((m_bEnable == data2.m_bEnable) &&
469  (m_bIsBackground == data2.m_bIsBackground) &&
470  (m_FogColor == data2.m_FogColor) &&
471  OdEqual(m_dNearDist, data2.m_dNearDist) &&
472  OdEqual(m_dFarDist, data2.m_dFarDist) &&
473  OdEqual(m_dNearPerc, data2.m_dNearPerc) &&
474  OdEqual(m_dFarPerc, data2.m_dFarPerc) &&
475  ((m_envMap.isNull() && data2.m_envMap.isNull()) ||
476  (!m_envMap.isNull() && data2.m_envMap.isNull() && (*m_envMap == *data2.m_envMap))));
477  }
479  {
480  return !(*this == data2);
481  }
482 };
483 
489 {
490  bool m_bMatEnable;
491  bool m_bTextureSampling;
492  bool m_bBackFaces;
493  bool m_bShadows;
494  bool m_bDiagnosticBack;
495  double m_dScaleFactor;
496 public:
498  : m_bMatEnable(true)
499  , m_bTextureSampling(true)
500  , m_bBackFaces(true)
501  , m_bShadows(true)
502  , m_bDiagnosticBack(false)
503  , m_dScaleFactor(1.0)
504  {
505  }
506  virtual ~OdGiRenderSettingsTraitsData() { } // Exclude warnings in some compilers
507 
508  void setMaterialEnabled(bool enabled) { m_bMatEnable = enabled; }
509  bool materialEnabled() const { return m_bMatEnable; }
510  void setTextureSampling(bool enabled) { m_bTextureSampling = enabled; }
511  bool textureSampling() const { return m_bTextureSampling; }
512  void setBackFacesEnabled(bool enabled) { m_bBackFaces = enabled; }
513  bool backFacesEnabled() const { return m_bBackFaces; }
514  void setShadowsEnabled(bool enabled) { m_bShadows = enabled; }
515  bool shadowsEnabled() const { return m_bShadows; }
516  void setDiagnosticBackgroundEnabled(bool enabled) { m_bDiagnosticBack = enabled; }
517  bool diagnosticBackgroundEnabled() const { return m_bDiagnosticBack; }
518  void setModelScaleFactor(double scaleFactor) { m_dScaleFactor = scaleFactor; }
519  double modelScaleFactor() const { return m_dScaleFactor; }
520 
521  bool operator ==(const OdGiRenderSettingsTraitsData &data2) const
522  {
523  return ((m_bMatEnable == data2.m_bMatEnable) &&
524  (m_bTextureSampling == data2.m_bTextureSampling) &&
525  (m_bBackFaces == data2.m_bBackFaces) &&
526  (m_bShadows == data2.m_bShadows) &&
527  (m_bDiagnosticBack == data2.m_bDiagnosticBack) &&
528  OdEqual(m_dScaleFactor, data2.m_dScaleFactor));
529  }
530  bool operator !=(const OdGiRenderSettingsTraitsData &data2) const
531  {
532  return !(*this == data2);
533  }
534 };
535 
541 {
542  int m_iSamplingMin;
543  int m_iSamplingMax;
544  OdGiMrFilter m_SamplingFilter;
545  double m_dSamplingWidth;
546  double m_dSamplingHeight;
547  float m_fContrastR;
548  float m_fContrastG;
549  float m_fContrastB;
550  float m_fContrastA;
551  OdGiMrShadowMode m_ShadowMode;
552  bool m_bShadowMapEnabled;
553  bool m_bRayTraceEnabled;
554  int m_iRTReflection;
555  int m_iRTRefraction;
556  int m_iRTSum;
557  bool m_bGlobalIllum;
558  int m_iGISampleCount;
559  bool m_bSampleRadEnabled;
560  double m_dSampleRad;
561  int m_iPhotonsPerLight;
562  int m_iPhotonsReflection;
563  int m_iPhotonsRefraction;
564  int m_iPhotonsSum;
565  bool m_bFGEnabled;
566  int m_iFGRayCount;
567  bool m_bFGRadMin;
568  bool m_bFGRadMax;
569  bool m_bFGPixels;
570  double m_dFGSRadMin;
571  double m_dFGSRadMax;
572  double m_dLightLumScale;
573  OdGiMrDiagnosticMode m_DiagMode;
574  OdGiMrDiagnosticGridMode m_DiagGridMode;
575  float m_fDiagGridSize;
576  OdGiMrDiagnosticPhotonMode m_DiagPhtMode;
577  OdGiMrDiagnosticBSPMode m_DiagBSPMode;
578  bool m_bExportMIEnabled;
579  OdString m_sMIFile;
580  int m_iTileSize;
581  OdGiMrTileOrder m_TileOrder;
582  int m_iMemLimit;
583  float m_fEnergyMult;
584  void* m_pProgressMonitor;
585  OdGiMrExposureType m_ExposureType;
586  OdGiMrFinalGatheringMode m_FGMode;
587  double m_dShadowMult;
588  OdGiMrExportMIMode m_MIMode;
589 public:
592  , m_iSamplingMin(-1)
593  , m_iSamplingMax(0)
594  , m_SamplingFilter(krBox)
595  , m_dSamplingWidth(1.0)
596  , m_dSamplingHeight(1.0)
597  , m_fContrastR(0.1f)
598  , m_fContrastG(0.1f)
599  , m_fContrastB(0.1f)
600  , m_fContrastA(0.1f)
601  , m_ShadowMode(krSimple)
602  , m_bShadowMapEnabled(true)
603  , m_bRayTraceEnabled(true)
604  , m_iRTReflection(2)
605  , m_iRTRefraction(2)
606  , m_iRTSum(4)
607  , m_bGlobalIllum(false)
608  , m_iGISampleCount(500)
609  , m_bSampleRadEnabled(false)
610  , m_dSampleRad(1.0)
611  , m_iPhotonsPerLight(10000)
612  , m_iPhotonsReflection(5)
613  , m_iPhotonsRefraction(5)
614  , m_iPhotonsSum(5)
615  , m_bFGEnabled(false)
616  , m_iFGRayCount(1000)
617  , m_bFGRadMin(false)
618  , m_bFGRadMax(false)
619  , m_bFGPixels(false)
620  , m_dFGSRadMin(1.0)
621  , m_dFGSRadMax(1.0)
622  , m_dLightLumScale(1.0)
623  , m_DiagMode(krOff)
624  , m_DiagGridMode(krObject)
625  , m_fDiagGridSize(10.0f)
626  , m_DiagPhtMode(krDensity)
627  , m_DiagBSPMode(krDepth)
628  , m_bExportMIEnabled(false)
629  , m_sMIFile()
630  , m_iTileSize(32)
631  , m_TileOrder(krHilbert)
632  , m_iMemLimit(1048)
633  , m_fEnergyMult(1.0f)
634  , m_pProgressMonitor(NULL)
635  , m_ExposureType(krAutomatic)
636  , m_FGMode(krFinalGatherAuto)
637  , m_dShadowMult(1.0)
638  , m_MIMode(krExportMIOff)
639  {
640  }
641 
642  void setSampling(int min, int max)
643  {
644  m_iSamplingMin = min;
645  m_iSamplingMax = max;
646  }
647  void sampling(int& min, int& max) const
648  {
649  min = m_iSamplingMin;
650  max = m_iSamplingMax;
651  }
652  void setSamplingFilter(OdGiMrFilter filter, double width, double height)
653  {
654  m_SamplingFilter = filter;
655  m_dSamplingWidth = width;
656  m_dSamplingHeight = height;
657  }
658  void samplingFilter(OdGiMrFilter& filter, double& width, double& height) const
659  {
660  filter = m_SamplingFilter;
661  width = m_dSamplingWidth;
662  height = m_dSamplingHeight;
663  }
664  void setSamplingContrastColor(float r, float g, float b, float a)
665  {
666  m_fContrastR = r;
667  m_fContrastG = g;
668  m_fContrastB = b;
669  m_fContrastA = a;
670  }
671  void samplingContrastColor(float& r, float& g, float& b, float& a) const
672  {
673  r = m_fContrastR;
674  g = m_fContrastG;
675  b = m_fContrastB;
676  a = m_fContrastA;
677  }
679  {
680  m_ShadowMode = mode;
681  }
683  {
684  return m_ShadowMode;
685  }
686  void setShadowMapEnabled(bool enabled)
687  {
688  m_bShadowMapEnabled = enabled;
689  }
690  bool shadowMapEnabled() const
691  {
692  return m_bShadowMapEnabled;
693  }
694  void setRayTraceEnabled(bool enabled)
695  {
696  m_bRayTraceEnabled = enabled;
697  }
698  bool rayTraceEnabled() const
699  {
700  return m_bRayTraceEnabled;
701  }
702  void setRayTraceDepth(int reflection, int refraction, int sum)
703  {
704  m_iRTReflection = reflection;
705  m_iRTRefraction = refraction;
706  m_iRTSum = sum;
707  }
708  void rayTraceDepth(int& reflection, int& refraction, int& sum) const
709  {
710  reflection = m_iRTReflection;
711  refraction = m_iRTRefraction;
712  sum = m_iRTSum;
713  }
714  void setGlobalIlluminationEnabled(bool enabled)
715  {
716  m_bGlobalIllum = enabled;
717  }
719  {
720  return m_bGlobalIllum;
721  }
722  void setGISampleCount(int num)
723  {
724  m_iGISampleCount = num;
725  }
726  int giSampleCount() const
727  {
728  return m_iGISampleCount;
729  }
730  void setGISampleRadiusEnabled(bool enabled)
731  {
732  m_bSampleRadEnabled = enabled;
733  }
735  {
736  return m_bSampleRadEnabled;
737  }
738  void setGISampleRadius(double radius)
739  {
740  m_dSampleRad = radius;
741  }
742  double giSampleRadius() const
743  {
744  return m_dSampleRad;
745  }
746  void setGIPhotonsPerLight(int num)
747  {
748  m_iPhotonsPerLight = num;
749  }
750  int giPhotonsPerLight() const
751  {
752  return m_iPhotonsPerLight;
753  }
754  void setPhotonTraceDepth(int reflection, int refraction, int sum)
755  {
756  m_iPhotonsReflection = reflection;
757  m_iPhotonsRefraction = refraction;
758  m_iPhotonsSum = sum;
759  }
760  void photonTraceDepth(int& reflection, int& refraction, int& sum) const
761  {
762  reflection = m_iPhotonsReflection;
763  refraction = m_iPhotonsRefraction;
764  sum = m_iPhotonsSum;
765  }
766  void setFinalGatheringEnabled(bool enabled)
767  {
768  m_bFGEnabled = enabled;
769  }
771  {
772  return m_bFGEnabled;
773  }
774  void setFGRayCount(int num)
775  {
776  m_iFGRayCount = num;
777  }
778  int fgRayCount() const
779  {
780  return m_iFGRayCount;
781  }
782  void setFGRadiusState(bool bMin, bool bMax, bool bPixels)
783  {
784  m_bFGRadMin = bMin;
785  m_bFGRadMax = bMax;
786  m_bFGPixels = bPixels;
787  }
788  void fgSampleRadiusState(bool& bMin, bool& bMax, bool& bPixels)
789  {
790  bMin = m_bFGRadMin;
791  bMax = m_bFGRadMax;
792  bPixels = m_bFGPixels;
793  }
794  void setFGSampleRadius(double min, double max)
795  {
796  m_dFGSRadMin = min;
797  m_dFGSRadMax = max;
798  }
799  void fgSampleRadius(double& min, double& max) const
800  {
801  min = m_dFGSRadMin;
802  max = m_dFGSRadMax;
803  }
804  void setLightLuminanceScale(double luminance)
805  {
806  m_dLightLumScale = luminance;
807  }
808  double lightLuminanceScale() const
809  {
810  return m_dLightLumScale;
811  }
813  {
814  m_DiagMode = mode;
815  }
817  {
818  return m_DiagMode;
819  }
821  {
822  m_DiagGridMode = mode;
823  m_fDiagGridSize = fSize;
824  }
825  void diagnosticGridMode(OdGiMrDiagnosticGridMode& mode, float& fSize) const
826  {
827  mode = m_DiagGridMode;
828  fSize = m_fDiagGridSize;
829  }
831  {
832  m_DiagPhtMode = mode;
833  }
835  {
836  return m_DiagPhtMode;
837  }
839  {
840  m_DiagBSPMode = mode;
841  }
843  {
844  return m_DiagBSPMode;
845  }
846  void setExportMIEnabled(bool enabled)
847  {
848  m_bExportMIEnabled = enabled;
849  }
850  bool exportMIEnabled() const
851  {
852  return m_bExportMIEnabled;
853  }
854  void setExportMIFileName(const OdString& miName)
855  {
856  m_sMIFile = miName;
857  }
858  const OdString &exportMIFileName() const
859  {
860  return m_sMIFile;
861  }
862  void setTileSize(int size)
863  {
864  m_iTileSize = size;
865  }
866  int tileSize() const
867  {
868  return m_iTileSize;
869  }
871  {
872  m_TileOrder = order;
873  }
875  {
876  return m_TileOrder;
877  }
878  void setMemoryLimit(int limit)
879  {
880  m_iMemLimit = limit;
881  }
882  int memoryLimit() const
883  {
884  return m_iMemLimit;
885  }
886  void setEnergyMultiplier(float fScale)
887  {
888  m_fEnergyMult = fScale;
889  }
890  float energyMultiplier() const
891  {
892  return m_fEnergyMult;
893  }
894  void setProgressMonitor(void* pMonitor)
895  {
896  m_pProgressMonitor = pMonitor;
897  }
898  const void* progressMonitor() const
899  {
900  return m_pProgressMonitor;
901  }
903  {
904  m_ExposureType = type;
905  }
907  {
908  return m_ExposureType;
909  }
911  {
912  m_FGMode = mode;
913  }
915  {
916  return m_FGMode;
917  }
918  void setShadowSamplingMultiplier(double multiplier)
919  {
920  m_dShadowMult = multiplier;
921  }
923  {
924  return m_dShadowMult;
925  }
927  {
928  m_MIMode = mode;
929  }
931  {
932  return m_MIMode;
933  }
934 
936  {
937  return ((*static_cast<const OdGiRenderSettingsTraitsData*>(this) != static_cast<const OdGiRenderSettingsTraitsData&>(data2)) ||
938  (m_iSamplingMin != data2.m_iSamplingMin) ||
939  (m_iSamplingMax != data2.m_iSamplingMax) ||
940  (m_SamplingFilter != data2.m_SamplingFilter) ||
941  !OdEqual(m_dSamplingWidth, data2.m_dSamplingWidth) ||
942  !OdEqual(m_dSamplingHeight, data2.m_dSamplingHeight) ||
943  (m_fContrastR != data2.m_fContrastR) ||
944  (m_fContrastG != data2.m_fContrastG) ||
945  (m_fContrastB != data2.m_fContrastB) ||
946  (m_fContrastA != data2.m_fContrastA) ||
947  (m_ShadowMode != data2.m_ShadowMode) ||
948  (m_bShadowMapEnabled != data2.m_bShadowMapEnabled) ||
949  (m_bRayTraceEnabled != data2.m_bRayTraceEnabled) ||
950  (m_iRTReflection != data2.m_iRTReflection) ||
951  (m_iRTRefraction != data2.m_iRTRefraction) ||
952  (m_iRTSum != data2.m_iRTSum) ||
953  (m_bGlobalIllum != data2.m_bGlobalIllum) ||
954  (m_iGISampleCount != data2.m_iGISampleCount) ||
955  (m_bSampleRadEnabled != data2.m_bSampleRadEnabled) ||
956  !OdEqual(m_dSampleRad, data2.m_dSampleRad) ||
957  (m_iPhotonsPerLight != data2.m_iPhotonsPerLight) ||
958  (m_iPhotonsReflection != data2.m_iPhotonsReflection) ||
959  (m_iPhotonsRefraction != data2.m_iPhotonsRefraction) ||
960  (m_iPhotonsSum != data2.m_iPhotonsSum) ||
961  (m_bFGEnabled != data2.m_bFGEnabled) ||
962  (m_iFGRayCount != data2.m_iFGRayCount) ||
963  (m_bFGRadMin != data2.m_bFGRadMin) ||
964  (m_bFGRadMax != data2.m_bFGRadMax) ||
965  (m_bFGPixels != data2.m_bFGPixels) ||
966  !OdEqual(m_dFGSRadMin, data2.m_dFGSRadMin) ||
967  !OdEqual(m_dFGSRadMax, data2.m_dFGSRadMax) ||
968  !OdEqual(m_dLightLumScale, data2.m_dLightLumScale) ||
969  (m_DiagMode != data2.m_DiagMode) ||
970  (m_DiagGridMode != data2.m_DiagGridMode) ||
971  (m_fDiagGridSize != data2.m_fDiagGridSize) ||
972  (m_DiagPhtMode != data2.m_DiagPhtMode) ||
973  (m_DiagBSPMode != data2.m_DiagBSPMode) ||
974  (m_bExportMIEnabled != data2.m_bExportMIEnabled) ||
975  (m_sMIFile != data2.m_sMIFile) ||
976  (m_iTileSize != data2.m_iTileSize) ||
977  (m_TileOrder != data2.m_TileOrder) ||
978  (m_iMemLimit != data2.m_iMemLimit) ||
979  (m_fEnergyMult != data2.m_fEnergyMult) ||
980  (m_pProgressMonitor != data2.m_pProgressMonitor) ||
981  (m_ExposureType != data2.m_ExposureType) ||
982  (m_FGMode != data2.m_FGMode) ||
983  !OdEqual(m_dShadowMult, data2.m_dShadowMult) ||
984  (m_MIMode != data2.m_MIMode));
985  }
987  {
988  return !(*this != data2);
989  }
990 };
991 
997 {
998  OdGiQuitCondition m_QuitCondition;
999  int m_iRenderLevel;
1000  int m_iRenderTime;
1001  OdGiLightingMode m_LightingModel;
1002  OdGiFilterType m_FilterType;
1003  float m_fFilterWidth;
1004  float m_fFilterHeight;
1005 public:
1008  , m_QuitCondition(krEQuitByRenderLevel)
1009  , m_iRenderLevel(1)
1010  , m_iRenderTime(1)
1011  , m_LightingModel(krEBasic)
1012  , m_FilterType(krEBox)
1013  , m_fFilterWidth(1.0f)
1014  , m_fFilterHeight(1.0f)
1015  {
1016  }
1017 
1019  {
1020  m_QuitCondition = condition;
1021  }
1023  {
1024  return m_QuitCondition;
1025  }
1027  {
1028  m_iRenderLevel = level;
1029  }
1031  {
1032  return m_iRenderLevel;
1033  }
1034  void setDesiredRenderTime(int time)
1035  {
1036  m_iRenderTime = time;
1037  }
1038  int desiredRenderTime() const
1039  {
1040  return m_iRenderTime;
1041  }
1043  {
1044  m_LightingModel = mode;
1045  }
1047  {
1048  return m_LightingModel;
1049  }
1051  {
1052  m_FilterType = type;
1053  }
1055  {
1056  return m_FilterType;
1057  }
1058  void setFilterWidth(float width)
1059  {
1060  m_fFilterWidth = width;
1061  }
1062  float filterWidth() const
1063  {
1064  return m_fFilterWidth;
1065  }
1067  {
1068  m_fFilterHeight = height;
1069  }
1070  float filterHeight() const
1071  {
1072  return m_fFilterHeight;
1073  }
1074 
1076  {
1077  return ((*static_cast<const OdGiRenderSettingsTraitsData*>(this) != static_cast<const OdGiRenderSettingsTraitsData&>(data2)) ||
1078  (m_QuitCondition != data2.m_QuitCondition) ||
1079  (m_iRenderLevel != data2.m_iRenderLevel) ||
1080  (m_iRenderTime != data2.m_iRenderTime) ||
1081  (m_LightingModel != data2.m_LightingModel) ||
1082  (m_FilterType != data2.m_FilterType) ||
1083  (m_fFilterWidth != data2.m_fFilterWidth) ||
1084  (m_fFilterHeight != data2.m_fFilterHeight));
1085  }
1087  {
1088  return !(*this != data2);
1089  }
1090 };
1091 
1098 {
1099  OdUInt32 m_kindOfRenderSettings;
1100 public:
1102  : m_kindOfRenderSettings(0)
1103  {
1104  }
1105 
1107  {
1109  kRapidRTSettings = 2
1110  };
1112  {
1113  m_kindOfRenderSettings = nFlags;
1114  }
1116  {
1117  return m_kindOfRenderSettings;
1118  }
1119  void modifyKindOfRenderSettings(OdUInt32 nFlags, bool bOp = true)
1120  {
1121  SETBIT(m_kindOfRenderSettings, nFlags, bOp);
1122  }
1123 
1125  {
1126  return GETBIT(m_kindOfRenderSettings, kMentalRaySettings);
1127  }
1129  {
1130  return GETBIT(m_kindOfRenderSettings, kRapidRTSettings);
1131  }
1132 
1134  {
1135  return ((*static_cast<const OdGiMentalRayRenderSettingsTraitsData*>(this) != static_cast<const OdGiMentalRayRenderSettingsTraitsData&>(data2)) ||
1136  (*static_cast<const OdGiRapidRTRenderSettingsTraitsData*>(this) != static_cast<const OdGiRapidRTRenderSettingsTraitsData&>(data2)) ||
1137  (m_kindOfRenderSettings != data2.m_kindOfRenderSettings));
1138  }
1140  {
1141  return !(*this != data2);
1142  }
1143 };
1144 
1145 #include "TD_PackPop.h"
1146 
1147 #endif // __OD_GI_ENVIRONMENT_TRAITS_DATA__
#define ODA_FAIL()
Definition: DebugStuff.h:65
true
Definition: DimVarDefs.h:2046
false
Definition: DimVarDefs.h:165
OdGiMrDiagnosticMode
@ krOff
OdGiQuitCondition
@ krEQuitByRenderLevel
OdGiMrDiagnosticPhotonMode
@ krDensity
OdGiMrExposureType
@ krAutomatic
OdGiMrFinalGatheringMode
@ krFinalGatherAuto
OdGiMrDiagnosticBSPMode
@ krDepth
OdGiFilterType
@ krEBox
OdGiMrDiagnosticGridMode
@ krObject
OdGiMrExportMIMode
@ krExportMIOff
OdGiLightingMode
@ krEBasic
OdGiMrFilter
Definition: GiEnvironment.h:97
@ krBox
Definition: GiEnvironment.h:98
OdGiMrShadowMode
@ krSimple
OdGiMrTileOrder
@ krHilbert
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
unsigned short OdUInt16
bool OdEqual(double x, double y, double tol=1.e-10)
Definition: OdaDefs.h:523
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:497
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
bool isNull() const
Definition: BaseObjectPtr.h:70
OdGeVector2d & set(double xx, double yy)
Definition: GeVector2d.h:439
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:92
@ kImageBackground
Definition: GiDrawable.h:94
@ kGroundPlaneBackground
Definition: GiDrawable.h:95
@ kGradientBackground
Definition: GiDrawable.h:93
@ kImageBasedLightingBackground
Definition: GiDrawable.h:99
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
bool operator!=(const OdGiImageBackgroundTraitsData &data2) const
void setImageFilename(const OdString &filename)
const OdString & imageFilename() const
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)
OdGiMrDiagnosticMode diagnosticMode() const
void sampling(int &min, int &max) const
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
const OdCmEntityColor & fogColor() const
bool operator==(const OdGiRenderEnvironmentTraitsData &data2) const
void setFogColor(const OdCmEntityColor &color)
void setEnvironmentMap(const OdGiMaterialTexture *map)
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:264
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
const T & min(const T &x, const T &y)
const T & max(const T &x, const T &y)