< Summary

Information
Class: JeremyAnsel.Media.WavefrontObj.ObjMaterial
Assembly: JeremyAnsel.Media.WavefrontObj
File(s): C:\projects\jeremyansel-media-wavefrontobj\JeremyAnsel.Media.WavefrontObj\JeremyAnsel.Media.WavefrontObj\ObjMaterial.cs
Line coverage
100%
Covered lines: 44
Uncovered lines: 0
Coverable lines: 44
Total lines: 129
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
.ctor(...)100%11100%
get_Name()100%11100%
set_Name(...)100%11100%
get_AmbientColor()100%11100%
set_AmbientColor(...)100%11100%
get_DiffuseColor()100%11100%
set_DiffuseColor(...)100%11100%
get_EmissiveColor()100%11100%
set_EmissiveColor(...)100%11100%
get_SpecularColor()100%11100%
set_SpecularColor(...)100%11100%
get_TransmissionColor()100%11100%
set_TransmissionColor(...)100%11100%
get_IlluminationModel()100%11100%
set_IlluminationModel(...)100%11100%
get_DissolveFactor()100%11100%
set_DissolveFactor(...)100%11100%
get_IsHaloDissolve()100%11100%
set_IsHaloDissolve(...)100%11100%
get_SpecularExponent()100%11100%
set_SpecularExponent(...)100%11100%
get_Sharpness()100%11100%
set_Sharpness(...)100%11100%
get_OpticalDensity()100%11100%
set_OpticalDensity(...)100%11100%
get_IsAntiAliasingEnabled()100%11100%
set_IsAntiAliasingEnabled(...)100%11100%
get_AmbientMap()100%11100%
set_AmbientMap(...)100%11100%
get_DiffuseMap()100%11100%
set_DiffuseMap(...)100%11100%
get_EmissiveMap()100%11100%
set_EmissiveMap(...)100%11100%
get_SpecularMap()100%11100%
set_SpecularMap(...)100%11100%
get_SpecularExponentMap()100%11100%
set_SpecularExponentMap(...)100%11100%
get_DissolveMap()100%11100%
set_DissolveMap(...)100%11100%
get_DecalMap()100%11100%
set_DecalMap(...)100%11100%
get_DispMap()100%11100%
set_DispMap(...)100%11100%
get_BumpMap()100%11100%
set_BumpMap(...)100%11100%
get_ReflectionMap()100%11100%
set_ReflectionMap(...)100%11100%
get_Roughness()100%11100%
set_Roughness(...)100%11100%
get_RoughnessMap()100%11100%
set_RoughnessMap(...)100%11100%
get_Metallic()100%11100%
set_Metallic(...)100%11100%
get_MetallicMap()100%11100%
set_MetallicMap(...)100%11100%
get_Sheen()100%11100%
set_Sheen(...)100%11100%
get_SheenMap()100%11100%
set_SheenMap(...)100%11100%
get_ClearCoatThickness()100%11100%
set_ClearCoatThickness(...)100%11100%
get_ClearCoatRoughness()100%11100%
set_ClearCoatRoughness(...)100%11100%
get_Anisotropy()100%11100%
set_Anisotropy(...)100%11100%
get_AnisotropyRotation()100%11100%
set_AnisotropyRotation(...)100%11100%
get_Norm()100%11100%
set_Norm(...)100%11100%

File(s)

C:\projects\jeremyansel-media-wavefrontobj\JeremyAnsel.Media.WavefrontObj\JeremyAnsel.Media.WavefrontObj\ObjMaterial.cs

#LineLine coverage
 1// <copyright file="ObjMaterial.cs" company="Jérémy Ansel">
 2// Copyright (c) 2017, 2019 Jérémy Ansel
 3// </copyright>
 4// <license>
 5// Licensed under the MIT license. See LICENSE.txt
 6// </license>
 7
 8namespace JeremyAnsel.Media.WavefrontObj;
 9
 10[System.Diagnostics.DebuggerDisplay("Material:{Name}")]
 11public class ObjMaterial
 12{
 413    public ObjMaterial()
 14    {
 415        this.ReflectionMap = new ObjMaterialReflectionMap();
 16
 417        this.IlluminationModel = 2;
 418        this.DissolveFactor = 1.0f;
 419        this.Sharpness = 60;
 420        this.OpticalDensity = 1.0f;
 421    }
 22
 23    public ObjMaterial(string? name)
 424        : this()
 25    {
 426        this.Name = name;
 427    }
 28
 429    public string? Name { get; set; }
 30
 431    public ObjMaterialColor? AmbientColor { get; set; }
 32
 433    public ObjMaterialColor? DiffuseColor { get; set; }
 34
 435    public ObjMaterialColor? EmissiveColor { get; set; }
 36
 437    public ObjMaterialColor? SpecularColor { get; set; }
 38
 439    public ObjMaterialColor? TransmissionColor { get; set; }
 40
 441    public int IlluminationModel { get; set; }
 42
 443    public float DissolveFactor { get; set; }
 44
 445    public bool IsHaloDissolve { get; set; }
 46
 447    public float SpecularExponent { get; set; }
 48
 449    public int Sharpness { get; set; }
 50
 451    public float OpticalDensity { get; set; }
 52
 453    public bool IsAntiAliasingEnabled { get; set; }
 54
 455    public ObjMaterialMap? AmbientMap { get; set; }
 56
 457    public ObjMaterialMap? DiffuseMap { get; set; }
 58
 459    public ObjMaterialMap? EmissiveMap { get; set; }
 60
 461    public ObjMaterialMap? SpecularMap { get; set; }
 62
 463    public ObjMaterialMap? SpecularExponentMap { get; set; }
 64
 465    public ObjMaterialMap? DissolveMap { get; set; }
 66
 467    public ObjMaterialMap? DecalMap { get; set; }
 68
 469    public ObjMaterialMap? DispMap { get; set; }
 70
 471    public ObjMaterialMap? BumpMap { get; set; }
 72
 473    public ObjMaterialReflectionMap ReflectionMap { get; private set; }
 74
 75    /// <summary>
 76    ///     PBR Extension: Pr
 77    /// </summary>
 478    public float Roughness { get; set; }
 79
 80    /// <summary>
 81    ///     PBR Extension: map_Pr
 82    /// </summary>
 483    public ObjMaterialMap? RoughnessMap { get; set; }
 84
 85    /// <summary>
 86    ///     PBR Extension: Pm
 87    /// </summary>
 488    public float Metallic { get; set; }
 89
 90    /// <summary>
 91    ///     PBR Extension: map_Pm
 92    /// </summary>
 493    public ObjMaterialMap? MetallicMap { get; set; }
 94
 95    /// <summary>
 96    ///     PBR Extension: Ps
 97    /// </summary>
 498    public float Sheen { get; set; }
 99
 100    /// <summary>
 101    ///     PBR Extension: map_Ps
 102    /// </summary>
 4103    public ObjMaterialMap? SheenMap { get; set; }
 104
 105    /// <summary>
 106    ///     PBR Extension: Pc
 107    /// </summary>
 4108    public float ClearCoatThickness { get; set; }
 109
 110    /// <summary>
 111    ///     PBR Extension: Pcr
 112    /// </summary>
 4113    public float ClearCoatRoughness { get; set; }
 114
 115    /// <summary>
 116    ///     PBR Extension: aniso
 117    /// </summary>
 4118    public float Anisotropy { get; set; }
 119
 120    /// <summary>
 121    ///     PBR Extension: anisor
 122    /// </summary>
 4123    public float AnisotropyRotation { get; set; }
 124
 125    /// <summary>
 126    ///     PBR Extension: norm
 127    /// </summary>
 4128    public ObjMaterialMap? Norm { get; set; }
 129}

Methods/Properties

.ctor()
.ctor(string)
get_Name()
set_Name(string)
get_AmbientColor()
set_AmbientColor(JeremyAnsel.Media.WavefrontObj.ObjMaterialColor)
get_DiffuseColor()
set_DiffuseColor(JeremyAnsel.Media.WavefrontObj.ObjMaterialColor)
get_EmissiveColor()
set_EmissiveColor(JeremyAnsel.Media.WavefrontObj.ObjMaterialColor)
get_SpecularColor()
set_SpecularColor(JeremyAnsel.Media.WavefrontObj.ObjMaterialColor)
get_TransmissionColor()
set_TransmissionColor(JeremyAnsel.Media.WavefrontObj.ObjMaterialColor)
get_IlluminationModel()
set_IlluminationModel(int)
get_DissolveFactor()
set_DissolveFactor(float)
get_IsHaloDissolve()
set_IsHaloDissolve(bool)
get_SpecularExponent()
set_SpecularExponent(float)
get_Sharpness()
set_Sharpness(int)
get_OpticalDensity()
set_OpticalDensity(float)
get_IsAntiAliasingEnabled()
set_IsAntiAliasingEnabled(bool)
get_AmbientMap()
set_AmbientMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_DiffuseMap()
set_DiffuseMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_EmissiveMap()
set_EmissiveMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_SpecularMap()
set_SpecularMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_SpecularExponentMap()
set_SpecularExponentMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_DissolveMap()
set_DissolveMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_DecalMap()
set_DecalMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_DispMap()
set_DispMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_BumpMap()
set_BumpMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_ReflectionMap()
set_ReflectionMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialReflectionMap)
get_Roughness()
set_Roughness(float)
get_RoughnessMap()
set_RoughnessMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_Metallic()
set_Metallic(float)
get_MetallicMap()
set_MetallicMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_Sheen()
set_Sheen(float)
get_SheenMap()
set_SheenMap(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)
get_ClearCoatThickness()
set_ClearCoatThickness(float)
get_ClearCoatRoughness()
set_ClearCoatRoughness(float)
get_Anisotropy()
set_Anisotropy(float)
get_AnisotropyRotation()
set_AnisotropyRotation(float)
get_Norm()
set_Norm(JeremyAnsel.Media.WavefrontObj.ObjMaterialMap)