Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoTransferFunctionElement.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2024 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : P. ESTRADE (Mar 2000)
22**=======================================================================*/
23
24
25#ifndef _SO_TRANSFER_FUNCTION_ELEMENT_
26#define _SO_TRANSFER_FUNCTION_ELEMENT_
27
28#ifdef _MSC_VER
29#pragma warning( push )
30#pragma warning(disable:4251)
31#endif
32
33#include <Inventor/nodes/SoShaderParameter.h>
34
35#include <Inventor/elements/SoAccumulatedElement.h>
36
37#include <Inventor/STL/vector>
38#include <Inventor/STL/map>
39
42
46SoEXTENDER_Documented class SoTransferFunctionElement : public SoAccumulatedElement {
47 SO_ELEMENT_HEADER( SoTransferFunctionElement );
48
49public:
50
52 static void set(SoState* state, SoNode *node, SoTransferFunction *m_transferFunctionNode);
53 static void get(SoState* state, SoTransferFunction *&m_transferFunctionNode);
54
56 static void get(SoState* state, std::vector<SoTransferFunction*>&);
57
59 static void getDefault(SoTransferFunction *&m_transferFunctionNode);
60
63
64 // Overrides push() method to copy values from next instance in the stack
65 virtual void push(SoState *state) ;
66
67private:
68
70 virtual void init(SoState* state);
71
72private:
73 typedef std::vector<SoTransferFunction*> TransferFunctionVector;
74 typedef TransferFunctionVector::iterator TransferFunctionVectorIt;
75 typedef std::map<int, SoTransferFunction*> TransferFunctionMap;
76
77 // Initializes the SoVolumeData class
78 static void initClass();
79 static void exitClass();
80
81 //Get the current list of transfer function stored in the state
82 static void get(SoState* state, TransferFunctionMap& tfMap);
83
85 static bool idEqual(SoTransferFunction* tf, short id);
86
88 static int getMinTransferFunctionId(SoState* state);
90 static int getMaxTransferFunctionId(SoState* state);
91
93 static SoTransferFunction* get(SoState* state, int transferFunctionId);
94
95private:
96 //List of transfer function.
97 //Each transfer function is stored at tf->transferFunctionId entry in this array
98 //If transferFunctionId are different, transfer functions are accumulated else replaced
99 TransferFunctionMap m_transferFunctionList;
100
101 SoTransferFunction *m_transferFunctionNode;
102 int m_minTfId;
103 int m_maxTfId;
104
105 virtual void setElt( SoTransferFunction *m_transferFunctionNode );
106
108};
109
110#ifdef _MSC_VER
111#pragma warning( pop )
112#endif
113
114#endif // _SO_TRANSFER_FUNCTION_ELEMENT_
115
116
Abstract base class for each state element whose value may be accumulated when it is set.
Renders a scene graph using Open Inventor's Render Engine.
Abstract base class for all database nodes.
Definition SoNode.h:145
Traversal state.
Definition SoState.h:74
virtual void push(SoState *state)
Pushes element.
static void get(SoState *state, std::vector< SoTransferFunction * > &)
Get the current list of transfer function stored in the state.
static void set(SoState *state, SoNode *node, SoTransferFunction *m_transferFunctionNode)
Sets/Gets the current volume data attributes in the state.
static void getDefault(SoTransferFunction *&m_transferFunctionNode)
Default values.
static void get(SoState *state, SoTransferFunction *&m_transferFunctionNode)
static SbBool hasTransparency(SoState *state)
returns true if one (at least) accumulated transferFuncion contains a transparency
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Describe...
int SbBool
Boolean type.
Definition SbBase.h:87