1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 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 #ifndef DFBrowserPane_TNamingNamedShape_H
17 #define DFBrowserPane_TNamingNamedShape_H
19 #include <inspector/DFBrowserPane_AttributePane.hxx>
20 #include <inspector/DFBrowserPane_HelperExport.hxx>
22 #include <Standard.hxx>
23 #include <TDF_Attribute.hxx>
24 #include <TNaming_NamedShape.hxx>
25 #include <TopoDS_Shape.hxx>
27 #include <Standard_WarningsDisable.hxx>
29 #include <QModelIndex>
30 #include <Standard_WarningsRestore.hxx>
32 class DFBrowserPane_TableView;
33 class DFBrowserPane_AttributePaneModel;
35 //! \class DFBrowserPane_TNamingNamedShape
36 //! \brief The class to manipulate of TNaming_NamedShape attribute
37 class DFBrowserPane_TNamingNamedShape : public DFBrowserPane_AttributePane
42 Standard_EXPORT DFBrowserPane_TNamingNamedShape();
45 Standard_EXPORT virtual ~DFBrowserPane_TNamingNamedShape() {}
47 //! Creates table view and call create widget of array table helper
48 //! \param theParent a parent widget
49 //! \return a new widget
50 Standard_EXPORT virtual QWidget* CreateWidget (QWidget* theParent) Standard_OVERRIDE;
52 //! Initializes the content of the pane by the parameter attribute
53 //! \param theAttribute an OCAF attribute
54 Standard_EXPORT void Init (const Handle(TDF_Attribute)& theAttribute);
56 //! Returns information for the given attribute
57 //! \param theAttribute a current attribute
58 //! \param theRole a role of information, used by tree model (e.g. DisplayRole, icon, background and so on)
59 //! \param theColumnId a tree model column
60 //! \return value, interpreted by tree model depending on the role
61 Standard_EXPORT virtual QVariant GetAttributeInfo (const Handle(TDF_Attribute)& theAttribute,
62 int theRole, int theColumnId) Standard_OVERRIDE;
64 //! Returns brief attribute information. In general case, it returns GetValues() result.
65 //! \param theAttribute a current attribute
66 //! \param theValues a result list of values
67 Standard_EXPORT virtual void GetShortAttributeInfo (const Handle(TDF_Attribute)& theAttribute,
68 QList<QVariant>& theValues) Standard_OVERRIDE;
70 //! Returns selection kind for the model, it may be General selection or Additional selection for example
71 //! \param theModel one of selection models provided by this pane
72 //! \return selection kind
73 Standard_EXPORT virtual int GetSelectionKind (QItemSelectionModel* theModel) Standard_OVERRIDE;
75 //! Returns selection parameters, that may be useful for communicate between tools
76 //! \param theModel one of selection models provided by this pane
77 //! \theParameters a container of parameters, might be extended depending on the pane state(e.g. selection)
78 Standard_EXPORT virtual void GetSelectionParameters (QItemSelectionModel* theModel,
79 NCollection_List<Handle(Standard_Transient)>& theParameters) Standard_OVERRIDE;
81 //! Returns container of Label references to the attribute
82 //! \param theAttribute a current attribute
83 //! \param theRefLabels a container of label references, to be selected in tree view
84 //! \param theRefPresentation handle of presentation for the references, to be visualized
85 Standard_EXPORT virtual void GetReferences (const Handle(TDF_Attribute)& theAttribute,
86 NCollection_List<TDF_Label>& theRefLabels,
87 Handle(Standard_Transient)& theRefPresentation) Standard_OVERRIDE;
89 //! Returns presentation of the attribute to be visualized in the view
90 //! \param theAttribute a current attribute
91 //! \return handle of presentation if the attribute has, to be visualized
92 Standard_EXPORT virtual Handle(Standard_Transient) GetPresentation
93 (const Handle (TDF_Attribute)& theAttribute) Standard_OVERRIDE;
95 //! Returns values to fill the table view model
96 //! \param theAttribute a current attribute
97 //! \param theValues a container of values
98 Standard_EXPORT virtual void GetValues (const Handle(TDF_Attribute)& theAttribute,
99 QList<QVariant>& theValues) Standard_OVERRIDE;
103 //! Returns a compound of selected shapes in both, values and evolution tables
104 //! \return shape or NULL
105 TopoDS_Shape getSelectedShapes();
109 DFBrowserPane_TableView* myEvolutionTableView; //!< table view for evolution shapes
110 DFBrowserPane_AttributePaneModel* myEvolutionPaneModel;//!< view model for evolution shapes
112 DFBrowserPane_HelperExport myHelperExport; //!<! helper to perform export to BREP