00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _SO_INTERACTIVE_COMPLEXITY_ELEMENT
00024 #define _SO_INTERACTIVE_COMPLEXITY_ELEMENT
00025
00026 #include <Inventor/elements/SoAccumulatedElement.h>
00027 #include <Inventor/STL/vector>
00028
00029 #ifdef _WIN32
00030 #pragma warning(push)
00031 #pragma warning(disable:4251)
00032 #endif
00033
00034 class SoInteractiveComplexity;
00035 class SoSField;
00036 class SoSFBool;
00037 class SoSFEnum;
00038
00051 SoEXTENDER_Documented class SoInteractiveComplexityElement : public SoAccumulatedElement
00052 {
00053 SO_ELEMENT_HEADER(SoInteractiveComplexityElement);
00054
00055 public:
00056
00058 static void set(SoState *state, SoInteractiveComplexity* node);
00059
00061 static double getScalarFieldValue(SoState *state,
00062 const SoSField* field);
00063
00065 static SbBool getBooleanFieldValue(SoState *state, const SoSFBool* field);
00066
00068 static int getEnumFieldValue(SoState *state, const SoSFEnum* field);
00069
00073 virtual void push(SoState *state) ;
00074
00076 virtual void pop(SoState *, const SoElement *prevTopElement) ;
00077
00078 private:
00079
00081 virtual void init(SoState *state);
00082
00083 private:
00084
00085 static void initClass();
00086 static void exitClass();
00087
00089 static double getCurrentScalarFieldValue(const SoSField* field);
00090
00092 static bool isBounded(SoState* state, const SoSField* field);
00093
00095 static const SoInteractiveComplexity* getLast(SoState *state);
00096
00097 private:
00098 typedef std::vector<SoInteractiveComplexity*> ComplexityVector;
00099 typedef ComplexityVector::const_reverse_iterator ComplexityVectorConstRevIt;
00100
00102 SoInteractiveComplexity* findComplexity(const SoSField* field) const;
00103
00105 double getScalarFieldValueInternal(SoState* state, const SoSField* field) const;
00106 SbBool getBooleanFieldValueInternal(SoState* state, const SoSFBool* field) const;
00107 int getEnumFieldValueInternal(SoState* state, const SoSFEnum* field) const;
00108
00109 void setElt(SoState *state, SoInteractiveComplexity* node);
00110
00111 virtual ~SoInteractiveComplexityElement();
00112
00114 ComplexityVector m_nodeList;
00115
00116
00117 size_t m_startIndex;
00118 };
00119
00120 #ifdef _WIN32
00121 #pragma warning(pop)
00122 #endif
00123
00124 #endif
00125
00126
00127