00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author(s) : VSG (oct 2011) 00022 **=======================================================================*/ 00023 00024 #ifndef _SO_MULTI_SWITCH_ 00025 #define _SO_MULTI_SWITCH_ 00026 00027 #include <Inventor/fields/SoMFInt32.h> 00028 #include <Inventor/fields/SoSFEnum.h> 00029 #include <Inventor/nodes/SoGroup.h> 00030 00082 class SoMultiSwitch : public SoGroup 00083 { 00084 00085 SO_NODE_HEADER(SoMultiSwitch); 00086 00087 public: 00089 SoMFInt32 whichChildren; 00090 00092 enum TraversalMode 00093 { 00095 NONE = 0, 00097 ALL = 1, 00099 INCLUDE = 2, 00101 EXCLUDE = 3 00102 }; 00103 00108 SoSFEnum traversalMode; 00109 00111 enum InheritMode 00112 { 00114 NO = 1 << 0, 00116 MODE = 1 << 1, 00118 LIST = 1 << 2, 00120 ANY = MODE | LIST 00121 }; 00122 00127 SoSFEnum inheritMode; 00128 00132 SoMultiSwitch(); 00133 00137 SoMultiSwitch(int nChildren); 00138 00143 virtual SbBool affectsState() const; 00144 00145 private: 00146 // Implement actions 00147 virtual void doAction(SoAction *action); 00148 virtual void callback(SoCallbackAction *action); 00149 virtual void GLRender(SoGLRenderAction *action); 00150 virtual void pick(SoPickAction *action); 00151 virtual void getBoundingBox(SoGetBoundingBoxAction *action); 00152 virtual void handleEvent(SoHandleEventAction *action); 00153 virtual void getMatrix(SoGetMatrixAction *action); 00154 virtual void search(SoSearchAction *action); 00155 virtual void write(SoWriteAction *action); 00156 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action); 00157 00158 private: 00159 static void initClass(); 00160 static void exitClass(); 00161 00162 virtual void notify(SoNotList *list); 00163 00169 virtual bool affectsPath() const; 00170 00171 private: 00173 virtual ~SoMultiSwitch(); 00174 00175 // Traverses correct child. If matchIndex >=0, child index must match 00176 virtual void doChild(SoAction *action, int matchIndex = -1); 00177 }; 00178 00179 #endif // _SO_MULTI_SWITCH_ 00180 00181 00182