![]() |
http://www.sim.no http://www.coin3d.org |
The SoImage class draws a 2D image on the viewport. More...
#include <Inventor/nodes/SoImage.h>
Public Types | |
enum | VertAlignment { BOTTOM , HALF , TOP } |
enum | HorAlignment { LEFT , CENTER , RIGHT } |
![]() | |
enum | TriangleShape { TRIANGLE_STRIP , TRIANGLE_FAN , TRIANGLES , POLYGON , QUADS , QUAD_STRIP , POINTS , LINES , LINE_STRIP } |
![]() | |
enum | NodeType { INVENTOR = 0x0000 , VRML1 = 0x0001 , VRML2 = 0x0002 , INVENTOR_1 = 0x0004 , INVENTOR_2_0 = 0x0008 , INVENTOR_2_1 = 0x0010 , INVENTOR_2_5 = 0x0020 , INVENTOR_2_6 = 0x0040 , COIN_1_0 = 0x0080 , COIN_2_0 = 0x0100 , EXTENSION = 0x0200 , COIN_2_2 = 0x0400 , COIN_2_3 = 0x0800 , COIN_2_4 = 0x1000 , INVENTOR_5_0 = 0x2000 , COIN_2_5 = 0x4000 } |
Public Attributes | |
SoSFInt32 | width |
SoSFInt32 | height |
SoSFEnum | vertAlignment |
SoSFEnum | horAlignment |
SoSFImage | image |
SoSFString | filename |
Static Protected Member Functions | |
static const SoFieldData ** | getFieldDataPtr (void) |
![]() | |
static const SoFieldData ** | getFieldDataPtr (void) |
![]() | |
static const SoFieldData ** | getFieldDataPtr (void) |
static void | setNextActionMethodIndex (int index) |
static int | getNextActionMethodIndex (void) |
static void | incNextActionMethodIndex (void) |
static void | setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask) |
![]() | |
static uint32_t | getCurrentWriteCounter (void) |
static void | staticDataLock (void) |
static void | staticDataUnlock (void) |
Additional Inherited Members | |
![]() | |
enum | BaseFlags { IS_ENGINE = 0x01 , IS_GROUP = 0x02 } |
![]() | |
uint32_t | uniqueId |
![]() | |
SbBool | isBuiltIn |
![]() | |
static uint32_t | nextUniqueId = 0 |
static int | nextActionMethodIndex = 0 |
The SoImage class draws a 2D image on the viewport.
An image can be specified either by using the image field, or by specifying a filename. If width and or height is specified, the image will be resized to match those values before it is displayed.
The current modelview matrix will be used to find the viewport position, and the image is rendered in that position, with z-buffer testing activated.
Here's a simple, stand-alone example on how to set up and show an SoImage:
Note that an SoImage node in the scene graph will have it's positioning / rendering influenced by the current viewport and camera. This has important implications for how to layout your scene graph for the best possible rendering performance. See the note about this issue in the SoText2 class documentation.
SoScale nodes can not be used to influence the dimensions of the rendering output of SoImage nodes.
FILE FORMAT/DEFAULTS:
SoImage::SoImage | ( | void | ) |
|
protectedvirtual |
Destructor.
Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and "downward" casting.
Usage example:
For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.
For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.
Reimplemented from SoShape.
|
protectedvirtual |
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL
.
Reimplemented from SoShape.
|
virtual |
Action method for the SoGLRenderAction.
This is called during rendering traversals. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method.
Reimplemented from SoShape.
References BOTTOM, CENTER, SoAction::getState(), SoSFImage::getValue(), HALF, SoGLRenderAction::handleTransparency(), horAlignment, image, LEFT, SoDebugError::post(), RIGHT, SbList< Type >::SbList(), SoShape::shouldGLRender(), TOP, and vertAlignment.
|
virtual |
Calculates picked point based on primitives generated by subclasses.
Reimplemented from SoShape.
References SoRayPickAction::addIntersection(), SoShape::computeObjectSpaceRay(), SoAction::getState(), SoRayPickAction::intersect(), SoRayPickAction::isBetweenPlanes(), and SoShape::shouldRayPick().
|
virtual |
Action method for the SoGetPrimitiveCountAction.
Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the action.
Nodes influencing how geometry nodes calculates their primitive count also overrides this method to change the relevant state variables.
Reimplemented from SoShape.
References SoGetPrimitiveCountAction::incNumImage(), and SoShape::shouldPrimitiveCount().
Will generate a textured quad, representing the image in 3D.
Implements SoShape.
References SoShape::beginShape(), SoShape::endShape(), SoAction::getState(), SoState::pop(), SoState::push(), SoPrimitiveVertex::setNormal(), SoPrimitiveVertex::setPoint(), SoPrimitiveVertex::setTextureCoords(), and SoShape::shapeVertex().
Implemented by SoShape subclasses to let the SoShape superclass know the exact size and weighted center point of the shape's bounding box.
The bounding box and center point should be calculated and returned in the local coordinate system.
The method implements action behavior for shape nodes for SoGetBoundingBoxAction. It is invoked from SoShape::getBoundingBox(). (Subclasses should not override SoNode::getBoundingBox().)
The box parameter sent in is guaranteed to be an empty box, while center is undefined upon function entry.
Implements SoShape.
References SoAction::getState().
This method is mainly intended for internal use during file import operations.
It reads a definition of an instance from the input stream in. The input stream state points to the start of a serialized / persistant representation of an instance of this class type.
TRUE
or FALSE
is returned, depending on if the instantiation and configuration of the new object of this class type went ok or not. The import process should be robust and handle corrupted input streams by returning FALSE
.
flags is used internally during binary import when reading user extension nodes, group nodes or engines.
Reimplemented from SoNode.
References filename, SoField::isDefault(), SoReadError::post(), SoFieldContainer::readInstance(), and setReadStatus().
Notifies all auditors for this instance when changes are made.
Reimplemented from SoShape.
References filename, SoNotList::getLastField(), height, image, SoShape::notify(), SoField::setDefault(), and width.
|
protected |
Returns TRUE if node was read ok.
|
protected |
Set read status for this node.
Referenced by readInstance().
SoSFInt32 SoImage::width |
SoSFInt32 SoImage::height |
SoSFEnum SoImage::vertAlignment |
Vertical alignment. Default value is SoImage::BOTTOM.
Referenced by GLRender(), and SoImage().
SoSFEnum SoImage::horAlignment |
Horizontal alignment. Default value is SoImage::LEFT.
Referenced by GLRender(), and SoImage().
SoSFImage SoImage::image |
Inline image data. Default empty.
Referenced by GLRender(), notify(), and SoImage().
SoSFString SoImage::filename |
Image filename. Default empty.
Referenced by notify(), readInstance(), and SoImage().
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Wed Jul 19 2023 for Coin by Doxygen. 1.9.8