Package org.bzdev.p3d

Class Model3D.ImageParams

java.lang.Object
org.bzdev.p3d.Model3D.ImageParams
Enclosing class:
Model3D

public static class Model3D.ImageParams extends Object
Image Parameters Instances of Image.ImageParams are created by the methods setImageParameters(m3d), setImageParameters(m3d, border), setImageParameters(m3d, border magnification), and * setImageParameters. The methods getHeight and getWidth return the height and width of the image passed as the first argument to setImageParameters. The methods getXOrigin, getYOrigin, getScaleFactor, getPhi, getTheta, getPsi, getXTranslation, and getYTranslation return the parameters used to configure the image. The methods getMinXTranslation, getMinYTranslation, getMaxXTranslation, and getMaxYTranslation return the minimum and maximum values that getXTranslation and getYTranslation can return, with minimum values occurring when getViewFractionX or getViewFractionY return values of 0.0 and with the maximum occurring when getViewFractionX or getViewFractionY return values of 1.0. The methods getBorder, getMagnification getScrollFractionX, and getScrollFractionY return the explicit and default arguments in the call to setImageParameters. The methods getLowerBoundX, getLowerBoundY, getUpperBoundX, and getUpperBoundY return the lower and upper X and Y values for a bounding box containing the 3D model after rotation and translation. The methods getViewFractionX and getViewFractionY give the fraction of the 3D model's bounding box (after rotation and translation) that will appear in the image window. Finally the methods getShowsAllX and getShowsAllY indicate if all the model in each direction is viewable in the image at one time.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Get the size of the desired border for the 3D model used to create this parameter set.
    double
    Get the color factor.
    double
    Get the minimum triangle size for rendering.
    float
    Get the height of the image associated with these parameters.
    float
    Get the width of the image associated with these parameters.
    double
    Get the light-source parameter phi.
    double
    Get the light-source parameter theta.
    double
    Get the smallest value along the X access for the 3D model used to create this parameter set.
    double
    Get the smallest value along the Y access for the 3D model used to create this parameter set.
    double
    Get the magnification for the 3D model used to create this parameter set.
    double
    Get the maximum possible value that getXTranslation can return.
    double
    Get the maximum possible value that getYTranslation can return.
    double
    Get the minimum possible value that getXTranslation can return.
    double
    Get the minimum possible value that getYTranslation can return.
    double
    Get the normal factor.
    double
    Get the Eulerian angle φ for a coordinate rotation.
    double
    Get the Eulerian angle ψ for a coordinate rotation.
    double
    Get the X coordinate of the origin about which the coordinate rotation will be performed.
    double
    Get the Y coordinate of the origin about which the coordinate rotation will be performed.
    double
    Get the Z coordinate of the origin about which the coordinate rotation will be performed.
    double
    Get the scale factor for the image associated with these parameters.
    double
    Get the horizontal fraction by which a 3D model was scrolled after being scaled and magnified.
    double
    Get the vertical fraction by which a 3D model was scrolled after being scaled and magnified.
    boolean
    Determine if the image used to create this parameter set contains the 3D model in the X direction after rotation.
    boolean
    Determine if the image used to create this parameter set contains the 3D model in the Y direction after rotation.
    double
    Get the Eulerian angle θ for a coordinate rotation.
    double
    Get the largest value along the X access for the 3D model used to create this parameter set.
    double
    Get the largest value along the Y access for the 3D model used to create this parameter set.
    double
    Get the horizontal fraction of a 3D model's bounding box after rotation for the viewable portion of its image.
    double
    Get the vertical fraction of a 3D model's bounding box after rotation for the viewable portion of its image.
    float
    Get the x origin for the image.
    double
    Get the x-axis coordinate translation to apply after a rotation.
    float
    Get the y origin for the image.
    double
    Get the y-axis coordinate translation to apply after a rotation.
    boolean
    Determine if the transformed origin for (0,0,0) will be moved to the coordinate origin after the rotation is completed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ImageParams

      public ImageParams()
  • Method Details

    • getFloatHeight

      public float getFloatHeight()
      Get the height of the image associated with these parameters.
      Returns:
      the image height
    • getFloatWidth

      public float getFloatWidth()
      Get the width of the image associated with these parameters.
      Returns:
      the image width
    • getXOrigin

      public float getXOrigin()
      Get the x origin for the image.
      Returns:
      the x origin in pixels.
    • getYOrigin

      public float getYOrigin()
      Get the y origin for the image.
      Returns:
      the y origin in pixels.
    • getScaleFactor

      public double getScaleFactor()
      Get the scale factor for the image associated with these parameters.
      Returns:
      the scale factor
    • getPhi

      public double getPhi()
      Get the Eulerian angle φ for a coordinate rotation.
      Returns:
      the angle in radians
    • getTheta

      public double getTheta()
      Get the Eulerian angle θ for a coordinate rotation.
      Returns:
      the angle in radians
    • getPsi

      public double getPsi()
      Get the Eulerian angle ψ for a coordinate rotation.
      Returns:
      the angle in radians
    • getXTranslation

      public double getXTranslation()
      Get the x-axis coordinate translation to apply after a rotation.
      Returns:
      the coordinate translation
    • getYTranslation

      public double getYTranslation()
      Get the y-axis coordinate translation to apply after a rotation.
      Returns:
      the coordinate translation
    • getMinXTranslation

      public double getMinXTranslation()
      Get the minimum possible value that getXTranslation can return. This corresponds to a X scroll fraction of 0.0.
      Returns:
      the minimum X translation in Model units
    • getMinYTranslation

      public double getMinYTranslation()
      Get the minimum possible value that getYTranslation can return. This corresponds to a Y scroll fraction of 0.0.
      Returns:
      the minimum Y translation in Model units
    • getMaxXTranslation

      public double getMaxXTranslation()
      Get the maximum possible value that getXTranslation can return. This corresponds to a X scroll fraction of 1.0.
      Returns:
      the maximum X translation in Model units
    • getMaxYTranslation

      public double getMaxYTranslation()
      Get the maximum possible value that getYTranslation can return. This corresponds to a Y scroll fraction of 1.0.
      Returns:
      the maximum Y translation in Model units
    • getBorder

      public double getBorder()
      Get the size of the desired border for the 3D model used to create this parameter set.
      Returns:
      the border length in AWT user-space units
    • getMagnification

      public double getMagnification()
      Get the magnification for the 3D model used to create this parameter set.
      Returns:
      the magnification
    • getLowerBoundX

      public double getLowerBoundX()
      Get the smallest value along the X access for the 3D model used to create this parameter set.
      Returns:
      the smallest S coordinate in AWT user-space units
    • getLowerBoundY

      public double getLowerBoundY()
      Get the smallest value along the Y access for the 3D model used to create this parameter set.
      Returns:
      the smallest Y coordinate in AWT user-space units
    • getUpperBoundX

      public double getUpperBoundX()
      Get the largest value along the X access for the 3D model used to create this parameter set.
      Returns:
      the largest x coordinate in AWT user-space units
    • getUpperBoundY

      public double getUpperBoundY()
      Get the largest value along the Y access for the 3D model used to create this parameter set.
      Returns:
      the largest y coordinate in AWT user-space units
    • getScrollFractionX

      public double getScrollFractionX()
      Get the horizontal fraction by which a 3D model was scrolled after being scaled and magnified.
      Returns:
      the fraction
    • getScrollFractionY

      public double getScrollFractionY()
      Get the vertical fraction by which a 3D model was scrolled after being scaled and magnified.
      Returns:
      the fraction
    • getViewFractionX

      public double getViewFractionX()
      Get the horizontal fraction of a 3D model's bounding box after rotation for the viewable portion of its image. This value ignores any portion of an image displayed in the border area. If the image is smaller horizontally than the image (excluding its borders) the value 1.0 is returned.
      Returns:
      the fraction
    • getViewFractionY

      public double getViewFractionY()
      Get the vertical fraction of a 3D model's bounding box after rotation for the viewable portion of its image. This value ignores any portion of an image displayed in the border area. If the image is smaller vertically than the image (excluding its borders) the value 1.0 is returned.
      Returns:
      the fraction
    • getShowsAllX

      public boolean getShowsAllX()
      Determine if the image used to create this parameter set contains the 3D model in the X direction after rotation.
      Returns:
      true if it does; false otherwise
    • getShowsAllY

      public boolean getShowsAllY()
      Determine if the image used to create this parameter set contains the 3D model in the Y direction after rotation.
      Returns:
      true if it does; false otherwise
    • getRotationXOrigin

      public double getRotationXOrigin()
      Get the X coordinate of the origin about which the coordinate rotation will be performed.
      Returns:
      the X coordinate
    • getRotationYOrigin

      public double getRotationYOrigin()
      Get the Y coordinate of the origin about which the coordinate rotation will be performed.
      Returns:
      the Y coordinate
    • getRotationZOrigin

      public double getRotationZOrigin()
      Get the Z coordinate of the origin about which the coordinate rotation will be performed.
      Returns:
      the Z coordinate
    • moveOriginAfterRotation

      public boolean moveOriginAfterRotation()
      Determine if the transformed origin for (0,0,0) will be moved to the coordinate origin after the rotation is completed.
      Returns:
      true if it will be moved; false if not
    • getDelta

      public double getDelta()
      Get the minimum triangle size for rendering. The size is measured in the x, y, and z directions. Larger triangles will be split into some number of smaller ones. Triangles will not be split if the value is zero.
      Returns:
      the minimum size
      See Also:
    • getLightSourcePhi

      public double getLightSourcePhi()
      Get the light-source parameter phi. The parameter partially determines the direction of the light source as described in the documentation for setLightSource.
      Returns:
      the light-source parameter phi
      See Also:
    • getLightSourceTheta

      public double getLightSourceTheta()
      Get the light-source parameter theta. The parameter partially determines the direction of the light source as described in the documentation for setLightSource.
      Returns:
      the light-source parameter theta
      See Also:
    • getColorFactor

      public double getColorFactor()
      Get the color factor. When not zero, the color factor causes triangles with lower Z values (after all transformations and coordinate-system rotations) to appear darker. When 1, a triangle with the lowest Z value will appear as black and the one with the highest Z value will have its specified color.
      Returns:
      the color factor
    • getNormalFactor

      public double getNormalFactor()
      Get the normal factor. When not zero, for each triangle, the color factor will be scaled by exp(-(1-nz)/f), where f is the normal factor and nz is the Z component of a triangle's normal vector (normalized so its length is 1).
      Returns:
      the normal factor