CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiViewportTraitsData.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#ifndef __OD_GI_VIEWPORT_TRAITS_DATA__
25#define __OD_GI_VIEWPORT_TRAITS_DATA__
26
27#include "TD_PackPush.h"
28
29#include "Ge/GeVector3d.h"
30#include "Gi/GiViewportTraits.h"
31#include "Gi/GiLightTraits.h"
32
40{
41 OdDbStub* m_backgroundId;
42 bool m_bDefLightOn;
44 OdGeVector3d m_userDefLightDir;
45 double m_defLightIntensity;
46 OdCmEntityColor m_defLightColor;
47 OdGiShadowParameters m_defShadowParams;
48 OdCmEntityColor m_colorAmbient;
49 double m_dBrightness;
50 double m_dContrast;
51 OdDbStub* m_renderEnvId;
52 OdDbStub* m_renderSettings;
53 OdDbStub* m_visualStyle;
54 OdGiToneOperatorParametersPtr m_pToneOperators;
55
56public:
57
79 : m_backgroundId(NULL)
80 , m_bDefLightOn(false)
81 , m_lightType(OdGiViewportTraits::kOneDistantLight)
82 , m_userDefLightDir(OdGeVector3d::kZAxis)
83 , m_defLightIntensity(0.5)
84 , m_defLightColor(255, 255, 255)
85 , m_defShadowParams()
86 , m_colorAmbient()
87 , m_dBrightness(50.0)
88 , m_dContrast(50.0)
89 , m_renderEnvId(NULL)
90 , m_renderSettings(NULL)
91 , m_visualStyle(NULL)
92 {
93 m_defShadowParams.setShadowsOn(false);
94 m_pToneOperators = OdGiToneOperatorParameters::createObject();
95 }
96
101
108 void setBackground(OdDbStub* backgroundId)
109 {
110 m_backgroundId = backgroundId;
111 }
117 OdDbStub* background() const
118 {
119 return m_backgroundId;
120 }
121
122
128 {
129 m_bDefLightOn = on;
130 }
137 {
138 return m_bDefLightOn;
139 }
140
141
147 {
148 m_lightType = typ;
149 }
154 {
155 return m_lightType;
156 }
157
158
163 {
164 return m_userDefLightDir;
165 }
170 void setUserDefinedLightDirection(const OdGeVector3d& lightDirection)
171 {
172 m_userDefLightDir = lightDirection;
173 }
174
175
180 {
181 return m_defLightIntensity;
182 }
187 void setDefaultLightingIntensity(double dIntensity)
188 {
189 m_defLightIntensity = dIntensity;
190 }
191
192
197 {
198 return m_defLightColor;
199 }
205 {
206 m_defLightColor = color;
207 }
208
209
216 {
217 return m_defShadowParams;
218 }
226 {
227 m_defShadowParams = params;
228 }
229
230
236 {
237 m_colorAmbient = clr;
238 }
243 {
244 return m_colorAmbient;
245 }
246
247
253 {
254 m_dBrightness = brightness;
255 }
259 double brightness() const
260 {
261 return m_dBrightness;
262 }
263
264
270 {
271 m_dContrast = contrast;
272 }
276 double contrast() const
277 {
278 return m_dContrast;
279 }
280
281
286 void setRenderEnvironment(OdDbStub* renderEnvId)
287 {
288 m_renderEnvId = renderEnvId;
289 }
293 OdDbStub* renderEnvironment() const
294 {
295 return m_renderEnvId;
296 }
297
298
303 void setRenderSettings(OdDbStub* renderSettingsId)
304 {
305 m_renderSettings = renderSettingsId;
306 }
310 OdDbStub* renderSettings() const
311 {
312 return m_renderSettings;
313 }
314
315
322 void setVisualStyle(OdDbStub* visualStyleId)
323 {
324 m_visualStyle = visualStyleId;
325 }
326
332 OdDbStub* visualStyle() const
333 {
334 return m_visualStyle;
335 }
336
337
343 {
345 {
346 if (!m_pToneOperators->isKindOf(OdGiPhotographicExposureParameters::desc()))
347 m_pToneOperators = OdGiPhotographicExposureParameters::createObject();
348 *static_cast<OdGiPhotographicExposureParameters*>(m_pToneOperators.get()) = static_cast<const OdGiPhotographicExposureParameters&>(params);
349 }
350 else
351 {
352 if (m_pToneOperators->isKindOf(OdGiPhotographicExposureParameters::desc()))
353 m_pToneOperators = OdGiToneOperatorParameters::createObject();
354 *m_pToneOperators = params;
355 }
356 }
362 {
363 if (m_pToneOperators->isKindOf(OdGiPhotographicExposureParameters::desc()) &&
365 static_cast<OdGiPhotographicExposureParameters&>(params) = *static_cast<const OdGiPhotographicExposureParameters*>(m_pToneOperators.get());
366 else
367 params = *m_pToneOperators;
368 }
373 {
374 return *m_pToneOperators;
375 }
376
385 {
386 const bool bPhoto1 = op1->isKindOf(OdGiPhotographicExposureParameters::desc());
387 const bool bPhoto2 = op2->isKindOf(OdGiPhotographicExposureParameters::desc());
388 if (bPhoto1 && bPhoto2)
389 return *static_cast<const OdGiPhotographicExposureParameters*>(op1.get()) == *static_cast<const OdGiPhotographicExposureParameters*>(op2.get());
390 else if (!bPhoto1 && !bPhoto2)
391 return *op1 == *op2;
392 return false;
393 }
394
416 bool operator ==(const OdGiViewportTraitsData &data2) const
417 {
418 return ((m_backgroundId == data2.m_backgroundId) &&
419 (m_bDefLightOn == data2.m_bDefLightOn) &&
420 (m_lightType == data2.m_lightType) &&
421 m_userDefLightDir.isEqualTo(data2.m_userDefLightDir) &&
422 OdEqual(m_defLightIntensity, data2.m_defLightIntensity) &&
423 (m_defLightColor == data2.m_defLightColor) &&
424 (m_colorAmbient == data2.m_colorAmbient) &&
425 OdEqual(m_dBrightness, data2.m_dBrightness) &&
426 OdEqual(m_dContrast, data2.m_dContrast) &&
427 (m_renderEnvId == data2.m_renderEnvId) &&
428 (m_renderSettings == data2.m_renderSettings) &&
429 (m_visualStyle == data2.m_visualStyle) &&
430 compareToneOps(m_pToneOperators, data2.m_pToneOperators));
431 }
453 bool operator !=(const OdGiViewportTraitsData &data2) const
454 {
455 return !(*this == data2);
456 }
457};
458
459#include "TD_PackPop.h"
460
461#endif // __OD_GI_VIEWPORT_TRAITS_DATA__
false
Definition: DimVarDefs.h:165
bool OdEqual(double x, double y, double tol=1.e-10)
Definition: OdaDefs.h:542
bool isEqualTo(const OdGeVector3d &vect, const OdGeTol &tol=OdGeContext::gTol) const
void setShadowsOn(bool on)
static bool compareToneOps(const OdGiToneOperatorParametersPtr &op1, const OdGiToneOperatorParametersPtr &op2)
void setDefaultLightingColor(const OdCmEntityColor &color)
void setDefaultLightingType(OdGiViewportTraits::DefaultLightingType typ)
void setDefaultLightingShadowParameters(const OdGiShadowParameters &params)
void setDefaultLightingIntensity(double dIntensity)
OdGiViewportTraits::DefaultLightingType defaultLightingType() const
void setBrightness(double brightness)
OdDbStub * background() const
const OdGiShadowParameters & defaultLightingShadowParameters() const
OdGiDrawable::DrawableType type() const
OdDbStub * visualStyle() const
bool operator!=(const OdGiViewportTraitsData &data2) const
OdGeVector3d userDefinedLightDirection() const
void toneOperatorParameters(OdGiToneOperatorParameters &params) const
void setVisualStyle(OdDbStub *visualStyleId)
OdDbStub * renderEnvironment() const
OdDbStub * renderSettings() const
void setContrast(double contrast)
void setAmbientLightColor(const OdCmEntityColor &clr)
void setRenderEnvironment(OdDbStub *renderEnvId)
const OdCmEntityColor & defaultLightingColor() const
double defaultLightingIntensity() const
void setToneOperatorParameters(const OdGiToneOperatorParameters &params)
void setUserDefinedLightDirection(const OdGeVector3d &lightDirection)
bool operator==(const OdGiViewportTraitsData &data2) const
const OdCmEntityColor & ambientLightColor() const
const OdGiToneOperatorParameters & toneOperatorParameters() const
void setBackground(OdDbStub *backgroundId)
void setRenderSettings(OdDbStub *renderSettingsId)
static OdRxClass * desc()
bool isKindOf(const OdRxClass *pClass) const
Definition: RxObject.h:1104
const T * get() const
Definition: SmartPtr.h:339
GLenum GLint * params
Definition: gles2_ext.h:184