0029018: Documentation - Provide user guide for Qt browser
[occt.git] / tools / DFBrowserPane / DFBrowserPane_TNamingNamedShape.hxx
CommitLineData
14bbbdcb 1// Created on: 2017-06-16
2// Created by: Natalia ERMOLAEVA
3// Copyright (c) 2017 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef DFBrowserPane_TNamingNamedShape_H
17#define DFBrowserPane_TNamingNamedShape_H
18
0cb512c0 19#include <inspector/DFBrowserPane_AttributePane.hxx>
20#include <inspector/DFBrowserPane_HelperExport.hxx>
21
14bbbdcb 22#include <Standard.hxx>
23#include <TDF_Attribute.hxx>
24#include <TNaming_NamedShape.hxx>
25#include <TopoDS_Shape.hxx>
26
27#include <QMap>
28#include <QModelIndex>
29
30class DFBrowserPane_TableView;
31class DFBrowserPane_AttributePaneModel;
32
33//! \class DFBrowserPane_TNamingNamedShape
34//! \brief The class to manipulate of TNaming_NamedShape attribute
35class DFBrowserPane_TNamingNamedShape : public DFBrowserPane_AttributePane
36{
37public:
38
39 //! Constructor
40 Standard_EXPORT DFBrowserPane_TNamingNamedShape();
41
42 //! Destructor
43 Standard_EXPORT virtual ~DFBrowserPane_TNamingNamedShape() {}
44
45 //! Creates table view and call create widget of array table helper
46 //! \param theParent a parent widget
47 //! \return a new widget
48 Standard_EXPORT virtual QWidget* CreateWidget (QWidget* theParent) Standard_OVERRIDE;
49
50 //! Initializes the content of the pane by the parameter attribute
51 //! \param theAttribute an OCAF attribute
52 Standard_EXPORT void Init (const Handle(TDF_Attribute)& theAttribute);
53
54 //! Returns information for the given attribute
55 //! \param theAttribute a current attribute
56 //! \param theRole a role of information, used by tree model (e.g. DisplayRole, icon, background and so on)
57 //! \param theColumnId a tree model column
58 //! \return value, interpreted by tree model depending on the role
59 Standard_EXPORT virtual QVariant GetAttributeInfo (const Handle(TDF_Attribute)& theAttribute,
60 int theRole, int theColumnId) Standard_OVERRIDE;
61
62 //! Returns brief attribute information. In general case, it returns GetValues() result.
63 //! \param theAttribute a current attribute
64 //! \param theValues a result list of values
65 Standard_EXPORT virtual void GetShortAttributeInfo (const Handle(TDF_Attribute)& theAttribute,
66 QList<QVariant>& theValues) Standard_OVERRIDE;
67
68 //! Returns selection kind for the model, it may be General selection or Additional selection for example
69 //! \param theModel one of selection models provided by this pane
70 //! \return selection kind
71 Standard_EXPORT virtual int GetSelectionKind (QItemSelectionModel* theModel) Standard_OVERRIDE;
72
73 //! Returns selection parameters, that may be useful for communicate between tools
74 //! \param theModel one of selection models provided by this pane
75 //! \theParameters a container of parameters, might be extended depending on the pane state(e.g. selection)
76 Standard_EXPORT virtual void GetSelectionParameters (QItemSelectionModel* theModel,
77 NCollection_List<Handle(Standard_Transient)>& theParameters) Standard_OVERRIDE;
78
79 //! Returns container of Label references to the attribute
80 //! \param theAttribute a current attribute
81 //! \param theRefLabels a container of label references, to be selected in tree view
82 //! \param theRefPresentation handle of presentation for the references, to be visualized
83 Standard_EXPORT virtual void GetReferences (const Handle(TDF_Attribute)& theAttribute,
84 NCollection_List<TDF_Label>& theRefLabels,
85 Handle(Standard_Transient)& theRefPresentation) Standard_OVERRIDE;
86
87 //! Returns presentation of the attribute to be visualized in the view
88 //! \param theAttribute a current attribute
89 //! \return handle of presentation if the attribute has, to be visualized
90 Standard_EXPORT virtual Handle(Standard_Transient) GetPresentation
91 (const Handle (TDF_Attribute)& theAttribute) Standard_OVERRIDE;
92
93 //! Returns values to fill the table view model
94 //! \param theAttribute a current attribute
95 //! \param theValues a container of values
96 Standard_EXPORT virtual void GetValues (const Handle(TDF_Attribute)& theAttribute,
97 QList<QVariant>& theValues) Standard_OVERRIDE;
98
99protected:
100
101 //! Returns a compound of selected shapes in both, values and evolution tables
102 //! \return shape or NULL
103 TopoDS_Shape getSelectedShapes();
104
105private:
106
107 DFBrowserPane_TableView* myEvolutionTableView; //!< table view for evolution shapes
108 DFBrowserPane_AttributePaneModel* myEvolutionPaneModel;//!< view model for evolution shapes
109
110 DFBrowserPane_HelperExport myHelperExport; //!<! helper to perform export to BREP
111};
112
113#endif