Class SoImage
- java.lang.Object
-
- All Implemented Interfaces:
SafeDisposable
public class SoImage extends SoShape
Displays an image that always faces the camera. TheSoImagenode allows you to display an image without using the texture facilities. The image is a 2D image attached to a 3D justification point. The justification point is at (0,0,0) after applying the current transformation. The image is always parallel to the screen. The image is not resized when the render window is resized.The image can be read from the file specified by the
filenamefield. Once the image has been read, theimagefield contains the image data. However, this field is marked so the image is not written out when the image node is written to a file. To turn off the image, set thefilenamefield to an empty string ("").Images can also be specified in memory by setting the
imagefield to contain the image data. Doing so resets the file name to the empty string.This node can be useful for placing a logo in the scene, or for attaching an icon or marker to a 3D point.
By default (or when the width and height fields are both set to negative values), the actual size of the image is used. If the width and/or height are specified, the image is scaled to the specified size in pixels.
Note that
SoImageautomatically enables blending for 2 or 4 component images, but it does not set the blending function. However, if you have enabled transparency, or if any of the textures in your scene graph have 2 or 4 components, the blending function will be set.Note that the position of the image on the screen depends on the current camera settings, so generally this node should not be render cached.
SoImagenodes prohibit auto-caching, so that noSoSeparator(or other render caching node) above anSoImagein the scene graph will automatically create a render cache. This can significantly affect performance and applications should try to keep nodes that can be render cached (especially geometry nodes) under a differentSoSeparator.Note that
SoImagedoes not cast a shadow (SoShadowGroup).Shape Antialiasing type is
SoShape.POINTS.File format/default:
Image {
filename " " image 0 0 0 horAlignment LEFT vertAlignment BOTTOM width -1 height -1 Action behavior:
SoGLRenderAction
Draws the image parallel to the screen.SoRayPickAction
Picks the image based on the current transformation and view.SoGetPrimitiveCountAction
Increments the number of images by 1.- See Also:
SoFullSceneAntialiasing,SoMarkerSet,SoTexture2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSoImage.FileTypesFile type.static classSoImage.HorAlignmentsHorizontal alignment.static classSoImage.VertAlignmentsVertical alignment.-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoShape
SoShape.ShapeTypes
-
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 SoSFFilePathStringfilenameNames file from which to read image.SoSFInt32heightHeight of image in pixels (optional).SoSFEnum<SoImage.HorAlignments>horAlignmentHorizontal alignment.SoSFImageimageContains an in-memory representation of the image.SoSFEnum<SoImage.VertAlignments>vertAlignmentVertical alignment.SoSFInt32widthWidth of image in pixels (optional).-
Fields inherited from class com.openinventor.inventor.nodes.SoShape
boundingBoxIgnoring
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoImage()Constructor.
-
Method Summary
-
Methods inherited from class com.openinventor.inventor.nodes.SoShape
getShapeType, isPrimitiveRestartAvailable, isPrimitiveRestartAvailable
-
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
-
filename
public final SoSFFilePathString filename
Names file from which to read image. The standard image file formats are supported. SeeSoRasterImageRWfor the list. If the filename is not an absolute path name, the list of directories maintained bySoInputis searched. If the texture is not found in any of those directories, then the file is searched for relative to the directory from which theSoImagenode was read. For example, if anSoImagenode with a filename of "../tofu.rgb" is read from /usr/people/bob/models/food.iv, then /usr/people/bob/tofu.rgb will be read (assuming tofu.rgb isn't found in the directories maintained bySoInput).
-
image
public final SoSFImage image
Contains an in-memory representation of the image. It is either the contents of the file read from filename, an image read directly from an Open Inventor file, or an image set programmatically using the methods provided bySoSFImage.
-
horAlignment
public final SoSFEnum<SoImage.HorAlignments> horAlignment
Horizontal alignment. For example, if the image is RIGHT BOTTOM justified, the bottom right-hand corner of the image is placed at the justification point. . Default is LEFT.
-
vertAlignment
public final SoSFEnum<SoImage.VertAlignments> vertAlignment
Vertical alignment. For example, if the image is RIGHT BOTTOM justified, the bottom right-hand corner of the image is placed at the justification point. . Default is BOTTOM.
-
width
public final SoSFInt32 width
Width of image in pixels (optional). By default (or when the width and height fields are both set to negative values), the actual size of the image is used. If the width and/or height are specified, the image is scaled to the specified size in pixels.
-
height
public final SoSFInt32 height
Height of image in pixels (optional). By default (or when the width and height fields are both set to negative values), the actual size of the image is used. If the width and/or height are specified, the image is scaled to the specified size in pixels.
-
-