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

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

Generated on Tue Jan 28 2020 for Coin by Doxygen 1.8.17.