24#ifndef __OD_GI_LIGHT_TRAITS__
25#define __OD_GI_LIGHT_TRAITS__
52 virtual void setOn(
bool on) = 0;
60 virtual bool isOn()
const = 0;
485 bool m_bShapeVisible;
490 double m_lightLength;
492 double m_lightRadius;
497 , m_shadowMapSoftness(1)
498 , m_bShapeVisible(
false)
500 , m_shadowMapSize(256)
501 , m_shadowSamples(16)
502 , m_lightShape(kSphere)
510 : m_bShadowsOn(parms.m_bShadowsOn)
511 , m_shadowMapSoftness(parms.m_shadowMapSoftness)
512 , m_bShapeVisible(parms.m_bShapeVisible)
513 , m_shadowType(parms.m_shadowType)
514 , m_shadowMapSize(parms.m_shadowMapSize)
515 , m_shadowSamples(parms.m_shadowSamples)
516 , m_lightShape(parms.m_lightShape)
517 , m_lightLength(parms.m_lightLength)
518 , m_lightWidth(parms.m_lightWidth)
519 , m_lightRadius(parms.m_lightRadius)
525 m_bShadowsOn = parms.m_bShadowsOn;
526 m_shadowType = parms.m_shadowType;
527 m_shadowMapSize = parms.m_shadowMapSize;
528 m_shadowMapSoftness = parms.m_shadowMapSoftness;
529 m_shadowSamples = parms.m_shadowSamples;
530 m_bShapeVisible = parms.m_bShapeVisible;
531 m_lightShape = parms.m_lightShape;
532 m_lightLength = parms.m_lightLength;
533 m_lightWidth = parms.m_lightWidth;
534 m_lightRadius = parms.m_lightRadius;
540 return (m_bShadowsOn == parms.m_bShadowsOn) &&
541 (m_shadowType == parms.m_shadowType) &&
542 (m_shadowMapSize == parms.m_shadowMapSize) &&
543 (m_shadowMapSoftness == parms.m_shadowMapSoftness) &&
544 (m_shadowSamples == parms.m_shadowSamples) &&
545 (m_bShapeVisible == parms.m_bShapeVisible) &&
546 (m_lightShape == parms.m_lightShape) &&
547 OdEqual(m_lightLength , parms.m_lightLength) &&
548 OdEqual(m_lightWidth , parms.m_lightWidth) &&
549 OdEqual(m_lightRadius , parms.m_lightRadius);
554 return (m_bShadowsOn != parms.m_bShadowsOn) ||
555 (m_shadowType != parms.m_shadowType) ||
556 (m_shadowMapSize != parms.m_shadowMapSize) ||
557 (m_shadowMapSoftness != parms.m_shadowMapSoftness) ||
558 (m_shadowSamples != parms.m_shadowSamples) ||
559 (m_bShapeVisible != parms.m_bShapeVisible) ||
560 (m_lightShape != parms.m_lightShape) ||
561 !
OdEqual(m_lightLength, parms.m_lightLength) ||
562 !
OdEqual(m_lightWidth , parms.m_lightWidth) ||
563 !
OdEqual(m_lightRadius, parms.m_lightRadius);
588 if((sz & (sz-1)) == 0 && sz >= 64 && sz <= 4096)
590 m_shadowMapSize = sz;
601 return m_shadowMapSize;
606 m_shadowMapSoftness = soft;
612 return m_shadowMapSoftness;
617 m_shadowSamples = nSamples;
623 return m_shadowSamples;
628 m_bShapeVisible = bVisibility;
633 return m_bShapeVisible;
638 m_lightShape = lightShape;
648 m_lightLength = dLength;
654 return m_lightLength;
659 m_lightWidth = dWidth;
670 m_lightRadius = dRadius;
676 return m_lightRadius;
756 void setLimits(
double startlim,
double endlim);
814 bool m_bUseAttenLimits;
815 double m_dAttenStartLimit;
816 double m_dAttenEndLimit;
821, m_bUseAttenLimits(
false)
822, m_dAttenStartLimit(1.0)
823, m_dAttenEndLimit(10.0)
839 m_bUseAttenLimits = on;
844 return m_bUseAttenLimits;
849 m_dAttenStartLimit = startlim;
850 m_dAttenEndLimit = endlim;
855 return m_dAttenStartLimit;
860 return m_dAttenEndLimit;
865 pFiler->
wrBool(m_bUseAttenLimits);
866 pFiler->
wrDouble(m_dAttenStartLimit);
872 m_bUseAttenLimits = pFiler->
rdBool();
873 m_dAttenStartLimit = pFiler->
rdDouble();
874 m_dAttenEndLimit = pFiler->
rdDouble();
879 return (m_attenType == other.m_attenType) &&
880 (m_bUseAttenLimits == other.m_bUseAttenLimits) &&
881 (m_dAttenStartLimit == other.m_dAttenStartLimit) &&
882 (m_dAttenEndLimit == other.m_dAttenEndLimit);
887 return (m_attenType != other.m_attenType) ||
888 (m_bUseAttenLimits != other.m_bUseAttenLimits) ||
889 (m_dAttenStartLimit != other.m_dAttenStartLimit) ||
890 (m_dAttenEndLimit != other.m_dAttenEndLimit);
1211 double m_intensityFactor;
1213 double m_horizonHeight;
1214 double m_horizonBlur;
1217 bool m_aerialPerspective;
1218 double m_visibilityDistance;
1220 double m_glowIntensity;
1221 double m_diskIntensity;
1224 double m_redBlueShift;
1225 double m_saturation;
1230, m_intensityFactor(1.0)
1232, m_horizonHeight(0.0)
1234, m_aerialPerspective(
false)
1235, m_visibilityDistance(10000.0)
1237, m_glowIntensity(1.0)
1238, m_diskIntensity(1.0)
1239, m_solarDiskSamples(8)
1240, m_redBlueShift(0.0)
1243 m_groundColor.
setColor(0xc2808080);
1245 m_sunDirection.
set(0.35, 1.0, -0.25);
1250 if (m_status !=
params.m_status)
return false;
1251 if (m_intensityFactor !=
params.m_intensityFactor)
return false;
1252 if (m_haze !=
params.m_haze)
return false;
1253 if (m_horizonHeight !=
params.m_horizonHeight)
return false;
1254 if (m_horizonBlur !=
params.m_horizonBlur)
return false;
1255 if (m_groundColor !=
params.m_groundColor)
return false;
1256 if (m_nightColor !=
params.m_nightColor)
return false;
1257 if (m_aerialPerspective !=
params.m_aerialPerspective)
return false;
1258 if (m_visibilityDistance !=
params.m_visibilityDistance)
return false;
1259 if (m_diskScale !=
params.m_diskScale)
return false;
1260 if (m_glowIntensity !=
params.m_glowIntensity)
return false;
1261 if (m_diskIntensity !=
params.m_diskIntensity)
return false;
1262 if (m_solarDiskSamples !=
params.m_solarDiskSamples)
return false;
1263 if (m_sunDirection !=
params.m_sunDirection)
return false;
1264 if (m_redBlueShift !=
params.m_redBlueShift)
return false;
1265 if (m_saturation !=
params.m_saturation)
return false;
1279 m_intensityFactor = intensity;
1283 return m_intensityFactor;
1295 m_horizonHeight =
height;
1299 return m_horizonHeight;
1303 m_horizonBlur = blur;
1307 return m_horizonBlur;
1311 m_groundColor = color;
1315 return m_groundColor;
1319 m_nightColor = color;
1323 return m_nightColor;
1327 m_aerialPerspective = apply;
1331 return m_aerialPerspective;
1335 m_visibilityDistance = distance;
1339 return m_visibilityDistance;
1343 m_diskScale =
scale;
1351 m_glowIntensity = intensity;
1355 return m_glowIntensity;
1359 m_diskIntensity = intensity;
1363 return m_diskIntensity;
1367 m_solarDiskSamples = samples;
1371 return m_solarDiskSamples;
1375 m_sunDirection = sundir;
1379 return m_sunDirection;
1387 return m_redBlueShift;
1395 return m_saturation;
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
bool operator==(const OdGiLightAttenuation &other) const
void setUseLimits(bool on)
void load(OdGsFiler *pFiler)
bool operator!=(const OdGiLightAttenuation &other) const
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 OdDbStub * viewportObjectId() const =0
virtual bool isOn() const =0
virtual OdUInt32 viewportId() const =0
ODRX_DECLARE_MEMBERS(OdGiLightTraitsVpDep)
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
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)