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 : Gavin Bell (MMM yyyy) 00025 **=======================================================================*/ 00026 /*======================================================================= 00027 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00028 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00029 *** *** 00030 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00031 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00032 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00033 *** *** 00034 *** RESTRICTED RIGHTS LEGEND *** 00035 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00036 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00037 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00038 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00039 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00040 *** *** 00041 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, *** 00042 *** BORDEAUX, FRANCE *** 00043 *** ALL RIGHTS RESERVED *** 00044 **=======================================================================*/ 00045 /*======================================================================= 00046 ** Modified by : VSG (MMM YYYY) 00047 **=======================================================================*/ 00048 00049 #ifndef _SO_DEBUG_ 00050 #define _SO_DEBUG_ 00051 00052 #include <Inventor/SbBasic.h> 00053 00054 class SoBase; 00055 class SoNode; 00056 class SoField; 00057 00058 // 00059 // List of environment variables for tracing: 00060 // 00061 // IV_DEBUG_BUFLEN : Number of lines RTPrintf saves up before 00062 // dumping out. Defaults to 100, set to 1 to get it to dump 00063 // after every line. 00064 // IV_DEBUG_SENSORS : will print out info as sensors are 00065 // triggered/etc 00066 // IV_DEBUG_CACHES : print out info on cache validity, etc. 00067 // IV_DEBUG_CACHELIST : print out info on Separator render caches. 00068 // 00069 00070 { 00071 public: 00072 // Returns value of environment variable; faster than getenv() 00073 // because the environment variables are stored in a dictionary. 00074 static const char * GetEnv(const char *envVar); 00075 00076 // Prints into an internal buffer that is emptied every once in a 00077 // while. Useful when doing the print right away screws up the 00078 // timing of the thing you're trying to debug. 00079 static void RTPrintf(const char *formatString ...); 00080 00081 // Assign the given pointer a name. The passed name string isn't 00082 // copied; if it changes, the name of the pointer changes. 00083 static void NamePtr(const char *name, void *ptr); 00084 00085 // Return the name of the given pointer (returns "<noName>" if not 00086 // named previously with NamePtr). 00087 static const char * PtrName(void *ptr); 00088 00089 // Applies an SoWriteAction to the graph rooted by the given node. 00090 // The results go to stdout. Very useful when called from within 00091 // a debugger! 00092 static void write(SoNode *node); 00093 00094 // Applies an SoWriteAction to the graph rooted by the given node, 00095 // writing to given file, or /tmp/debug.iv if filename is NULL. 00096 static void writeFile(SoNode *node, const char *filename); 00097 00098 // Applies an SoWriteAction to the container of the given field. 00099 // The results go to stdout. Very useful when called from within 00100 // a debugger! 00101 static void writeField(SoField *node); 00102 00103 // Writes the name of the given object to stdout. Very useful 00104 // when called from within a debugger! 00105 static void printName(SoBase *base); 00106 }; 00107 00108 #endif /* _SO_DEBUG_ */ 00109 00110 00111