SoImage.h Source File

| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

SoImage.h
1 #ifndef COIN_SOIMAGE_H
2 #define COIN_SOIMAGE_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/nodes/SoSubNode.h>
28 #include <Inventor/nodes/SoShape.h>
29 #include <Inventor/fields/SoSFInt32.h>
30 #include <Inventor/fields/SoSFEnum.h>
31 #include <Inventor/fields/SoSFImage.h>
32 #include <Inventor/fields/SoSFString.h>
33
34 class SoSensor;
35 class SoFieldSensor;
36 class SbImage;
37
38 class COIN_DLL_API SoImage : public SoShape {
39 typedef SoShape inherited;
40
41 SO_NODE_HEADER(SoImage);
42
43 public:
44 static void initClass(void);
45 SoImage(void);
46
47 enum VertAlignment {
48 BOTTOM,
49 HALF,
50 TOP
51 };
52
53 enum HorAlignment {
54 LEFT,
55 CENTER,
56 RIGHT
57 };
58
59 SoSFInt32 width;
60 SoSFInt32 height;
61 SoSFEnum vertAlignment;
62 SoSFEnum horAlignment;
63 SoSFImage image;
64 SoSFString filename;
65
66 virtual void GLRender(SoGLRenderAction * action);
67 virtual void rayPick(SoRayPickAction * action);
68 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
69
70 protected:
71 virtual ~SoImage();
72
73 virtual void generatePrimitives(SoAction * action);
74 virtual void computeBBox(SoAction * action, SbBox3f & box, SbVec3f & center);
75
76 virtual SbBool readInstance(SoInput * in, unsigned short flags);
77 virtual void notify(SoNotList * list);
78 int getReadStatus(void);
79 void setReadStatus(SbBool flag);
80
81 private:
82 SbVec2s getSize(void) const;
83 static SbVec3f getNilpoint(SoState *state);
84 void getQuad(SoState *state, SbVec3f &v0, SbVec3f &v1,
85 SbVec3f &v2, SbVec3f &v3);
86
87 const unsigned char * getImage(SbVec2s & size, int & nc);
88 SbBool loadFilename(void);
89 SbBool readstatus;
90 SbImage * resizedimage;
91 SbBool resizedimagevalid;
92 class SoFieldSensor * filenamesensor;
93 SbBool transparency;
94 SbBool testtransparency;
95 void testTransparency(void);
96 static void filenameSensorCB(void *, SoSensor *);
97 };
98
99 #endif // !COIN_SOIMAGE_H
SoBase
The SoBase class is the top-level superclass for a number of class-hierarchies.SoBase provides the ba...
Definition: SoBase.h:36
SoImage::LEFT
Definition: SoImage.h:54
SoRayPickAction
The SoRayPickAction class does ray intersection with scene graphs.For interaction with the scene grap...
Definition: SoRayPickAction.h:41
SO_NODE_HEADER
#define SO_NODE_HEADER(classname)
SoImage::CENTER
Definition: SoImage.h:55
SoShape::GLRender
virtual void GLRender(SoGLRenderAction *action)
Definition: SoShape.cpp:392
SoImage::height
SoSFInt32 height
Definition: SoImage.h:60
SbBox3f
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.This box abstraction class ...
Definition: SbBox3f.h:37
SoImage::width
SoSFInt32 width
Definition: SoImage.h:59
SoSFString
The SoSFString class is a container for an SbString.This field is used where nodes, engines or other field containers needs to store a single string.
Definition: SoSFString.h:31
SoSFEnum
The SoSFEnum class is a container for an enum value.This field is used where nodes, engines or other field containers needs to store one particular value out of an enumerated set.
Definition: SoSFEnum.h:31
SoImage::horAlignment
SoSFEnum horAlignment
Definition: SoImage.h:62
SoImage::BOTTOM
Definition: SoImage.h:48
SoState
The SoState class manages the Coin scenegraph traversal state data.The SoState class is used by actio...
Definition: SoState.h:35
SoSFInt32
The SoSFInt32 class is a container for a 32-bit integer value.This field is used where nodes...
Definition: SoSFInt32.h:30
SoSensor
The SoSensor class is the abstract base class for all sensors.Sensors is a mechanism in Coin for sche...
Definition: SoSensor.h:34
SoNode::readInstance
virtual SbBool readInstance(SoInput *in, unsigned short flags)
Definition: SoNode.cpp:1466
SoShape::getPrimitiveCount
virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action)
Definition: SoShape.cpp:1344
SoImage::HorAlignment
HorAlignment
Definition: SoImage.h:53
SoAction
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:68
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
SoFieldSensor
The SoFieldSensor class detects changes to a field.Attach a field to a sensor of this type to put it ...
Definition: SoFieldSensor.h:29
SoImage::VertAlignment
VertAlignment
Definition: SoImage.h:47
SoShape::generatePrimitives
virtual void generatePrimitives(SoAction *action)=0
SoShape::computeBBox
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)=0
SoGetPrimitiveCountAction
The SoGetPrimitiveCountAction class counts the primitives in a scene.Apply this action to a scene if ...
Definition: SoGetPrimitiveCountAction.h:34
SoSFImage
The SoSFImage class is used to store pixel images.The SoSFImage class provides storage for inline 2D ...
Definition: SoSFImage.h:33
SoShape::notify
virtual void notify(SoNotList *nl)
Definition: SoShape.cpp:1416
SoImage::vertAlignment
SoSFEnum vertAlignment
Definition: SoImage.h:61
SoInput
The SoInput class is an abstraction of file import functionality.This class takes care of most of the...
Definition: SoInput.h:52
SoShape
The SoShape class is the superclass for geometry shapes.The node types which have actual geometry to ...
Definition: SoShape.h:43
SbImage
The SbImage class is an abstract datatype for 2D and 3D images.Be aware that this class is an extensi...
Definition: SbImage.h:37
SoImage
The SoImage class draws a 2D image on the viewport.An image can be specified either by using the imag...
Definition: SoImage.h:38
SoNotList
The SoNotList class is a list of SoNotRec notification records.
Definition: SoNotification.h:34
SoImage::filename
SoSFString filename
Definition: SoImage.h:64
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:41
SoImage::HALF
Definition: SoImage.h:49
SoImage::image
SoSFImage image
Definition: SoImage.h:63
SoShape::rayPick
virtual void rayPick(SoRayPickAction *action)
Definition: SoShape.cpp:445
SoGLRenderAction
The SoGLRenderAction class renders the scene graph with OpenGL calls.Applying this method at a root n...
Definition: SoGLRenderAction.h:41

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.