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_TDataStdNamedData_H |
17 | #define DFBrowserPane_TDataStdNamedData_H |
18 | |
0cb512c0 |
19 | #include <inspector/DFBrowserPane_AttributePane.hxx> |
20 | |
14bbbdcb |
21 | #include <Standard.hxx> |
22 | |
23 | class DFBrowserPane_AttributePaneModel; |
14bbbdcb |
24 | class DFBrowserPane_TableView; |
25 | |
26 | //! \class DFBrowserPane_TDataStdNamedData |
27 | //! \brief The class to manipulate of TDataStd_NamedData attribute |
28 | //! This pane contains six pair of table views, where values of this data container presented |
29 | //! The first table in pair presents size of a separate data container, the second presents values |
30 | //! Each control for data container is grouped in a checkable group box to switch off/on using of a container. |
31 | class DFBrowserPane_TDataStdNamedData : public DFBrowserPane_AttributePane |
32 | { |
33 | public: |
34 | |
35 | //! Constructor |
36 | Standard_EXPORT DFBrowserPane_TDataStdNamedData(); |
37 | |
38 | //! Destructor |
39 | virtual ~DFBrowserPane_TDataStdNamedData() {} |
40 | |
41 | //! Creates a new widget that contains containers for attribute values |
42 | //! \param theParent a parent widget |
43 | //! \return pane widget |
44 | Standard_EXPORT virtual QWidget* CreateWidget (QWidget* theParent) Standard_OVERRIDE; |
45 | |
46 | //! Gets values of attribute using GetValues(), after fill tables if the pane with the values and Init the view model |
47 | //! \param theAttribute a current attribute |
48 | Standard_EXPORT virtual void Init (const Handle(TDF_Attribute)& theAttribute) Standard_OVERRIDE; |
49 | |
50 | //! Returns values to fill the table view model. The values are separated by an auxiliary key for getPartOfValues |
51 | //! \param theAttribute a current attribute |
52 | //! \param theValues a container of values |
53 | Standard_EXPORT virtual void GetValues (const Handle(TDF_Attribute)& theAttribute, |
54 | QList<QVariant>& theValues) Standard_OVERRIDE; |
55 | |
56 | private: |
57 | |
58 | //! Obtains sub container of a general values container for given keys to fill tables for this kind |
59 | //! \param theKey1 a key where values are started |
60 | //! \param theKey2 a key before that the values are got |
61 | //! \param theValues a full container of values for the current attribute |
62 | //! \returns sub container |
63 | QList<QVariant> getPartOfValues (const QString& theKey1, const QString& theKey2, |
64 | const QList<QVariant>& theValues) const; |
65 | |
66 | //! Creates a model with two columns: "Name" to "Value". The orientation is horizontal |
67 | DFBrowserPane_AttributePaneModel* createPaneModel(); |
68 | |
69 | private: |
14bbbdcb |
70 | //! myPaneMode and myTableView are used for int values |
14bbbdcb |
71 | |
72 | DFBrowserPane_AttributePaneModel* myRealValuesModel; //!< real values model |
73 | DFBrowserPane_TableView* myRealValues; //!< values table view |
14bbbdcb |
74 | |
75 | DFBrowserPane_AttributePaneModel* myStringValuesModel; //!< string values model |
76 | DFBrowserPane_TableView* myStringValues; //!< values table view |
14bbbdcb |
77 | |
78 | DFBrowserPane_AttributePaneModel* myByteValuesModel; //!< byte values model |
79 | DFBrowserPane_TableView* myByteValues; //!< values table view |
14bbbdcb |
80 | |
81 | DFBrowserPane_AttributePaneModel* myIntArrayValuesModel; //!< int array values model |
82 | DFBrowserPane_TableView* myIntArrayValues; //!< values table view |
14bbbdcb |
83 | |
84 | DFBrowserPane_AttributePaneModel* myRealArrayModel; //!< real array values model |
85 | DFBrowserPane_TableView* myRealArrayValues; //!< values table view |
14bbbdcb |
86 | }; |
87 | |
88 | #endif |