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-2019 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 00031 SO_PIMPL_PUBLIC_DECLARATION( SoMultiSwitch ) 00032 00033 00083 class SoMultiSwitch : public SoGroup 00084 { 00085 00086 SO_NODE_HEADER(SoMultiSwitch); 00087 SO_PIMPL_PUBLIC_HEADER(SoMultiSwitch) 00088 00089 public: 00091 SoMFInt32 whichChildren; 00092 00094 enum TraversalMode 00095 { 00097 NONE = 0, 00099 ALL = 1, 00101 INCLUDE = 2, 00103 EXCLUDE = 3 00104 }; 00105 00110 SoSFEnum traversalMode; 00111 00113 enum InheritMode 00114 { 00116 NO = 1 << 0, 00118 MODE = 1 << 1, 00120 LIST = 1 << 2, 00122 ANY = MODE | LIST 00123 }; 00124 00129 SoSFEnum inheritMode; 00130 00134 SoMultiSwitch(); 00135 00139 SoMultiSwitch(int nChildren); 00140 00145 virtual SbBool affectsState() const; 00146 00147 private: 00148 // Implement actions 00149 virtual void doAction(SoAction *action); 00150 virtual void callback(SoCallbackAction *action); 00151 virtual void GLRender(SoGLRenderAction *action); 00152 virtual void pick(SoPickAction *action); 00153 virtual void getBoundingBox(SoGetBoundingBoxAction *action); 00154 virtual void handleEvent(SoHandleEventAction *action); 00155 virtual void getMatrix(SoGetMatrixAction *action); 00156 virtual void search(SoSearchAction *action); 00157 virtual void write(SoWriteAction *action); 00158 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action); 00159 00160 private: 00161 static void initClass(); 00162 static void exitClass(); 00163 00164 virtual void notify(SoNotList *list); 00165 00171 virtual bool affectsPath() const; 00172 00173 private: 00175 virtual ~SoMultiSwitch(); 00176 00177 // Traverses correct child. If matchIndex >=0, child index must match 00178 virtual void doChild(SoAction *action, int matchIndex = -1); 00179 00180 private: 00181 void commonConstructor(int nbChildren = -1); 00182 }; 00183 00184 #endif // _SO_MULTI_SWITCH_ 00185 00186 00187