Record Class Material

java.lang.Object
java.lang.Record
cz.fidentis.analyst.data.mesh.Material
Record Components:
name - Name of the material
ambient - Ambient color
diffuse - Diffuse color
specular - Specular color
shininess - Shininess
alpha - Alpha channel
illumination - Illumination
texturePath - Path to the texture file
All Implemented Interfaces:
Serializable

public record Material(String name, javax.vecmath.Vector3d ambient, javax.vecmath.Vector3d diffuse, javax.vecmath.Vector3d specular, double shininess, double alpha, double illumination, String texturePath) extends Record implements Serializable
Material.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Material(String name, javax.vecmath.Vector3d ambient, javax.vecmath.Vector3d diffuse, javax.vecmath.Vector3d specular, double shininess, double alpha, double illumination, String texturePath)
    Creates an instance of a Material record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the alpha record component.
    javax.vecmath.Vector3d
    Returns the value of the ambient record component.
    javax.vecmath.Vector3d
    Returns the value of the diffuse record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
     
    boolean
     
    double
    Returns the value of the illumination record component.
    Returns the value of the name record component.
    double
    Returns the value of the shininess record component.
    javax.vecmath.Vector3d
    Returns the value of the specular record component.
    Returns the value of the texturePath record component.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Material

      public Material(String name, javax.vecmath.Vector3d ambient, javax.vecmath.Vector3d diffuse, javax.vecmath.Vector3d specular, double shininess, double alpha, double illumination, String texturePath)
      Creates an instance of a Material record class.
      Parameters:
      name - the value for the name record component
      ambient - the value for the ambient record component
      diffuse - the value for the diffuse record component
      specular - the value for the specular record component
      shininess - the value for the shininess record component
      alpha - the value for the alpha record component
      illumination - the value for the illumination record component
      texturePath - the value for the texturePath record component
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hasName

      public boolean hasName(String name)
      Parameters:
      name - compared string
      Returns:
      true if material name is same as provided string.
    • hasTexture

      public boolean hasTexture()
      Returns:
      true if texture file exists
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • ambient

      public javax.vecmath.Vector3d ambient()
      Returns the value of the ambient record component.
      Returns:
      the value of the ambient record component
    • diffuse

      public javax.vecmath.Vector3d diffuse()
      Returns the value of the diffuse record component.
      Returns:
      the value of the diffuse record component
    • specular

      public javax.vecmath.Vector3d specular()
      Returns the value of the specular record component.
      Returns:
      the value of the specular record component
    • shininess

      public double shininess()
      Returns the value of the shininess record component.
      Returns:
      the value of the shininess record component
    • alpha

      public double alpha()
      Returns the value of the alpha record component.
      Returns:
      the value of the alpha record component
    • illumination

      public double illumination()
      Returns the value of the illumination record component.
      Returns:
      the value of the illumination record component
    • texturePath

      public String texturePath()
      Returns the value of the texturePath record component.
      Returns:
      the value of the texturePath record component