0032722: Visualization, TKOpenGl - performance counters disappear at some camera...
[occt.git] / dox / user_guides / inspector / inspector.md
d2c90917 1Inspector {#occt_user_guides__inspector}
6@section occt_inspector_1 Introduction
ab5b3c22 8This manual explains how to use the Inspector.
d2c90917 9
10@subsection occt_inspector_1_1 Overview
ab5b3c22 11Inspector is a Qt-based library that provides functionality to interactively inspect low-level content of the OCAF data model, OCCT viewer and Modeling Data.
d2c90917 12This component is aimed to assist the developers of OCCT-based applications to debug the problematic situations that occur in their applications.
14Inspector has a plugin-oriented architecture. The current release contains the following plugins:
16| Plugin | OCCT component | Root class of OCCT investigated component |
17| :----- | :----- | :----- |
ab5b3c22 18| @ref occt_inspector_2_2 "DFBrowser"| OCAF | *TDocStd_Application* |
19| @ref occt_inspector_2_3 "VInspector"| Visualization | *AIS_InteractiveContext* |
20| @ref occt_inspector_2_4 "ShapeView"| Modeling Data | *TopoDS_Shape* |
8dcb81ac 21| @ref occt_inspector_2_5 "MessageView"| Modeling Data | *Message_Report* |
d2c90917 22
24Each plugin implements logic of a corresponding OCCT component.
ab5b3c22 26Each of the listed plugins is embedded in the common framework, thus it is possible to manage, which plugins should be loaded by the Inspector, and to extend their number by implementing a new plugin.
d2c90917 27
29@subsection occt_inspector_1_3 Getting started
31There are two launch modes:
ab5b3c22 321. Launch **TInspectorEXE** executable sample. For more details see @ref occt_inspector_4_1 "TInspectorEXE" section;
332. Launch DRAW, load plugin INSPECTOR, and use *tinspector* command.
07f2b741 34 For more details, see @ref occt_inspector_4_2 "Launch in DRAW Test Harness" section.
d2c90917 35
07f2b741 37**Note**. If you have no Inspector library in your build directory, make sure that OCCT is compiled with *BUILD_Inspector*
ab5b3c22 38option ON. For more details see @ref occt_inspector_5 "Build procedure".
d2c90917 39
ab5b3c22 41@section occt_inspector_2 Inspector Plugins
d2c90917 42
43@subsection occt_inspector_2_1 Overview
45Inspector consists of the following components:
46 * <b>buttons</b> to activate the corresponding plugin;
47 * <b>view area</b> to visualize the plugin content.
49@figure{tinspector_elements.svg,"Plugins placement in Inspector",360}
51@subsection occt_inspector_2_2 DFBrowser Plugin
53@subsubsection occt_inspector_2_2_1 Overview
55@figure{dfbrowser.png, "DFBrowser"}
ab5b3c22 57This plugin visualizes the content of *TDocStd_Application* in a tree view. It shows application documents,
58the hierarchy of *TDF_Labels*, the content of *TDF_Attributes* and interconnection between attributes (e.g. references).
59Additionally there is a 3D view to visualize *TopoDS_Shape* elements stored in the document.
d2c90917 60
61@subsubsection occt_inspector_2_2_2 Elements
63@figure{dfbrowser_elements.svg, "DFBrowser Elements",360}
65<b>OCAF tree view</b>
67Each OCAF element has own tree view item:
69| Type | Tree item | Text | Description |
70| :----- | :----- | :----- | :----- |
ab5b3c22 71| *TDocStd_Application* | Application | *TDocStd_Application* | The root of tree view. Its children are documents.|
72| *TDocStd_Document* | Document | entry : name | A child of *Application* item. Its children are *Label* and *Attribute* items.<br> Text view is an entry of the root label and the value of *TDataStd_Name* attribute for the label if it exists. |
73| *TDF_Label* | Label | entry : name | A child of a *Document* or another *Label* item. Its children and text view are the same as for Document item. |
74| *TDF_Attribute* | Attribute | attribute type [additional information] | A child of a *Label*. It has no children. <br> Text view is the attribute type *(DynamicType()->Name()* of *TDF_Attribute*) and additional information (a combination of attribute values). |
d2c90917 75
ab5b3c22 77Additional information about TDF_Attributes:
d2c90917 78
79| Type | Text |
80| :----- | :----- |
ab5b3c22 81| *TDocStd_Owner* | [storage format] |
82| *TDataStd_AsciiString*,<br> *TDataStd_Name*,<br> *TDataStd_Real*,<br> other *Simple* type attributes | [value] |
83| *TDataStd_BooleanList*,<br> *TDataStd_ExtStringList*,<br> other *List* attributes | [value_1 ... value_n] |
84| *TDataStd_BooleanArray*,<br> *TDataStd_ByteArray*,<br> other *Array* type attributes | [value_1 ... value_n] |
85| *TDataStd_TreeNode* | [tree node ID ==> Father()->Label()] (if it has a father) or <br> [tree node ID <== First()->Label()] (if it has NO father)|
86| *TDataStd_TreeNode(XDE)* | [XDE tree node ID ==> Father()->Label()] (if it has a father), <br> [XDE tree Node ID <== label_1, ..., label_n] (if it has NO father)|
87| *TNaming_NamedShape* | [shape type : evolution] |
88| *TNaming_UsedShapes* | [map extent] |
d2c90917 89
91Custom color of items:
93| OCAF element Type | Color |
94| :----- | :----- |
ab5b3c22 95| *TDF_Label* | <b>dark green</b>, if the label has *TDataStd_Name* attribute, <br><b>light grey</b> if the label is empty (has no attributes on all levels of hierarchy),<br> <b>black</b> otherwise. |
96| *TNaming_NamedShape* | <b>dark gray</b> for *TopAbs_FORWARD* orientation of *TopoDS_Shape*, <br> <b>gray</b> for *TopAbs_REVERSED* orientation of *TopoDS_Shape*, <br> <b>black</b> for other orientation. |
d2c90917 97
ab5b3c22 99Context pop-up menu:
d2c90917 100| Action | Functionality |
101| :----- | :----- |
ab5b3c22 102| Expand | Expands the next two levels under the selected item. |
103| Expand All | Expands the whole tree of the selected item. |
104| Collapse All | Collapses the whole tree of the selected item. |
d2c90917 105
d2c90917 106<b>Property Panel</b>
8dcb81ac 108Property panel is used to display the result of <b>TDF_Attribute::Dump()</b> or <b>TDF_Label::Dump()</b> of the selected tree view item.
109The information is shown in one table.
113<b>Property Panel (custom)</b>
115Property panel (custom) is used to display the content of *Label* or *Attribute* tree view items or Search result view.
ab5b3c22 116The information is usually shown in one or several tables.
d2c90917 117
ab5b3c22 118*TDF_Attribute* has the following content in the Property Panel:
d2c90917 119
ab5b3c22 122<tr><td><i>TDF_Label</i></td>
d2c90917 123 <td> a table of [entry or attribute name, value]</td>
8dcb81ac 124 <td>@figure{property_panel_custom_label.png, "",140}</td></tr>
ab5b3c22 125<tr><td><i>TDocStd_Owner</i>,<br> Simple type attributes, <br> List type attributes</td>
d2c90917 126 <td>a table of [method name, value]</td>
8dcb81ac 127 <td>@figure{property_panel_custom_simple_type.png, "",140}</td></tr>
ab5b3c22 128<tr><td><i>TDataStd_BooleanArray</i>,<br> <i>TDataStd_ByteArray</i>,<br> other Array type attributes</td>
129 <td>2 controls: <br> - a table of [array bound, value], <br> - a table of [method name, value] </td>
8dcb81ac 130 <td>@figure{property_panel_custom_array.png, "",140}</td></tr>
ab5b3c22 131<tr><td><i>TDataStd_TreeNode</i></td>
132 <td>2 controls: <br> - a table of [Tree ID, value] (visible only if Tree ID() != ID() ), <br> - a tree view of tree nodes starting from *Root()* of the tree node. The current tree node has <b>dark blue</b> text.</td>
8dcb81ac 133 <td>@figure{property_panel_custom_tree_node.png, "",140} </td></tr>
ab5b3c22 134<tr><td><i>TDataStd_NamedData</i></td>
d2c90917 135 <td>tab bar of attribute elements, each tab has a table of [name, value]</td>
8dcb81ac 136 <td>@figure{property_panel_custom_named_data.png, "",140}</td></tr>
ab5b3c22 137<tr><td><i>TNaming_UsedShapes</i></td>
138 <td>a table of all shapes handled by the framework</td>
8dcb81ac 139 <td>@figure{property_panel_custom_tnaming_used_shapes.png, "",140}</td></tr>
ab5b3c22 140<tr><td><i>TNaming_NamedShape</i></td>
141 <td>2 controls: <br> - a table of [method name, value] including CurrentShape/OriginalShape methods result of <i>TNaming_Tools</i>, <br> - an evolution table. <br> Tables contain buttons for @ref occt_shape_export "TopoDS_Shape export".</td>
8dcb81ac 142 <td>@figure{property_panel_custom_tnaming_named_shape.png, "",140}</td></tr>
ab5b3c22 143<tr><td><i>TNaming_Naming</i></td>
144 <td>2 controls: <br> - a table of <i>TNaming_Name</i> values,<br> - a table of [method name, value]</td>
8dcb81ac 145 <td>@figure{property_panel_custom_tnaming_naming.png, "",140}</td></tr>
d2c90917 146</table>
149<b>Dump view</b>
ab5b3c22 151@figure{dump_attribute.png, "Dump of TDF_Attribute",200}
d2c90917 152
ab5b3c22 153Dump view shows the result of <b>TDF_Attribute::Dump()</b> or <b>TDF_Label::Dump()</b> of the selected tree view item.
d2c90917 154
155<b>3D view</b>
ab5b3c22 1573D View visualizes *TopoDS_Shape* elements of OCAF attribute via AIS facilities.
d2c90917 158
ab5b3c22 159DFBrowser creates two kinds of presentations depending on the selection place:
d2c90917 160
ab5b3c22 162<tr><th>Kind</th><th>Source object</th><th>Visualization properties</th><th>View</th></tr>
d2c90917 163<tr><td>Main presentation</td>
ab5b3c22 164 <td>Tree view item:<br> *TPrsStd_AISPresentation*,<br> *TNaming_NamedShape*,<br> *TNaming_Naming*</td>
165 <td>Color: a default color for shape type of the current *TopoDS_Shape*.</td>
d2c90917 166 <td>@figure{display_main_presentation.png, "",100}</td></tr>
167<tr><td>Additional presentation</td>
168 <td>References in Property panel</td>
169 <td>Color: white</td>
170 <td>@figure{display_additional_presentation.png, "",100}</td></tr>
175<b>Tree Navigation</b>
177Tree Navigation shows a path to the item selected in the tree view.
ab5b3c22 178The path is a sequence of label entries and attribute type names.
179Each element in the path is selectable - simply click on it to select the corresponding tree view item.
d2c90917 180
181Navigation control has buttons to go to the previous and the next selected tree view items.
184<b>Update Button</b>
186Update button synchronizes content of tree view to the current content of OCAF document that could be modified outside.
190The user can search OCAF element by typing:
ab5b3c22 191 * *TDF_Label* entry,
192 * *TDF_Attribute* name,
193 * *TDataStd_Name* and *TDataStd_Comment* attributes value.
d2c90917 194
ab5b3c22 195@figure{search.png,"Search",360}
d2c90917 196
197As soon as the user confirms the typed criteria, the Property panel is filled by all satisfied values.
ab5b3c22 198The user can click a value to highlight the corresponding tree view item. By double click the item will be selected.
d2c90917 199
201@subsubsection occt_inspector_2_2_3 Elements cooperation
203<b>Tree item selection</b>
205Selection of tree view item updates content of the following controls:
ab5b3c22 206 * Navigation line;
207 * Property Panel;
208 * 3D View (if it is possible to create an interactive presentation);
209 * Dump View.
d2c90917 210
8dcb81ac 213<b>Property Panel (custom) item selection </b>
d2c90917 214
8dcb81ac 215If the property panel (custom) shows content of *TDF_Label*:
ab5b3c22 216 * selection of the table row highlights the corresponding item in the tree view,
217 * double click on the table row selects this item in the tree view.
d2c90917 218
8dcb81ac 219If the property panel (custom) shows content of *TDF_Attribute* that has reference to another attribute, selection of this reference:
ab5b3c22 220 * highlights the referenced item in the tree view,
221 * displays additional presentation in the 3D view if it can be created.
d2c90917 222
8dcb81ac 223@figure{property_panel_custom_item_selection.svg,"",360}
d2c90917 224
225Attributes having references:
227| Type | Reference | Additional presentation
228| :----- | :----- | :----- |
ab5b3c22 229| *TDF_Reference* | *TDF_Label* | |
230| *TDataStd_ReferenceArray*, <br> *TDataStd_ReferenceList*, <br> *TNaming_Naming* | One or several *TDF_Label* in a container. | |
231| *TDataStd_TreeNode* | *TDF_Label* | |
232| *TNaming_NamedShape* | *TDF_Label* in Evolution table | *TopoDS_Shapes* selected in the property panel tables. |
233| *TNaming_UsedShapes* | one or several *TNaming_NamedShape* | *TopoDS_Shapes* of the selected *TNaming_NamedShape*. |
d2c90917 234
236@subsubsection occt_shape_export TopoDS_Shape export
ab5b3c22 238Property panel of *TNaming_NamedShape* attribute has controls to export *TopoDS_Shape* to:
239 * BREP. **Save file** dialog is open to enter the result file name,
240 * @ref occt_inspector_2_4 "ShapeView" plugin. The dialog for exporting element to ShapeView allows activating this plugin immediately.
d2c90917 241
243@subsection occt_inspector_2_3 VInspector Plugin
245@subsubsection occt_inspector_2_3_1 Overview
ab5b3c22 247@figure{vinspector.png, "VInspector",360}
d2c90917 248
ab5b3c22 249This plugin visualizes interactive objects displayed in *AIS_InteractiveContext* in a tree view with computed selection
250components for each presentation. It shows the selected elements in the context and allows selecting these elements.
d2c90917 251
252@subsubsection occt_inspector_2_3_2 Elements
254@figure{vinspector_elements.svg,"VInspector Elements",360}
256<b>Presentations tree view</b>
ab5b3c22 258This view shows presentations and selection computed on them. Also, the view has columns with information about the state of visualization elements.
d2c90917 259
260VInspector tree items.
262| Type | Description |
263| :----- | :----- |
ab5b3c22 264| *AIS_InteractiveContext* | The root of tree view. Its children are interactive objects obtained by *DisplayedObjects* and *ErasedObjects* methods.|
265| *AIS_InteractiveObject* | A child of *AIS_InteractiveContext* item. Its children are *SelectMgr_Selection* obtained by iteration on *CurrentSelection*. |
266| *SelectMgr_Selection* | A child of *AIS_InteractiveObject*. Its children are *SelectMgr_SensitiveEntity* obtaining by iteration on *Sensitive*. |
267| *SelectMgr_SensitiveEntity* | A child of *SelectMgr_Selection*. Its children are *SelectMgr_SensitiveEntity* obtaining by iteration on *OwnerId*. |
268| *SelectBasics_EntityOwner* | A child of *SelectMgr_SensitiveEntity*. It has no children. |
d2c90917 269
271Custom color of tree view items:
273| OCAF element Type | Column | What | Color |
274| :----- | :----- | :----- | :----- |
ab5b3c22 275| *AIS_InteractiveObject* | 0 | Text | <b>dark gray</b> in *ErasedObjects* list of *AIS_InteractiveContext*,<br> <b>black</b> otherwise |
276| *AIS_InteractiveObject*, <br> *SelectMgr_SensitiveEntity*, <br> *SelectBasics_EntityOwner*| 1 | Background | <b>dark blue</b>, if there is a selected owner under the item, <br> <b>black</b> otherwise |
277| *SelectMgr_Selection*,<br> *SelectMgr_SensitiveEntity*,<br> *electBasics_EntityOwner* | all | Text | <b>dark gray</b>, if *SelectionState* of *SelectMgr_Selection* is not *SelectMgr_SOS_Activated*,<br> <b>black</b> otherwise |
d2c90917 278
280Context popup menu in tree view:
281| Action | Item | Functionality |
282| :----- | :----- | :----- |
ab5b3c22 283| Export to ShapeView | *AIS_InteractiveObject* | Exports *TopoDS_Shape* of the *AIS_Interactive* presentation to ShapeView plugin. <br> It should be *AIS_Shape* presentation and ShapeView plugin should be registered in Inspector<br> Dialog about exporting element to ShapeView is shown with a possibility to activate this plugin immediately. |
284| Show | *AIS_InteractiveObject* | Displays presentation in *AIS_InteractiveContext*. |
285| Hide | *AIS_InteractiveObject* | Erases presentation from *AIS_InteractiveContext*. |
d2c90917 286
ab5b3c22 289This button synchronizes the plugin content with the current state of *AIS_InteractiveContext* and updates the presence of items and their current selection.
d2c90917 290
d2c90917 291@subsubsection occt_inspector_2_3_3 Elements cooperation
ab5b3c22 293*VInspector* marks the presentations currently selected in *AIS_InteractiveContext* with a blue background in tree items. Use **Update** button to synchronize VInspector selected items state to the context.
d2c90917 294
ab5b3c22 295It is also possible to perform selection in the context using "Selection controls" VInspector feature. However, this operation should be performed carefully as
296it clears the current selection in *AIS_InteractiveContext*.
d2c90917 297
298Selection change:
299| From | To | Action | Result |
300| :----- | :----- | :----- | :----- |
ab5b3c22 301| *AIS_InteractiveContext* | VInspector | Performs selection in *AIS_InteractiveContext*. | Click **Update** button in VInspector and check **Selection** column: <br> *AIS_InteractiveContext* item contains some selected objects, <br> the value of some *AIS_InteractiveObject* is filled if they are selected for this presentation or its entity owner. |
302| VInspector | *AIS_InteractiveContext* | Activates one of Selection controls and selects one or several elements in the tree view. | The objects become selected in *AIS_InteractiveContext*. |
304@subsubsection occt_inspector_2_3_4 VInspector tree view columns
306Use context pop-up menu on the tree view header to select, which columns should be displayed.
307@figure{vinspector_tree_columns.png, "Vinspector tree header context menu",360}
d2c90917 308
8dcb81ac 309Use the setting Lights (position, color) in the view.
310@figure{vinspector_light_setting.png, "Vinspector light setting",360}
312@subsubsection occt_inspector_2_3_5 VInspector property panel
314Property panel shows the result of <b>AIS_InteractiveContext::Dump()</b> or <b>AIS_InteractiveObject::Dump()</b>.
315@figure{vinspector_property_panel.png, "Vinspector property panel",360}
d2c90917 317@subsection occt_inspector_2_4 ShapeView Plugin
319@subsubsection occt_inspector_2_4_1 Overview
ab5b3c22 321@figure{shapeview.png, "ShapeView",360}
d2c90917 322
ab5b3c22 323This plugin visualizes content of *TopoDS_Shape* in a tree view.
d2c90917 324
8dcb81ac 325@subsubsection occt_inspector_2_4_2 Property panel
327Property panel shows properties for TopoDS_Shape based on DumpJson.
329@figure{shapeview_property_panel.png, "ShapeView Property panel",360}
331@subsubsection occt_inspector_2_4_3 Elements
d2c90917 332
333@figure{shapeview_elements.svg,"ShapeView Elements",360}
335<b>TopoDS_Shape View</b>
ab5b3c22 337The view elements are *TopoDS_Shape* objects.
338The shape is exploded into sub-shapes using *TopoDS_Iterator* of the *TopoDS_Shape*.
339Children sub-shapes are presented in the view as children of the initial shape.
340By iterating recursively through all shapes we obtain a tree view of items shown in the ShapeView.
d2c90917 341
ab5b3c22 342The columns of the View show some information about *TopoDS_Shape* of the item.
343The first column allows changing the visibility of the item shape in the 3D view.
d2c90917 344
ab5b3c22 345Context pop-up menu in tree view:
d2c90917 346| Action | Functionality |
347| :----- | :----- |
ab5b3c22 348| Load BREP file | Opens the selected file and appends the resulting *TopoDS_Shape* into the tree view. |
349| Remove all shape items | Clears tree view. |
350| BREP view | Shows the text view with BREP content of the selected item. Creates the BREP file in a temporary directory of the plugin. |
351| Close All BREP views | Closes all opened text views. |
352| BREP directory | Displays the folder, where temporary BREP files have been stored. |
d2c90917 353
8dcb81ac 354@subsubsection occt_inspector_2_4_4 Elements cooperation
d2c90917 355
ab5b3c22 356Selection of one or several items in *TopoDS_Shape* View creates its *AIS_Shape* presentation and displays it in the 3D View.
8dcb81ac 358@subsubsection occt_inspector_2_4_5 ShapeView tree view columns
d2c90917 359
ab5b3c22 360Use context pop-up menu on the tree view header to select, which columns should be displayed.
361@figure{shapeview_tree_columns.png, "ShapeView tree header context menu",360}
d2c90917 362
8dcb81ac 363@subsection occt_inspector_2_5 MessageView Plugin
365MessageView plugin is used to display content of Message_Report.
367@subsubsection occt_inspector_2_5_1 Message report tree view
369Message report tree view shows the content of the Message_Report.
371Context pop-up menu in message report tree view:
372| Action | Functionality |
373| :----- | :----- |
374| Export Report | Exports the report as json file. |
375| WallClock Metric statistic | Creates the table that sums the number of calls and the time spent on the functionality inside the value and shows it in Property panel (custom). It's necessary to activate "WallClock metric". |
376| Preview children presentations | Displays presentations of children items of selected items if found. |
377| Deactivate | Deactivates all types of metrics for the current report. |
378| Activate | Appends items to activate report metrics. |
379| Clear | Clears message report. |
380| Activate metric | Switches active state in report for clicked type of metric. |
381| Test metric | Sends several alerts to check metric of message-alert-tool mechanism. |
382| Test Message_Messenger | Sends several alerts to check property panel/presentations of messenger-alert-tool mechanism. |
383| Test Tree of messages | Sends several alerts to check tree of alerts. |
385@figure{messageview_pop_up_menu.png, "MessageView pop-up menu",360}
387@subsubsection occt_inspector_2_5_2 3D View
3893D View shows the selected item (TopoDS_Shape) in message report tree view.
390@figure{messageview_view.png, "MessageView 3D View",360}
392@subsubsection occt_inspector_2_5_3 Dump panel
394Shows Dump() information of the selected item if the item has Dump().
395@figure{messageview_dump_panel.png, "MessageView 3D View",360}
397@subsubsection occt_inspector_2_5_4 Property panel (custom)
399Shows the table for WallClock Metric statistic option.
400@figure{messageview_property_panel_custom.png, "MessageView 3D View",360}
402@subsubsection occt_inspector_2_5_5 Elements
403@figure{messageview_elements.svg, "MessageView elements",360}
d2c90917 404
405@section occt_inspector_3 Common controls
d2c90917 406
ab5b3c22 407@subsection occt_inspector_3_1 Tree View
409This control shows presentation hierarchy of the investigated OCCT element, e.g. *TDocStd_Application* for DFBrowser, see @ref occt_inspector_1_1 "Overview".
410The first column contains the name, other columns are informative.
412The tree view has a context menu with plugin-specific actions.
414@subsubsection occt_inspector_3_1_1 Tree View preferences
416It is possible to define visibility and width of columns.
417This option is available in a view that contains more than one column,
418 e.g. @ref occt_inspector_2_3_4 "VInspector tree view columns"
419 and @ref occt_inspector_2_4_4 "ShapeView tree view columns".
421@figure{treeview_preferences.svg, "Preferences schema",360}
424@subsection occt_inspector_3_2 3D View
426@subsubsection occt_inspector_3_2_1 Overview
428@figure{3DView.png, "3D View",360}
430This control for OCCT 3D viewer creates visualization view components and allows performing some user actions in the view.
433@subsubsection occt_inspector_3_2_2 Elements
435@figure{3DView_elements.svg,"3DView Elements",360}
4373D View contains the following elements:
438| Element | Functionality |
439| :----- | :----- |
440| 3D view | V3d viewer with mouse events processing. |
441| Context | Allows choosing another context that should be used in the plugin. The following contexts are available:<br> **Own** - the context of this view, <br> **External** - the context of the @ref occt_inspector_4_3 "external application", which initializes the plugin, <br> **None** - the visualization is not performed at all (useful if the presentation is too complex). |
442| Multi/Single | The buttons define what to do with the previously displayed objects: <br> **Multi** displays new presentations together with already displayed ones, <br> **Single** removes all previously displayed presentations. |
443| Clean | Removes all displayed presentations. |
8dcb81ac 444| Trihedron display | Shows the trihedron. |
445| View cube display | Shows the view cube. |
446| Fit All | Scene manipulation actions<br> (Fit All is checkable. If checked(by double click), display/hide of new objects will perform **Fit All** of the scene.) |
ab5b3c22 447| Display Mode | Sets *AIS_Shading* or *AIS_WireFrame* display mode for all presentations. |
d2c90917 448
ab5b3c22 449Context popup menu:
450| Action | Functionality |
451| :----- | :----- |
452| Set View Orientation | Shows the list of available *V3d_View* projections. Selection of an item with change the view. |
d2c90917 453
ab5b3c22 454@figure{3DView_set_orientation.png,"Set view orientation",360}
d2c90917 455
ab5b3c22 456@subsubsection occt_inspector_3_2_3 3D View preferences.
457View preferences store the current view orientation.
d2c90917 458
ab5b3c22 459@subsection occt_inspector_3_3 Preferences context menu
d2c90917 460
ab5b3c22 461@figure{preferences.png,"Plugin preferences",360}
d2c90917 462
ab5b3c22 463Context menu contains:
d2c90917 464| Element | Functionality |
465| :----- | :----- |
8dcb81ac 466| Tree Level Line,<br> PropertyPanel,<br> PropertyPanel (custom),<br> Dump, <br> View| Names of dock widgets in the active plugin. If the button is checked, dock widget is visible. |
ab5b3c22 467| Store Preferences | Creates ".tinspector.xml" preferences file with the current settings for each plugin.<br> This file is created in TEMP/TMP directory (by default) or in a user-defined directory. |
468| Remove Preferences | Removes preferences file. After the Inspector is restarted, default values will be applied. |
d2c90917 470
ab5b3c22 471The following controls have store/restore preferences:
472| Element | Preferences |
473| :----- | :----- |
474| Geometry| Inspector window size and position. <br>State of dockable widgets : visibility, position, size.|
475| @ref occt_inspector_3_1_1 "Tree View preferences"| Columns visible in the tree view and their width. |
476| @ref occt_inspector_3_2_3 "3D View preferences"| 3D view camera direction. |
d2c90917 477
ab5b3c22 478@section occt_inspector_4 Getting Started
d2c90917 479
ab5b3c22 480@subsection occt_inspector_4_1 TInspectorEXE sample
d2c90917 481
ab5b3c22 482This sample allows trying Inspector functionality.
d2c90917 483
ab5b3c22 484Use *inspector.bat* script file placed in a binary directory of OCCT to launch it.
d2c90917 485
ab5b3c22 486This script accepts the names of plugin's DLL that should be loaded. By default it loads all plugins described above.
d2c90917 487
d2c90917 488
ab5b3c22 489@figure{TStandaloneEXE.png, "TStandaloneEXE",360}
d2c90917 490
ab5b3c22 491Click on the Open button shows the dialog to select a file.
492@figure{TStandaloneEXE_open.png, "",360}
d2c90917 493
ab5b3c22 494Depending on the active plugin, it is possible to select the following files in the dialog:<br>
495- DFBRowser: OCAF document or STEP files;
496- VInspector: BREP files;
497- ShapeView: BREP files.
d2c90917 498
ab5b3c22 499Click the file name in the proposed directory and enter it manually or using **Browse** button.
d2c90917 500
ab5b3c22 501By default, TInspectorEXE opens the following files for plugins:
d2c90917 502| Plugin DLL library name | Files |
503| :----- | :----- |
504| TKDFBrowser | step/screw.step |
505| TKVInspector | occ/hammer.brep |
506| TKShapeView | occ/face1.brep, <br> occ/face2.brep |
ab5b3c22 508These files are found relatively to *CSF_OCCTDataPath*.
d2c90917 509
ab5b3c22 510@subsubsection occt_inspector_4_1_1 TInspectorEXE preferences
511The application stores recently loaded files. On the application start, the last file is activated.
512**Open file** dialog contains recently loaded files.
513Selection of a new file updates the container of recently loaded files and rewrites preferences.
d2c90917 514
ab5b3c22 515Source code of *TIspectorEXE* is a good sample for @ref occt_inspector_4_3 "using the Inspector in a custom application".
d2c90917 516
ab5b3c22 517@subsection occt_inspector_4_2 How to launch the Inspector in DRAW Test Harness
d2c90917 518
ab5b3c22 519*TKToolsDraw* plugin provides DRAW commands for Qt tools. Use *INSPECTOR* parameter of @ref occt_draw_1_3_3 "pload"
520command to download the commands of this library. It contains *tinspector* command to start Inspector under DRAW.
d2c90917 521See more detailed description of the @ref occt_draw_13_1 "tinspector" command.
523The simple code to start Inspector with all plugins loaded:
77d94fd1 525~~~~
d2c90917 526pload INSPECTOR
77d94fd1 528~~~~
d2c90917 529
ab5b3c22 530@figure{drawexe_tinspector.png,"tinspector",360}
532This command does the following:
8dcb81ac 533- all available Plugins are presented in the Inspector. These are @ref occt_inspector_2_2 "DFBrowser", @ref occt_inspector_2_3 "VInspector", @ref occt_inspector_2_4 "ShapeView" and @ref occt_inspector_2_5 "MessageView";
ab5b3c22 534- DFBrowser is the active plugin;
535- OCAF tree is empty.
537After this, we should create objects in DRAW and update *tinspector*.
538The examples of using Inspector in DRAW can be found in OCCT source directory /tests/tools.
d2c90917 539
ab5b3c22 540@subsection occt_inspector_4_3 How to use the Inspector in a custom application
d2c90917 541
ab5b3c22 542The example of using the Inspector in a custom application is presented in OCCT qt sample - <b>FuncDemo</b>.
543For building qt samples, switch on *BUILD_SAMPLES_QT* variable in @ref build_cmake_conf "Configuration process".
d2c90917 544
ab5b3c22 545In general, the following steps should be taken:
546* Set dependencies to OCCT and Qt in the application (Header and Link);
547* Create an instance of *TInspector_Communicator*;
548* Register the plugins of interest in the communicator by DLL library name;
549* Initialize the communicator with objects that will be investigated;
550* Set visible true for the communicator.
d2c90917 551
d2c90917 552
ab5b3c22 554Here is an example of C++ implementation:
77d94fd1 555~~~~{.cpp}
d2c90917 556
557#include <inspector/TInspector_Communicator.hxx>
559static TInspector_Communicator* MyTCommunicator;
561void CreateInspector()
563 NCollection_List<Handle(Standard_Transient)> aParameters;
564 //... append parameters in the list
566 if (!MyTCommunicator)
567 {
568 MyTCommunicator = new TInspector_Communicator();
570 MyTCommunicator->RegisterPlugin ("TKDFBrowser");
571 MyTCommunicator->RegisterPlugin ("TKVInspector");
572 MyTCommunicator->RegisterPlugin ("TKShapeView");
8dcb81ac 573 MyTCommunicator->RegisterPlugin ("TKMessageView");
d2c90917 574
575 MyTCommunicator->Init (aParameters);
576 MyTCommunicator->Activate ("TKDFBrowser");
577 }
578 MyTCommunicator->SetVisible (true);
77d94fd1 580~~~~
d2c90917 581
ab5b3c22 582Give one the following objects for a plugin using a container of parameters:
d2c90917 584| Plugin | to be initialized by |
585| :----- | :----- |
ab5b3c22 586| *TKDFBrowser* | *TDocStd_Application* |
587| *TKVInspector* | *AIS_InteractiveContext* |
588| *TKShapeView* | *TopoDS_TShape* |
8dcb81ac 589| *TKMessageView* | *Message_Report* |
ab5b3c22 590
d2c90917 591
ab5b3c22 592@section occt_inspector_5 Build procedure
d2c90917 593
ab5b3c22 595@subsection occt_inspector_5_1 Building with CMake within OCCT
d2c90917 596
597By default the Inspector compilation is off.
ab5b3c22 598To compile it, set the *BUILD_Inspector* flag to "ON". See @ref build_cmake_conf "Configuration process".
d2c90917 599
ab5b3c22 600When this option is switched ON, MS Visual Studio project has an additional tree of folders:
d2c90917 601
ab5b3c22 602@figure{VStudio_projects.png,"Inspector packages in MS Visual Studio",160}
d2c90917 603
ab5b3c22 605@section occt_inspector_6 Sources and packaging
d2c90917 606
607OCCT sources are extended by the /tools directory.
ab5b3c22 609Distribution of plugin packages :
610| Source packages | Plugin |
d2c90917 611| :----- | :----- |
ab5b3c22 612| *DFBrowser*, <br> *DFBrowserPane*, <br> *DFBrowserPaneXDE*, <br> *TKDFBrowser* | DFBrowser |
613| *VInspector*, <br> *TKVInspector* | VInspector |
614| *ShapeView*, <br> *TKShapeView* | ShapeView |
8dcb81ac 615| *MessageView*, <br> *TKMessageView* | MessageView |
d2c90917 616
617Other packages:
ab5b3c22 618| Source packages| Used in |
d2c90917 619| :----- | :----- |
ab5b3c22 620| *TInspectorAPI*, <br> *TKInspectorAPI* | Interface for connection to plugin. |
8dcb81ac 621| *ViewControl*, <br> *TKTreeModel* | Classes for property view, table, table model. |
ab5b3c22 622| *TreeModel*, <br> *TKTreeView* | Items-oriented model to simplify work with GUI tree control. |
623| *View*, <br> *TKView* | 3D View component. |
624| *TInspector*, <br> *TKTInspector* | Inspector window, where plugins are placed. |
625| *ToolsDraw*, <br> *TKToolsDraw* | Plugin for DRAW to start Inspector. |
d2c90917 626
ab5b3c22 628In MSVC studio, a separate folder contains Inspector projects.
d2c90917 629
ab5b3c22 630@section occt_inspector_7 Glossary
631* **Component** -- a part of OCCT , e.g. OCAF, VISUALIZATION, MODELING and others.
632* **Plugin** -- a library that is loaded in some executable/library. Here, the plugins are:
d2c90917 633 * DFBrowser,
634 * ShapeView,
635 * VInspector.