Documentation of 'visad.java3d.DisplayRendererJ3D' Java class
DisplayRendererJ3D
visad.java3d

Class DisplayRendererJ3D

    • Constructor Detail

      • DisplayRendererJ3D

        public DisplayRendererJ3D()
    • Method Detail

      • setSceneGraphObjectName

        public static void setSceneGraphObjectName(javax.media.j3d.SceneGraphObject obj,
                                                   java.lang.String name)
        Set the name of a SceneGraphObject. If SceneGraphObject does not have a setName (J3D pre v1.4) this is a no-op.
        Parameters:
        name -
      • destroy

        public void destroy()
      • getView

        public javax.media.j3d.View getView()
      • getViewTrans

        public javax.media.j3d.TransformGroup getViewTrans()
      • getCanvas

        public VisADCanvasJ3D getCanvas()
        Get the canvas for this renderer
        Returns:
        VisADCanvasJ3D that this renderer uses.
      • getImage

        public java.awt.image.BufferedImage getImage()
        Capture the display rendition as an image.
        Specified by:
        getImage in class DisplayRenderer
        Returns:
        image of the display.
      • getRoot

        public javax.media.j3d.BranchGroup getRoot()
      • initControl

        public void initControl(RendererControl ctl)
        Internal method used to initialize newly created RendererControl with current renderer settings before it is actually connected to the renderer. This means that changes will not generate MonitorEvents.
        Specified by:
        initControl in class DisplayRenderer
        Parameters:
        ctl - RendererControl to initialize
      • controlChanged

        public void controlChanged(ControlEvent evt)
        Update internal values from those in the RendererControl.
        Specified by:
        controlChanged in interface ControlListener
        Parameters:
        evt - ControlEvent generated by a change to the RendererControl
      • getTrans

        public javax.media.j3d.TransformGroup getTrans()
      • getCursorOnBranch

        public javax.media.j3d.BranchGroup getCursorOnBranch()
      • getBoxOnBranch

        public javax.media.j3d.BranchGroup getBoxOnBranch()
      • setCursorOn

        public void setCursorOn(boolean on)
        Toggle the cursor in the display
        Specified by:
        setCursorOn in class DisplayRenderer
        Parameters:
        on - true to display the cursor, false to hide it.
      • setDirectOn

        public void setDirectOn(boolean on)
        Set the flag for direct manipulation
        Specified by:
        setDirectOn in class DisplayRenderer
        Parameters:
        on - true for enabling direct manipulation, false to disable
      • createSceneGraph

        public abstract javax.media.j3d.BranchGroup createSceneGraph(javax.media.j3d.View v,
                                                                     javax.media.j3d.TransformGroup vpt,
                                                                     VisADCanvasJ3D c)
        Create scene graph root, if none exists, with Transform and direct manipulation root; create special graphics (e.g., 3-D box, SkewT background), any lights, any user interface embedded in scene.
        Parameters:
        v -
        vpt -
        c -
        Returns:
        Scene graph root.
      • createBasicSceneGraph

        public javax.media.j3d.BranchGroup createBasicSceneGraph(javax.media.j3d.View v,
                                                                 javax.media.j3d.TransformGroup vpt,
                                                                 VisADCanvasJ3D c,
                                                                 MouseBehaviorJ3D m)
        Deprecated. use createBasicSceneGraph(View v, TransformGroup vpt, VisADCanvasJ3D c, MouseBehaviorJ3D m, ColoringAttributes bc, ColoringAttributes cc) instead
      • createBasicSceneGraph

        public javax.media.j3d.BranchGroup createBasicSceneGraph(javax.media.j3d.View v,
                                                                 javax.media.j3d.TransformGroup vpt,
                                                                 VisADCanvasJ3D c,
                                                                 MouseBehaviorJ3D m,
                                                                 javax.media.j3d.ColoringAttributes bc,
                                                                 javax.media.j3d.ColoringAttributes cc)
        Create scene graph root, if none exists, with Transform and direct manipulation root.
        Parameters:
        v -
        vpt -
        c -
        m -
        Returns:
        Scene graph root.
      • setClip

        public void setClip(int plane,
                            boolean enable,
                            float a,
                            float b,
                            float c,
                            float d)
                     throws VisADException
        Define a clipping plane in (XAxis, YAxis, ZAxis) space. Allows up to 6 arbitrary planes. Each clip plane is defined by the equation:
              aX + bY + cZ + d <= 0
         

        Example useage:

        To clip to the usual VisAD cube (i.e., x, y and z values in the range -1.0 to +1.0) (see Test35.java), call:
            DisplayRendererJ3D dr = 
                     (DisplayRendererJ3D) display.getDisplayRenderer();
            dr.setClip(0, true,  1.0f,  0.0f,  0.0f, -1.01f);  // X_POS face
            dr.setClip(1, true, -1.0f,  0.0f,  0.0f, -1.01f);  // X_NEG face
            dr.setClip(2, true,  0.0f,  1.0f,  0.0f, -1.01f);  // Y_POS face
            dr.setClip(3, true,  0.0f, -1.0f,  0.0f, -1.01f);  // Y_NEG face
            dr.setClip(4, true,  0.0f,  0.0f,  1.0f, -1.01f);  // Z_POS face
            dr.setClip(5, true,  0.0f,  0.0f, -1.0f, -1.01f);  // Z_NEG face
         
        Note: d value is slightly less than -1.0 so items in the plane are not clipped.
        Parameters:
        plane - plane number must be in (0, ..., 5)).
        enable - true to enable clipping on this plane, false to disable
        a - x coefficent
        b - y coefficent
        c - z coefficent
        d - constant
        Throws:
        VisADException - illegal plane argument or unsupported (< 1.2) version of Java 3D
      • getMouseBehavior

        public MouseBehavior getMouseBehavior()
        Get the MouseBehavior associated with this renderer.
        Specified by:
        getMouseBehavior in class DisplayRenderer
        Returns:
        the MouseBehavior used by this renderer to handle mouse events.
      • getKeyboardBehavior

        public KeyboardBehavior getKeyboardBehavior()
        Get the KeyboardBehavior associated with this renderer.
        Returns:
        the KeyboardBehavior used by this renderer to handle mouse events.
      • addSceneGraphComponent

        public void addSceneGraphComponent(javax.media.j3d.Group group)
      • addLockedSceneGraphComponent

        public void addLockedSceneGraphComponent(javax.media.j3d.Group group)
      • addLockedSceneGraphComponent

        public void addLockedSceneGraphComponent(javax.media.j3d.Group group,
                                                 boolean initWithProj)
      • updateLockedTrans

        public void updateLockedTrans(double[] matrix)
      • addDirectManipulationSceneGraphComponent

        public void addDirectManipulationSceneGraphComponent(javax.media.j3d.Group group,
                                                             DirectManipulationRendererJ3D renderer)
      • clearScene

        public void clearScene(DataRenderer renderer)
      • getCursor

        public double[] getCursor()
        Get the cusor location.
        Specified by:
        getCursor in class DisplayRenderer
        Returns:
        cursor location as an array of x, y, and z values
      • depth_cursor

        public void depth_cursor(VisADRay ray)
        Description copied from class: DisplayRenderer
        set a VisADRay along which to drag cursor in depth (in and out of screen)
        Specified by:
        depth_cursor in class DisplayRenderer
        Parameters:
        ray - VisADRay to set
      • drag_depth

        public void drag_depth(float diff)
        Description copied from class: DisplayRenderer
        drag cursor in depth (in and out of screen)
        Specified by:
        drag_depth in class DisplayRenderer
        Parameters:
        diff - amount to move cursor in depth (0.0 corresponds to no movement)
      • drag_cursor

        public void drag_cursor(VisADRay ray,
                                boolean first)
        Description copied from class: DisplayRenderer
        drag cursor parallel to plane of screen
        Specified by:
        drag_cursor in class DisplayRenderer
        Parameters:
        ray - VisADRay that goes through new cursor location
        first - true to indicate this is first call to drag_cursor() for this drag
      • setCursorLoc

        public void setCursorLoc(float x,
                                 float y,
                                 float z)
        Set the cursor location
        Parameters:
        x - x location
        y - y location
        z - z location
      • drawCursorStringVector

        public void drawCursorStringVector(VisADCanvasJ3D canvas)
        Whenever cursorOn or directOn is true, display Strings in cursorStringVector.
        Parameters:
        canvas -
      • findDirect

        public DataRenderer findDirect(VisADRay ray,
                                       int mouseModifiers)
        Find the DataRenderer that is closest to the ray and uses the specified mouse modifiers for direct manipulation.
        Specified by:
        findDirect in class DisplayRenderer
        Parameters:
        ray - position to check
        mouseModifiers - modifiers for mouse clicks
        Returns:
        closest DataRenderer that uses the specified mouse click modifiers for direct manipulation or null if there is none.
      • anyDirects

        public boolean anyDirects()
        Check to see if there are any DirectManipulationRenderers in this display.
        Specified by:
        anyDirects in class DisplayRenderer
        Returns:
        true if there are any
      • setScaleOn

        public void setScaleOn(boolean on)
        Set the scales on.
        Specified by:
        setScaleOn in class DisplayRenderer
        Parameters:
        on - turn on if true, otherwise turn them off
      • setScale

        public void setScale(int axis,
                             int axis_ordinal,
                             VisADLineArray array,
                             float[] scale_color)
                      throws VisADException
        Set the scale for the appropriate axis.
        Specified by:
        setScale in class DisplayRenderer
        Parameters:
        axis - axis for this scale (0 = XAxis, 1 = YAxis, 2 = ZAxis)
        axis_ordinal - position along the axis
        array - VisADLineArray representing the scale plot
        scale_color - array (dim 3) representing the red, green and blue color values.
        Throws:
        VisADException - couldn't set the scale
      • setScale

        public void setScale(int axis,
                             int axis_ordinal,
                             VisADLineArray array,
                             VisADTriangleArray labels,
                             float[] scale_color)
                      throws VisADException
        Set the scale for the appropriate axis.
        Specified by:
        setScale in class DisplayRenderer
        Parameters:
        axis - axis for this scale (0 = XAxis, 1 = YAxis, 2 = ZAxis)
        axis_ordinal - position along the axis
        array - VisADLineArray representing the scale plot
        labels - VisADTriangleArray representing the labels created using a font (can be null)
        scale_color - array (dim 3) representing the red, green and blue color values.
        Throws:
        VisADException - couldn't set the scale
      • clearScales

        public void clearScales()
        Remove all the scales being rendered.
        Specified by:
        clearScales in class DisplayRenderer
      • clearScale

        public void clearScale(AxisScale axisScale)
        Remove a particular scale being rendered.
        Specified by:
        clearScale in class DisplayRenderer
        Parameters:
        axisScale - AxisScale to remove
      • setTransform3D

        public void setTransform3D(javax.media.j3d.Transform3D t)
      • makeControl

        public Control makeControl(ScalarMap map)
        Factory for constructing a subclass of Control appropriate for the graphics API and for this DisplayRenderer; invoked by ScalarMap when it is addMap()ed to a Display.
        Specified by:
        makeControl in class DisplayRenderer
        Parameters:
        map - The ScalarMap for which a Control should be built.
        Returns:
        The appropriate Control.
      • legalDataRenderer

        public boolean legalDataRenderer(DataRenderer renderer)
        Check if the DataRenderer in question is legal for this DisplayRenderer
        Specified by:
        legalDataRenderer in class DisplayRenderer
        Parameters:
        renderer - DataRenderer to check
        Returns:
        true if renderer is a subclass of RendererJ3D
      • setLineWidth

        public void setLineWidth(float width)
      • addKeyboardBehavior

        public void addKeyboardBehavior(KeyboardBehaviorJ3D behavior)
        Add a KeyboardBehavior for keyboard control of rotation, translation and zoom.
        Parameters:
        behavior - keyboard behavior to add
      • render_trigger

        public void render_trigger()
        Description copied from class: DisplayRenderer
        trigger the graphics API to render the scene graph to the screen; intended to be over-ridden by graphics-API-specific extensions of DisplayRenderer
        Overrides:
        render_trigger in class DisplayRenderer
      • setWaitFlag

        public void setWaitFlag(boolean b)
        Description copied from class: DisplayRenderer
        Set the wait flag to the specified value. (When the wait flag is enabled, the user is informed that the application is busy, typically by displaying a Please wait . . . message at the bottom of the Display.) DisplayEvent.WAIT_ON and DisplayEvent.WAIT_OFF events are fired based on value of b.
        Overrides:
        setWaitFlag in class DisplayRenderer
        Parameters:
        b - Boolean value to which wait flag is set.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.