Class SoMarker
- All Implemented Interfaces:
SafeDisposable
SoMarkerSet
and SoIndexedMarkerSet
.
This class defines a Marker. A marker is an image defined by a bitmap and optional color values. If no color values are given then image pixels corresponding to "1" bits are drawn using the current material color (see SoMaterial
) and pixels corresponding to "0" bits are not drawn (whatever is behind the marker shows through). If color values are given then each pixel in the image can be assigned an RGBA value.
size is the dimensions of the marker image in pixels. bitmap is the marker bitmap. The bitmap is arranged row by row, from left to right and up to down (or down to up according to the parameter isUpToDown ). Each byte specifies eight pixels. If isLSBFirst is true, bits are ordered within a byte from Least Significant to Most Significant; otherwise the first bit in each byte is the most significant one. If isUpToDown is true, the marker bitmap is described from down to up (first byte is the bottom left corner of the bitmap), otherwise from up to down (first byte is the top left corner).
Also note that each row must use a whole number of bytes. Padding is thus needed at the end of each row if row size is not a multiple of 8.
orderedRGBA is an optional color mask to apply to the marker. The color mask is arranged the same as bitmap, but each value (unsigned integer) specifies the color of one pixel. Each color is an ordered RGBA value. A value of 0xFF for Alpha makes the color mask be ignored for this pixel, and the color is inherited from the state depending on the bitmap value (as if no color values were given).
Note:
- If only orderedRGBA values are set, the bitmap is assumed to be a fully defined set of "1" bits.
- Marker size must be greater than 1x1.
Marker definitions are used by the SoMarkerSet
and SoIndexedMarkerSet
nodes. To make a custom marker available to these nodes, use one of the addMarker methods defined in those classes.
An SoMarker
node can be added to the scene graph, but it is not a geometry node or an attribute node (does not render anything and does not affect the traversal state list). However SoMarker
nodes are written out to an Inventor file if an SoWriteAction
is applied to the scene graph. So adding SoMarker
nodes to the scene graph allows custom marker definitions to be saved and restored. For example:
// Add markers to scene graph in order to export them in IV file. root.addChild( SoMarkerSet.getMarker(90) ); root.addChild( SoMarkerSet.getMarker(91) ); root.addChild( SoMarkerSet.getMarker(92) );
File format/default:
Marker {
bitmap | 0 |
orderedRGBA | 0 |
upToDown | true |
LSBFirst | true |
size | (0, 0) |
index | -1 |
- See Also:
-
Nested Class Summary
Nested ClassesNested 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 TypeFieldDescriptionfinal SoMFUByte
Defines the current marker data buffer.final SoSFInt32
Defines the marker index.final SoSFBool
if true, bits are ordered within a byte from Least Significant to most significant; otherwise the first bit in each byte is the most significant one.final SoMFUInt32
Defines the marker coloration mask.final SoSFVec2s
Defines the size (in pixels) of the marker.final SoSFBool
if true, marker bitmap is described from down to up (that is bytes[0] is the left bottom corner of the bitmap), otherwise from up to down (that is bytes[0] is the top left corner).Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, 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
-
bitmap
Defines the current marker data buffer. Note that each pixel row of the marker must use a whole number of bytes. Padding is thus needed at the end of each row if row size is not a multiple of 8. -
orderedRGBA
Defines the marker coloration mask. -
upToDown
if true, marker bitmap is described from down to up (that is bytes[0] is the left bottom corner of the bitmap), otherwise from up to down (that is bytes[0] is the top left corner). -
isLSBFirst
if true, bits are ordered within a byte from Least Significant to most significant; otherwise the first bit in each byte is the most significant one. -
size
Defines the size (in pixels) of the marker. Must be greater than 1x1 -
index
Defines the marker index.
-
-
Constructor Details
-
SoMarker
public SoMarker()Marker constructor.
-