CFx SDK Documentation
2020SP3
|
Go to the documentation of this file.
24 #ifndef __OD_GI_LIGHT_TRAITS__
25 #define __OD_GI_LIGHT_TRAITS__
45 virtual void setOn(
bool on) = 0;
46 virtual bool isOn()
const = 0;
203 bool m_bShapeVisible;
208 double m_lightLength;
210 double m_lightRadius;
215 , m_shadowMapSoftness(1)
216 , m_bShapeVisible(
false)
218 , m_shadowMapSize(256)
219 , m_shadowSamples(16)
228 : m_bShadowsOn(parms.m_bShadowsOn)
229 , m_shadowMapSoftness(parms.m_shadowMapSoftness)
230 , m_bShapeVisible(parms.m_bShapeVisible)
231 , m_shadowType(parms.m_shadowType)
232 , m_shadowMapSize(parms.m_shadowMapSize)
233 , m_shadowSamples(parms.m_shadowSamples)
234 , m_lightShape(parms.m_lightShape)
235 , m_lightLength(parms.m_lightLength)
236 , m_lightWidth(parms.m_lightWidth)
237 , m_lightRadius(parms.m_lightRadius)
243 m_bShadowsOn = parms.m_bShadowsOn;
244 m_shadowType = parms.m_shadowType;
245 m_shadowMapSize = parms.m_shadowMapSize;
246 m_shadowMapSoftness = parms.m_shadowMapSoftness;
247 m_shadowSamples = parms.m_shadowSamples;
248 m_bShapeVisible = parms.m_bShapeVisible;
249 m_lightShape = parms.m_lightShape;
250 m_lightLength = parms.m_lightLength;
251 m_lightWidth = parms.m_lightWidth;
252 m_lightRadius = parms.m_lightRadius;
258 return (m_bShadowsOn == parms.m_bShadowsOn) &&
259 (m_shadowType == parms.m_shadowType) &&
260 (m_shadowMapSize == parms.m_shadowMapSize) &&
261 (m_shadowMapSoftness == parms.m_shadowMapSoftness) &&
262 (m_shadowSamples == parms.m_shadowSamples) &&
263 (m_bShapeVisible == parms.m_bShapeVisible) &&
264 (m_lightShape == parms.m_lightShape) &&
265 OdEqual(m_lightLength , parms.m_lightLength) &&
266 OdEqual(m_lightWidth , parms.m_lightWidth) &&
267 OdEqual(m_lightRadius , parms.m_lightRadius);
272 return (m_bShadowsOn != parms.m_bShadowsOn) ||
273 (m_shadowType != parms.m_shadowType) ||
274 (m_shadowMapSize != parms.m_shadowMapSize) ||
275 (m_shadowMapSoftness != parms.m_shadowMapSoftness) ||
276 (m_shadowSamples != parms.m_shadowSamples) ||
277 (m_bShapeVisible != parms.m_bShapeVisible) ||
278 (m_lightShape != parms.m_lightShape) ||
279 !
OdEqual(m_lightLength, parms.m_lightLength) ||
280 !
OdEqual(m_lightWidth , parms.m_lightWidth) ||
281 !
OdEqual(m_lightRadius, parms.m_lightRadius);
306 if((sz & (sz-1)) == 0 && sz >= 64 && sz <= 4096)
308 m_shadowMapSize = sz;
319 return m_shadowMapSize;
324 m_shadowMapSoftness = soft;
330 return m_shadowMapSoftness;
335 m_shadowSamples = nSamples;
341 return m_shadowSamples;
346 m_bShapeVisible = bVisibility;
351 return m_bShapeVisible;
356 m_lightShape = lightShape;
366 m_lightLength = dLength;
372 return m_lightLength;
377 m_lightWidth = dWidth;
388 m_lightRadius = dRadius;
394 return m_lightRadius;
419 void setLimits(
double startlim,
double endlim);
427 bool m_bUseAttenLimits;
428 double m_dAttenStartLimit;
429 double m_dAttenEndLimit;
434 , m_bUseAttenLimits(
false)
435 , m_dAttenStartLimit(1.0)
436 , m_dAttenEndLimit(10.0)
452 m_bUseAttenLimits = on;
457 return m_bUseAttenLimits;
462 m_dAttenStartLimit = startlim;
463 m_dAttenEndLimit = endlim;
468 return m_dAttenStartLimit;
473 return m_dAttenEndLimit;
478 pFiler->
wrBool(m_bUseAttenLimits);
479 pFiler->
wrDouble(m_dAttenStartLimit);
485 m_bUseAttenLimits = pFiler->
rdBool();
486 m_dAttenStartLimit = pFiler->
rdDouble();
487 m_dAttenEndLimit = pFiler->
rdDouble();
554 double m_intensityFactor;
556 double m_horizonHeight;
557 double m_horizonBlur;
560 bool m_aerialPerspective;
561 double m_visibilityDistance;
563 double m_glowIntensity;
564 double m_diskIntensity;
567 double m_redBlueShift;
573 , m_intensityFactor(1.0)
575 , m_horizonHeight(0.0)
577 , m_aerialPerspective(
false)
578 , m_visibilityDistance(10000.0)
580 , m_glowIntensity(1.0)
581 , m_diskIntensity(1.0)
582 , m_solarDiskSamples(8)
583 , m_redBlueShift(0.0)
588 m_sunDirection.
set(0.35, 1.0, -0.25);
593 if (m_status !=
params.m_status)
return false;
594 if (m_intensityFactor !=
params.m_intensityFactor)
return false;
595 if (m_haze !=
params.m_haze)
return false;
596 if (m_horizonHeight !=
params.m_horizonHeight)
return false;
597 if (m_horizonBlur !=
params.m_horizonBlur)
return false;
598 if (m_groundColor !=
params.m_groundColor)
return false;
599 if (m_nightColor !=
params.m_nightColor)
return false;
600 if (m_aerialPerspective !=
params.m_aerialPerspective)
return false;
601 if (m_visibilityDistance !=
params.m_visibilityDistance)
return false;
602 if (m_diskScale !=
params.m_diskScale)
return false;
603 if (m_glowIntensity !=
params.m_glowIntensity)
return false;
604 if (m_diskIntensity !=
params.m_diskIntensity)
return false;
605 if (m_solarDiskSamples !=
params.m_solarDiskSamples)
return false;
606 if (m_sunDirection !=
params.m_sunDirection)
return false;
607 if (m_redBlueShift !=
params.m_redBlueShift)
return false;
608 if (m_saturation !=
params.m_saturation)
return false;
622 m_intensityFactor = intensity;
626 return m_intensityFactor;
642 return m_horizonHeight;
646 m_horizonBlur = blur;
650 return m_horizonBlur;
654 m_groundColor = color;
658 return m_groundColor;
662 m_nightColor = color;
670 m_aerialPerspective = apply;
674 return m_aerialPerspective;
678 m_visibilityDistance = distance;
682 return m_visibilityDistance;
694 m_glowIntensity = intensity;
698 return m_glowIntensity;
702 m_diskIntensity = intensity;
706 return m_diskIntensity;
710 m_solarDiskSamples = samples;
714 return m_solarDiskSamples;
718 m_sunDirection = sundir;
722 return m_sunDirection;
730 return m_redBlueShift;
929 #endif // __OD_GI_LIGHT_TRAITS__
AttenuationType attenuationType() const
virtual double webFlux() const =0
bool OdEqual(double x, double y, double tol=1.e-10)
virtual void setLampColor(const OdGiColorRGB &color)=0
virtual void setOn(bool on)=0
ExtendedLightShape extendedLightShape() const
OdUInt16 shadowMapSize() const
void setShadowType(ShadowType typ)
ODRX_DECLARE_MEMBERS(OdGiLightTraitsVpDep)
virtual OdGePoint3d position() const =0
virtual OdGiColorRGB lampColor() const =0
virtual OdGeVector3d webRotation() const =0
void setGroundColor(const OdCmEntityColor &color)
virtual OdGiShadowParameters shadowParameters() const =0
double visibilityDistance() const
virtual OdGiLightAttenuation lightAttenuation() const =0
bool setExtendedLightLength(double dLength)
ODRX_DECLARE_MEMBERS(OdGiStandardLightTraits)
virtual bool isSunlight() const =0
virtual void setTargetLocation(const OdGePoint3d &loc)=0
OdUInt16 shadowSamples() const
virtual void setWebRotation(OdGeVector3d fRot)=0
bool setShadowMapSize(OdUInt16 sz)
void setShadowsOn(bool on)
double extendedLightRadius() const
virtual OdGePoint3d targetLocation() const =0
OdGiShadowParameters & operator=(const OdGiShadowParameters &parms)
GLuint GLsizei GLsizei GLint GLenum * type
virtual void setPhysicalIntensity(double fIntensity)=0
void setHorizonHeight(double height)
virtual void setAttenuation(const OdGiLightAttenuation &atten)=0
void setGlowIntensity(double intensity)
OdGeVector3d & set(double xx, double yy, double zz)
OdSmartPtr< OdGiStandardLightTraits > OdGiStandardLightTraitsPtr
virtual void wrDouble(double val)
virtual double hotspot() const =0
bool setShadowMapSoftness(OdUInt8 soft)
void setSolarDiskSamples(OdUInt16 samples)
void setDiskIntensity(double intensity)
virtual void setWebFileType(WebFileType type)=0
virtual void setLampColor(const OdGiColorRGB &color)=0
void setColor(OdUInt32 color)
double extendedLightWidth() const
void load(OdGsFiler *pFiler)
virtual void setLightDirection(const OdGeVector3d &vec)=0
virtual void setLampColor(const OdGiColorRGB &color)=0
ODRX_DECLARE_MEMBERS(OdGiWebLightTraits)
void setVisibilityDistance(double distance)
void setHorizonBlur(double blur)
virtual double physicalIntensity() const =0
OdSmartPtr< OdGiWebLightTraits > OdGiWebLightTraitsPtr
virtual void setAttenuation(const OdGiLightAttenuation &atten)=0
@ kNone
Light mode is inherited from the annotation.
OdCmEntityColor groundColor() const
double glowIntensity() const
void setSunDirection(const OdGeVector3d &sundir)
bool setExtendedLightRadius(double dRadius)
virtual bool rdBool() const
double extendedLightLength() const
bool aerialPerspective() const
OdSmartPtr< OdGiPointLightTraits > OdGiPointLightTraitsPtr
virtual void setLightColor(const OdCmEntityColor &color)=0
virtual bool hasTarget() const =0
virtual double dimming() const =0
void setShapeVisibility(bool bVisibility)
void setDiskScale(double scale)
OdSmartPtr< OdGiLightTraitsVpDep > OdGiLightTraitsVpDepPtr
virtual bool isOn() const =0
virtual void setHemisphericalDistribution(bool bHemisphere)=0
virtual void setOn(bool on)=0
const OdGeVector3d & sunDirection() const
bool illumination() const
virtual void setWebSymmetry(WebSymmetry sym)=0
void setIllumination(bool enable)
virtual void setHasTarget(bool bTarget)=0
virtual bool webHorzAng90to270() const =0
bool operator!=(const OdGiShadowParameters &parms) const
virtual OdGiColorRGB lampColor() const =0
double redBlueShift() const
virtual void setDimming(double dim)=0
virtual WebFileType webFileType() const =0
virtual OdDbStub * viewportObjectId() const =0
double startLimit() const
virtual OdGePoint3d position() const =0
virtual OdUInt16 rdUInt16() const
OdSmartPtr< OdGiDistantLightTraits > OdGiDistantLightTraitsPtr
virtual void setShadowParameters(const OdGiShadowParameters ¶ms)=0
void setRedBlueShift(double redBlueShift)
void save(OdGsFiler *pFiler) const
virtual void wrUInt16(OdUInt16 val)
OdSmartPtr< OdGiSpotLightTraits > OdGiSpotLightTraitsPtr
virtual void setWebFile(const OdString &fileName)=0
void setIntensityFactor(double intensity)
virtual bool isOn() const =0
virtual void setIntensity(double inten)=0
GLint GLenum GLsizei GLsizei height
friend OdGiColorRGB operator/(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
ODRX_DECLARE_MEMBERS(OdGiLightTraits)
bool setShadowSamples(OdUInt16 nSamples)
bool shapeVisibility() const
virtual OdCmEntityColor lightColor() const =0
virtual void setTargetLocation(const OdGePoint3d &loc)=0
double diskIntensity() const
double intensityFactor() const
virtual void setPhysicalIntensity(double fIntensity)=0
OdGiColorRGB(double _red, double _green, double _blue)
double horizonBlur() const
void setHaze(double haze)
virtual double rdDouble() const
void setSaturation(double saturation)
virtual void setIsSunlight(bool isSunlight)=0
virtual WebSymmetry webSymmetry() const =0
virtual void wrUInt8(OdUInt8 val)
OdSmartPtr< OdGiLightTraits > OdGiLightTraitsPtr
virtual bool hemisphericalDistribution() const =0
OdUInt16 solarDiskSamples() const
virtual void wrBool(bool bVal)
virtual void setPosition(const OdGePoint3d &pos)=0
void save(OdGsFiler *pFiler) const
virtual double physicalIntensity() const =0
void setExtendedLightShape(ExtendedLightShape lightShape)
void setLimits(double startlim, double endlim)
virtual double falloff() const =0
ShadowType shadowType() const
virtual void setWebFlux(double fFlux)=0
virtual void setPhysicalIntensity(double fIntensity)=0
bool operator==(const OdGiSkyParameters ¶ms) const
friend OdGiColorRGB operator+(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
virtual OdUInt8 rdUInt8() const
ODRX_DECLARE_MEMBERS(OdGiPointLightTraits)
void setNightColor(const OdCmEntityColor &color)
virtual bool setHotspotAndFalloff(double hotspot, double falloff)=0
virtual void setPosition(const OdGePoint3d &pos)=0
ODRX_DECLARE_MEMBERS(OdGiSpotLightTraits)
bool setExtendedLightWidth(double dWidth)
void setAerialPerspective(bool apply)
virtual void setSkyParameters(const OdGiSkyParameters ¶ms)=0
virtual OdGiLightAttenuation lightAttenuation() const =0
void setUseLimits(bool on)
virtual OdGeVector3d lightDirection() const =0
friend OdGiColorRGB operator*(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
friend OdGiColorRGB operator-(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
virtual OdGiColorRGB lampColor() const =0
double saturation() const
void load(OdGsFiler *pFiler)
double horizonHeight() const
OdCmEntityColor nightColor() const
virtual void skyParameters(OdGiSkyParameters ¶ms) const =0
OdUInt8 shadowMapSoftness() const
virtual OdGePoint3d targetLocation() const =0
virtual void setWebHorzAng90to270(bool bFlag)=0
virtual OdUInt32 viewportId() const =0
ODRX_DECLARE_MEMBERS(OdGiDistantLightTraits)
void setAttenuationType(AttenuationType typ)
bool operator==(const OdGiShadowParameters &parms) const
virtual double physicalIntensity() const =0
virtual double intensity() const =0
virtual OdString webFile() const =0