Class Ruler

  • All Implemented Interfaces:
    SafeDisposable

    public class Ruler
    extends SoNode
    (Preview Feature) Interactive distance measuring tool for SoOrthoSlice.

    Preview Feature means this class is fully supported and can be used in Open Inventor applications. Being tagged as a Preview Feature just means that the implementation is still subject to API changes and adjustments based on feedback from early adopters. Please be also aware that source compatibility might be broken regardless of the Open Inventor compatibility changes policy due to our commitment to bring needed changes to be sure the specifications of this Preview Feature match the expectations of our customers.

    This node displays an interactive distance measuring tool on top of an SoOrthoSlice. The user can click and drag to display a line and the physical distance between the clicked point and the current cursor position.

    This node is only intended to be used in a "2D" viewing environment using an SoOrthographicCamera, for example viewing a single slice of a medical volume.

    This node requires that the application handle mouse press, release and move events. Mouse move events must be forwarded to the node using the manageMouseMove method.

    File format/default:

    Ruler {

      globalFactor 1
      label mm
    }
    See Also:
    DicomInfo, Magnifier, Gnomon
    • Field Detail

      • globalFactor

        public SoSFFloat globalFactor
        Specifies a scale factor applied to the size of the arrowheads on the line. Default is 1.
      • label

        public SoSFString label
        Specifies a label string appended to the measurement value. Default is "mm".
    • Constructor Detail

      • Ruler

        public Ruler()
        Constructor
    • Method Detail

      • doAction

        public void doAction​(SoAction action)
        Override doAction function
        Overrides:
        doAction in class SoNode
        Parameters:
        action - Generic Inventor action
      • GLRender

        public void GLRender​(SoGLRenderAction action)
        Override GLRender function
        Overrides:
        GLRender in class SoNode
        Parameters:
        action - GL Render action
      • manageMouseMove

        public void manageMouseMove​(boolean firstClick,
                                    SoOrthoSliceDetail detail)
        The application should call this method with 'true' on the mouse down event that begins a measure operation, then call this method with 'false' on each mouse move event during the measure operation. See the medicalRuler example program for more details.
      • getFont

        public SoFont getFont()
        Access the font property