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 19 #include <inspector/DFBrowserPane_AttributePane.hxx> 20 #include <inspector/DFBrowserPane_HelperExport.hxx> 21 22 #include <Standard.hxx> 23 #include <TDF_Attribute.hxx> 24 #include <TNaming_NamedShape.hxx> 25 #include <TopoDS_Shape.hxx> 26 27 #include <Standard_WarningsDisable.hxx> 28 #include <QMap> 29 #include <QModelIndex> 30 #include <Standard_WarningsRestore.hxx> 31 32 class DFBrowserPane_TableView; 33 class DFBrowserPane_AttributePaneModel; 34 35 //! \class DFBrowserPane_TNamingNamedShape 36 //! \brief The class to manipulate of TNaming_NamedShape attribute 37 class DFBrowserPane_TNamingNamedShape : public DFBrowserPane_AttributePane 38 { 39 public: 40 41 //! Constructor 42 Standard_EXPORT DFBrowserPane_TNamingNamedShape(); 43 44 //! Destructor ~DFBrowserPane_TNamingNamedShape()45 Standard_EXPORT virtual ~DFBrowserPane_TNamingNamedShape() {} 46 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; 51 52 //! Initializes the content of the pane by the parameter attribute 53 //! \param theAttribute an OCAF attribute 54 Standard_EXPORT virtual void Init (const Handle(TDF_Attribute)& theAttribute) Standard_OVERRIDE; 55 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; 63 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; 69 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; 74 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 //! \theItemNames names to be selected for each selection parameter 79 Standard_EXPORT virtual void GetSelectionParameters (QItemSelectionModel* theModel, 80 NCollection_List<Handle(Standard_Transient)>& theParameters, 81 NCollection_List<TCollection_AsciiString>& theItemNames) Standard_OVERRIDE; 82 83 //! Returns container of Label references to the attribute 84 //! \param theAttribute a current attribute 85 //! \param theRefLabels a container of label references, to be selected in tree view 86 //! \param theRefPresentation handle of presentation for the references, to be visualized 87 Standard_EXPORT virtual void GetReferences (const Handle(TDF_Attribute)& theAttribute, 88 NCollection_List<TDF_Label>& theRefLabels, 89 Handle(Standard_Transient)& theRefPresentation) Standard_OVERRIDE; 90 91 //! Returns presentation of the attribute to be visualized in the view 92 //! \param theAttribute a current attribute 93 //! \return handle of presentation if the attribute has, to be visualized 94 Standard_EXPORT virtual Handle(Standard_Transient) GetPresentation 95 (const Handle (TDF_Attribute)& theAttribute) Standard_OVERRIDE; 96 97 //! Returns values to fill the table view model 98 //! \param theAttribute a current attribute 99 //! \param theValues a container of values 100 Standard_EXPORT virtual void GetValues (const Handle(TDF_Attribute)& theAttribute, 101 QList<QVariant>& theValues) Standard_OVERRIDE; 102 103 protected: 104 105 //! Returns a compound of selected shapes in both, values and evolution tables 106 //! \return shape or NULL 107 TopoDS_Shape getSelectedShapes(); 108 109 private: 110 111 DFBrowserPane_TableView* myEvolutionTableView; //!< table view for evolution shapes 112 DFBrowserPane_AttributePaneModel* myEvolutionPaneModel;//!< view model for evolution shapes 113 114 DFBrowserPane_HelperExport myHelperExport; //!<! helper to perform export to BREP 115 }; 116 117 #endif 118