Class MeshPointImpl

java.lang.Object
cz.fidentis.analyst.data.mesh.impl.MeshPointImpl
All Implemented Interfaces:
IPosition, MeshPoint, Serializable
Direct Known Subclasses:
RayIntersectionImpl

public class MeshPointImpl extends Object implements MeshPoint
MeshPoint represents a point with position, normal, and texture coordinates.
See Also:
  • Constructor Details

    • MeshPointImpl

      public MeshPointImpl(javax.vecmath.Point3d position, javax.vecmath.Vector3d normal, javax.vecmath.Vector3d texCoord)
      Constructor. Curvature is not set.
      Parameters:
      position - position of MeshPoint
      normal - normal of MeshPoint
      texCoord - coordinates in texture
    • MeshPointImpl

      public MeshPointImpl(javax.vecmath.Point3d position, javax.vecmath.Vector3d normal, javax.vecmath.Vector3d texCoord, Curvature curvature)
      Complete constructor with curvature
      Parameters:
      position - position of MeshPoint
      normal - normal of MeshPoint
      texCoord - coordinates in texture
      curvature - curvature of the mesh point
    • MeshPointImpl

      public MeshPointImpl(MeshPoint meshPoint)
      Copy constructor.
      Parameters:
      meshPoint - copied meshPoint
    • MeshPointImpl

      public MeshPointImpl(Collection<MeshPoint> meshPoints)
      Creates average point.
      Parameters:
      meshPoints - Mesh points
      Throws:
      IllegalArgumentException - if meshPoints is null or empty.
  • Method Details

    • relativeDistance

      public double relativeDistance(javax.vecmath.Point3d point)
      Description copied from interface: MeshPoint
      Method for calculating relative distance to point. Positive if point is in front (same side as normal vector) of MeshPoint. Negative if point is behind (opposite side as normal vector) of MeshPoint.
      Specified by:
      relativeDistance in interface MeshPoint
      Parameters:
      point - Point3d from which to calculate relative distance to MeshPoint.
      Returns:
      Positive or negative distance depending if point is in front of/behind MeshPoint.
    • getNormal

      public javax.vecmath.Vector3d getNormal()
      Description copied from interface: MeshPoint
      Returns normal vector at the point
      Specified by:
      getNormal in interface MeshPoint
      Returns:
      normal vector at the point
    • getPosition

      public javax.vecmath.Point3d getPosition()
      Description copied from interface: IPosition
      get position of the Point3d object
      Specified by:
      getPosition in interface IPosition
      Specified by:
      getPosition in interface MeshPoint
      Returns:
      position of the Point3d object
    • getCurvature

      public Curvature getCurvature()
      Specified by:
      getCurvature in interface MeshPoint
      Returns:
      curvature
    • getTexCoord

      public javax.vecmath.Vector3d getTexCoord()
      Specified by:
      getTexCoord in interface MeshPoint
      Returns:
      texture coordinates
    • setPosition

      public void setPosition(javax.vecmath.Point3d newPos)
      Specified by:
      setPosition in interface MeshPoint
      Parameters:
      newPos - New position, must not be null
    • setNormal

      public void setNormal(javax.vecmath.Vector3d newNormal)
      Description copied from interface: MeshPoint
      Sets the normal vector
      Specified by:
      setNormal in interface MeshPoint
      Parameters:
      newNormal - New normal vector or null
    • setCurvature

      public void setCurvature(Curvature curvature)
      Description copied from interface: MeshPoint
      Sets curvature of the mesh point.
      Specified by:
      setCurvature in interface MeshPoint
      Parameters:
      curvature - Curvature
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object