mxcad_3d API 文档 / Mx3dGeMaterial
Class: Mx3dGeMaterial 
表示三维图形中的材料属性,封装了材料的各种属性和设置方法。
Hierarchy 
- ↳ - Mx3dGeMaterial
Table of contents 
Constructors 
Methods 
- Alpha
- AmbientColor
- Color
- DiffuseColor
- EmissiveColor
- IncreaseShine
- IsDifferent
- IsEqual
- MaterialName
- MaterialType
- Name
- ReflectionMode
- RefractionIndex
- RequestedName
- Reset
- SetAlpha
- SetAmbientColor
- SetColor
- SetDiffuseColor
- SetEmissiveColor
- SetMaterialName
- SetMaterialType
- SetRefractionIndex
- SetShininess
- SetSpecularColor
- SetTransparency
- Shininess
- SpecularColor
- StringName
- Transparency
Constructors 
constructor 
• new Mx3dGeMaterial()
创建一个默认材料对象。
Overrides 
Mx3dBaseObject.constructor
• new Mx3dGeMaterial(theName)
创建一个具有指定名称的材料对象。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theName | MxNameOfMaterial | 材料名称,参见 MdGe.MxNameOfMaterial。 | 
Overrides 
Mx3dBaseObject.constructor
Methods 
Alpha 
▸ Alpha(): number
返回反透明度系数(0.0为完全透明,1.0为完全不透明)。
Returns 
number
反透明度系数。
AmbientColor 
▸ AmbientColor(): Mx3dGeColor
返回环境光颜色。
Returns 
环境光颜色。
Color 
▸ Color(): Mx3dGeColor
返回材料的颜色。
Returns 
材料的颜色。
DiffuseColor 
▸ DiffuseColor(): Mx3dGeColor
返回漫反射颜色。
Returns 
漫反射颜色。
EmissiveColor 
▸ EmissiveColor(): Mx3dGeColor
返回发光颜色。
Returns 
发光颜色。
IncreaseShine 
▸ IncreaseShine(theDelta): void
增加光泽度。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theDelta | number | 增加的百分比。 | 
Returns 
void
IsDifferent 
▸ IsDifferent(theOther): boolean
检查当前材料是否与另一个材料不同。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theOther | Mx3dGeMaterial | 另一个材料对象。 | 
Returns 
boolean
如果当前材料与另一个材料不同,则返回 true,否则返回 false。
IsEqual 
▸ IsEqual(theOther): boolean
检查当前材料是否与另一个材料相等。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theOther | Mx3dGeMaterial | 另一个材料对象。 | 
Returns 
boolean
如果当前材料与另一个材料相等,则返回 true,否则返回 false。
MaterialName 
▸ MaterialName(): string
返回材料的名称(字符串形式)。
Returns 
string
材料的字符串名称。
MaterialType 
▸ MaterialType(): MxTypeOfMaterial
返回材料类型。
Returns 
材料类型,参见 MdGe.MxTypeOfMaterial。
Name 
▸ Name(): MxNameOfMaterial
返回材料的名称。
Returns 
材料名称。
ReflectionMode 
▸ ReflectionMode(theType): boolean
检查指定类型的反射模式是否启用。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theType | MxTypeOfReflection | 反射类型,参见 MdGe.MxTypeOfReflection。 | 
Returns 
boolean
如果指定类型的反射模式启用,则返回 true,否则返回 false。
RefractionIndex 
▸ RefractionIndex(): number
返回折射率。
Returns 
number
折射率值。
RequestedName 
▸ RequestedName(): MxNameOfMaterial
返回请求的材料名称。
Returns 
请求的材料名称。
Reset 
▸ Reset(): void
重置材料属性为默认值。
Returns 
void
SetAlpha 
▸ SetAlpha(theValue): void
设置反透明度系数。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theValue | number | 反透明度系数(0.0至1.0)。 | 
Returns 
void
SetAmbientColor 
▸ SetAmbientColor(theColor): void
设置环境光颜色。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theColor | Mx3dGeColor | 新的环境光颜色。 | 
Returns 
void
SetColor 
▸ SetColor(theColor): void
设置材料的颜色。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theColor | Mx3dGeColor | 新的颜色。 | 
Returns 
void
SetDiffuseColor 
▸ SetDiffuseColor(theColor): void
设置漫反射颜色。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theColor | Mx3dGeColor | 新的漫反射颜色。 | 
Returns 
void
SetEmissiveColor 
▸ SetEmissiveColor(theColor): void
设置发光颜色。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theColor | Mx3dGeColor | 新的发光颜色。 | 
Returns 
void
SetMaterialName 
▸ SetMaterialName(theName): void
设置材料的名称。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theName | string | 新的材料名称。 | 
Returns 
void
SetMaterialType 
▸ SetMaterialType(theType): void
设置材料类型。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theType | MxTypeOfMaterial | 新的材料类型,参见 MdGe.MxTypeOfMaterial。 | 
Returns 
void
SetRefractionIndex 
▸ SetRefractionIndex(theValue): void
设置折射率。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theValue | number | 新的折射率值,必须大于等于1.0。 | 
Returns 
void
SetShininess 
▸ SetShininess(theValue): void
设置材料的光泽度。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theValue | number | 新的光泽度值(通常在0到1之间)。 | 
Returns 
void
SetSpecularColor 
▸ SetSpecularColor(theColor): void
设置镜面反射颜色。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theColor | Mx3dGeColor | 新的镜面反射颜色。 | 
Returns 
void
SetTransparency 
▸ SetTransparency(theValue): void
设置透明度系数。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theValue | number | 透明度系数(0.0至1.0)。 | 
Returns 
void
Shininess 
▸ Shininess(): number
返回材料的光泽度。
Returns 
number
光泽度值。
SpecularColor 
▸ SpecularColor(): Mx3dGeColor
返回镜面反射颜色。
Returns 
镜面反射颜色。
StringName 
▸ StringName(): string
返回材料的字符串表示形式。
Returns 
string
材料的字符串名称。
Transparency 
▸ Transparency(): number
返回透明度系数(0.0为完全透明,1.0为完全不透明)。
Returns 
number
透明度系数。