Class Ruler
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.medical.nodes.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFFloat
globalFactor
Specifies a scale factor applied to the size of the arrowheads on the line.SoSFString
label
Specifies a label string appended to the measurement value.-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description Ruler()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doAction(SoAction action)
Override doAction functionvoid
getBoundingBox(SoGetBoundingBoxAction action)
Override getBoundingBox functionSoFont
getFont()
Access the font propertySoNode.RenderModes
getRenderEngineMode()
Returns the supported Render engine mode.void
GLRender(SoGLRenderAction action)
Override GLRender functionvoid
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.-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, getAlternateRep, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
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".
-
-
Method Detail
-
doAction
public void doAction(SoAction action)
Override doAction function
-
GLRender
public void GLRender(SoGLRenderAction action)
Override GLRender function
-
getBoundingBox
public void getBoundingBox(SoGetBoundingBoxAction action)
Override getBoundingBox function- Overrides:
getBoundingBox
in classSoNode
- Parameters:
action
- GetBoundingBox 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.
-
getRenderEngineMode
public SoNode.RenderModes getRenderEngineMode()
Description copied from class:SoNode
Returns the supported Render engine mode.For custom node, this method returns by default
SoNode.RenderModes.OIV_UNKNOWN_RENDERING_MODE
, override this method to specify the Render engine mode supported by your custom node.- Overrides:
getRenderEngineMode
in classSoNode
- Returns:
- the supported Render engine mode for this node.
-
getFont
public SoFont getFont()
Access the font property
-
-