Coin Logo http://www.sim.no/
http://www.coin3d.org/

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
34class SoSensor;
35class SoFieldSensor;
36class SbImage;
37
38class COIN_DLL_API SoImage : public SoShape {
39 typedef SoShape inherited;
40
42
43public:
44 static void initClass(void);
45 SoImage(void);
46
52
56 RIGHT
57 };
58
65
66 virtual void GLRender(SoGLRenderAction * action);
67 virtual void rayPick(SoRayPickAction * action);
68 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
69
70protected:
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
81private:
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
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.
Definition SbBox3f.h:37
The SbImage class is an abstract datatype for 2D and 3D images.
Definition SbImage.h:37
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition SbVec2s.h:41
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:40
The SoAction class is the base class for all traversal actions.
Definition SoAction.h:68
The SoFieldSensor class detects changes to a field.
Definition SoFieldSensor.h:29
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition SoGLRenderAction.h:41
The SoGetPrimitiveCountAction class counts the primitives in a scene.
Definition SoGetPrimitiveCountAction.h:34
The SoImage class draws a 2D image on the viewport.
Definition SoImage.h:38
SoSFImage image
Definition SoImage.h:63
VertAlignment
Definition SoImage.h:47
@ HALF
Definition SoImage.h:49
@ BOTTOM
Definition SoImage.h:48
SoSFInt32 height
Definition SoImage.h:60
SoSFString filename
Definition SoImage.h:64
SoSFEnum horAlignment
Definition SoImage.h:62
HorAlignment
Definition SoImage.h:53
@ LEFT
Definition SoImage.h:54
@ CENTER
Definition SoImage.h:55
SoSFInt32 width
Definition SoImage.h:59
SoSFEnum vertAlignment
Definition SoImage.h:61
The SoInput class is an abstraction of file import functionality.
Definition SoInput.h:52
virtual SbBool readInstance(SoInput *in, unsigned short flags)
Definition SoNode.cpp:1466
The SoNotList class is a list of SoNotRec notification records.
Definition SoNotification.h:34
The SoRayPickAction class does ray intersection with scene graphs.
Definition SoRayPickAction.h:41
The SoSFEnum class is a container for an enum value.
Definition SoSFEnum.h:31
The SoSFImage class is used to store pixel images.
Definition SoSFImage.h:33
The SoSFInt32 class is a container for a 32-bit integer value.
Definition SoSFInt32.h:30
The SoSFString class is a container for an SbString.
Definition SoSFString.h:31
The SoSensor class is the abstract base class for all sensors.
Definition SoSensor.h:34
The SoShape class is the superclass for geometry shapes.
Definition SoShape.h:43
virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action)
Definition SoShape.cpp:1344
virtual void generatePrimitives(SoAction *action)=0
virtual void notify(SoNotList *nl)
Definition SoShape.cpp:1416
virtual void GLRender(SoGLRenderAction *action)
Definition SoShape.cpp:392
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)=0
virtual void rayPick(SoRayPickAction *action)
Definition SoShape.cpp:445
The SoState class manages the Coin scenegraph traversal state data.
Definition SoState.h:35
#define SO_NODE_HEADER(classname)
Definition macros.dox:43

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

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.