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;
OdSmartPtr< OdGiLightTraitsVpDep > OdGiLightTraitsVpDepPtr
OdSmartPtr< OdGiPointLightTraits > OdGiPointLightTraitsPtr
OdSmartPtr< OdGiWebLightTraits > OdGiWebLightTraitsPtr
OdSmartPtr< OdGiStandardLightTraits > OdGiStandardLightTraitsPtr
OdSmartPtr< OdGiSpotLightTraits > OdGiSpotLightTraitsPtr
OdSmartPtr< OdGiDistantLightTraits > OdGiDistantLightTraitsPtr
OdSmartPtr< OdGiLightTraits > OdGiLightTraitsPtr
bool OdEqual(double x, double y, double tol=1.e-10)
void setColor(OdUInt32 color)
OdGeVector3d & set(double xx, double yy, double zz)
virtual OdGiColorRGB lampColor() const =0
virtual void skyParameters(OdGiSkyParameters ¶ms) const =0
virtual void setLightDirection(const OdGeVector3d &vec)=0
virtual bool isSunlight() const =0
virtual void setSkyParameters(const OdGiSkyParameters ¶ms)=0
virtual void setLampColor(const OdGiColorRGB &color)=0
virtual void setPhysicalIntensity(double fIntensity)=0
virtual void setIsSunlight(bool isSunlight)=0
ODRX_DECLARE_MEMBERS(OdGiDistantLightTraits)
virtual double physicalIntensity() const =0
virtual OdGeVector3d lightDirection() const =0
void save(OdGsFiler *pFiler) const
double startLimit() const
AttenuationType attenuationType() const
void setUseLimits(bool on)
void load(OdGsFiler *pFiler)
void setAttenuationType(AttenuationType typ)
void setLimits(double startlim, double endlim)
virtual void setOn(bool on)=0
ODRX_DECLARE_MEMBERS(OdGiLightTraits)
virtual bool isOn() const =0
virtual double dimming() const =0
virtual void setDimming(double dim)=0
virtual bool isOn() const =0
virtual OdUInt32 viewportId() const =0
ODRX_DECLARE_MEMBERS(OdGiLightTraitsVpDep)
virtual OdDbStub * viewportObjectId() const =0
virtual void setOn(bool on)=0
virtual void setPosition(const OdGePoint3d &pos)=0
virtual OdGePoint3d targetLocation() const =0
virtual OdGePoint3d position() const =0
ODRX_DECLARE_MEMBERS(OdGiPointLightTraits)
virtual void setLampColor(const OdGiColorRGB &color)=0
virtual void setAttenuation(const OdGiLightAttenuation &atten)=0
virtual double physicalIntensity() const =0
virtual void setHemisphericalDistribution(bool bHemisphere)=0
virtual bool hasTarget() const =0
virtual void setPhysicalIntensity(double fIntensity)=0
virtual bool hemisphericalDistribution() const =0
virtual void setTargetLocation(const OdGePoint3d &loc)=0
virtual void setHasTarget(bool bTarget)=0
virtual OdGiLightAttenuation lightAttenuation() const =0
virtual OdGiColorRGB lampColor() const =0
bool setShadowSamples(OdUInt16 nSamples)
double extendedLightWidth() const
void save(OdGsFiler *pFiler) const
OdUInt16 shadowMapSize() const
OdGiShadowParameters & operator=(const OdGiShadowParameters &parms)
double extendedLightLength() const
ShadowType shadowType() const
void setShapeVisibility(bool bVisibility)
bool setExtendedLightWidth(double dWidth)
ExtendedLightShape extendedLightShape() const
double extendedLightRadius() const
OdUInt8 shadowMapSoftness() const
bool shapeVisibility() const
void load(OdGsFiler *pFiler)
void setShadowType(ShadowType typ)
bool setExtendedLightLength(double dLength)
void setShadowsOn(bool on)
bool setShadowMapSize(OdUInt16 sz)
bool setShadowMapSoftness(OdUInt8 soft)
OdUInt16 shadowSamples() const
bool operator!=(const OdGiShadowParameters &parms) const
bool setExtendedLightRadius(double dRadius)
bool operator==(const OdGiShadowParameters &parms) const
void setExtendedLightShape(ExtendedLightShape lightShape)
void setRedBlueShift(double redBlueShift)
void setNightColor(const OdCmEntityColor &color)
void setSolarDiskSamples(OdUInt16 samples)
void setIntensityFactor(double intensity)
double diskIntensity() const
double visibilityDistance() const
double saturation() const
double horizonHeight() const
void setHorizonBlur(double blur)
OdCmEntityColor nightColor() const
bool aerialPerspective() const
void setDiskIntensity(double intensity)
void setGlowIntensity(double intensity)
bool operator==(const OdGiSkyParameters ¶ms) const
double glowIntensity() const
void setSunDirection(const OdGeVector3d &sundir)
void setAerialPerspective(bool apply)
void setSaturation(double saturation)
double horizonBlur() const
OdCmEntityColor groundColor() const
OdUInt16 solarDiskSamples() const
void setIllumination(bool enable)
void setGroundColor(const OdCmEntityColor &color)
void setHaze(double haze)
void setDiskScale(double scale)
bool illumination() const
void setVisibilityDistance(double distance)
void setHorizonHeight(double height)
double redBlueShift() const
double intensityFactor() const
const OdGeVector3d & sunDirection() const
virtual double hotspot() const =0
ODRX_DECLARE_MEMBERS(OdGiSpotLightTraits)
virtual void setPhysicalIntensity(double fIntensity)=0
virtual OdGiColorRGB lampColor() const =0
virtual bool setHotspotAndFalloff(double hotspot, double falloff)=0
virtual OdGePoint3d position() const =0
virtual OdGiLightAttenuation lightAttenuation() const =0
virtual void setTargetLocation(const OdGePoint3d &loc)=0
virtual void setAttenuation(const OdGiLightAttenuation &atten)=0
virtual void setLampColor(const OdGiColorRGB &color)=0
virtual OdGePoint3d targetLocation() const =0
virtual double falloff() const =0
virtual void setPosition(const OdGePoint3d &pos)=0
virtual double physicalIntensity() const =0
virtual double intensity() const =0
virtual OdGiShadowParameters shadowParameters() const =0
ODRX_DECLARE_MEMBERS(OdGiStandardLightTraits)
virtual OdCmEntityColor lightColor() const =0
virtual void setIntensity(double inten)=0
virtual void setLightColor(const OdCmEntityColor &color)=0
virtual void setShadowParameters(const OdGiShadowParameters ¶ms)=0
virtual void setWebFlux(double fFlux)=0
virtual OdString webFile() const =0
virtual void setWebFileType(WebFileType type)=0
virtual double webFlux() const =0
ODRX_DECLARE_MEMBERS(OdGiWebLightTraits)
virtual WebFileType webFileType() const =0
virtual void setWebSymmetry(WebSymmetry sym)=0
virtual OdGeVector3d webRotation() const =0
virtual void setWebHorzAng90to270(bool bFlag)=0
virtual void setWebRotation(OdGeVector3d fRot)=0
virtual void setWebFile(const OdString &fileName)=0
virtual WebSymmetry webSymmetry() const =0
virtual bool webHorzAng90to270() const =0
virtual void wrDouble(double val)
virtual void wrUInt16(OdUInt16 val)
virtual OdUInt8 rdUInt8() const
virtual void wrUInt8(OdUInt8 val)
virtual bool rdBool() const
virtual void wrBool(bool bVal)
virtual OdUInt16 rdUInt16() const
virtual double rdDouble() const
GLuint GLsizei GLsizei GLint GLenum * type
GLint GLenum GLsizei GLsizei height
@ kNone
Light mode is inherited from the annotation.
friend OdGiColorRGB operator+(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
friend OdGiColorRGB operator*(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
OdGiColorRGB(double _red, double _green, double _blue)
friend OdGiColorRGB operator/(const OdGiColorRGB &c1, const OdGiColorRGB &c2)
friend OdGiColorRGB operator-(const OdGiColorRGB &c1, const OdGiColorRGB &c2)