CFx SDK Documentation  2020SP3
GiViewportTraits.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 #ifndef __OD_GI_VIEWPORT_TRAITS__
25 #define __OD_GI_VIEWPORT_TRAITS__
26 
27 #include "TD_PackPush.h"
28 
29 #include "Gi.h"
30 #include "CmColorBase.h"
31 #include "StaticRxObject.h"
32 
34 
40 {
41 public:
43  {
44  kDaylightOff = 0,
45  kDaylightOn = 1,
46  kDaylightAuto = 2
47  };
48 public:
50 
52  // GCC < 4.4 uses generated copy constructor which is references private OdRxObject copy constructor
54  // User-defined destructor moved to header.
55  // MSVC compiler bug: http://connect.microsoft.com/VisualStudio/feedback/details/680927/dereferencing-of-incomplete-type-not-diagnosed-fails-to-synthesise-constructor-and-destructor
57 
61 
62  virtual void setIsActive(bool bActive);
63  virtual bool isActive() const;
64 
65  virtual void setChromaticAdaptation(bool bEnable);
66  virtual bool chromaticAdaptation() const;
67 
68  virtual void setColorDifferentiation(bool bEnable);
69  virtual bool colorDifferentiation() const;
70 
71  virtual void setWhiteColor(const OdCmEntityColor &color);
72  virtual const OdCmEntityColor &whiteColor() const;
73 
74  virtual void setProcessBackground(bool bProcessBg);
75  virtual bool processBackground() const;
76 
77  virtual bool setBrightness(double fBrightness);
78  virtual double brightness() const;
79 
80  virtual bool setContrast(double fContrast);
81  virtual double contrast() const;
82 
83  virtual bool setMidTones(double fMidTones);
84  virtual double midTones() const;
85 
88 private:
89  bool m_bIsActive;
90  bool m_bChromaticAdaptation;
91  bool m_bColorDifferentiation;
92  OdCmEntityColor m_clrWhiteColor;
93  bool m_bProcessBackground;
94  double m_fBrightness;
95  double m_fContrast;
96  double m_fMidTones;
97  ExteriorDaylightMode m_eExteriorDaylight;
98 };
99 
104 class OdGiToneOperatorParametersStatic : public OdStaticRxObject<OdGiToneOperatorParameters>
105 {
106  public:
108  bool operator ==(const OdGiToneOperatorParameters &params) const { return params == *this; }
109  bool operator !=(const OdGiToneOperatorParameters &params) const { return params != *this; }
111 };
112 
117 
123 {
124 public:
126 
129  // WinCE failed to build w/o user-defined destructor.
131 
135 
136  virtual bool setExposure(double fExposure);
137  virtual double exposure() const;
138 
139  virtual bool setWhitePoint(double fWhitePoint);
140  virtual double whitePoint() const;
141 
142  virtual bool setBrightness(double fBrightness);
143 
145 
146  static double convertExposureToBrightness(double fExposure);
147  static double convertBrightnessToExposure(double fBrightness);
148 private:
149  double m_fExposure;
150  double m_fWhitePoint;
151 };
152 
157 class OdGiPhotographicExposureParametersStatic : public OdStaticRxObject<OdGiPhotographicExposureParameters>
158 {
159 public:
161  bool operator ==(const OdGiPhotographicExposureParameters &params) const { return params == *this; }
162  bool operator !=(const OdGiPhotographicExposureParameters &params) const { return params != *this; }
164 };
165 
170 
176 {
177 public:
179 
181  {
182  kOneDistantLight = 0,
183  kTwoDistantLights = 1,
184  kBackLighting = 2,
185  kUserDefinedLight = 3
186  };
187 
188  virtual bool isDefaultLightingOn() const = 0;
189  virtual void setDefaultLightingOn(bool b) = 0;
190 
193 
195  virtual void setUserDefinedLightDirection(const OdGeVector3d& lightDirection) = 0;
196 
197  virtual double defaultLightingIntensity() const = 0;
198  virtual void setDefaultLightingIntensity(double dIntensity) = 0;
199 
201  virtual void setDefaultLightingColor(const OdCmEntityColor& color) = 0;
202 
205 
206  virtual void setAmbientLightColor(const OdCmEntityColor& color) = 0;
207  virtual OdCmEntityColor ambientLightColor() const = 0;
208 
209  virtual void setContrast(double contrast) = 0;
210  virtual double contrast() const = 0;
211 
212  virtual void setBrightness(double brightness) = 0;
213  virtual double brightness() const = 0;
214 
215  virtual void setBackground(OdDbStub* bg) = 0;
216  virtual OdDbStub* background() const = 0;
217 
218  virtual void setRenderEnvironment(OdDbStub* re) = 0;
219  virtual OdDbStub* renderEnvironment () const = 0;
220 
221  virtual void setRenderSettings(OdDbStub* rs) = 0;
222  virtual OdDbStub* renderSettings() const = 0;
223 
226 };
227 
233 
234 #include "TD_PackPop.h"
235 
236 #endif // __OD_GI_VIEWPORT_TRAITS__
OdGiToneOperatorParameters::processBackground
virtual bool processBackground() const
FIRSTDLL_EXPORT
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdCmEntityColor
Definition: CmColorBase.h:68
OdGiViewportTraits::ambientLightColor
virtual OdCmEntityColor ambientLightColor() const =0
OdGiToneOperatorParameters::chromaticAdaptation
virtual bool chromaticAdaptation() const
OdGeVector3d
Definition: GeVector3d.h:54
OdGiViewportTraits::defaultLightingColor
virtual OdCmEntityColor defaultLightingColor() const =0
OdGiPhotographicExposureParameters::convertBrightnessToExposure
static double convertBrightnessToExposure(double fBrightness)
OdGiToneOperatorParameters::setColorDifferentiation
virtual void setColorDifferentiation(bool bEnable)
OdGiViewportTraits::isDefaultLightingOn
virtual bool isDefaultLightingOn() const =0
OdGiViewportTraits::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGiViewportTraits)
OdGiToneOperatorParameters::~OdGiToneOperatorParameters
virtual ~OdGiToneOperatorParameters()
Definition: GiViewportTraits.h:56
OdGiViewportTraits::defaultLightingIntensity
virtual double defaultLightingIntensity() const =0
OdGiToneOperatorParameters::setExteriorDaylight
virtual bool setExteriorDaylight(ExteriorDaylightMode mode)
OdGiToneOperatorParameters::contrast
virtual double contrast() const
OdGiToneOperatorParameters::setIsActive
virtual void setIsActive(bool bActive)
OdGiToneOperatorParameters::setChromaticAdaptation
virtual void setChromaticAdaptation(bool bEnable)
OdGiViewportTraits::setDefaultLightingIntensity
virtual void setDefaultLightingIntensity(double dIntensity)=0
OdGiToneOperatorParameters::brightness
virtual double brightness() const
OdGiToneOperatorParametersPtr
OdSmartPtr< OdGiToneOperatorParameters > OdGiToneOperatorParametersPtr
Definition: GiViewportTraits.h:116
OdRxObject
Definition: RxObject.h:564
OdGiToneOperatorParameters::setWhiteColor
virtual void setWhiteColor(const OdCmEntityColor &color)
OdGiToneOperatorParametersStatic::operator=
OdGiToneOperatorParameters & operator=(const OdGiToneOperatorParameters &params)
Definition: GiViewportTraits.h:110
OdGiViewportTraits::setBrightness
virtual void setBrightness(double brightness)=0
OdGiPhotographicExposureParametersStatic::operator==
bool operator==(const OdGiPhotographicExposureParameters &params) const
Definition: GiViewportTraits.h:161
OdGiPhotographicExposureParametersStatic
Definition: GiViewportTraits.h:158
OdGiToneOperatorParameters::whiteColor
virtual const OdCmEntityColor & whiteColor() const
OdGiViewportTraits::background
virtual OdDbStub * background() const =0
TD_PackPop.h
OdGiViewportTraits::renderSettings
virtual OdDbStub * renderSettings() const =0
OdGiViewportTraits::setBackground
virtual void setBackground(OdDbStub *bg)=0
OdGiToneOperatorParameters::setMidTones
virtual bool setMidTones(double fMidTones)
OdGiToneOperatorParameters::operator==
bool operator==(const OdGiToneOperatorParameters &params) const
OdGiToneOperatorParameters::ExteriorDaylightMode
ExteriorDaylightMode
Definition: GiViewportTraits.h:43
OdGiToneOperatorParameters::setProcessBackground
virtual void setProcessBackground(bool bProcessBg)
OdGiPhotographicExposureParameters::convertExposureToBrightness
static double convertExposureToBrightness(double fExposure)
OdGiToneOperatorParametersStatic
Definition: GiViewportTraits.h:105
OdGiToneOperatorParameters::setBrightness
virtual bool setBrightness(double fBrightness)
OdGiPhotographicExposureParameters::exposure
virtual double exposure() const
OdGiViewportTraits::setUserDefinedLightDirection
virtual void setUserDefinedLightDirection(const OdGeVector3d &lightDirection)=0
OdGiShadowParameters
Definition: GiLightTraits.h:120
OdGiViewportTraits::setRenderEnvironment
virtual void setRenderEnvironment(OdDbStub *re)=0
OdGiViewportTraits::userDefinedLightDirection
virtual OdGeVector3d userDefinedLightDirection() const =0
OdGiPhotographicExposureParameters::setExposure
virtual bool setExposure(double fExposure)
OdGiViewportTraits::setDefaultLightingColor
virtual void setDefaultLightingColor(const OdCmEntityColor &color)=0
OdGiToneOperatorParametersStatic::operator==
bool operator==(const OdGiToneOperatorParameters &params) const
Definition: GiViewportTraits.h:108
OdGiPhotographicExposureParameters::setBrightness
virtual bool setBrightness(double fBrightness)
OdGiPhotographicExposureParametersStatic::operator!=
bool operator!=(const OdGiPhotographicExposureParameters &params) const
Definition: GiViewportTraits.h:162
OdSmartPtr< OdGiToneOperatorParameters >
OdGiPhotographicExposureParameters::whitePoint
virtual double whitePoint() const
OdGiViewportTraits::defaultLightingShadowParameters
virtual void defaultLightingShadowParameters(OdGiShadowParameters &params) const =0
OdDAI::operator!=
bool DAI_EXPORT operator!=(const OdDAI::OdSelect &left, const OdDAI::OdSelect &right)
OdGiViewportTraits::brightness
virtual double brightness() const =0
OdGiPhotographicExposureParametersPtr
OdSmartPtr< OdGiPhotographicExposureParameters > OdGiPhotographicExposureParametersPtr
Definition: GiViewportTraits.h:169
OdGiPhotographicExposureParameters::~OdGiPhotographicExposureParameters
virtual ~OdGiPhotographicExposureParameters()
Definition: GiViewportTraits.h:130
OdGiViewportTraits::setToneOperatorParameters
virtual void setToneOperatorParameters(const OdGiToneOperatorParameters &params)=0
OdGiViewportTraits::toneOperatorParameters
virtual void toneOperatorParameters(OdGiToneOperatorParameters &params)=0
OdGiPhotographicExposureParameters::whitePointToColor
OdCmEntityColor whitePointToColor() const
OdGiToneOperatorParameters::colorDifferentiation
virtual bool colorDifferentiation() const
OdGiToneOperatorParameters::setContrast
virtual bool setContrast(double fContrast)
OdGiViewportTraits::setContrast
virtual void setContrast(double contrast)=0
OdGiViewportTraits::setAmbientLightColor
virtual void setAmbientLightColor(const OdCmEntityColor &color)=0
OdGiViewportTraits::defaultLightingType
virtual DefaultLightingType defaultLightingType() const =0
OdGiPhotographicExposureParameters::OdGiPhotographicExposureParameters
OdGiPhotographicExposureParameters(const OdGiPhotographicExposureParameters &params)
CmColorBase.h
TD_PackPush.h
OdGiSubEntityTraits
Definition: Gi.h:94
StaticRxObject.h
OdGiToneOperatorParameters
Definition: GiViewportTraits.h:40
OdGiViewportTraits
Definition: GiViewportTraits.h:176
OdGiViewportTraits::contrast
virtual double contrast() const =0
params
GLenum GLint * params
Definition: gles2_ext.h:184
OdGiToneOperatorParameters::operator=
OdGiToneOperatorParameters & operator=(const OdGiToneOperatorParameters &params)
OdGiPhotographicExposureParameters::setWhitePoint
virtual bool setWhitePoint(double fWhitePoint)
OdGiToneOperatorParametersStatic::operator!=
bool operator!=(const OdGiToneOperatorParameters &params) const
Definition: GiViewportTraits.h:109
OdGiViewportTraits::renderEnvironment
virtual OdDbStub * renderEnvironment() const =0
OdGiToneOperatorParameters::isActive
virtual bool isActive() const
OdGiToneOperatorParametersStatic::OdGiToneOperatorParametersStatic
OdGiToneOperatorParametersStatic()
Definition: GiViewportTraits.h:107
OdStaticRxObject
Definition: StaticRxObject.h:57
OdDAI::operator==
bool DAI_EXPORT operator==(const OdFileDescriptionAuto &left, const OdFileDescriptionAuto &right)
OdGiPhotographicExposureParameters
Definition: GiViewportTraits.h:123
OdGiToneOperatorParameters::exteriorDaylight
virtual ExteriorDaylightMode exteriorDaylight() const
OdGiToneOperatorParameters::OdGiToneOperatorParameters
OdGiToneOperatorParameters()
OdGiPhotographicExposureParameters::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGiPhotographicExposureParameters)
OdGiToneOperatorParameters::OdGiToneOperatorParameters
OdGiToneOperatorParameters(const OdGiToneOperatorParameters &params)
OdGiViewportTraits::setDefaultLightingOn
virtual void setDefaultLightingOn(bool b)=0
OdGiViewportTraitsPtr
OdSmartPtr< OdGiViewportTraits > OdGiViewportTraitsPtr
Definition: GiViewportTraits.h:232
OdGiViewportTraits::setDefaultLightingShadowParameters
virtual void setDefaultLightingShadowParameters(const OdGiShadowParameters &params)=0
OdGiToneOperatorParameters::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGiToneOperatorParameters)
OdGiViewportTraits::DefaultLightingType
DefaultLightingType
Definition: GiViewportTraits.h:181
OdGiViewportTraits::setRenderSettings
virtual void setRenderSettings(OdDbStub *rs)=0
OdGiPhotographicExposureParameters::OdGiPhotographicExposureParameters
OdGiPhotographicExposureParameters()
OdGiViewportTraits::setDefaultLightingType
virtual void setDefaultLightingType(DefaultLightingType)=0
OdGiToneOperatorParameters::operator!=
bool operator!=(const OdGiToneOperatorParameters &params) const
OdGiToneOperatorParameters::midTones
virtual double midTones() const
OdGiPhotographicExposureParametersStatic::operator=
OdGiPhotographicExposureParameters & operator=(const OdGiPhotographicExposureParameters &params)
Definition: GiViewportTraits.h:163
Gi.h
OdGiPhotographicExposureParametersStatic::OdGiPhotographicExposureParametersStatic
OdGiPhotographicExposureParametersStatic()
Definition: GiViewportTraits.h:160