File: DFBrowser_Window.cxx

package info (click to toggle)
opencascade 7.9.2%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 301,924 kB
  • sloc: cpp: 1,523,264; tcl: 10,159; cs: 5,173; java: 1,554; sh: 1,342; ansic: 827; xml: 699; makefile: 30; javascript: 22
file content (1120 lines) | stat: -rw-r--r-- 43,324 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
// Created on: 2017-06-16
// Created by: Natalia ERMOLAEVA
// Copyright (c) 2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.

#include <inspector/DFBrowser_Window.hxx>

#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_ListOfInteractive.hxx>

#include <inspector/DFBrowserPane_AttributePaneAPI.hxx>

#include <inspector/DFBrowser_AttributePaneStack.hxx>
#include <inspector/DFBrowser_AttributePaneType.hxx>
#include <inspector/DFBrowser_DumpView.hxx>
#include <inspector/DFBrowser_Item.hxx>
#include <inspector/DFBrowser_ItemApplication.hxx>
#include <inspector/DFBrowser_Module.hxx>
#include <inspector/DFBrowser_OpenApplication.hxx>
#include <inspector/DFBrowser_PropertyPanel.hxx>
#include <inspector/DFBrowser_SearchLine.hxx>
#include <inspector/DFBrowser_SearchView.hxx>
#include <inspector/DFBrowser_Tools.hxx>
#include <inspector/DFBrowser_TreeLevelLine.hxx>
#include <inspector/DFBrowser_TreeLevelView.hxx>
#include <inspector/DFBrowser_TreeModel.hxx>

#include <inspector/DFBrowserPane_AttributePaneSelector.hxx>
#include <inspector/DFBrowserPane_SelectionKind.hxx>
#include <inspector/DFBrowserPane_Tools.hxx>

#include <inspector/TreeModel_ContextMenu.hxx>
#include <inspector/TreeModel_Tools.hxx>

#include <inspector/ViewControl_PropertyView.hxx>
#include <inspector/ViewControl_TreeView.hxx>

#include <OSD_Directory.hxx>
#include <OSD_Environment.hxx>
#include <OSD_Protection.hxx>

#include <inspector/View_Displayer.hxx>
#include <inspector/View_ToolBar.hxx>
#include <inspector/View_Viewer.hxx>
#include <inspector/View_Window.hxx>

#include <TDF_Tool.hxx>
#include <inspector/ViewControl_MessageDialog.hxx>
#include <inspector/ViewControl_Tools.hxx>

#include <Standard_WarningsDisable.hxx>
#include <QAction>
#include <QApplication>
#include <QComboBox>
#include <QDir>
#include <QDockWidget>
#include <QGridLayout>
#include <QList>
#include <QMainWindow>
#include <QItemSelectionModel>
#include <QPushButton>
#include <QTabWidget>
#include <QToolBar>
#include <QTreeView>
#include <QMenu>
#include <QMessageBox>
#include <QStatusBar>
#include <QWidget>
#if QT_VERSION < 0x050000
  #include <QWindowsStyle>
#else
  #include <QStyleFactory>
#endif
#include <Standard_WarningsRestore.hxx>

const int DFBROWSER_DEFAULT_TREE_VIEW_WIDTH  = 325;
const int DFBROWSER_DEFAULT_TREE_VIEW_HEIGHT = 500;
const int DFBROWSER_DEFAULT_VIEW_WIDTH       = 400;
const int DFBROWSER_DEFAULT_VIEW_HEIGHT      = 300;

static Standard_Boolean MyIsUseDumpJson = Standard_False;

// =======================================================================
// function : Constructor
// purpose :
// =======================================================================
DFBrowser_Window::DFBrowser_Window()
    : myModule(0),
      myParent(0),
      myPropertyPanel(0),
      myExportToShapeViewDialog(0)
{
  myMainWindow = new QMainWindow(0);

  // tree view
  myTreeView = new ViewControl_TreeView(myMainWindow);
  myTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
  connect(myTreeView,
          SIGNAL(customContextMenuRequested(const QPoint&)),
          this,
          SLOT(onTreeViewContextMenuRequested(const QPoint&)));
  new TreeModel_ContextMenu(myTreeView);
  ((ViewControl_TreeView*)myTreeView)
    ->SetPredefinedSize(
      QSize(DFBROWSER_DEFAULT_TREE_VIEW_WIDTH, DFBROWSER_DEFAULT_TREE_VIEW_HEIGHT));
  myTreeView->setHeaderHidden(true);
  myTreeView->setSortingEnabled(Standard_False);
  myMainWindow->setCentralWidget(myTreeView);

#if QT_VERSION < 0x050000
  myTreeView->setStyle(new QWindowsStyle);
#else
  myTreeView->setStyle(QStyleFactory::create("Windows"));
#endif

  myTreeLevelLine = new DFBrowser_TreeLevelLine(myMainWindow);
  connect(myTreeLevelLine->GetSearchLine(),
          SIGNAL(searchActivated()),
          this,
          SLOT(onSearchActivated()));
  connect(myTreeLevelLine,
          SIGNAL(indexSelected(const QModelIndex&)),
          this,
          SLOT(onTreeLevelLineSelected(const QModelIndex&)));
  connect(myTreeLevelLine, SIGNAL(updateClicked()), this, SLOT(onUpdateClicked()));

  QDockWidget* aTreeLineDockWidget = new QDockWidget(tr("Tree Level Line"), myMainWindow);
  aTreeLineDockWidget->setObjectName(aTreeLineDockWidget->windowTitle());
  aTreeLineDockWidget->setTitleBarWidget(new QWidget(myMainWindow));
  aTreeLineDockWidget->setWidget(myTreeLevelLine->GetControl());
  myMainWindow->addDockWidget(Qt::TopDockWidgetArea, aTreeLineDockWidget);

  // property panel
  myPropertyPanel                                    = new DFBrowser_PropertyPanel(myMainWindow);
  DFBrowser_AttributePaneStack* anAttributePaneStack = myPropertyPanel->GetAttributesStack();
  anAttributePaneStack->GetSearchView()->SetSearchLine(myTreeLevelLine->GetSearchLine());

  connect(
    anAttributePaneStack->GetPaneSelector(),
    SIGNAL(
      tableSelectionChanged(const QItemSelection&, const QItemSelection&, QItemSelectionModel*)),
    this,
    SLOT(
      onPaneSelectionChanged(const QItemSelection&, const QItemSelection&, QItemSelectionModel*)));

  DFBrowser_SearchView* aSearchView = anAttributePaneStack->GetSearchView();
  connect(aSearchView,
          SIGNAL(pathSelected(const QStringList&, const QString&)),
          this,
          SLOT(onSearchPathSelected(const QStringList&, const QString&)));
  connect(aSearchView,
          SIGNAL(pathDoubleClicked(const QStringList&, const QString&)),
          this,
          SLOT(onSearchPathDoubleClicked(const QStringList&, const QString&)));

  DFBrowser_TreeLevelView* aLevelView = anAttributePaneStack->GetTreeLevelView();
  connect(aLevelView,
          SIGNAL(indexSelected(const QModelIndex&)),
          this,
          SLOT(onLevelSelected(const QModelIndex&)));
  connect(aLevelView,
          SIGNAL(indexDoubleClicked(const QModelIndex&)),
          this,
          SLOT(onLevelDoubleClicked(const QModelIndex&)));

  // property custom panel with specific parameters of attributes
  QDockWidget* aPropertyPanelWidget = new QDockWidget(tr("PropertyPanel (custom)"), myMainWindow);
  aPropertyPanelWidget->setObjectName(aPropertyPanelWidget->windowTitle());
  aPropertyPanelWidget->setTitleBarWidget(new QWidget(myMainWindow));
  aPropertyPanelWidget->setWidget(myPropertyPanel->GetControl());
  myMainWindow->addDockWidget(Qt::RightDockWidgetArea, aPropertyPanelWidget);

  // property panel
  myUseDumpJson             = new QWidget(myMainWindow);
  QVBoxLayout* aLay         = new QVBoxLayout(myUseDumpJson);
  QPushButton* aUseDumpJson = new QPushButton("Use DumpJson", myMainWindow);
  aLay->addWidget(aUseDumpJson);
  aLay->addStretch(1);
  connect(aUseDumpJson, SIGNAL(clicked(bool)), this, SLOT(onUseDumpJson()));
  myUseDumpJson->setVisible(false);

  myPropertyPanelWidget = new QDockWidget(tr("PropertyPanel"), myMainWindow);
  myPropertyView        = new ViewControl_PropertyView(
    myMainWindow,
    QSize(DFBROWSER_DEFAULT_VIEW_WIDTH, DFBROWSER_DEFAULT_VIEW_HEIGHT));
  myPropertyPanelWidget->setObjectName(myPropertyPanelWidget->windowTitle());
  myPropertyPanelWidget->setTitleBarWidget(new QWidget(myMainWindow));
  myPropertyPanelWidget->setWidget(myPropertyView->GetControl());
  updatePropertyPanelWidget();
  myMainWindow->addDockWidget(Qt::RightDockWidgetArea, myPropertyPanelWidget);

  // dump view window
  QWidget*     aDumpWidget = new QWidget(myMainWindow);
  QVBoxLayout* aDumpLay    = new QVBoxLayout(aDumpWidget);
  aDumpLay->setMargin(0);
  myDumpView = new DFBrowser_DumpView(aDumpWidget);
  aDumpLay->addWidget(myDumpView->GetControl());
  QDockWidget* aDumpDockWidget = new QDockWidget(tr("Dump"), myMainWindow);
  aDumpDockWidget->setObjectName(aDumpDockWidget->windowTitle());

  aDumpDockWidget->setWidget(aDumpWidget);
  myMainWindow->addDockWidget(Qt::RightDockWidgetArea, aDumpDockWidget);

  // view
  myViewWindow = new View_Window(myMainWindow);
  myViewWindow->SetPredefinedSize(DFBROWSER_DEFAULT_VIEW_WIDTH, DFBROWSER_DEFAULT_VIEW_HEIGHT);

  QDockWidget* aViewDockWidget = new QDockWidget(tr("View"), myMainWindow);
  aViewDockWidget->setObjectName(aViewDockWidget->windowTitle());
  aViewDockWidget->setTitleBarWidget(myViewWindow->ViewToolBar()->GetControl());
  aViewDockWidget->setWidget(myViewWindow);
  myMainWindow->addDockWidget(Qt::RightDockWidgetArea, aViewDockWidget);

  QColor aHColor(229, 243, 255);
  myViewWindow->Displayer()->SetAttributeColor(Quantity_Color(aHColor.red() / 255.,
                                                              aHColor.green() / 255.,
                                                              aHColor.blue() / 255.,
                                                              Quantity_TOC_sRGB),
                                               View_PresentationType_Additional);

  myMainWindow->splitDockWidget(myPropertyPanelWidget, aViewDockWidget, Qt::Vertical);
  myMainWindow->tabifyDockWidget(myPropertyPanelWidget, aPropertyPanelWidget);

  myMainWindow->tabifyDockWidget(aDumpDockWidget, aViewDockWidget);

  myTreeView->resize(DFBROWSER_DEFAULT_TREE_VIEW_WIDTH, DFBROWSER_DEFAULT_TREE_VIEW_HEIGHT);
}

// =======================================================================
// function : Destructor
// purpose :
// =======================================================================
DFBrowser_Window::~DFBrowser_Window()
{
  delete myModule;
}

// =======================================================================
// function : SetParent
// purpose :
// =======================================================================
void DFBrowser_Window::SetParent(void* theParent)
{
  myParent = (QWidget*)theParent;
  if (myParent)
  {
    QLayout* aLayout = myParent->layout();
    if (aLayout)
      aLayout->addWidget(GetMainWindow());

    if (!myOpenedFileName.isEmpty())
      myParent->setObjectName(myOpenedFileName);
  }
}

// =======================================================================
// function : FillActionsMenu
// purpose :
// =======================================================================
void DFBrowser_Window::FillActionsMenu(void* theMenu)
{
  QMenu*              aMenu        = (QMenu*)theMenu;
  QList<QDockWidget*> aDockwidgets = myMainWindow->findChildren<QDockWidget*>();
  for (QList<QDockWidget*>::iterator it = aDockwidgets.begin(); it != aDockwidgets.end(); ++it)
  {
    QDockWidget* aDockWidget = *it;
    if (aDockWidget->parentWidget() == myMainWindow)
      aMenu->addAction(aDockWidget->toggleViewAction());
  }
}

// =======================================================================
// function : GetPreferences
// purpose :
// =======================================================================
void DFBrowser_Window::GetPreferences(TInspectorAPI_PreferencesDataMap& theItem)
{
  theItem.Bind("geometry",
               TreeModel_Tools::ToString(myMainWindow->saveState()).toStdString().c_str());

  QMap<QString, QString> anItems;
  TreeModel_Tools::SaveState(myTreeView, anItems);
  View_Window::SaveState(myViewWindow, anItems);

  for (QMap<QString, QString>::const_iterator anItemsIt = anItems.begin();
       anItemsIt != anItems.end();
       anItemsIt++)
    theItem.Bind(anItemsIt.key().toStdString().c_str(), anItemsIt.value().toStdString().c_str());
}

// =======================================================================
// function : SetPreferences
// purpose :
// =======================================================================
void DFBrowser_Window::SetPreferences(const TInspectorAPI_PreferencesDataMap& theItem)
{
  if (theItem.IsEmpty())
  {
    TreeModel_Tools::SetDefaultHeaderSections(myTreeView);
    return;
  }

  for (TInspectorAPI_IteratorOfPreferencesDataMap anItemIt(theItem); anItemIt.More();
       anItemIt.Next())
  {
    if (anItemIt.Key().IsEqual("geometry"))
      myMainWindow->restoreState(TreeModel_Tools::ToByteArray(anItemIt.Value().ToCString()));
    else if (TreeModel_Tools::RestoreState(myTreeView,
                                           anItemIt.Key().ToCString(),
                                           anItemIt.Value().ToCString()))
      continue;
    else if (View_Window::RestoreState(myViewWindow,
                                       anItemIt.Key().ToCString(),
                                       anItemIt.Value().ToCString()))
      continue;
  }
}

// =======================================================================
// function : UpdateContent
// purpose :
// =======================================================================
void DFBrowser_Window::UpdateContent()
{
  TCollection_AsciiString aName = "TKDFBrowser";

  if (myParameters->FindParameters(aName))
    Init(myParameters->Parameters(aName));
  else
    Init(NCollection_List<Handle(Standard_Transient)>());

  if (myParameters->FindFileNames(aName))
  {
    NCollection_List<TCollection_AsciiString> aFileNames = myParameters->FileNames(aName);
    if (aFileNames.Extent() > 0) // only one document file might be opened
      OpenFile(aFileNames.First());
    myParameters->SetFileNames(aName, NCollection_List<TCollection_AsciiString>());
  }
  onUpdateClicked();

  // make parameter items selected if defined
  if (myParameters->FindSelectedNames(aName))
  {
    const NCollection_List<TCollection_AsciiString>& aSelected =
      myParameters->GetSelectedNames(aName);

    DFBrowser_TreeModel* aTreeModel = dynamic_cast<DFBrowser_TreeModel*>(myTreeView->model());
    Handle(TDocStd_Application) anApplication = aTreeModel->GetTDocStdApplication();

    QItemSelectionModel* aSelectionModel = myTreeView->selectionModel();
    aSelectionModel->clear();

    NCollection_List<TCollection_AsciiString>::Iterator aSelectedIt(aSelected);
    if (aSelectedIt.More())
    {
      TCollection_AsciiString aLabelEntry = aSelectedIt.Value();

      TDF_Label aLabel;
      for (Standard_Integer aDocId = 1, aNbDoc = anApplication->NbDocuments(); aDocId <= aNbDoc;
           aDocId++)
      {
        Handle(TDocStd_Document) aDocument;
        anApplication->GetDocument(aDocId, aDocument);

        TDF_Tool::Label(aDocument->GetData(), aLabelEntry.ToCString(), aLabel, Standard_False);
        if (!aLabel.IsNull())
          break;
      }
      if (!aLabel.IsNull())
      {
        QModelIndex anIndexToBeSelected = aTreeModel->FindIndex(aLabel);

        TCollection_AsciiString anAttributeType;
        aSelectedIt.Next();
        // find attribute by attribute type on the given label
        if (aSelectedIt.More())
        {
          anAttributeType = aSelectedIt.Value();

          TreeModel_ItemBasePtr aLabelItem =
            TreeModel_ModelBase::GetItemByIndex(anIndexToBeSelected);
          // DFBrowser_ItemPtr anItem = itemDynamicCast<DFBrowser_Item> (anItemBase);
          for (int aChildId = 0, aNbChildren = aLabelItem->rowCount(); aChildId < aNbChildren;
               aChildId++)
          {
            QModelIndex           anIndex    = aTreeModel->index(aChildId, 0, anIndexToBeSelected);
            TreeModel_ItemBasePtr anItemBase = TreeModel_ModelBase::GetItemByIndex(anIndex);
            DFBrowser_ItemPtr     anItem     = itemDynamicCast<DFBrowser_Item>(anItemBase);
            if (anItem->HasAttribute())
            {
              // processing attribute in theValue
              DFBrowser_ItemApplicationPtr aRootAppItem =
                itemDynamicCast<DFBrowser_ItemApplication>(aTreeModel->RootItem(0));
              QString anAttributeInfo =
                DFBrowser_Module::GetAttributeInfo(anItem->GetAttribute(),
                                                   aRootAppItem->GetModule(),
                                                   Qt::DisplayRole,
                                                   0)
                  .toString();
              if (anAttributeInfo == anAttributeType.ToCString())
              {
                anIndexToBeSelected = anIndex;
                break;
              }
            }
          }
        }
        aSelectionModel->select(anIndexToBeSelected, QItemSelectionModel::Select);
        myTreeView->scrollTo(anIndexToBeSelected);
      }
    }

    myParameters->SetSelectedNames(aName, NCollection_List<TCollection_AsciiString>());
  }
}

// =======================================================================
// function : Init
// purpose :
// =======================================================================
void DFBrowser_Window::Init(const NCollection_List<Handle(Standard_Transient)>& theParameters)
{
  Handle(TDocStd_Application) anApplication;
  if (myModule)
  {
    DFBrowser_TreeModel* anOCAFViewModel =
      dynamic_cast<DFBrowser_TreeModel*>(myModule->GetOCAFViewModel());
    if (anOCAFViewModel)
      anApplication = anOCAFViewModel->GetTDocStdApplication();
  }
  Handle(AIS_InteractiveContext) aContext;
  if (myModule)
    aContext = myModule->GetExternalContext();

  bool aSameApplication = !anApplication.IsNull(), aSameContext = !aContext.IsNull();
  for (NCollection_List<Handle(Standard_Transient)>::Iterator aParametersIt(theParameters);
       aParametersIt.More();
       aParametersIt.Next())
  {
    Handle(Standard_Transient) anObject = aParametersIt.Value();
    // check if the object is an application
    Handle(TDocStd_Application) anIApplication = Handle(TDocStd_Application)::DownCast(anObject);
    if (!anIApplication.IsNull())
    {
      aSameApplication = anApplication == anIApplication;
      if (!aSameApplication)
        anApplication = anIApplication;
    }
    // check if the object is an interactive context
    Handle(AIS_InteractiveContext) anIContext = Handle(AIS_InteractiveContext)::DownCast(anObject);
    if (!anIContext.IsNull())
    {
      aSameContext = aContext == anIContext;
      if (!aSameContext)
        aContext = anIContext;
    }
  }
  if (aSameApplication)
  {
    if (!aSameContext && !aContext.IsNull())
    {
      myModule->SetExternalContext(aContext);
      myViewWindow->SetContext(View_ContextType_External, aContext);
    }
    return;
  }

  myModule = new DFBrowser_Module();
  myModule->CreateViewModel(myMainWindow);

  myPropertyPanel->GetAttributesStack()->SetModule(myModule);

  // model should be set after the attribute pane stack is initialized by module
  QAbstractItemModel* aModel = myModule->GetOCAFViewModel();
  setOCAFModel(aModel);
  myModule->SetOCAFViewSelectionModel(myTreeView->selectionModel());
  myTreeLevelLine->GetSearchLine()->SetModule(myModule);
  myPropertyPanel->GetAttributesStack()->GetSearchView()->InitModels();

  connect(myModule, SIGNAL(beforeUpdateTreeModel()), this, SLOT(onBeforeUpdateTreeModel()));

  if (!aContext.IsNull())
  {
    myModule->SetExternalContext(aContext);
    myViewWindow->SetContext(View_ContextType_External, aContext);
  }

  myModule->SetApplication(anApplication);
  //! expand first three levels: CUSTOM
  QModelIndex aParentIndex = aModel->index(0, 0);
  setExpandedLevels(myTreeView, aParentIndex, 3 /*levels*/);

  myModule->SetInitialTreeViewSelection();
}

// =======================================================================
// function : OpenFile
// purpose :
// =======================================================================
void DFBrowser_Window::OpenFile(const TCollection_AsciiString& theFileName)
{
  QApplication::setOverrideCursor(Qt::WaitCursor);

  myTreeLevelLine->ClearHistory();
  QItemSelectionModel* aSelectionModel = myModule->GetOCAFViewSelectionModel();
  if (aSelectionModel)
  {
    aSelectionModel->clearSelection();
    QModelIndex anIndex;
    aSelectionModel->select(anIndex, QItemSelectionModel::ClearAndSelect);
  }

  myTreeLevelLine->ClearHistory();

  DFBrowser_TreeModel* anOCAFViewModel =
    dynamic_cast<DFBrowser_TreeModel*>(myModule->GetOCAFViewModel());
  anOCAFViewModel->Reset();

  //! close previous documents to open new document
  Handle(TDocStd_Application) anApplication = myModule->GetTDocStdApplication();
  if (!anApplication.IsNull())
  {
    for (int aDocId = 1, aNbDocuments = anApplication->NbDocuments(); aDocId <= aNbDocuments;
         aDocId++)
    {
      Handle(TDocStd_Document) aDocument;
      anApplication->GetDocument(aDocId, aDocument);
      if (!aDocument.IsNull())
        anApplication->Close(aDocument);
    }
  }

  //! open new document
  bool isSTEPFileName = false;
  anApplication       = DFBrowser_OpenApplication::OpenApplication(theFileName, isSTEPFileName);

  if (myParent)
    myParent->setObjectName(isSTEPFileName
                              ? QString(TCollection_AsciiString(theFileName).ToCString())
                              : getWindowTitle());
  else
    myOpenedFileName =
      isSTEPFileName ? QString(TCollection_AsciiString(theFileName).ToCString()) : getWindowTitle();

  if (anApplication.IsNull())
  {
    QApplication::restoreOverrideCursor();
    QMessageBox::information(0,
                             "Error",
                             QString("File %1 can't be opened by OCAF application")
                               .arg(TCollection_AsciiString(theFileName).ToCString()));
  }
  else
  {
    myModule->SetApplication(anApplication);
    //! expand first three levels: CUSTOM
    QModelIndex aParentIndex = anOCAFViewModel->index(0, 0);
    setExpandedLevels(myTreeView, aParentIndex, 3 /*levels*/);

    myModule->SetInitialTreeViewSelection();
    QApplication::restoreOverrideCursor();
  }
}

// =======================================================================
// function : getWindowTitle
// purpose :
// =======================================================================
QString DFBrowser_Window::getWindowTitle() const
{
  DFBrowser_TreeModel* anOCAFViewModel =
    dynamic_cast<DFBrowser_TreeModel*>(myModule->GetOCAFViewModel());
  if (!anOCAFViewModel)
    return "";

  Handle(TDocStd_Application) anApplication = anOCAFViewModel->GetTDocStdApplication();
  if (anApplication.IsNull() || anApplication->NbDocuments() == 0)
    return "";

  Handle(TDocStd_Document) aDocument;
  anApplication->GetDocument(1, aDocument);
  if (aDocument.IsNull() || !aDocument->IsSaved())
    return "";

  return DFBrowserPane_Tools::ToString(aDocument->GetPath());
}

// =======================================================================
// function : setExpandedLevels
// purpose :
// =======================================================================
void DFBrowser_Window::setExpandedLevels(QTreeView*         theTreeView,
                                         const QModelIndex& theParentIndex,
                                         const int          theLevels)
{
  if (theLevels <= 0)
    return;

  QAbstractItemModel* aModel = theTreeView->model();
  if (!aModel)
    return;

  theTreeView->setExpanded(theParentIndex, true);
  for (int aRowId = 0, aRows = aModel->rowCount(theParentIndex); aRowId < aRows; aRowId++)
    setExpandedLevels(theTreeView, aModel->index(aRowId, 0, theParentIndex), theLevels - 1);
}

// =======================================================================
// function : setOCAFModel
// purpose :
// =======================================================================
void DFBrowser_Window::setOCAFModel(QAbstractItemModel* theModel)
{
  myTreeView->setModel(theModel);

  QItemSelectionModel* aSelectionModel = new QItemSelectionModel(theModel);
  myTreeView->setSelectionModel(aSelectionModel);

  connect(aSelectionModel,
          SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
          myTreeLevelLine,
          SLOT(OnTreeViewSelectionChanged(const QItemSelection&, const QItemSelection&)));
  connect(aSelectionModel,
          SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
          myDumpView,
          SLOT(OnTreeViewSelectionChanged(const QItemSelection&, const QItemSelection&)));
  connect(aSelectionModel,
          SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
          this,
          SLOT(onTreeViewSelectionChanged(const QItemSelection&, const QItemSelection&)));
}

// =======================================================================
// function : onBeforeUpdateTreeModel
// purpose :
// =======================================================================
void DFBrowser_Window::onBeforeUpdateTreeModel()
{
  myTreeLevelLine->ClearHistory();
}

// =======================================================================
// function : TmpDirectory
// purpose :
// =======================================================================
TCollection_AsciiString DFBrowser_Window::TmpDirectory()
{
  TCollection_AsciiString aTmpDir;
#ifdef _WIN32
  OSD_Environment anEnvironment("TEMP");
  aTmpDir = anEnvironment.Value();
  if (aTmpDir.IsEmpty())
  {
    anEnvironment.SetName("TMP");
    aTmpDir = anEnvironment.Value();
    if (aTmpDir.IsEmpty())
      aTmpDir = "C:\\";
  }
  OSD_Path      aTmpPath(aTmpDir);
  OSD_Directory aTmpDirectory(aTmpPath);
  if (!aTmpDirectory.Exists())
    aTmpDirectory.Build(OSD_Protection());
#else
  OSD_Directory aTmpDirectory = OSD_Directory::BuildTemporary();
  OSD_Path      aTmpPath;
  aTmpDirectory.Path(aTmpPath);
  aTmpPath.SystemName(aTmpDir);
#endif

  return aTmpDir;
}

// =======================================================================
// function : SetUseDumpJson
// purpose :
// =======================================================================
void DFBrowser_Window::SetUseDumpJson(const Standard_Boolean theValue)
{
  MyIsUseDumpJson = theValue;
}

// =======================================================================
// function : IsUseDumpJson
// purpose :
// =======================================================================
Standard_Boolean DFBrowser_Window::IsUseDumpJson()
{
  return MyIsUseDumpJson;
}

// =======================================================================
// function : onTreeViewContextMenuRequested
// purpose :
// =======================================================================
void DFBrowser_Window::onTreeViewContextMenuRequested(const QPoint& thePosition)
{
  QMenu* aMenu = new QMenu(GetMainWindow());
  aMenu->addAction(
    ViewControl_Tools::CreateAction(tr("Expand"), SLOT(onExpand()), GetMainWindow(), this));
  aMenu->addAction(
    ViewControl_Tools::CreateAction(tr("Expand All"), SLOT(onExpandAll()), GetMainWindow(), this));
  aMenu->addAction(ViewControl_Tools::CreateAction(tr("Collapse All"),
                                                   SLOT(onCollapseAll()),
                                                   GetMainWindow(),
                                                   this));

  aMenu->addSeparator();
  QAction* aUseDumpJsonAction = ViewControl_Tools::CreateAction(tr("Use DumpJson"),
                                                                SLOT(onUseDumpJson()),
                                                                GetMainWindow(),
                                                                this);
  aUseDumpJsonAction->setCheckable(true);
  aUseDumpJsonAction->setChecked(IsUseDumpJson());
  aMenu->addAction(aUseDumpJsonAction);

  QPoint aPoint = myTreeView->mapToGlobal(thePosition);
  aMenu->exec(aPoint);
}

// =======================================================================
// function : onExpand
// purpose :
// =======================================================================
void DFBrowser_Window::onExpand()
{
  QApplication::setOverrideCursor(Qt::WaitCursor);

  QItemSelectionModel* aSelectionModel  = myTreeView->selectionModel();
  QModelIndexList      aSelectedIndices = aSelectionModel->selectedIndexes();
  for (int aSelectedId = 0, aSize = aSelectedIndices.size(); aSelectedId < aSize; aSelectedId++)
  {
    int aLevels = 2;
    TreeModel_Tools::SetExpanded(myTreeView, aSelectedIndices[aSelectedId], true, aLevels);
  }
  QApplication::restoreOverrideCursor();
}

// =======================================================================
// function : onExpandAll
// purpose :
// =======================================================================
void DFBrowser_Window::onExpandAll()
{
  QApplication::setOverrideCursor(Qt::WaitCursor);

  QItemSelectionModel* aSelectionModel  = myTreeView->selectionModel();
  QModelIndexList      aSelectedIndices = aSelectionModel->selectedIndexes();
  for (int aSelectedId = 0, aSize = aSelectedIndices.size(); aSelectedId < aSize; aSelectedId++)
  {
    int aLevels = -1;
    TreeModel_Tools::SetExpanded(myTreeView, aSelectedIndices[aSelectedId], true, aLevels);
  }
  QApplication::restoreOverrideCursor();
}

// =======================================================================
// function : onCollapseAll
// purpose :
// =======================================================================
void DFBrowser_Window::onCollapseAll()
{
  QItemSelectionModel* aSelectionModel  = myTreeView->selectionModel();
  QModelIndexList      aSelectedIndices = aSelectionModel->selectedIndexes();
  for (int aSelectedId = 0, aSize = aSelectedIndices.size(); aSelectedId < aSize; aSelectedId++)
  {
    int aLevels = -1;
    TreeModel_Tools::SetExpanded(myTreeView, aSelectedIndices[aSelectedId], false, aLevels);
  }
}

// =======================================================================
// function : onUseDumpJson
// purpose :
// =======================================================================
void DFBrowser_Window::onUseDumpJson()
{
  SetUseDumpJson(!IsUseDumpJson());
  updatePropertyPanelWidget();

  QApplication::setOverrideCursor(Qt::WaitCursor);
  myModule->UpdateTreeModel();
  QApplication::restoreOverrideCursor();
}

// =======================================================================
// function : onTreeViewSelectionChanged
// purpose :
// =======================================================================
void DFBrowser_Window::onTreeViewSelectionChanged(const QItemSelection& theSelected,
                                                  const QItemSelection& theDeselected)
{
  if (!myModule)
    return;

  if (IsUseDumpJson() && myPropertyPanelWidget->toggleViewAction()->isChecked())
  {
    myPropertyView->Init(ViewControl_Tools::CreateTableModelValues(myTreeView->selectionModel()));
  }

  // previuos selection should be cleared in the panel selectors
  DFBrowser_AttributePaneStack* anAttributePaneStack = myPropertyPanel->GetAttributesStack();
  anAttributePaneStack->GetPaneSelector()->ClearSelected();

  myPropertyPanel->UpdateBySelectionChanged(theSelected, theDeselected);
  anAttributePaneStack->GetTreeLevelView()->UpdateByTreeSelectionChanged(theSelected,
                                                                         theDeselected);

  QModelIndexList aSelectedIndices = theSelected.indexes();
  QModelIndex     aSelectedIndex   = TreeModel_ModelBase::SingleSelected(aSelectedIndices, 0);

  myTreeView->scrollTo(aSelectedIndex);
  View_Displayer* aDisplayer = myViewWindow->Displayer();

  aDisplayer->ErasePresentations(View_PresentationType_Additional, false);
  aDisplayer->DisplayPresentation(findPresentation(aSelectedIndex), View_PresentationType_Main);
}

// =======================================================================
// function : onSearchActivated
// purpose :
// =======================================================================
void DFBrowser_Window::onSearchActivated()
{
  myPropertyPanel->GetAttributesStack()->SetPaneMode(
    (myTreeLevelLine->GetSearchLine()->Text().isEmpty() ? DFBrowser_AttributePaneType_ItemView
                                                        : DFBrowser_AttributePaneType_SearchView));
}

// =======================================================================
// function : onPaneSelectionChanged
// purpose :
// =======================================================================
void DFBrowser_Window::onPaneSelectionChanged(const QItemSelection&,
                                              const QItemSelection&,
                                              QItemSelectionModel* theModel)
{
  DFBrowserPane_AttributePaneAPI* anAttributePane =
    myPropertyPanel->GetAttributesStack()->GetCurrentPane();
  switch (anAttributePane->GetSelectionKind(theModel))
  {
    case DFBrowserPane_SelectionKind_ExportToShapeViewer: {
      QItemSelectionModel* aSelectionModel  = theModel;
      QModelIndexList      aSelectedIndices = aSelectionModel->selectedIndexes();
      if (aSelectedIndices.size() != 1)
        return;

      TCollection_AsciiString                      aPluginName("TKShapeView");
      NCollection_List<Handle(Standard_Transient)> aParameters;
      if (myParameters->FindParameters(aPluginName))
        aParameters = myParameters->Parameters(aPluginName);

      NCollection_List<TCollection_AsciiString> anItemNames;
      if (myParameters->FindSelectedNames(aPluginName))
        anItemNames = myParameters->GetSelectedNames(aPluginName);

      int aParametersCount = aParameters.Extent();
      anAttributePane->GetSelectionParameters(aSelectionModel, aParameters, anItemNames);
      if (aParametersCount != aParameters.Extent()) // some TShapes are added
      {
        TCollection_AsciiString aPluginShortName = aPluginName.SubString(3, aPluginName.Length());
        QString                 aMessage         = QString("TShape %1 is sent to %2.")
                             .arg(Standard_Dump::GetPointerInfo(aParameters.Last()).ToCString())
                             .arg(aPluginShortName.ToCString());
        QString aQuestion = QString("Would you like to activate %1 immediately?\n")
                              .arg(aPluginShortName.ToCString())
                              .toStdString()
                              .c_str();
        if (!myExportToShapeViewDialog)
          myExportToShapeViewDialog = new ViewControl_MessageDialog(myParent, aMessage, aQuestion);
        else
          myExportToShapeViewDialog->SetInformation(aMessage);
        myExportToShapeViewDialog->Start();

        myParameters->SetSelectedNames(aPluginName, anItemNames);
        myParameters->SetParameters(aPluginName,
                                    aParameters,
                                    myExportToShapeViewDialog->IsAccepted());
      }
      return;
    }
    case DFBrowserPane_SelectionKind_ExportToBREP:
    case DFBrowserPane_SelectionKind_LabelReferences:
    case DFBrowserPane_SelectionKind_AttributeReferences:
    default:
      break;
  }

  QItemSelectionModel* aSelectionModel  = myTreeView->selectionModel();
  QModelIndexList      aSelectedIndices = aSelectionModel->selectedIndexes();
  if (aSelectedIndices.size() != 1)
    return;

  // make the shape visualized
  QModelIndex     aSelectedIndex = aSelectedIndices.first();
  View_Displayer* aDisplayer     = myViewWindow->Displayer();
  aDisplayer->DisplayPresentation(findPresentation(aSelectedIndex), View_PresentationType_Main);

  // highlight and scroll to the referenced item if it exists
  Handle(TDF_Attribute)       anAttribute = myModule->FindAttribute(aSelectedIndex);
  NCollection_List<TDF_Label> aReferences;
  Handle(Standard_Transient)  aPresentation;
  anAttributePane->GetReferences(anAttribute, aReferences, aPresentation);
  QModelIndexList      anIndices;
  DFBrowser_TreeModel* aTreeModel = dynamic_cast<DFBrowser_TreeModel*>(myTreeView->model());
  if (!aReferences.IsEmpty())
    aTreeModel->ConvertToIndices(aReferences, anIndices);
  else
  {
    NCollection_List<Handle(TDF_Attribute)> anAttributeReferences;
    anAttributePane->GetAttributeReferences(anAttribute, anAttributeReferences, aPresentation);
    aTreeModel->ConvertToIndices(anAttributeReferences, anIndices);
  }
  highlightIndices(anIndices);
  // display either the reference presentation of the panel or find a presentation if the reference
  // is an attribute
  if (!aPresentation.IsNull())
    aDisplayer->DisplayPresentation(aPresentation, View_PresentationType_Additional);
  else
  {
    aDisplayer->ErasePresentations(View_PresentationType_Additional, false);
    AIS_ListOfInteractive aDisplayed;
    findPresentations(anIndices, aDisplayed);
    for (AIS_ListIteratorOfListOfInteractive aDisplayedIt(aDisplayed); aDisplayedIt.More();
         aDisplayedIt.Next())
      aDisplayer->DisplayPresentation(aDisplayedIt.Value(),
                                      View_PresentationType_Additional,
                                      false);

    aDisplayer->UpdateViewer();
  }
}

// =======================================================================
// function : onTreeLevelLineSelected
// purpose :
// =======================================================================
void DFBrowser_Window::onTreeLevelLineSelected(const QModelIndex& theIndex)
{
  QItemSelectionModel* aSelectionModel = myTreeView->selectionModel();
  if (theIndex.isValid())
    aSelectionModel->select(theIndex, QItemSelectionModel::ClearAndSelect);
  else
    aSelectionModel->clearSelection();
}

// =======================================================================
// function : onUpdateClicked
// purpose :
// =======================================================================
void DFBrowser_Window::onUpdateClicked()
{
  if (myModule)
    myModule->UpdateTreeModel();
}

// =======================================================================
// function : onSearchPathSelected
// purpose :
// =======================================================================
void DFBrowser_Window::onSearchPathSelected(const QStringList& thePath, const QString& theValue)
{
  DFBrowser_TreeModel* aDFBrowserModel = dynamic_cast<DFBrowser_TreeModel*>(myTreeView->model());
  const QModelIndex&   anIndex         = aDFBrowserModel->FindIndexByPath(thePath, theValue);

  if (anIndex.isValid())
  {
    QModelIndexList anIndices;
    anIndices.append(anIndex);
    highlightIndices(anIndices);
  }
}

// =======================================================================
// function : onSearchPathDoubleClicked
// purpose :
// =======================================================================
void DFBrowser_Window::onSearchPathDoubleClicked(const QStringList& thePath,
                                                 const QString&     theValue)
{
  DFBrowser_TreeModel* aDFBrowserModel = dynamic_cast<DFBrowser_TreeModel*>(myTreeView->model());
  const QModelIndex&   anIndex         = aDFBrowserModel->FindIndexByPath(thePath, theValue);

  QItemSelectionModel* aSelectionModel = myTreeView->selectionModel();
  if (anIndex.isValid())
    aSelectionModel->select(anIndex, QItemSelectionModel::ClearAndSelect);
  else
    aSelectionModel->clearSelection();
}

// =======================================================================
// function : onLevelSelected
// purpose :
// =======================================================================
void DFBrowser_Window::onLevelSelected(const QModelIndex& theIndex)
{
  if (!theIndex.isValid())
    return;

  QModelIndexList anIndices;
  anIndices.append(theIndex);
  highlightIndices(anIndices);
  View_Displayer* aDisplayer = myViewWindow->Displayer();
  aDisplayer->ErasePresentations(View_PresentationType_Additional, false);
  aDisplayer->DisplayPresentation(findPresentation(theIndex), View_PresentationType_Main);
}

// =======================================================================
// function : onLevelDoubleClicked
// purpose :
// =======================================================================
void DFBrowser_Window::onLevelDoubleClicked(const QModelIndex& theIndex)
{
  QItemSelectionModel* aSelectionModel = myTreeView->selectionModel();
  if (theIndex.isValid())
    aSelectionModel->select(theIndex, QItemSelectionModel::ClearAndSelect);
  else
    aSelectionModel->clearSelection();
}

// =======================================================================
// function : highlightIndices
// purpose :
// =======================================================================
void DFBrowser_Window::highlightIndices(const QModelIndexList& theIndices)
{
  QAbstractItemModel* aModel = myTreeView->model();
  if (!aModel)
    return;

  DFBrowser_TreeModel* aTreeModel = dynamic_cast<DFBrowser_TreeModel*>(aModel);
  if (!aTreeModel)
    return;

  aTreeModel->SetHighlighted(theIndices);

  QModelIndex anIndexToScroll;
  if (!theIndices.isEmpty())
    anIndexToScroll = theIndices.last(); // scroll to last selected index
  else
  {
    // scroll to tree selected item
    QItemSelectionModel* aSelectionModel  = myTreeView->selectionModel();
    QModelIndexList      aSelectedIndices = aSelectionModel->selectedIndexes();
    if (aSelectedIndices.size() == 1)
      anIndexToScroll = aSelectedIndices.first();
  }
  if (anIndexToScroll.isValid())
    myTreeView->scrollTo(anIndexToScroll);

  if (theIndices.isEmpty())
    myTreeView->setFocus(); // to see the selected item in active palette color

  aTreeModel->EmitLayoutChanged();
}

// =======================================================================
// function : findPresentation
// purpose :
// =======================================================================
Handle(AIS_InteractiveObject) DFBrowser_Window::findPresentation(const QModelIndex& theIndex)
{
  Handle(AIS_InteractiveObject) aPresentation;

  QModelIndexList anIndices;
  anIndices.append(theIndex);
  AIS_ListOfInteractive aDisplayed;
  findPresentations(anIndices, aDisplayed);
  if (!aDisplayed.IsEmpty())
    aPresentation = aDisplayed.First();

  return aPresentation;
}

// =======================================================================
// function : findPresentations
// purpose :
// =======================================================================
void DFBrowser_Window::findPresentations(const QModelIndexList& theIndices,
                                         AIS_ListOfInteractive& thePresentations)
{
  for (int anIndexId = 0, aCount = theIndices.size(); anIndexId < aCount; anIndexId++)
  {
    Handle(AIS_InteractiveObject) aPresentation;
    Handle(TDF_Attribute)         anAttribute = myModule->FindAttribute(theIndices[anIndexId]);
    if (anAttribute.IsNull())
      continue;
    DFBrowserPane_AttributePaneAPI* anAttributePane = myModule->GetAttributePane(anAttribute);
    if (!anAttributePane)
      continue;
    aPresentation =
      Handle(AIS_InteractiveObject)::DownCast(anAttributePane->GetPresentation(anAttribute));
    if (aPresentation.IsNull())
      continue;

    thePresentations.Append(aPresentation);
  }
}

// =======================================================================
// function : updatePropertyPanelWidget
// purpose :
// =======================================================================
void DFBrowser_Window::updatePropertyPanelWidget()
{
  bool aUseDumpJson = IsUseDumpJson();

  myUseDumpJson->setVisible(!aUseDumpJson);
  myPropertyPanelWidget->setWidget(aUseDumpJson ? myPropertyView->GetControl() : myUseDumpJson);
}