Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoImage Class Reference

VSG extension Displays an image that always faces the camera. More...

#include <Inventor/nodes/SoImage.h>

+ Inheritance diagram for SoImage:

Public Types

enum  HorAlignment {
  LEFT ,
  CENTER ,
  RIGHT
}
 Horizontal alignment. More...
 
enum  VertAlignment {
  BOTTOM ,
  HALF ,
  TOP
}
 Vertical alignment. More...
 
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 ,
  DDS = SoTexture::DDS ,
  HDRI = SoTexture::HDRI ,
  NUM_FILETYPES
}
 File type. More...
 
- Public Types inherited from SoShape
enum  ShapeType {
  POINTS ,
  LINES ,
  POLYGONS ,
  TEXT
}
 Basic type for antialiased rendering for this shape (Do not consider the SoDrawStyle property currently in the state). More...
 

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoImage ()
 Constructor.
 
- Public Member Functions inherited from SoShape
virtual SbBool affectsState () const
 Overrides default method on SoNode.
 
ShapeType getShapeType ()
 Gets the current shape Full Scene Antialiasing type.
 
- Public Member Functions inherited from SoNode
virtual void setOverride (const SbBool state)
 Turns the override flag on or off.
 
virtual SbBool isOverride () const
 Returns the state of the override flag.
 
virtual SoNodecopy (SbBool copyConnections=FALSE) const
 Creates and returns an exact copy of the node.
 
virtual void touch ()
 Marks an instance as modified, simulating a change to it.
 
- Public Member Functions inherited from SoFieldContainer
void setToDefaults ()
 Sets all fields in this object to their default values.
 
SbBool hasDefaultValues () const
 Returns TRUE if all of the object's fields have their default values.
 
SbBool fieldsAreEqual (const SoFieldContainer *fc) const
 Returns TRUE if this object's fields are exactly equal to fc's fields.
 
void copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE)
 Copies the contents of fc's fields into this object's fields.
 
SoNONUNICODE SbBool set (const char *fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
SbBool set (const SbString &fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
void get (SbString &fieldDataString)
 Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.
 
virtual int getFields (SoFieldList &list) const
 Appends references to all of this object's fields to resultList, and returns the number of fields appended.
 
virtual int getAllFields (SoFieldList &list) const
 Returns a list of fields, including the eventIn's and eventOut's.
 
virtual SoFieldgetField (const SbName &fieldName) const
 Returns a the field of this object whose name is fieldName.
 
virtual SoFieldgetEventIn (const SbName &fieldName) const
 Returns a the eventIn with the given name.
 
virtual SoFieldgetEventOut (const SbName &fieldName) const
 Returns the eventOut with the given name.
 
SbBool getFieldName (const SoField *field, SbName &fieldName) const
 Returns the name of the given field in the fieldName argument.
 
SbBool enableNotify (SbBool flag)
 Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE).
 
SbBool isNotifyEnabled () const
 Notification is the process of telling interested objects that this object has changed.
 
virtual void setUserData (void *data)
 Sets application data.
 
void * getUserData (void) const
 Gets user application data.
 
- Public Member Functions inherited from SoBase
virtual SbName getName () const
 Returns the name of an instance.
 
virtual void setName (const SbName &name)
 Sets the name of an instance.
 
void setSynchronizable (const bool b)
 Sets this to be a ScaleViz synchronizable object.
 
bool isSynchronizable () const
 Gets the ScaleViz synchronizable state of this object.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoShape
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static SbBool isPrimitiveRestartAvailable (SoState *state=NULL)
 Returns TRUE if the primitive restart feature is available.
 
- Static Public Member Functions inherited from SoNode
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static SoNodegetByName (const SbName &name)
 A node's name can be set using SoBase::setName().
 
static int getByName (const SbName &name, SoNodeList &list)
 A node's name can be set using SoBase::setName().
 
- Static Public Member Functions inherited from SoFieldContainer
static SoType getClassTypeId ()
 Returns the type of this class.
 
- Static Public Member Functions inherited from SoBase
static SoType getClassTypeId ()
 Returns type identifier for this class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Public Attributes

SoSFFilePathString filename
 Names file from which to read image.
 
SoSFImage image
 Contains an in-memory representation of the image.
 
SoSFEnum horAlignment
 Horizontal alignment.
 
SoSFEnum vertAlignment
 Vertical alignment.
 
SoSFInt32 width
 Width of image in pixels (optional).
 
SoSFInt32 height
 Height of image in pixels (optional).
 
- Public Attributes inherited from SoShape
SoSFBool boundingBoxIgnoring
 Whether to ignore this node during bounding box traversal.
 

Detailed Description

VSG extension Displays an image that always faces the camera.

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 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. 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.

Note that SoImage does 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

SEE ALSO

SoFullSceneAntialiasing, SoMarkerSet, SoTexture2

Definition at line 122 of file SoImage.h.

Member Enumeration Documentation

◆ FileType

File type.

Enumerator
UNKNOWN 

The file type is unknown.

RGB 

The file type is RGB.

SGI 

The file type is SGI.

TIFF 

The file type is TIFF.

GIF 

The file type is GIF.

JPEG 

The file type is JPEG.

BMP 

The file type is BMP.

PNG 

The file type is PNG.

JPEG2000 

The file type is JPEG2000.

DDS 

The file type is DDS (DirectDraw Surface).

HDRI 

The file type is HDRi (High Dynamic Range).

NUM_FILETYPES 

NUM_FILETYPES.

Definition at line 162 of file SoImage.h.

◆ HorAlignment

Horizontal alignment.

Enumerator
LEFT 

The image is left justified.

CENTER 

The image is center justified.

RIGHT 

The image is right justified.

Definition at line 130 of file SoImage.h.

◆ VertAlignment

Vertical alignment.

Enumerator
BOTTOM 

The image is bottom justified.

HALF 

The image is middle justified.

TOP 

The image is top justified.

Definition at line 146 of file SoImage.h.

Constructor & Destructor Documentation

◆ SoImage()

SoImage::SoImage ( )

Constructor.

Member Function Documentation

◆ getClassTypeId()

static SoType SoImage::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getTypeId()

virtual SoType SoImage::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoShape.

Member Data Documentation

◆ filename

SoSFFilePathString SoImage::filename

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).

Definition at line 224 of file SoImage.h.

◆ height

SoSFInt32 SoImage::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.

Definition at line 265 of file SoImage.h.

◆ horAlignment

SoSFEnum SoImage::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. Use enum HorAlignment. Default is LEFT.

Definition at line 240 of file SoImage.h.

◆ image

SoSFImage SoImage::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 by SoSFImage.

Definition at line 232 of file SoImage.h.

◆ vertAlignment

SoSFEnum SoImage::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. Use enum VertAlignment. Default is BOTTOM.

Definition at line 247 of file SoImage.h.

◆ width

SoSFInt32 SoImage::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.

Definition at line 256 of file SoImage.h.


The documentation for this class was generated from the following file: