24#ifndef __ODGIMATERIAL_H__
25#define __ODGIMATERIAL_H__
72 kUseDiffuse = 0x00001,
74 kUseSpecular = 0x00002,
76 kUseReflection = 0x00004,
78 kUseOpacity = 0x00008,
82 kUseRefraction = 0x00020,
84 kUseNormalMap = 0x00040,
87 kUseEmission = 0x00080,
91 kUseAll = (kUseDiffuse | kUseSpecular | kUseReflection |
92 kUseOpacity | kUseBump | kUseRefraction | kUseNormalMap),
94 kUseAllInternal = (kUseAll | kUseEmission | kUseTint)
123 kSelfIllumination = 0,
151 kGlobalIlluminationCastAndReceive
166 kFinalGatherCastAndReceive
176 kDiffuseRealisticColor = 0,
180 kDiffuseStyleDependent
751 void setMethod(
Method method);
761 void setFactor(
double factor);
794 double factor()
const;
818 return (m_method == other.m_method) &&
819 (m_factor == other.m_factor) &&
820 (m_color == other.m_color);
837 return (m_method != other.m_method) ||
838 (m_factor != other.m_factor) ||
839 (m_color != other.m_color);
919 virtual void setSourceFileName(
const OdString& fileName);
926 virtual const OdString sourceFileName()
const;
1204 virtual void setRadialNoise(
double radialNoise);
1211 virtual double radialNoise(
void)
const;
1218 virtual void setAxialNoise(
double axialNoise);
1225 virtual double axialNoise(
void)
const;
1232 virtual void setGrainThickness(
double grainThickness);
1239 virtual double grainThickness(
void)
const;
1281 double m_radialNoise;
1282 double m_axialNoise;
1283 double m_grainThickness;
1348 virtual void setVeinSpacing(
double veinSpacing);
1356 virtual double veinSpacing(
void)
const;
1363 virtual void setVeinWidth(
double veinWidth);
1371 virtual double veinWidth(
void)
const;
1412 double m_veinSpacing;
1448 virtual void setDefinition(
const OdGiVariant &definition);
1523 kInheritProjection = 0,
1533 kDgnParametric = 0x32,
1537 kDgnCylinder = 0x34,
1539 kDgnCylinderCapped = 0x35,
1567 kInheritAutoTransform = 0x0,
1583 : m_projection(kPlanar)
1586 , m_autoTransform(kNone)
1654 void setProjection(Projection projection);
1673 void setUTiling(Tiling tiling);
1692 void setVTiling(Tiling tiling);
1710 void setAutoTransform(AutoTransform autoTransform);
1738 Projection projection()
const;
1755 Tiling uTiling()
const;
1772 Tiling vTiling()
const;
1788 AutoTransform autoTransform()
const;
1805 Projection m_projection;
1808 AutoTransform m_autoTransform;
1879 void setBlendFactor(
double blendFactor);
1932 double blendFactor()
const;
1971 if ((m_source == other.m_source) &&
1972 (m_blendFactor == other.m_blendFactor) &&
1973 (m_mapper == other.m_mapper))
1975 if (m_texture.isNull() && other.m_texture.
isNull())
1977 if (!m_texture.isNull() && !other.m_texture.
isNull())
1978 return (*m_texture == *(other.m_texture));
1998 return !(*
this == other);
2012 m_source = mmap.m_source;
2013 m_blendFactor = mmap.m_blendFactor;
2014 m_mapper = mmap.m_mapper;
2015 m_texture = mmap.m_texture;
2020 double m_blendFactor;
2029 : m_method(kInherit)
2036 : m_method(kOverride)
2038 , m_color(overrideColor)
2089 , m_blendFactor(1.0)
2114 return m_blendFactor;
2139 : m_projection(mapper.m_projection)
2140 , m_uTiling(mapper.m_uTiling)
2141 , m_vTiling(mapper.m_vTiling)
2142 , m_autoTransform(mapper.m_autoTransform)
2143 , m_transform(mapper.m_transform)
2150 if (&mapper !=
this)
2152 m_projection = mapper.m_projection;
2153 m_uTiling = mapper.m_uTiling;
2154 m_vTiling = mapper.m_vTiling;
2155 m_autoTransform = mapper.m_autoTransform;
2156 m_transform = mapper.m_transform;
2164 return m_projection == mapper.m_projection
2165 && m_uTiling == mapper.m_uTiling
2166 && m_vTiling == mapper.m_vTiling
2167 && m_autoTransform == mapper.m_autoTransform
2168 && m_transform == mapper.m_transform;
2174 return !(*
this == mapper);
2204 return m_projection;
2222 return m_autoTransform;
2248 m_sourceFileName = fileName;
2254 return m_sourceFileName;
2263 return m_sourceFileName == refTexture.m_sourceFileName;
2269 m_sourceFileName =
texture.m_sourceFileName;
2282 throw OdError(eNotApplicable);
2291 m_pRasterImage =
reinterpret_cast<const OdRxObject*
>(pRasterImage);
2306 return m_pRasterImage.
get() == refTexture.m_pRasterImage.
get();
2312 m_pRasterImage =
texture.m_pRasterImage;
2325 throw OdError(eNotApplicable);
2336 if (m_pRasterImage.
isNull())
2337 m_pRasterImage = OdGiRasterImageTexture::createObject();
2346 if (m_pRasterImage.
isNull())
2354 m_pRasterImage = pRasterImage;
2360 return m_pRasterImage;
2390 throw OdError(eNotApplicable);
2400 , m_grainThickness(0.)
2407 m_color1 = woodColor1;
2419 m_color2 = woodColor2;
2437 return m_radialNoise;
2449 return m_axialNoise;
2461 return m_grainThickness;
2470 return (m_color1 == refTexture.m_color1) &&
2471 (m_color2 == refTexture.m_color2) &&
2472 (m_radialNoise == refTexture.m_radialNoise) &&
2473 (m_axialNoise == refTexture.m_axialNoise) &&
2474 (m_grainThickness == refTexture.m_grainThickness);
2482 m_radialNoise =
texture.m_radialNoise;
2483 m_axialNoise =
texture.m_axialNoise;
2484 m_grainThickness =
texture.m_grainThickness;
2501 throw OdError(eNotApplicable);
2523 return m_stoneColor;
2547 return m_veinSpacing;
2568 return (m_stoneColor == refTexture.m_stoneColor) &&
2569 (m_veinColor == refTexture.m_veinColor) &&
2570 (m_veinSpacing == refTexture.m_veinSpacing) &&
2571 (m_veinWidth == refTexture.m_veinWidth);
2577 m_stoneColor =
texture.m_stoneColor;
2578 m_veinColor =
texture.m_veinColor;
2579 m_veinSpacing =
texture.m_veinSpacing;
2580 m_veinWidth =
texture.m_veinWidth;
2596 throw OdError(eNotApplicable);
2610 if (m_definition.
isNull())
2623 return m_definition;
2629 if (m_definition.
isNull())
2645 if (m_definition.
isNull() && refTexture.m_definition.
isNull())
2647 if (!m_definition.
isNull() && !refTexture.m_definition.
isNull())
2648 return (*m_definition == *(refTexture.m_definition));
2655 if (!
texture.m_definition.isNull())
2671 throw OdError(eNotApplicable);
#define ODGI_EXPORT_STATIC
OdSmartPtr< OdGiWoodTexture > OdGiWoodTexturePtr
OdSmartPtr< OdGiImageFileTexture > OdGiImageFileTexturePtr
OdSmartPtr< OdGiRasterImageFileTexture > OdGiRasterImageFileTexturePtr
OdSmartPtr< OdGiRasterImageTexture > OdGiRasterImageTexturePtr
OdSmartPtr< OdGiMaterialTexture > OdGiMaterialTexturePtr
OdSmartPtr< OdGiMaterialTraits > OdGiMaterialTraitsPtr
OdSmartPtr< OdGiImageTexture > OdGiImageTexturePtr
OdSmartPtr< OdGiMarbleTexture > OdGiMarbleTexturePtr
OdSmartPtr< OdGiProceduralTexture > OdGiProceduralTexturePtr
OdSmartPtr< OdGiGenericTexture > OdGiGenericTexturePtr
bool operator!=(T left, const OdGiVariant::EnumType right)
bool operator==(T left, const OdGiVariant::EnumType right)
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 setSpecularHighlightingOverride(double overrideVal)=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
virtual double shadowsOpacityEffect(double &nonShadowLightsMergeEffect) 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 setShadowsOpacityEffect(double effectPercentage, double nonShadowLightsMergeEffect=1.0)=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 double specularHighlightingOverride() const =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)
OdGiRasterImageFileTexture & operator=(const OdGiRasterImageFileTexture &texture)
void copyFrom(const OdRxObject *pSource)
virtual const OdGiRasterImage * rasterImage() const
virtual void setRasterImage(const OdGiRasterImage *pRasterImage)
virtual bool operator==(const OdGiMaterialTexture &texture) const
virtual void setRasterImageTexture(const OdGiRasterImageTexture *pRasterImage)
virtual const OdGiRasterImageTexture * rasterImageTexture() const
ODRX_DECLARE_MEMBERS(OdGiRasterImageFileTexture)
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 void copyFrom(const OdRxObject *pSource)
virtual OdRxClass * isA() const
static OdRxObjectPtr cast(const OdRxObject *pointer)
GLsizei GLsizei GLchar * source
GLenum GLenum GLuint texture
GLsizei const GLfloat * value