View3DLit
vmm3d.core3D

Class View3DLit

    • Field Detail

      • WIREFRAME_RENDERING

        public static final int WIREFRAME_RENDERING
        A constant that can be used as a parameter to setRenderingStyle(int) to specify that surfaces should always be rendered as wireframes.
        See Also:
        Constant Field Values
      • PATCH_RENDERING

        public static final int PATCH_RENDERING
        A constant that can be used as a parameter to setRenderingStyle(int) to specify that surfaces should always be rendered as solid patches.
        See Also:
        Constant Field Values
      • NORMAL_ORIENTATION

        public static final int NORMAL_ORIENTATION
        A constant that can be used as a parameter to setOrientation(int) to specify that surfaces have normal orientation, in which the normal vector points out from the front face.
        See Also:
        Constant Field Values
      • REVERSE_ORIENTATION

        public static final int REVERSE_ORIENTATION
        A constant that can be used as a parameter to setOrientation(int) to specify that surfaces have reverse orientation, in which the normal vector points out from the back face.
        See Also:
        Constant Field Values
      • NO_ORIENTATION

        public static final int NO_ORIENTATION
        A constant that can be used as a parameter to setOrientation(int) to specify that surfaces have no orientation, so that both faces of a patch are treated as front faces.
        See Also:
        Constant Field Values
    • Constructor Detail

      • View3DLit

        public View3DLit()
        Create a View3DLit object, using default light settings and normal orientation.
    • Method Detail

      • getRenderingStyle

        public int getRenderingStyle()
        Returns the current rendering style.
        See Also:
        setRenderingStyle(int)
      • setRenderingStyle

        public void setRenderingStyle(int style)
        Sets the rendering style that is used to draw surfaces. The two available styles are WIREFRAME_RENDERING and PATCH_RENDERING. With the former, only surface grid lines are drawn. With the latter, surface patches are drawn with color determined by their intrinsic color and lighting conditions.
        Parameters:
        style - the new rendering style; must be one of the constants WIREFRAME_RENDERING or PATCH_RENDERING
      • getBlackAndWhite

        public boolean getBlackAndWhite()
        Tells whether surfaces are rendered in gray-scale rather than color.
        See Also:
        setBlackAndWhite(boolean)
      • setBlackAndWhite

        public void setBlackAndWhite(boolean blackAndWhite)
        Set whether surfaces should be rendered in gray-scale or in color. In a gray-scale image, the color is computed as usual but then only the brightness is used to determine the level of gray for drawing. Note that this setting has no effectg in anaglyph stereo views, since the drawing there is effectively always done in gray-scale.
        Parameters:
        blackAndWhite - true if surfaces are to be drawn in gray-scale; false if they are to be drawn in color
      • getOrientation

        public int getOrientation()
        Returns the current orientation setting for surfaces.
        See Also:
        setOrientation(int)
      • setOrientation

        public void setOrientation(int orientation)
        Set how front and back faces of surface patches are determined. In NORMAL_ORIENTATION, the standard normal vectorto a surface patch points out of the front face of the patch. In REVERSE_ORIENTATION, the normal vector points out of the back face. In NO_ORIENTATION, both faces are considered to be front faces.
        Parameters:
        orientation - the method for determining front/back faces of surface patches. Must be one of the contstants NORMAL_ORIENTATION, REVERSE_ORIENTATION, or NO_ORIENTATION.
      • getPhongShading

        public boolean getPhongShading()
        Returns the current shading setting, true for Phong shading or false for flat shading.
        See Also:
        getPhongShading()
      • setPhongShading

        public void setPhongShading(boolean phongShading)
        Select the type of shading to be used for surface patches. If phongShading is set to true, then the Phong shading algorithm is used to determine the color of each individual pixel in the surface patch. This gives the highest quality results, but is time consuming. If phongShading is set to false, and flat shading is used; in flat shading, the same color is used for all pixels in the patch.
      • getDragAsSurface

        public boolean getDragAsSurface()
        Determines how surfaces are rendered when the "fast draw" mode is in effect, such as during rotation, zooming, or dragging by the user.
        See Also:
        setDragAsSurface(boolean), View#setFastDrawing(boolean)
      • setDragAsSurface

        public void setDragAsSurface(boolean dragAsSurface)
        Specify how surfaces are rendered when the "fast draw" mode is in effect, such as during rotation, zooming, or dragging by the user. If dragAsSurface is set to false, then wireframe rendering is used for fast drawing of surface. If dragAsSurface is set to true, and the rendering method is set to PATCH_RENDERING, then "rough" surfaces are drawn during fast drawing. In a "rough" surface, flat shading is always used and all the subpatches in a patch are rendered as a single large patch. Note that when WIREFRAME_RENDERING is in effect, fast drawing will be done in wireframe mode regardless of the setting of the dragAsSurface property.
      • setTransparency

        public void setTransparency(double transparency)
        Set the degree of transparency for surfaces displayed in this View3DLit. The transparency degree is a number in the range 0.0 to 1.0, with 0.0 representing a fully opaque surface and 1.0 representing a fully transparent surface that will, in effect, be invisible.
        Parameters:
        transparency - the desired degree of transparency. The value is clamped so that it lies in the range 0 to 1, inclusive.
      • setEnableThreeD

        public void setEnableThreeD(boolean enable)
        Description copied from class: View3D
        Sets the enableThreeD property. When this property is set to false, three-D related items in the Settings menu are disabled. When 3D is disabled, the view style is set to MONOCULAR, the Viewpoint is set to (1,0,0), and the projection is set to be orthographic, so any 3D drawing that is done while 3D is disabled will use a simple projection onto the yz-plane by discarding the x-coordinate. (Although in general you should not be doing any 3D drawing while 3D is disabled.) When 3D is enabled after being disabled, the view style and viewpoint settings are restored to what they were when 3D was entered unless they have been changed in the meantime.

        Note that if this view has an Axes decoration, they type of Axes decoration (Axes2D or Axes3D) is set to match the new state of the enableThreeD property.

        WARNING: This method does NOT do anything about mouse tasks, so you might want to change the mouse task in this View's display at the same time that you call this method.

        Overrides:
        setEnableThreeD in class View3D
      • getSettingsCommands

        public ActionList getSettingsCommands()
        Adds a checkbox for setting the dragAsSurface property to any settings contributed by the superclass.
        Overrides:
        getSettingsCommands in class View3DWithLightSettings
        See Also:
        View#getSettingsCommands()
      • takeExhibit

        public void takeExhibit(View view,               boolean shareTransform)
        Description copied from class: View3D
        Set this View to view the same exhibit as another specififed view. This is overridden here to copy the 3D transform from the specified view (if it has one) and to copy its viewStyle if it is a View3D and to properly handle the enableThreeD propety. Since a 3D View cannot make effective use of a 2D transform, the sharedTransform parameter is ignored if the transform in the given view is not a 3D transform.
        Overrides:
        takeExhibit in class View3D
        Parameters:
        view - The view whose Exhibit is to be copied. After the method is called, both views will be drawing the same exhibit. If null, then the exhibit of this view will also be set to null.
        shareTransform - If true, the two views will share the same Transform, so that changes made to the transform in one will also result in a change in the other.
      • getViewCommands

        public ActionList getViewCommands()
        Adds commands for setting various View3DLit options to any view commands contributed by the superclass.
        Overrides:
        getViewCommands in class View3D
        See Also:
        View#getViewCommands()
      • drawSurface

        public void drawSurface(Grid3D surfaceData)
        Draws an entire surface represented in the form of a Grid3D object, taking into account current lighting and rendering settings.
      • drawSurface

        public void drawSurface(Grid3D surfaceData,               double startPercent,               double endPercent)
        Draws all or part of a surface that is represented in the form of a Grid3D object, taking into account current lighting and rendering settings. The ability to draw only part of a surface is used in surface build animations.

        If fast drawing mode is in effect, the entire surface is always drawn; the startIndex and endIndex are ignored in this case. Also, if WIREFRAME_RENDERING is in effect, the entire surface is drawn in wireframe form. For normal speed rendering with patch display, the startPercent and endPercent specify a range of subpatches to draw; these numbers are given as percentages of the total number of available patches (taking into account patches that have been clipped). The subpatches are sorted into back-to-front order. (The total number of subpatches can be determined by calling Grid3D.getSubPatchCountInSurface(), but note that some of the patches might not be included in the drawing or in the calculation of percentages because ofclipping.)

      • fillPolygon

        public void fillPolygon(Vector3D[] vertices,               Color outlineColor)
        Draws a filled-in polygon in current drawing color. To projection of the polygon onto the xy-plane is drawn. Note: This is used by IFS.
        Parameters:
        vertices - The vertices of the polygon, in object coordinates.
        outlineColor - If non-null, then the polygon is outlined with this color.

SCaVis 2.2 © jWork.ORG