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_HelperArray_H |
17 | #define DFBrowserPane_HelperArray_H |
18 | |
19 | #include <Standard.hxx> |
20 | #include <TDF_Attribute.hxx> |
21 | |
22 | class DFBrowserPane_AttributePaneModel; |
23 | class DFBrowserPane_TableView; |
24 | |
25 | class QWidget; |
26 | |
130eb114 |
27 | #include <Standard_WarningsDisable.hxx> |
14bbbdcb |
28 | #include <QList> |
29 | #include <QVariant> |
130eb114 |
30 | #include <Standard_WarningsRestore.hxx> |
14bbbdcb |
31 | |
32 | //! \class DFBrowserPane_HelperArray |
33 | //! \brief Class that is used for list and array attributes. Two tables, the first for bounds, the second for values. |
34 | //! Bound table contains two values: Lower and Upper values of the container. |
35 | //! So, the first and the second values in GetValue() are these bounds, other values are used to fill usual table view. |
36 | class DFBrowserPane_HelperArray |
37 | { |
38 | public: |
39 | |
40 | //! Constructor |
41 | Standard_EXPORT DFBrowserPane_HelperArray(DFBrowserPane_AttributePaneModel* theValuesModel); |
42 | |
43 | //! Destructor |
44 | virtual ~DFBrowserPane_HelperArray() {} |
45 | |
46 | //! Creates bounds table view and grid layout, where the bounds view and the values view are shown |
47 | //! \param theParent a parent widget |
48 | //! \param theValuesView a view of values(table view filled by myValuesModel) |
d2c90917 |
49 | Standard_EXPORT void CreateWidget(QWidget* theParent, DFBrowserPane_TableView* theValuesView); |
14bbbdcb |
50 | |
51 | //! Fills bounds model by firsth and second values, fills values model by left values |
52 | //! \param theValues values to fill views |
53 | Standard_EXPORT void Init(const QList<QVariant>& theValues); |
54 | |
55 | //! Returns only values of values view model |
56 | //! \param theAttribute a current attribute |
57 | //! \param theValues a container of result values |
58 | Standard_EXPORT virtual void GetShortAttributeInfo(const Handle(TDF_Attribute)& theAttribute, QList<QVariant>& theValues); |
59 | |
60 | private: |
61 | |
62 | DFBrowserPane_AttributePaneModel* myValuesModel; //!< model of table view |
63 | DFBrowserPane_AttributePaneModel* myBoundsModel; //!< model of bounds view |
64 | DFBrowserPane_TableView* myArrayBounds; //!< bounds view |
d2c90917 |
65 | DFBrowserPane_TableView* myValuesView; //!< values view |
14bbbdcb |
66 | }; |
67 | #endif |