Class Ruler
- All Implemented Interfaces:
SafeDisposable
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:
-
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
FieldsModifier and TypeFieldDescriptionSpecifies a scale factor applied to the size of the arrowheads on the line.Specifies a label string appended to the measurement value.Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Override doAction functionvoid
getBoundingBox
(SoGetBoundingBoxAction action) Override getBoundingBox functiongetFont()
Access the font propertyReturns 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 Details
-
globalFactor
Specifies a scale factor applied to the size of the arrowheads on the line. Default is 1. -
label
Specifies a label string appended to the measurement value. Default is "mm".
-
-
Constructor Details
-
Ruler
public Ruler()Constructor
-
-
Method Details
-
doAction
Override doAction function -
GLRender
Override GLRender function -
getBoundingBox
Override getBoundingBox function- Overrides:
getBoundingBox
in classSoNode
- Parameters:
action
- GetBoundingBox action
-
manageMouseMove
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
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
Access the font property
-