Class SoDrawStyle
- All Implemented Interfaces:
SafeDisposable
SoDrawStyle
specifies how primitives should be rendered.
Draw style
The drawing style has no effect on picking or callback primitive generation. In particular, geometry with style INVISIBLE is not rendered but is still pickable. It can be useful to put, for example, an invisible sphere around an assembly to ensure that it is always picked as a unit.
Style INVISIBLE should generally not be used to "turn off" geometry. It is more efficient to put an SoSwitch
node above the geometry and all its associated nodes. Using the Switch's whichChild field to "turn off" geometry avoids traversing any of the associated nodes.
Point size and line width notes
- The default point size and line width are both 0, which means to use the OpenGL default value (1 in both cases). Point size and line width valuess greater than zero are considered to be specified in printer's points, where 1 inch = 72 printer's points. However the default pixels-per-inch (managed by
SbViewportRegion
) is also 72. So effectively point size and line width are specified in pixels unless the application specifically sets a different pixels-per-inch value. - The maximum line width is hardware dependent. Only width 1 is guaranteed. An application could simulate wider lines using polygons if necessary.
- If line antialiasing is disabled (which is the default), then OpenGL rounds the specified line width to the nearest integer. If rounding results in the value 0, it is as if the line width was set to 1.
- When the specified point size and/or line width is greater than zero, the
SoDrawStyle
node will have a dependency on theSoViewportRegionElement
(for the pixels-per-inch value). As a result render caches may be invalidated when the viewport size changes, e.g. if the drawing window is resized.
File format/default:
DrawStyle {
style | FILLED |
pointSize | 0 |
lineWidth | 0 |
linePattern | 0xffff |
linePatternScaleFactor | 1 |
Action behavior:
SoGLRenderAction
, SoCallbackAction
Sets the current drawing style. Sets: SoDrawStyleElement
, SoPointSizeElement
, SoLineWidthElement
, SoLinePatternElement
.
- 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 SoSFUShort
Stipple pattern for lines (for LINES style).final SoSFInt32
Stipple pattern scale factor (for LINES style).final SoSFFloat
Width of lines (for LINES style).final SoSFFloat
Radius of points (for POINTS style).final SoSFEnum
<SoDrawStyle.Styles> Drawing style.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
-
style
Drawing style. . Default is FILLED. -
pointSize
Radius of points (for POINTS style). Default is 0, meaning to use the default OpenGL value (1). Point sizes greater than zero are considered to be specified in printer's point, where 1 inch = 72 printer's points. However the default pixels-per-inch value (managed bySbViewportRegion
) is also 72. So effectively point size is specified in pixels unless the application sets a different pixels-per-inch value.Please see the notes in the class description for more information.
-
lineWidth
Width of lines (for LINES style). The default line width is 0, meaning to use the default OpenGL value (1). Line widths greater than zero are considered to be specified in printer's points, where 1 inch = 72 printer's points. However the default pixels-per-inch value (managed bySbViewportRegion
) is also 72. So effectively line width is specified in pixels unless the application sets a different pixels-per-inch value.Please see the notes in the class description for more information.
-
linePattern
Stipple pattern for lines (for LINES style). This specifies how dashed or dotted lines will be drawn. The pattern is a 16-bit series of 0s and 1s and is repeated as necessary to stipple a given line. A 1 indicates that drawing occurs, and a 0 that it does not, on a pixel-by-pixel basis, starting with the low-order bits of the pattern. Values can range from 0 (invisible) to 0xffff (solid). Default is 0xffff.The line pattern can be stretched using the
linePatternScaleFactor
field. -
linePatternScaleFactor
Stipple pattern scale factor (for LINES style). It stretches the line pattern (seelinePattern
) by multiplying each subseries of consecutive 1s and 0s. Scale factors are clamped to lie between 1 and 255. Default is 1.- Since:
- Open Inventor 4.0
-
-
Constructor Details
-
SoDrawStyle
public SoDrawStyle()Creates a drawing style node with default settings.
-