24 #ifndef __ODGIMATERIAL_H__
25 #define __ODGIMATERIAL_H__
66 kUseDiffuse = 0x00001,
67 kUseSpecular = 0x00002,
68 kUseReflection = 0x00004,
69 kUseOpacity = 0x00008,
71 kUseRefraction = 0x00020,
72 kUseNormalMap = 0x00040,
74 kUseEmission = 0x00080,
77 kUseAll = (kUseDiffuse | kUseSpecular | kUseReflection |
78 kUseOpacity | kUseBump | kUseRefraction | kUseNormalMap),
79 kUseAllInternal = (kUseAll | kUseEmission | kUseTint)
105 kSelfIllumination = 0,
126 kGlobalIlluminationCastAndReceive
137 kFinalGatherCastAndReceive
146 kDiffuseRealisticColor = 0,
148 kDiffuseStyleDependent
635 void setMethod(
Method method);
645 void setFactor(
double factor);
673 double factor()
const;
683 return (m_method == other.m_method) &&
684 (m_factor == other.m_factor) &&
685 (m_color == other.m_color);
689 return (m_method != other.m_method) ||
690 (m_factor != other.m_factor) ||
691 (m_color != other.m_color);
765 virtual void setSourceFileName(
const OdString& fileName);
770 virtual const OdString sourceFileName()
const;
913 virtual void setRadialNoise(
double radialNoise);
918 virtual double radialNoise(
void)
const;
925 virtual void setAxialNoise(
double axialNoise);
930 virtual double axialNoise(
void)
const;
937 virtual void setGrainThickness(
double grainThickness);
942 virtual double grainThickness(
void)
const;
958 double m_radialNoise;
960 double m_grainThickness;
1014 virtual void setVeinSpacing(
double veinSpacing);
1019 virtual double veinSpacing(
void)
const;
1026 virtual void setVeinWidth(
double veinWidth);
1031 virtual double veinWidth(
void)
const;
1047 double m_veinSpacing;
1078 virtual void setDefinition(
const OdGiVariant &definition);
1130 kInheritProjection = 0,
1136 kDgnParametric = 0x32,
1138 kDgnCylinder = 0x34,
1139 kDgnCylinderCapped = 0x35,
1161 kInheritAutoTransform = 0x0,
1173 , m_autoTransform(
kNone)
1218 void setUTiling(Tiling tiling);
1237 void setVTiling(Tiling tiling);
1255 void setAutoTransform(AutoTransform autoTransform);
1297 Tiling uTiling()
const;
1314 Tiling vTiling()
const;
1330 AutoTransform autoTransform()
const;
1348 AutoTransform m_autoTransform;
1400 void setSourceFileName(
const OdString& filename);
1411 void setBlendFactor(
double blendFactor);
1455 double blendFactor()
const;
1476 if ((m_source == other.m_source) &&
1477 (m_fileName == other.m_fileName) &&
1478 (m_blendFactor == other.m_blendFactor) &&
1479 (m_mapper == other.m_mapper))
1481 if (m_texture.isNull() && other.m_texture.
isNull())
1483 if (!m_texture.isNull() && !other.m_texture.
isNull())
1484 return (*m_texture == *(other.m_texture));
1490 return !(*
this == other);
1495 m_source = mmap.m_source;
1496 m_fileName = mmap.m_fileName;
1497 m_blendFactor = mmap.m_blendFactor;
1498 m_mapper = mmap.m_mapper;
1499 m_texture = mmap.m_texture;
1505 double m_blendFactor;
1521 : m_method(kOverride)
1523 , m_color(overrideColor)
1574 , m_blendFactor(1.0)
1587 m_fileName = filename;
1617 return m_blendFactor;
1635 m_texture = pTexture;
1648 : m_projection(mapper.m_projection)
1649 , m_uTiling(mapper.m_uTiling)
1650 , m_vTiling(mapper.m_vTiling)
1651 , m_autoTransform(mapper.m_autoTransform)
1652 , m_transform(mapper.m_transform)
1659 if (&mapper !=
this)
1661 m_projection = mapper.m_projection;
1662 m_uTiling = mapper.m_uTiling;
1663 m_vTiling = mapper.m_vTiling;
1664 m_autoTransform = mapper.m_autoTransform;
1665 m_transform = mapper.m_transform;
1673 return m_projection == mapper.m_projection
1674 && m_uTiling == mapper.m_uTiling
1675 && m_vTiling == mapper.m_vTiling
1676 && m_autoTransform == mapper.m_autoTransform
1677 && m_transform == mapper.m_transform;
1683 return !(*
this == mapper);
1713 return m_projection;
1731 return m_autoTransform;
1757 m_sourceFileName = fileName;
1763 return m_sourceFileName;
1772 return m_sourceFileName == refTexture.m_sourceFileName;
1778 m_sourceFileName =
texture.m_sourceFileName;
1791 throw OdError(eNotApplicable);
1800 m_pRasterImage =
reinterpret_cast<const OdRxObject*
>(pRasterImage);
1815 return m_pRasterImage.
get() == refTexture.m_pRasterImage.
get();
1821 m_pRasterImage =
texture.m_pRasterImage;
1834 throw OdError(eNotApplicable);
1844 , m_grainThickness(0.)
1851 m_color1 = woodColor1;
1863 m_color2 = woodColor2;
1881 return m_radialNoise;
1893 return m_axialNoise;
1905 return m_grainThickness;
1914 return (m_color1 == refTexture.m_color1) &&
1915 (m_color2 == refTexture.m_color2) &&
1916 (m_radialNoise == refTexture.m_radialNoise) &&
1917 (m_axialNoise == refTexture.m_axialNoise) &&
1918 (m_grainThickness == refTexture.m_grainThickness);
1926 m_radialNoise =
texture.m_radialNoise;
1927 m_axialNoise =
texture.m_axialNoise;
1928 m_grainThickness =
texture.m_grainThickness;
1945 throw OdError(eNotApplicable);
1967 return m_stoneColor;
1991 return m_veinSpacing;
2012 return (m_stoneColor == refTexture.m_stoneColor) &&
2013 (m_veinColor == refTexture.m_veinColor) &&
2014 (m_veinSpacing == refTexture.m_veinSpacing) &&
2015 (m_veinWidth == refTexture.m_veinWidth);
2021 m_stoneColor =
texture.m_stoneColor;
2022 m_veinColor =
texture.m_veinColor;
2023 m_veinSpacing =
texture.m_veinSpacing;
2024 m_veinWidth =
texture.m_veinWidth;
2040 throw OdError(eNotApplicable);
2054 if (m_definition.
isNull())
2067 return m_definition;
2073 if (m_definition.
isNull())
2089 if (m_definition.
isNull() && refTexture.m_definition.
isNull())
2091 if (!m_definition.
isNull() && !refTexture.m_definition.
isNull())
2092 return (*m_definition == *(refTexture.m_definition));
2099 if (!
texture.m_definition.isNull())
2115 throw OdError(eNotApplicable);
#define ODGI_EXPORT_STATIC
OdSmartPtr< OdGiWoodTexture > OdGiWoodTexturePtr
OdSmartPtr< OdGiImageFileTexture > OdGiImageFileTexturePtr
OdSmartPtr< OdGiRasterImageTexture > OdGiRasterImageTexturePtr
OdSmartPtr< OdGiMaterialTexture > OdGiMaterialTexturePtr
OdSmartPtr< OdGiMaterialTraits > OdGiMaterialTraitsPtr
OdSmartPtr< OdGiImageTexture > OdGiImageTexturePtr
OdSmartPtr< OdGiMarbleTexture > OdGiMarbleTexturePtr
OdSmartPtr< OdGiProceduralTexture > OdGiProceduralTexturePtr
OdSmartPtr< OdGiGenericTexture > OdGiGenericTexturePtr
virtual OdGiVariantPtr definition() const
ODRX_DECLARE_MEMBERS(OdGiGenericTexture)
void copyFrom(const OdRxObject *pSource)
virtual void setDefinition(const OdGiVariant &definition)
virtual Type type() const
virtual bool operator==(const OdGiMaterialTexture &texture) const
OdGiGenericTexture & operator=(const OdGiGenericTexture &texture)
virtual bool operator==(const OdGiMaterialTexture &texture) const
virtual void setSourceFileName(const OdString &fileName)
ODRX_DECLARE_MEMBERS(OdGiImageFileTexture)
void copyFrom(const OdRxObject *pSource)
OdGiImageFileTexture & operator=(const OdGiImageFileTexture &texture)
virtual const OdString sourceFileName() const
ODRX_DECLARE_MEMBERS(OdGiImageTexture)
void setProjection(Projection projection)
OdGiMapper & operator=(const OdGiMapper &mapper)
static ODGI_EXPORT_STATIC const OdGiMapper kIdentity
AutoTransform autoTransform() const
Projection projection() const
void setVTiling(Tiling tiling)
bool operator!=(const OdGiMapper &mapper) const
void setAutoTransform(AutoTransform autoTransform)
OdGeMatrix3d & transform()
void setTransform(const OdGeMatrix3d &tm)
void setUTiling(Tiling tiling)
bool operator==(const OdGiMapper &mapper) const
OdGiMarbleTexture & operator=(const OdGiMarbleTexture &texture)
virtual void setStoneColor(const OdGiMaterialColor &stoneColor)
virtual bool operator==(const OdGiMaterialTexture &texture) const
virtual double veinWidth(void) const
virtual double veinSpacing(void) const
void copyFrom(const OdRxObject *pSource)
virtual const OdGiMaterialColor & veinColor(void) const
virtual Type type() const
virtual const OdGiMaterialColor & stoneColor(void) const
virtual void setVeinSpacing(double veinSpacing)
ODRX_DECLARE_MEMBERS(OdGiMarbleTexture)
virtual void setVeinColor(const OdGiMaterialColor &veinColor)
virtual void setVeinWidth(double veinWidth)
void setFactor(double factor)
OdCmEntityColor & color()
static ODGI_EXPORT_STATIC const OdGiMaterialColor kNull
void setColor(const OdCmEntityColor &color)
void setMethod(Method method)
void setMapper(const OdGiMapper &mapper)
void setSourceFileName(const OdString &filename)
void setTexture(OdGiMaterialTexturePtr pTexture)
const OdGiMaterialTexturePtr texture(void) const
OdString sourceFileName() const
static ODGI_EXPORT_STATIC const OdGiMaterialMap kNull
void setSource(Source source)
double blendFactor() const
void setBlendFactor(double blendFactor)
virtual bool operator==(const OdGiMaterialTexture &texture) const
ODRX_DECLARE_MEMBERS(OdGiMaterialTexture)
virtual double luminance() const =0
virtual void setChannelFlags(ChannelFlags flags)=0
virtual void reflection(OdGiMaterialMap &reflectionMap) const =0
virtual void setShadingDiffuse(const OdGiMaterialColor &diffuseColor)=0
virtual double reflectanceScale() const =0
virtual ChannelFlags channelFlags() const =0
virtual void opacity(double &opacityPercentage, OdGiMaterialMap &opacityMap) const =0
virtual void bump(OdGiMaterialMap &bumpMap) const =0
virtual void diffuse(OdGiMaterialColor &diffuseColor, OdGiMaterialMap &diffuseMap) const =0
virtual void setTranslucence(double value)=0
virtual double transmittanceScale() const =0
virtual void setLuminance(double value)=0
virtual void setReflection(const OdGiMaterialMap &reflectionMap)=0
virtual double colorBleedScale() const =0
virtual void setFinalGather(FinalGatherMode mode)=0
virtual void setIndirectBumpScale(double scale)=0
virtual void setBump(const OdGiMaterialMap &bumpMap)=0
virtual void setColorBleedScale(double scale)=0
virtual void setIlluminationModel(IlluminationModel model)=0
virtual void shadingAmbient(OdGiMaterialColor &ambientColor) const =0
ODRX_DECLARE_MEMBERS(OdGiMaterialTraits)
virtual FinalGatherMode finalGather() const =0
virtual void setNormalMap(const OdGiMaterialMap &normalMap, NormalMapMethod method, double strength)=0
virtual double indirectBumpScale() const =0
virtual void setDiffuseColorMode(DiffuseColorMode diffuseColorMode)=0
virtual void setReflectivity(double value)=0
virtual LuminanceMode luminanceMode() const =0
virtual bool twoSided() const =0
virtual void setRefraction(double refractionIndex, const OdGiMaterialMap &refractionMap)=0
virtual void shadingOpacity(double &opacityPercentage) const =0
virtual void tint(OdGiMaterialColor &tintColor) const =0
virtual void setMode(Mode value)=0
virtual void setShadingOpacity(double opacityPercentage)=0
virtual void setTwoSided(bool flag)=0
virtual GlobalIlluminationMode globalIllumination() const =0
virtual void shadingSpecular(OdGiMaterialColor &specularColor) const =0
virtual void setShadingSpecular(const OdGiMaterialColor &specularColor)=0
virtual void ambient(OdGiMaterialColor &ambientColor) const =0
virtual DiffuseColorMode diffuseColorMode() const =0
virtual void setTint(const OdGiMaterialColor &tintColor)=0
virtual void setOpacity(double opacityPercentage, const OdGiMaterialMap &opacityMap)=0
virtual void setLuminanceMode(LuminanceMode mode)=0
@ kGlobalIlluminationCast
@ kGlobalIlluminationNone
@ kGlobalIlluminationReceive
virtual void emission(OdGiMaterialColor &emissionColor, OdGiMaterialMap &emissionMap) const =0
virtual void setSelfIllumination(double value)=0
virtual void refraction(double &refractionIndex, OdGiMaterialMap &refractionMap) const =0
virtual double selfIllumination() const =0
virtual void setEmission(const OdGiMaterialColor &emissionColor, const OdGiMaterialMap &emissionMap)=0
virtual void setTransmittanceScale(double scale)=0
virtual void setSpecular(const OdGiMaterialColor &specularColor, const OdGiMaterialMap &specularMap, double glossFactor)=0
virtual void setAmbient(const OdGiMaterialColor &ambientColor)=0
virtual void setDiffuse(const OdGiMaterialColor &diffuseColor, const OdGiMaterialMap &diffuseMap)=0
virtual void setShadingAmbient(const OdGiMaterialColor &ambientColor)=0
virtual void setGlobalIllumination(GlobalIlluminationMode mode)=0
virtual Mode mode() const =0
virtual void normalMap(OdGiMaterialMap &normalMap, NormalMapMethod &method, double &strength) const =0
virtual double reflectivity() const =0
virtual IlluminationModel illuminationModel() const =0
virtual void shadingDiffuse(OdGiMaterialColor &diffuseColor) const =0
virtual void specular(OdGiMaterialColor &specularColor, OdGiMaterialMap &specularMap, double &glossFactor) const =0
virtual void setReflectanceScale(double scale)=0
virtual double translucence() const =0
virtual Type type() const =0
ODRX_DECLARE_MEMBERS(OdGiProceduralTexture)
virtual const OdGiRasterImage * rasterImage() const
OdGiRasterImageTexture & operator=(const OdGiRasterImageTexture &texture)
ODRX_DECLARE_MEMBERS(OdGiRasterImageTexture)
virtual bool operator==(const OdGiMaterialTexture &texture) const
void copyFrom(const OdRxObject *pSource)
virtual void setRasterImage(const OdGiRasterImage *pRasterImage)
static OdSmartPtr< OdGiVariant > createObject(const OdGiVariant &value)
virtual void setGrainThickness(double grainThickness)
virtual void setRadialNoise(double radialNoise)
virtual const OdGiMaterialColor & color2(void) const
virtual const OdGiMaterialColor & color1(void) const
OdGiWoodTexture & operator=(const OdGiWoodTexture &texture)
virtual double grainThickness(void) const
void copyFrom(const OdRxObject *pSource)
virtual void setColor2(const OdGiMaterialColor &woodColor2)
virtual Type type() const
virtual void setAxialNoise(double axialNoise)
ODRX_DECLARE_MEMBERS(OdGiWoodTexture)
virtual double axialNoise(void) const
virtual double radialNoise(void) const
virtual bool operator==(const OdGiMaterialTexture &texture) const
virtual void setColor1(const OdGiMaterialColor &woodColor1)
virtual OdRxClass * isA() const
virtual void copyFrom(const OdRxObject *pSource)
static OdRxObjectPtr cast(const OdRxObject *pointer)
GLsizei GLsizei GLchar * source
GLenum GLenum GLuint texture
GLsizei const GLfloat * value
bool DAI_EXPORT operator!=(const OdDAI::OdSelect &left, const OdDAI::OdSelect &right)
bool DAI_EXPORT operator==(const OdFileDescriptionAuto &left, const OdFileDescriptionAuto &right)
@ kNone
Light mode is inherited from the annotation.