Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoROIElement.h
Go to the documentation of this file.
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_ROI_ELEMENT_
26#define _SO_ROI_ELEMENT_
27
29#include <Inventor/SbBox.h>
30#include <LDM/SoLDM.h>
31
32class SoROI;
33
38{
40
41public:
42
44 virtual void push(SoState* state);
45
46 // Sets/Gets the current volume data attributes in the state
47 static void set(SoState* state, SoNode *node, SoROI *ROINode);
48 static void get(SoState* state, SoROI *&ROINode);
49
54 static SoROI* get(SoState* state, int dataSetId = 0);
55
56 // Default values
57 static void getDefault(SoROI *&ROINode);
58
59private:
60
62 virtual void init(SoState* state);
63
65 virtual SbBool matches(const SoElement* elt) const;
66
68 virtual SoElement* copyMatchInfo() const;
69
70private:
71 // Initializes the SoVolumeData class
72 static void initClass();
73 static void exitClass();
74
75private:
76 virtual void setElt( SoROI *ROINode );
77
78 virtual ~SoROIElement() ;
79
80private:
81 // Set copy constructor as private to avoid automatic public one
83 {}
84
85 SoROI* findROIById(const SoLDM::DataSetIdPairList& idPairList, int dataSetId) const;
86
87 struct Parameters
88 {
89 Parameters();
90 Parameters(const Parameters& other);
91 Parameters(SoROI* roi);
92
93 Parameters& operator=(const Parameters& other);
94 bool operator==(const Parameters& other) const;
95
96 SoROI* ROINode;
97 SbBox3i32 box;
98 int flags;
99 SbBox3i32 subVolume;
100 SbBool relative;
101 };
102
103 std::map<int, Parameters> m_params;
104 int m_lastId;
105 static const Parameters defaultParams;
106};
107
108#endif // _SO_ROI_ELEMENT_
109
110
static void init()
#define SO_ELEMENT_HEADER(className)
valueRef operator=(valueRef newValue)
Sets this field to newValue.
Definition SoSubField.h:242
int operator==(const className &f) const
Returns TRUE if otherField is of the same type and has the same value as this field.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
Definition SbBox.h:96
Abstract base class for all state elements.
Definition SoElement.h:102
Abstract base class for all database nodes.
Definition SoNode.h:145
static SoROI * get(SoState *state, int dataSetId=0)
Returns the last traversed ROI with the given ID.
virtual void push(SoState *state)
Overrides push() method to copy values from next instance in the stack.
static void getDefault(SoROI *&ROINode)
static void get(SoState *state, SoROI *&ROINode)
static void set(SoState *state, SoNode *node, SoROI *ROINode)
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Region o...
Definition SoROI.h:320
Abstract base class for each state element whose value is replaced whenever it is set.
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87
std::vector< DataSetIdPair > DataSetIdPairList
List of DataSetIdPair.
Definition SoLDM.h:76