DEBUG_DEF
List of: Discussion Topic
Subjects: Entity, Extending ACIS
Contents: Application Development Manual

The DEBUG_DEF macro calls the debug_ent function, which is used to produce neatly formatted, human readable information about the contents of the entity in the debug file. It is also used when gathering size data only, in which case the passed in file pointer will be NULL.

Function debug_ent is called from the debug_entity function, which prints out details of an entity and all of its subsidiary and sibling entities and from debug_lists, which prints subsidiary entities only. It is called from the entity:debug Scheme extension. It is also called from various points in the code that are inside DEBUG_LEVEL blocks.

Signature

void MY_ENTITY::debug_ent( FILE *fp ) const

Implementation

DEBUG_DEF should be implemented with functions declared at the end of file kernel/kerndata/data/debug.hxx. These functions are all named with the string "debug_"at their beginning of their name and the type of data at the end. For example, use debug_box to print a formatted description of SPAbox data. Functions are provided for most data types commonly used in ENTITY derivations. For other types, use debug_title followed by a call to fprintf guarded by a check that the file pointer is not NULL.

Three functions are provided for formatting entity pointers. Select the one to use based on the notion that when debugging a substructure, one would like to see its subsidiary entities, but not the containing entities. For example, when debugging a face, one would like to look down the structure to the loops, but not up the structure to the shell, from which many other faces could be dragged in. The difference between the three functions is whether the entity will be added to the list of entities to be debugged later in the same call to debug_entity. The three functions are:

debug_new_pointer Used for subsidiary entities; always adds to the list so that subsidiary entities will be included in the debug output.

debug_old_pointer Used for containing entities; never adds to the list, so that containing entities are not included.

debug_sib_pointer Used for entities at the same level, such as the next_in_list pointer from a face; adds to the list when the global flag, debug_siblings is true. This flag is controlled by whether one starts with debug_entity or debug_lists.

A problem exists with attributes that point to entities in another body: following those pointers would cause entities of the other body to be mixed in with those of the entity of interest, causing great confusion. Use debug_old_pointer to write pointers into other bodies or data structures.
PDF/APPDEV/09ENT.PDF
HTM/DATA/ACIS/APPDEV/09ENT/0007.HTM