00001 /*======================================================================= 00002 * Copyright 1991-1996, Silicon Graphics, Inc. 00003 * ALL RIGHTS RESERVED 00004 * 00005 * UNPUBLISHED -- Rights reserved under the copyright laws of the United 00006 * States. Use of a copyright notice is precautionary only and does not 00007 * imply publication or disclosure. 00008 * 00009 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND: 00010 * Use, duplication or disclosure by the Government is subject to restrictions 00011 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights 00012 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or 00013 * in similar or successor clauses in the FAR, or the DOD or NASA FAR 00014 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc., 00015 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311. 00016 * 00017 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY 00018 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION, 00019 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY 00020 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON 00021 * GRAPHICS, INC. 00022 **=======================================================================*/ 00023 /*======================================================================= 00024 ** Author : Paul S. Strauss (MMM yyyy) 00025 ** Modified by : Nick Thompson (MMM yyyy) 00026 **=======================================================================*/ 00027 /*======================================================================= 00028 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00029 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00030 *** *** 00031 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00032 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00033 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00034 *** *** 00035 *** RESTRICTED RIGHTS LEGEND *** 00036 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00037 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00038 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00039 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00040 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00041 *** *** 00042 *** COPYRIGHT (C) 1996-2022 BY FEI S.A.S, *** 00043 *** BORDEAUX, FRANCE *** 00044 *** ALL RIGHTS RESERVED *** 00045 **=======================================================================*/ 00046 /*======================================================================= 00047 ** Modified by : VSG (MMM YYYY) 00048 **=======================================================================*/ 00049 00050 00051 #ifndef _SO_SEPARATOR_ 00052 #define _SO_SEPARATOR_ 00053 00054 #include <Inventor/nodes/SoGroup.h> 00055 #include <Inventor/fields/SoSFEnum.h> 00056 #include <Inventor/fields/SoSFInt32.h> 00057 #include <Inventor/fields/SoMFInt32.h> 00058 #include <Inventor/SbPImpl.h> 00059 00060 class SoBoundingBoxCache; 00061 class SoPrimitiveCountCache; 00062 00063 #ifdef _MSC_VER 00064 #pragma warning( push ) 00065 #pragma warning(disable:4251) 00066 #endif 00067 00069 // 00070 // Class: SoSeparator 00071 // 00072 // Separator group node: state is saved before traversing children 00073 // and restored afterwards. 00074 // 00076 00077 #include <Inventor/fields/SoSFBitMask.h> 00078 #include <Inventor/SbRenderUnitID.h> 00079 00080 SO_PIMPL_PUBLIC_DECLARATION(SoSeparator) 00081 00082 00178 class SoSeparator : public SoGroup 00179 { 00180 SO_NODE_HEADER(SoSeparator); 00181 SO_PIMPL_PUBLIC_HEADER(SoSeparator) 00182 00183 public: 00184 00186 enum CacheEnabled { 00190 OFF, 00194 ON, 00198 AUTO 00199 }; 00200 00201 #if 1 SoDEPRECATED 00207 SoSFEnum renderCaching; 00208 #endif 00214 SoSFEnum boundingBoxCaching; 00215 00220 SoSFEnum renderCulling; 00221 00226 SoSFEnum pickCulling; 00227 00229 enum FastEditing { 00233 DISABLE = 0x01, 00234 00238 KEEP_ZBUFFER = 0x02, 00239 00243 CLEAR_ZBUFFER = 0x03 00244 }; 00245 00252 SoSFEnum fastEditing; 00253 00279 SoSFInt32 renderUnitId; 00280 00284 SoSeparator(); 00285 00289 SoSeparator(int nChildren); 00290 00291 private: 00292 // Overrides default method on SoNode 00293 virtual SbBool affectsState() const; 00294 00295 // Implement actions 00296 virtual void doAction(SoAction *action); 00297 virtual void callback(SoCallbackAction *action); 00298 virtual void getBoundingBox(SoGetBoundingBoxAction *action); 00299 virtual void getMatrix(SoGetMatrixAction *action); 00300 virtual void GLRender(SoGLRenderAction *action); 00301 virtual void handleEvent(SoHandleEventAction *action); 00302 virtual void rayPick(SoRayPickAction *action); 00303 virtual void search(SoSearchAction *action); 00304 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action); 00305 virtual void clearCacheList(); 00306 00307 // These methods make render traversal faster by implementing 00308 // different rendering paths corresponding to different action 00309 // path codes. 00310 virtual void GLRenderBelowPath(SoGLRenderAction *action); 00311 virtual void GLRenderInPath(SoGLRenderAction *action); 00312 virtual void GLRenderOffPath(SoGLRenderAction *action); 00313 00314 private: 00315 static void initClass(); 00316 static void exitClass(); 00317 00318 SB_THREAD_TLS_HEADER(); 00319 00320 virtual void notify(SoNotList *list); 00321 00327 SoBoundingBoxCache* getBoundingBoxCache() const 00328 { return bboxCache; } 00329 00330 #ifdef ADD_MFIELD_DEPLIST 00331 SoMFInt32 renderUnitDependencies; 00332 #endif 00333 00335 void invalidateAllParentCaches(); 00336 00337 private: 00338 // Returns TRUE if this separator can be culled because it is 00339 // outside the cull volume. The cullResults flags come from the 00340 // GLRenderAction->getCullTestResults() method, and track the 00341 // results of previous cull tests to save work when we know we're 00342 // completely inside the view volume. 00343 virtual SbBool cullTest(SoGLRenderAction *action, int &cullResults); 00344 00345 virtual SbBool readInstance(SoInput *in, unsigned short flags); 00346 00347 virtual ~SoSeparator(); 00348 00349 private: 00350 00351 SoBoundingBoxCache* bboxCache; // Cache for bounding boxes 00352 00353 SoPrimitiveCountCache *primCountCache; // Cache for primitive count 00354 00355 SbBool bboxCacheIsOpen; 00356 00357 // bba is in thread local storage now. 00358 struct MTstruct { 00359 SoGetBoundingBoxAction *bba; 00360 }; 00361 00362 void commonConstructor(); 00363 00364 float m_depthOffsetCachedValue; 00365 00366 #if 1 SoDEPRECATED 00375 SoSFEnum directVizCaching; 00376 #endif 00377 }; 00378 00379 #ifdef _MSC_VER 00380 #pragma warning( pop ) 00381 #endif 00382 00383 #endif /* _SO_SEPARATOR_ */ 00384 00385 00386