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_HelperArray_H
17 #define DFBrowserPane_HelperArray_H
19 #include <Standard.hxx>
20 #include <TDF_Attribute.hxx>
22 class DFBrowserPane_AttributePaneModel;
23 class DFBrowserPane_TableView;
28 #pragma warning(disable : 4127) // conditional expression is constant
33 //! \class DFBrowserPane_HelperArray
34 //! \brief Class that is used for list and array attributes. Two tables, the first for bounds, the second for values.
35 //! Bound table contains two values: Lower and Upper values of the container.
36 //! So, the first and the second values in GetValue() are these bounds, other values are used to fill usual table view.
37 class DFBrowserPane_HelperArray
42 Standard_EXPORT DFBrowserPane_HelperArray(DFBrowserPane_AttributePaneModel* theValuesModel);
45 virtual ~DFBrowserPane_HelperArray() {}
47 //! Creates bounds table view and grid layout, where the bounds view and the values view are shown
48 //! \param theParent a parent widget
49 //! \param theValuesView a view of values(table view filled by myValuesModel)
50 Standard_EXPORT void CreateWidget(QWidget* theParent, DFBrowserPane_TableView* theValuesView);
52 //! Fills bounds model by firsth and second values, fills values model by left values
53 //! \param theValues values to fill views
54 Standard_EXPORT void Init(const QList<QVariant>& theValues);
56 //! Returns only values of values view model
57 //! \param theAttribute a current attribute
58 //! \param theValues a container of result values
59 Standard_EXPORT virtual void GetShortAttributeInfo(const Handle(TDF_Attribute)& theAttribute, QList<QVariant>& theValues);
63 DFBrowserPane_AttributePaneModel* myValuesModel; //!< model of table view
64 DFBrowserPane_AttributePaneModel* myBoundsModel; //!< model of bounds view
65 DFBrowserPane_TableView* myArrayBounds; //!< bounds view
66 DFBrowserPane_TableView* myValuesView; //!< values view