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 
34 class SoSensor;
35 class SoFieldSensor;
36 class SbImage;
37 
38 class COIN_DLL_API SoImage : public SoShape {
39  typedef SoShape inherited;
40 
42 
43 public:
44  static void initClass(void);
45  SoImage(void);
46 
50  TOP
51  };
52 
53  enum HorAlignment {
56  RIGHT
57  };
58 
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
The SoBase class is the top-level superclass for a number of class-hierarchies.SoBase provides the ba...
Definition: SoBase.h:36
Definition: SoImage.h:54
The SoRayPickAction class does ray intersection with scene graphs.For interaction with the scene grap...
Definition: SoRayPickAction.h:41
#define SO_NODE_HEADER(classname)
Definition: SoImage.h:55
virtual void GLRender(SoGLRenderAction *action)
Definition: SoShape.cpp:392
SoSFInt32 height
Definition: SoImage.h:60
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.This box abstraction class ...
Definition: SbBox3f.h:37
SoSFInt32 width
Definition: SoImage.h:59
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
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
SoSFEnum horAlignment
Definition: SoImage.h:62
Definition: SoImage.h:48
The SoState class manages the Coin scenegraph traversal state data.The SoState class is used by actio...
Definition: SoState.h:35
The SoSFInt32 class is a container for a 32-bit integer value.This field is used where nodes...
Definition: SoSFInt32.h:30
The SoSensor class is the abstract base class for all sensors.Sensors is a mechanism in Coin for sche...
Definition: SoSensor.h:34
virtual SbBool readInstance(SoInput *in, unsigned short flags)
Definition: SoNode.cpp:1466
virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action)
Definition: SoShape.cpp:1344
HorAlignment
Definition: SoImage.h:53
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:68
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
The SoFieldSensor class detects changes to a field.Attach a field to a sensor of this type to put it ...
Definition: SoFieldSensor.h:29
VertAlignment
Definition: SoImage.h:47
virtual void generatePrimitives(SoAction *action)=0
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)=0
The SoGetPrimitiveCountAction class counts the primitives in a scene.Apply this action to a scene if ...
Definition: SoGetPrimitiveCountAction.h:34
The SoSFImage class is used to store pixel images.The SoSFImage class provides storage for inline 2D ...
Definition: SoSFImage.h:33
virtual void notify(SoNotList *nl)
Definition: SoShape.cpp:1416
SoSFEnum vertAlignment
Definition: SoImage.h:61
The SoInput class is an abstraction of file import functionality.This class takes care of most of the...
Definition: SoInput.h:52
The SoShape class is the superclass for geometry shapes.The node types which have actual geometry to ...
Definition: SoShape.h:43
The SbImage class is an abstract datatype for 2D and 3D images.Be aware that this class is an extensi...
Definition: SbImage.h:37
The SoImage class draws a 2D image on the viewport.An image can be specified either by using the imag...
Definition: SoImage.h:38
The SoNotList class is a list of SoNotRec notification records.
Definition: SoNotification.h:34
SoSFString filename
Definition: SoImage.h:64
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:41
Definition: SoImage.h:49
SoSFImage image
Definition: SoImage.h:63
virtual void rayPick(SoRayPickAction *action)
Definition: SoShape.cpp:445
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.

Generated on Wed Feb 7 2018 for Coin by Doxygen 1.8.14.