Class LinCompf

  • All Implemented Interfaces:
    java.io.Serializable

    public abstract class LinCompf
    extends java.lang.Object
    implements java.io.Serializable
    The linear component is represented as P+t*D where P is the component origin and D is a unit-length direction vector. The user must ensure that the direction vector satisfies this condition. The t-intervals for lines, rays, segments, points, or the empty set are described later.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  LinCompf.ComponentType
      component type
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected LinCompf()
      Constructs an new LinComf object: default is CT_NONE
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean Contains​(float fParam)
      Determine if the specified parameter is in the interval.
      float GetMax()
      access the interval [min,max]
      float GetMin()
      access the interval [min,max]
      LinCompf.ComponentType GetType()
      Gets the type of linear component
      static LinCompf.ComponentType GetTypeFromInterval​(float fMin, float fMax)
      Determine the type of an interval without having to create an instance of a LinComp object.
      boolean IsCanonical()
      The canonical intervals are [-MAX_REAL,MAX_REAL] for a line; [0,MAX_REAL] for a ray; [-e,e] for a segment, where e > 0; [0,0] for a point, and [MAX_REAL,-MAX_REAL] for the empty set.
      abstract void MakeCanonical()
      The canonical intervals are [-MAX_REAL,MAX_REAL] for a line; [0,MAX_REAL] for a ray; [-e,e] for a segment, where e > 0; [0,0] for a point, and [MAX_REAL,-MAX_REAL] for the empty set.
      void SetInterval​(float fMin, float fMax)
      The interval of restriction for t, as defined above.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_fMin

        protected float m_fMin
        the interval of restriction for t
      • m_fMax

        protected float m_fMax
        the interval of restriction for t
    • Constructor Detail

      • LinCompf

        protected LinCompf()
        Constructs an new LinComf object: default is CT_NONE
    • Method Detail

      • GetTypeFromInterval

        public static LinCompf.ComponentType GetTypeFromInterval​(float fMin,
                                                                 float fMax)
        Determine the type of an interval without having to create an instance of a LinComp object.
        Parameters:
        fMin - min
        fMax - max
      • Contains

        public boolean Contains​(float fParam)
        Determine if the specified parameter is in the interval.
        Parameters:
        fParam - value to test
        Returns:
        true if in the interval
      • GetMax

        public final float GetMax()
        access the interval [min,max]
        Returns:
        interval max-value
      • GetMin

        public final float GetMin()
        access the interval [min,max]
        Returns:
        interval min-value
      • GetType

        public final LinCompf.ComponentType GetType()
        Gets the type of linear component
        Returns:
        component type.
      • IsCanonical

        public boolean IsCanonical()
        The canonical intervals are [-MAX_REAL,MAX_REAL] for a line; [0,MAX_REAL] for a ray; [-e,e] for a segment, where e > 0; [0,0] for a point, and [MAX_REAL,-MAX_REAL] for the empty set. If the interval is [min,max], the adjustments are as follows. CT_RAY: If max is MAX_REAL and if min is not zero, then P is modified to P' = P+min*D so that the ray is represented by P'+t*D for t >= 0. If min is -MAX_REAL and max is finite, then the origin and direction are modified to P' = P+max*D and D' = -D. CT_SEGMENT: If min is not -max, then P is modified to P' = P + ((min+max)/2)*D and the extent is e' = (max-min)/2. CT_POINT: If min is not zero, the P is modified to P' = P+min*D. CT_EMPTY: Set max to -MAX_REAL and min to MAX_REAL. The first function is virtual since the updates are dependent on the dimension of the vector space.
        Returns:
        true if this is a canonical interval
      • MakeCanonical

        public abstract void MakeCanonical()
        The canonical intervals are [-MAX_REAL,MAX_REAL] for a line; [0,MAX_REAL] for a ray; [-e,e] for a segment, where e > 0; [0,0] for a point, and [MAX_REAL,-MAX_REAL] for the empty set. If the interval is [min,max], the adjustments are as follows. CT_RAY: If max is MAX_REAL and if min is not zero, then P is modified to P' = P+min*D so that the ray is represented by P'+t*D for t >= 0. If min is -MAX_REAL and max is finite, then the origin and direction are modified to P' = P+max*D and D' = -D. CT_SEGMENT: If min is not -max, then P is modified to P' = P + ((min+max)/2)*D and the extent is e' = (max-min)/2. CT_POINT: If min is not zero, the P is modified to P' = P+min*D. CT_EMPTY: Set max to -MAX_REAL and min to MAX_REAL. The first function is virtual since the updates are dependent on the dimension of the vector space.
      • SetInterval

        public void SetInterval​(float fMin,
                                float fMax)
        The interval of restriction for t, as defined above. The function SetInterval(min,max) sets the t-interval; it handles all possible inputs according to the following scheme: CT_LINE: [-MAX_REAL,MAX_REAL] CT_RAY: [min,MAX_REAL], where min is finite [-MAX_REAL,max], where max is finite CT_SEGMENT: [min,max], where min and max are finite with min max or min = max = MAX_REAL or min = max = -MAX_REAL
        Parameters:
        fMin - min
        fMax - max