SIMVoleon: SoTransferFunction.h Source File

| Coin3D is Free Software, published under the BSD 3-clause license. | https://bitbucket.org/Coin3D/ http://www.kongsberg.com/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 {
45 typedef SoVolumeRendering inherited;
46
47 SO_NODE_HEADER(SoTransferFunction);
48
49public:
50 static void initClass(void);
51 SoTransferFunction(void);
52
53 enum PredefColorMap {
54 NONE = 0,
55 GREY,
56 GRAY = GREY,
57 TEMPERATURE,
58 PHYSICS,
59 STANDARD,
60 GLOW,
61 BLUE_RED,
62 SEISMIC
63 };
64
65 enum ColorMapType {
66 ALPHA,
67 LUM_ALPHA,
68 RGBA
69 };
70
71 SoSFInt32 shift;
72 SoSFInt32 offset;
73 SoSFEnum predefColorMap;
74 SoSFEnum colorMapType;
75 SoMFFloat colorMap;
76
77 void reMap(int low, int high);
78 SbBool hasTransparency(void) const;
79
80protected:
81 ~SoTransferFunction();
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
88private:
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
SoTransferFunction::ColorMapType
ColorMapType
Definition SoTransferFunction.h:65
SoTransferFunction::ALPHA
@ ALPHA
Definition SoTransferFunction.h:66
SoTransferFunction::RGBA
@ RGBA
Definition SoTransferFunction.h:68
SoTransferFunction::LUM_ALPHA
@ LUM_ALPHA
Definition SoTransferFunction.h:67
SoTransferFunction::colorMapType
SoSFEnum colorMapType
Definition SoTransferFunction.h:74
SoTransferFunction::PredefColorMap
PredefColorMap
Definition SoTransferFunction.h:53
SoTransferFunction::NONE
@ NONE
Definition SoTransferFunction.h:54
SoTransferFunction::TEMPERATURE
@ TEMPERATURE
Definition SoTransferFunction.h:57
SoTransferFunction::STANDARD
@ STANDARD
Definition SoTransferFunction.h:59
SoTransferFunction::GLOW
@ GLOW
Definition SoTransferFunction.h:60
SoTransferFunction::GRAY
@ GRAY
Definition SoTransferFunction.h:56
SoTransferFunction::BLUE_RED
@ BLUE_RED
Definition SoTransferFunction.h:61
SoTransferFunction::SEISMIC
@ SEISMIC
Definition SoTransferFunction.h:62
SoTransferFunction::PHYSICS
@ PHYSICS
Definition SoTransferFunction.h:58
SoTransferFunction::GREY
@ GREY
Definition SoTransferFunction.h:55
SoTransferFunction::colorMap
SoMFFloat colorMap
Definition SoTransferFunction.h:75
SoTransferFunction::predefColorMap
SoSFEnum predefColorMap
Definition SoTransferFunction.h:73
SoTransferFunction::shift
SoSFInt32 shift
Definition SoTransferFunction.h:71
SoTransferFunction::offset
SoSFInt32 offset
Definition SoTransferFunction.h:72
SoTransferFunction::reMap
void reMap(int low, int high)
Definition TransferFunction.cpp:352
SoVolumeRendering::initClass
static void initClass(void)
Definition VolumeRendering.cpp:370