Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoDebug.h
Go to the documentation of this file.
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Gavin Bell (MMM yyyy)
25**=======================================================================*/
26/*=======================================================================
27 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
28 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
29 *** ***
30 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
31 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
32 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
33 *** ***
34 *** RESTRICTED RIGHTS LEGEND ***
35 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
36 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
37 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
38 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
39 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
40 *** ***
41 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
42 *** BORDEAUX, FRANCE ***
43 *** ALL RIGHTS RESERVED ***
44**=======================================================================*/
45/*=======================================================================
46** Modified by : VSG (MMM YYYY)
47**=======================================================================*/
48
49#ifndef _SO_DEBUG_
50#define _SO_DEBUG_
51
52#include <Inventor/SbBasic.h>
53
54class SoBase;
55class SoNode;
56class SoField;
57
58//
59// List of environment variables for tracing:
60//
61// IV_DEBUG_BUFLEN : Number of lines RTPrintf saves up before
62// dumping out. Defaults to 100, set to 1 to get it to dump
63// after every line.
64// IV_DEBUG_SENSORS : will print out info as sensors are
65// triggered/etc
66// IV_DEBUG_CACHES : print out info on cache validity, etc.
67// IV_DEBUG_CACHELIST : print out info on Separator render caches.
68//
69
70{
71 public:
72 // Returns value of environment variable; faster than getenv()
73 // because the environment variables are stored in a dictionary.
74 static const char * GetEnv(const char *envVar);
75
76 // Prints into an internal buffer that is emptied every once in a
77 // while. Useful when doing the print right away screws up the
78 // timing of the thing you're trying to debug.
79 static void RTPrintf(const char *formatString ...);
80
81 // Assign the given pointer a name. The passed name string isn't
82 // copied; if it changes, the name of the pointer changes.
83 static void NamePtr(const char *name, void *ptr);
84
85 // Return the name of the given pointer (returns "<noName>" if not
86 // named previously with NamePtr).
87 static const char * PtrName(void *ptr);
88
89 // Applies an SoWriteAction to the graph rooted by the given node.
90 // The results go to stdout. Very useful when called from within
91 // a debugger!
92 static void write(SoNode *node);
93
94 // Applies an SoWriteAction to the graph rooted by the given node,
95 // writing to given file, or /tmp/debug.iv if filename is NULL.
96 static void writeFile(SoNode *node, const char *filename);
97
98 // Applies an SoWriteAction to the container of the given field.
99 // The results go to stdout. Very useful when called from within
100 // a debugger!
101 static void writeField(SoField *node);
102
103 // Writes the name of the given object to stdout. Very useful
104 // when called from within a debugger!
105 static void printName(SoBase *base);
106};
107
108#endif /* _SO_DEBUG_ */
109
110
static void RTPrintf(const char *formatString ...)
static const char * PtrName(void *ptr)
static void write(SoNode *node)
static void writeField(SoField *node)
static void NamePtr(const char *name, void *ptr)
static void writeFile(SoNode *node, const char *filename)
static void printName(SoBase *base)
Base class for all nodes, paths, and engines.
Definition SoBase.h:111
Base class for all fields.
Definition SoField.h:234
Abstract base class for all database nodes.
Definition SoNode.h:145