00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _SO_LOGIC_OPERATION_ELEMENT_H
00028 #define _SO_LOGIC_OPERATION_ELEMENT_H
00029
00030 #include <Inventor/elements/SoElement.h>
00031 #include <Inventor/elements/SoSubElement.h>
00032 #include <Inventor/SbEnums.h>
00033
00046 class SoLogicOperationElement : public SoElement
00047 {
00048 SO_ELEMENT_HEADER( SoLogicOperationElement );
00049
00050 public:
00054 enum LogicOperation
00055 {
00056 NOOP = SbEnums::LOGIC_OP_NOOP,
00057 CLEAR = SbEnums::LOGIC_OP_CLEAR,
00058 SET = SbEnums::LOGIC_OP_SET,
00059 COPY = SbEnums::LOGIC_OP_COPY,
00060 COPY_INVERTED = SbEnums::LOGIC_OP_COPY_INVERTED,
00061 INVERT = SbEnums::LOGIC_OP_INVERT,
00062 AND = SbEnums::LOGIC_OP_AND,
00063 NAND = SbEnums::LOGIC_OP_NAND,
00064 AND_REVERSE = SbEnums::LOGIC_OP_AND_REVERSE,
00065 AND_INVERTED = SbEnums::LOGIC_OP_AND_INVERTED,
00066 OR = SbEnums::LOGIC_OP_OR,
00067 NOR = SbEnums::LOGIC_OP_NOR,
00068 XOR = SbEnums::LOGIC_OP_XOR,
00069 OR_REVERSE = SbEnums::LOGIC_OP_OR_REVERSE,
00070 OR_INVERTED = SbEnums::LOGIC_OP_OR_INVERTED,
00071 EQUIV = SbEnums::LOGIC_OP_EQUIV,
00072 };
00073
00074
00075
00082 static void set( SoState* state, bool enable, LogicOperation operation );
00083
00090 static void get( SoState* state, bool& enabled, LogicOperation& operation );
00091
00095 virtual void print( FILE* fp ) const;
00096
00100 virtual void push( SoState* state );
00101
00105 virtual void pop( SoState* state, const SoElement* prevTopElement );
00106
00107 private:
00108 ~SoLogicOperationElement();
00109
00111 virtual void init( SoState* state );
00112
00116 virtual SbBool matches( const SoElement* element ) const;
00117
00121 virtual SoElement* copyMatchInfo() const;
00122
00123 private:
00124
00126 static void initClass();
00127
00129 static void exitClass();
00130
00131 virtual void setElt( const bool enable, const LogicOperation operation );
00132
00133 private:
00134 bool m_enabled;
00135 LogicOperation m_operation;
00136 };
00137
00138 #endif // _SO_LOGIC_OPERATION_ELEMENT_H
00139