Class SoMarker

  • All Implemented Interfaces:
    SafeDisposable

    public class SoMarker
    extends SoNode
    Defines a custom bitmap for 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:
    SoMarkerSet, SoIndexedMarkerSet
    • 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.
    • Constructor Detail

      • SoMarker

        public SoMarker()
        Marker constructor.