Class SceneViewer


  • public class SceneViewer
    extends java.lang.Object
    interface for viewing a scene graph.

    The scene graph viewer
    • Constructor Detail

      • SceneViewer

        public SceneViewer​(long cPtr,
                           boolean cMemoryOwn)
    • Method Detail

      • getCPtr

        public static long getCPtr​(SceneViewer obj)
      • delete

        public void delete()
      • getScene

        public SceneGraphPtr getScene()
        get the current scene graph
      • getLogo

        public java.lang.String getLogo()
        get the logo that is displayed in the 3d scene
      • setLogo

        public void setLogo​(java.lang.String string)
        set the logo that is displayed in the 3d scene
      • getPropertyMap

        public PropertyMap getPropertyMap()
        get propertymap
      • updateView

        public void updateView()
        Update the view.
      • updateState

        public void updateState​(State state)
        Set a new state.
        Parameters:
        state - [in] new state.
      • setWorldNode

        public void setWorldNode​(GroupNodePtr wnode)
        Set the world group node.
        Parameters:
        wnode - [in] the world node.
      • setWorkCellScene

        public void setWorkCellScene​(WorkCellScenePtr wcscene)
        Set the WorkCell scene.
        Parameters:
        wcscene - [in] the workcell scene.
      • getWorldNode

        public GroupNodePtr getWorldNode()
        Get the world node.
        Returns:
        the world node.
      • saveBufferToFile

        public void saveBufferToFile​(java.lang.String filename,
                                     int fillR,
                                     int fillG,
                                     int fillB)
        Saves the current 3D view to disk as either jpg, bmp or png.

        If failing a std::string is thrown with a detailed description of what
        when wrong.

        Parameters:
        filename - [in] Path and name of the file. The filename extension
        should be either ".jpg", ".bmp" or ".png" to specify which format to use.
        fillR - [in] Fill color if viewport is smaller than image, red component [0,255]
        fillG - [in] Fill color if viewport is smaller than image, green component [0,255]
        fillB - [in] Fill color if viewport is smaller than image, blue component [0,255]
      • getViewCenter

        public Vector3D getViewCenter()
        Get the view center.
        Returns:
        the center.
      • pickDrawable

        public DrawableNodePtr pickDrawable​(int x,
                                            int y)
        picks the drawable in the scene that intersects with the ray (x,y,-1) in
        camera coordinates.

        Parameters:
        x - [in] first camera coordinate.
        y - [in] second camera coordinate.
        Returns:
        the picked drawable.
      • createView

        public SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t createView​(java.lang.String name,
                                                                                      boolean enableBackground)
        Create a new view.
        Parameters:
        name - [in] name of view.
        enableBackground - [in] (optional) enable the background. Default is false.
        Returns:
        the new view.
      • setTransform

        public void setTransform​(Transform3D t3d)
        set the orientation of the view. The view will look in the
        positive direction of the z-axis, with x-axis as the width and
        the y-axis as the height. Origin of view is in the center of the
        image.
        Parameters:
        t3d - [in] transform relative to world
      • getTransform

        public Transform3D getTransform()
        get the current rotation of the view
        Returns:
        orientation of the view
      • zoom

        public void zoom​(double amount)
        Move the camera along its z-axis.
        Parameters:
        amount - [in] the amount of zoom.
      • autoZoom

        public void autoZoom()
        Automatically fits all frames inside the viewport by moving camera in its z-axis.