Class RMScene3D

  • All Implemented Interfaces:
    Archivable, DeepChangeListener, RMPropertyChanger, RMTypes, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

    public class RMScene3D
    extends RMParentShape
    This class manages a list of children and transforms them to 3D representations for display based on X and Y axis rotations.

    ReportMill 3D conventions:

    Coordinate system: Right handed (not left handed) Polygon front: Right hand rule (counter-clockwise defined polygons face forward) Transforms: Row major notation (as opposed to column major, points are assumed row vectors)

    • Constructor Detail

      • RMScene3D

        public RMScene3D()
    • Method Detail

      • getDepth

        public double getDepth()
        Returns the depth of the scene.
      • setDepth

        public void setDepth​(double aValue)
        Sets the depth of the scene.
      • getOrigin

        public RMPoint3D getOrigin()
        Returns the scene's origin.
      • getYaw

        public double getYaw()
        Returns the rotation about the Y axis in degrees.
      • setYaw

        public void setYaw​(double aValue)
        Sets the rotation about the Y axis in degrees.
      • getPitch

        public double getPitch()
        Returns the rotation about the X axis in degrees.
      • setPitch

        public void setPitch​(double aValue)
        Sets the rotation about the X axis in degrees.
      • getRoll3D

        public double getRoll3D()
        Returns the rotation about the Z axis in degrees.
      • setRoll3D

        public void setRoll3D​(double aValue)
        Sets the rotation about the Z axis in degrees.
      • getFocalLength

        public double getFocalLength()
        Returns the focal length of the camera (derived from the field of view and with view size).
      • setFocalLength

        public void setFocalLength​(double aValue)
        Sets the focal length of the camera. Two feet is normal (1728 points).
      • getOffsetZ

        public double getOffsetZ()
        Returns the Z offset of the scene (for zooming).
      • setOffsetZ

        public void setOffsetZ​(double aValue)
        Sets the Z offset of the scene (for zooming).
      • isPseudo3D

        public boolean isPseudo3D()
        Returns whether scene is rendered in pseudo 3d.
      • setPseudo3D

        public void setPseudo3D​(boolean aFlag)
        Sets whether scene is rendered in pseudo 3d.
      • getPseudoSkewX

        public double getPseudoSkewX()
        Returns the skew angle for X by Z.
      • setPseudoSkewX

        public void setPseudoSkewX​(double anAngle)
        Sets the skew angle for X by Z.
      • getPseudoSkewY

        public double getPseudoSkewY()
        Returns the skew angle for Y by Z.
      • setPseudoSkewY

        public void setPseudoSkewY​(double anAngle)
        Sets the skew angle for Y by Z.
      • getFieldOfView

        public double getFieldOfView()
        Returns the field of view of the camera (derived from focalLength).
      • setFieldOfView

        public void setFieldOfView​(double aValue)
        Sets the field of view of the camera.
      • setDefaultViewSettings

        public void setDefaultViewSettings()
        Sets some reasonable default view settings.
      • getCamera

        public RMVector3D getCamera()
        Returns the camera as a vector.
      • getLight

        public RMVector3D getLight()
        Returns the scene light as a vector.
      • getShapeCount

        public int getShapeCount()
        Returns the number of shapes in the shape list.
      • getShape

        public RMShape getShape​(int anIndex)
        Returns the specific shape at the given index from the shape list.
      • addShape

        public void addShape​(RMShape aShape)
        Adds a shape to the end of the shape list.
      • addShape

        public void addShape​(RMShape aShape,
                             int anIndex)
        Adds a shape to the shape list at the given index.
      • removeShape

        public void removeShape​(int anIndex)
        Removes the shape at the given index from the shape list.
      • getTransform3D

        public RMTransform3D getTransform3D()
        Returns the transform 3d for the scene's camera.
      • layoutChildren

        protected void layoutChildren()
        Rebuilds 3D representation of shapes from shapes list.
        Overrides:
        layoutChildren in class RMParentShape
      • addChild3D

        protected RMScene3D.RMShape3D addChild3D​(RMShape aShape,
                                                 double z1,
                                                 double z2,
                                                 boolean fixEdges)
        Adds a given shape in 3D. FixEdges flag indicates wheter to stroke polygons created during extrusion, to try to make them mesh better. The axisAlign flag can be set to true to make sure the shape's coordinate system is aligned with the screen.
      • setColor

        public void setColor​(RMScene3D.RMShape3D aShape3D,
                             RMColor aColor)
        Sets the color for a 3d shape from a base color.
      • resort

        public void resort()
        Resorts child shapes from back to front.
      • isShowing

        protected boolean isShowing​(RMShape aChild)
        Override to make all 3D children show.
        Overrides:
        isShowing in class RMParentShape
      • isHittable

        public boolean isHittable​(RMShape aChild)
        Override to indicate that scene children are unhittable.
        Overrides:
        isHittable in class RMParentShape
      • acceptsMouse

        public boolean acceptsMouse()
        Viewer method.
        Overrides:
        acceptsMouse in class RMShape
      • getValueIsAdjusting

        public boolean getValueIsAdjusting()
        Returns whether scene3d is being re-oriented.
      • copy3D

        public void copy3D​(RMScene3D aScene3D)
        Copy 3D attributes only.
      • toXMLChildren

        protected void toXMLChildren​(RXArchiver anArchiver,
                                     RXElement anElement)
        XML archival of children - overrides shape implementation to suppress archival of generated 3D shapes.
        Overrides:
        toXMLChildren in class RMParentShape