Relation Window
Relation Window
The Relation Window is a Source Insight innovation that shows the relationship between the currently selected symbol and other things. The Relation Window can show function call trees, class hierarchies, structure members, reference trees, and more. It can be docked along side your source windows, and it works in the background tracking what you are selecting and showing relationship information automatically.
To show the Relation Window, select View > Panels > Relation Window.
You can specify the relationship types and many other options in the Relation Window Options dialog. See
“Relation Window Options” on page 297.
The Relation Window runs in the background and tracks what symbols you have selected. The beauty of the
Relation Window is that you don’t have to do anything special. It works in the background while you work, but you can interact with it when you want to. You can also have several Relation Windows open, each showing different types of information.
Outline and Graph Views
The Relation Window has two types of views: Outline view and Graph view. The Graph view shows symbols as graph nodes with lines connecting them. The Relation Graph Options command (available on the Relation
Window right-click menu) gives you control over the appearance of the graph view.
Source Insight 4 User Guide 91
Relation Window
Outline View
The Relation Window outline view is a compact, textual view of the relation hierarchy. You can click to expand and collapse levels in the outline.
Graph View
The Relation Window graph view is a visual representation of the same relationship as the outline view. You can expand and collapse nodes in the graph. You can select either a horizontal graph layout, or a vertical
92 Source Insight 4 User Guide
Relation Window
graph layout. You can also print the graph, or copy the graph images to the system clipboard so you can process it in another imaging program.
To expand or collapse a node, hover the mouse cursor first over the right or left edge of the node in a horizontal graph (or the top or bottom middle of a node in a vertical graph). The mouse cursor will contain a + or - symbol. Click to expand or collapse.
You can choose Graph View options by right-clicking on the Relation Window and selecting Relation Window
Graph Options. See “Relation Window Graph Options” on page 296.
Source Insight 4 User Guide 93
Relation Window
Relation Window Right-Click Menu
Relationship Rules
The relation view that appears when you select a symbol depends on the type of symbol. You have control over this in the Relation Window Options. For example, you can specify that if you select a function in your source code, the Relation Window will show references to that function. And, if you select a class name, the
Relation Window will show the classes derived from it.
Each time the Relation Window expands a symbol to show a new level, the relationship represented by the expansion is based on the type of symbol being expanded. That means each Relation Window can potentially
show multiple relationships. See “Relation Window Options” on page 297.
Relationship Types
The relationships fall into these general categories, listed from computationally the fastest to slowest:
•
Contains
– show the contents of the current symbol. For example, the members of a struct.
•
Calls
– show what other symbols are referred to by the current symbol. For example, functions that are called by the current function.
•
Calls and Callers
- show a split graph; one side are the functions called by the current function, the other side is the functions that call the current function.
94 Source Insight 4 User Guide
Relation Window
•
References
– show what other symbols refer to the current symbol. For example, functions that call the current function.
Call Graphs
The function call graph relationships can be filtered to show only what you consider the most interesting paths. The “Call Graph Filtering” button in the Relation Window Properties dialog box takes you to a dialog box that lets you control the filtering by specifying particular functions you want to exclude. You can also filter functions out by code metrics constraints.
Note that Source Insight considers C/C++ macros legitimate function-like symbols, and so C/C++ macros may show up in a call graph. You can filter them out in the Call Graph Filtering dialog box if you want.
Relation Window Performance
The Relation Window requires some processing. Some relationships are slower to compute. For very large projects, the “References” relationship will be the slowest to compute.
Multiple Relation Windows
You can have multiple Relation Window instances, so you can show multiple relationships at the same time.
Each Relation Window has its own relationship options. For example, one window could show you what functions are called by the selected function, and another window could show you what functions make calls to the selected function. To create a new Relation Window, right-click on the Relation Window and select New
Relation Window.
Customizing the Relation Window
The Relation Window Options command is accessed from the Relation Window toolbar or shortcut menu.
You control what relationships are shown from this command, and how the window displayed. See “Relation
Window Options” on page 297.
You can also customize the appearance of the Graph View of the Relation Window by using the Relation
Graph Options command. See “Relation Window Graph Options” on page 296.
Source Insight 4 User Guide 95