Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://coin3d.github.io
https://www.kongsberg.com/en/kogt/
SoTransferFunction.h
1 #ifndef COIN_SOTRANSFERFUNCTION_H
2 #define COIN_SOTRANSFERFUNCTION_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
36 #include <VolumeViz/nodes/SoVolumeRendering.h>
37 #include <Inventor/fields/SoMFFloat.h>
38 #include <Inventor/fields/SoSFEnum.h>
39 #include <Inventor/fields/SoSFInt32.h>
40 #include <Inventor/fields/SoSFUInt32.h>
41 
42 // *************************************************************************
43 
44 class SIMVOLEON_DLL_API SoTransferFunction : public SoVolumeRendering {
46 
48 
49 public:
50  static void initClass(void);
51  SoTransferFunction(void);
52 
54  NONE = 0,
56  GRAY = GREY,
62  SEISMIC
63  };
64 
65  enum ColorMapType {
68  RGBA
69  };
70 
76 
77  void reMap(int low, int high);
78  SbBool hasTransparency(void) const;
79 
80 protected:
82 
83  virtual void doAction(SoAction * action);
84  virtual void GLRender(SoGLRenderAction * action);
85  virtual void callback(SoCallbackAction * action);
86  virtual void pick(SoPickAction * action);
87 
88 private:
89  // These were added to make it possible to control the narrowing of
90  // the transfer function from the iv-file. They provide the same
91  // functionality as the reMap() function.
92  //
93  // These are "unofficial", private fields, as they are not available
94  // in TGS VolumeViz, which we want to stay compatible with.
95  SoSFUInt32 remapLow;
96  SoSFUInt32 remapHigh;
97 
98  friend class SoTransferFunctionP;
99  class SoTransferFunctionP * pimpl;
100 };
101 
102 // *************************************************************************
103 
104 #endif // !COIN_SOTRANSFERFUNCTION_H
Definition: SoTransferFunction.h:55
Definition: SoTransferFunction.h:67
#define SO_NODE_HEADER(classname)
SoSFEnum colorMapType
Definition: SoTransferFunction.h:74
Definition: SoTransferFunction.h:58
Definition: SoTransferFunction.h:57
static void initClass(void)
Definition: VolumeRendering.cpp:373
Definition: SoTransferFunction.h:60
Abstract base class for all nodes related to volume rendering.
Definition: SoVolumeRendering.h:41
SoSFInt32 shift
Definition: SoTransferFunction.h:71
SoSFInt32 offset
Definition: SoTransferFunction.h:72
virtual void pick(SoPickAction *action)
PredefColorMap
Definition: SoTransferFunction.h:53
Definition: SoTransferFunction.h:66
virtual void doAction(SoAction *action)
Definition: SoTransferFunction.h:59
Contains the transfer function definition.
Definition: SoTransferFunction.h:44
Definition: SoTransferFunction.h:61
SoSFEnum predefColorMap
Definition: SoTransferFunction.h:73
ColorMapType
Definition: SoTransferFunction.h:65
virtual void GLRender(SoGLRenderAction *action)
virtual void callback(SoCallbackAction *action)
SoMFFloat colorMap
Definition: SoTransferFunction.h:75