Displays an image that always faces the camera. More...
#include <Inventor/nodes/SoImage.h>
Public Types | |
enum | HorAlignment { LEFT, CENTER, RIGHT } |
enum | VertAlignment { BOTTOM, HALF, TOP } |
enum | FileType { UNKNOWN = SoTexture::UNKNOWN, RGB = SoTexture::RGB, SGI = SoTexture::SGI, TIFF = SoTexture::TIFF, GIF = SoTexture::GIF, JPEG = SoTexture::JPEG, BMP = SoTexture::BMP, PNG = SoTexture::PNG, JPEG2000 = SoTexture::JPEG2000, PGX = SoTexture::PGX, PNM = SoTexture::PNM, RAS = SoTexture::RAS, DDS = SoTexture::DDS, HDRI = SoTexture::HDRI, NUM_FILETYPES } |
Public Member Functions | |
virtual SoType | getTypeId () const |
SoImage () | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoSFFilePathString | filename |
SoSFImage | image |
SoSFEnum | horAlignment |
SoSFEnum | vertAlignment |
SoSFInt32 | width |
SoSFInt32 | height |
The SoImage node 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 filename field. Once the image has been read, the image field 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 the filename field to an empty string ("").
Images can also be specified in memory by setting the image field 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 SoImage automatically enables OpenGL blending for 2 or 4 component images, but it does not set the blending function. However, if you have enabled non-screendoor 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. SoImage nodes prohibit auto-caching, so that no SoSeparator (or other render caching node) above an SoImage in 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 different SoSeparator.
Shape Antialiasing type is SoShape::POINTS.
Note: SoImage does not cast or receive shadows (see SoShadowGroup).
filename | " " |
image | 0 0 0 |
horAlignment | LEFT |
vertAlignment | BOTTOM |
width | -1 |
height | -1 |
SoRayPickAction
Picks the image based on the current transformation and view.
SoGetPrimitiveCountAction
Increments the number of images by 1.
SoFullSceneAntialiasing, SoMarkerSet, SoTexture2
enum SoImage::FileType |
File type.
SoImage::SoImage | ( | ) |
Constructor.
static SoType SoImage::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoShape.
virtual SoType SoImage::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoShape.
Names file from which to read image.
The standard image file formats are supported. See SoRasterImageRW for the list. If the filename is not an absolute path name, the list of directories maintained by SoInput is searched. If the texture is not found in any of those directories, then the file is searched for relative to the directory from which the SoImage node was read. For example, if an SoImage node 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 by SoInput).
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.
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. Use enum HorAlignment. Default is LEFT.
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 by SoSFImage.
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. Use enum VertAlignment. Default is BOTTOM.
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.