Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoInteractiveComplexityElement.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-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23#ifndef _SO_INTERACTIVE_COMPLEXITY_ELEMENT
24#define _SO_INTERACTIVE_COMPLEXITY_ELEMENT
25
26#include <Inventor/elements/SoAccumulatedElement.h>
27#include <Inventor/STL/vector>
28
29#ifdef _WIN32
30#pragma warning(push)
31#pragma warning(disable:4251)
32#endif
33
35class SoSField;
36class SoSFBool;
37class SoSFEnum;
38
51SoEXTENDER_Documented class SoInteractiveComplexityElement : public SoAccumulatedElement
52{
54
55 public:
56
58 static void set(SoState *state, SoInteractiveComplexity* node);
59
61 static double getScalarFieldValue(SoState *state,
62 const SoSField* field);
63
65 static SbBool getBooleanFieldValue(SoState *state, const SoSFBool* field);
66
68 static int getEnumFieldValue(SoState *state, const SoSFEnum* field);
69
73 virtual void push(SoState *state) ;
74
76 virtual void pop(SoState *, const SoElement *prevTopElement) ;
77
78private:
79
81 virtual void init(SoState *state);
82
83 private:
84 // Initializes the SoInteractiveComplexityElement class
85 static void initClass();
86 static void exitClass();
87
89 static double getCurrentScalarFieldValue(const SoSField* field);
90
92 static bool isBounded(SoState* state, const SoSField* field);
93
95 static const SoInteractiveComplexity* getLast(SoState *state);
96
97 private:
98 typedef std::vector<SoInteractiveComplexity*> ComplexityVector;
99 typedef ComplexityVector::const_reverse_iterator ComplexityVectorConstRevIt;
100
102 SoInteractiveComplexity* findComplexity(const SoSField* field) const;
103
105 double getScalarFieldValueInternal(SoState* state, const SoSField* field) const;
106 SbBool getBooleanFieldValueInternal(SoState* state, const SoSFBool* field) const;
107 int getEnumFieldValueInternal(SoState* state, const SoSFEnum* field) const;
108
109 void setElt(SoState *state, SoInteractiveComplexity* node);
110
112
114 ComplexityVector m_nodeList;
115
116 //Element has been pushed at this point
117 size_t m_startIndex;
118};
119
120#ifdef _WIN32
121#pragma warning(pop)
122#endif
123
124#endif /* _SO_COMPLEXITY_ELEMENT */
125
126
Abstract base class for each state element whose value may be accumulated when it is set.
Abstract base class for all state elements.
Definition SoElement.h:102
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Stores the curre...
static int getEnumFieldValue(SoState *state, const SoSFEnum *field)
Return value of a SoSFEnum.
static SbBool getBooleanFieldValue(SoState *state, const SoSFBool *field)
Return value of a SoSFBool.
static void set(SoState *state, SoInteractiveComplexity *node)
Set the current SoInteractiveComplexity node.
static double getScalarFieldValue(SoState *state, const SoSField *field)
Return value of scalar field as a double.
virtual void pop(SoState *, const SoElement *prevTopElement)
Pop method.
virtual void push(SoState *state)
Overrides push() method to copy values from next instance in the stack.
Field interactive complexity node.
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing an enumerated value.
Definition SoSFEnum.h:89
Abstract base class for all single-value fields.
Definition SoSField.h:93
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87