Class SceneViewerPtr


  • public class SceneViewerPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • SceneViewerPtr

        public SceneViewerPtr​(long cPtr,
                              boolean cMemoryOwn)
      • SceneViewerPtr

        public SceneViewerPtr()
        Default constructor yielding a NULL-pointer.
      • SceneViewerPtr

        public SceneViewerPtr​(SceneViewer ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • delete

        public void delete()
      • deref

        public SceneViewer deref()
        The pointer stored in the object.
      • __ref__

        public SceneViewer __ref__()
        Dereferencing operator.
      • getDeref

        public SceneViewer getDeref()
        Member access operator.
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • 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.