Class SoMarker
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodes.SoMarker
-
- All Implemented Interfaces:
SafeDisposable
public class SoMarker extends SoNode
Defines a custom bitmap forSoMarkerSet
andSoIndexedMarkerSet
. 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 (seeSoMaterial
) 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
andSoIndexedMarkerSet
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). HoweverSoMarker
nodes are written out to an Inventor file if anSoWriteAction
is applied to the scene graph. So addingSoMarker
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:
SoMarkerSet
,SoIndexedMarkerSet
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoMarker.MarkerTypes
Marker type.-
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 SoMFUByte
bitmap
Defines the current marker data buffer.SoSFInt32
index
Defines the marker index.SoSFBool
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.SoMFUInt32
orderedRGBA
Defines the marker coloration mask.SoSFVec2s
size
Defines the size (in pixels) of the marker.SoSFBool
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).-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoMarker()
Marker constructor.
-
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 Detail
-
bitmap
public final SoMFUByte 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
public final SoMFUInt32 orderedRGBA
Defines the marker coloration mask.
-
upToDown
public final SoSFBool 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
public final SoSFBool 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
public final SoSFVec2s size
Defines the size (in pixels) of the marker. Must be greater than 1x1
-
index
public final SoSFInt32 index
Defines the marker index.
-
-