1 // Created on: 2020-02-10
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2020 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <inspector/VInspector_ItemContextProperties.hxx>
18 #include <inspector/VInspector_ItemContext.hxx>
19 #include <inspector/VInspector_ItemV3dViewer.hxx>
20 #include <inspector/VInspector_ItemSelectMgrViewerSelector.hxx>
22 // =======================================================================
23 // function : initValue
25 // =======================================================================
26 QVariant VInspector_ItemContextProperties::initValue (int theItemRole) const
28 QVariant aParentValue = VInspector_ItemBase::initValue (theItemRole);
29 if (aParentValue.isValid())
32 if (Column() != 0 || (theItemRole != Qt::DisplayRole && theItemRole != Qt::ToolTipRole))
38 // =======================================================================
39 // function : initRowCount
41 // =======================================================================
42 int VInspector_ItemContextProperties::initRowCount() const
44 return 2; // V3d_Viewer, SelectMgr_ViewerSelector
47 // =======================================================================
48 // function : createChild
50 // =======================================================================
51 TreeModel_ItemBasePtr VInspector_ItemContextProperties::createChild (int theRow, int theColumn)
54 return VInspector_ItemV3dViewer::CreateItem (currentItem(), theRow, theColumn);
56 return VInspector_ItemSelectMgrViewerSelector::CreateItem (currentItem(), theRow, theColumn);
59 // =======================================================================
60 // function : initItem
62 // =======================================================================
63 void VInspector_ItemContextProperties::initItem() const
67 const_cast<VInspector_ItemContextProperties*> (this)->Init();