0029807: [Regression to 7.0.0] Impossible to cut cone from prism
[occt.git] / tools / VInspector / VInspector_ItemEntityOwner.hxx
CommitLineData
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 VInspector_ItemEntityOwner_H
17#define VInspector_ItemEntityOwner_H
18
19#include <AIS_InteractiveObject.hxx>
20#include <Standard.hxx>
0cb512c0 21#include <inspector/VInspector_ItemBase.hxx>
14bbbdcb 22
23class QItemSelectionModel;
24
25class VInspector_ItemEntityOwner;
26typedef QExplicitlySharedDataPointer<VInspector_ItemEntityOwner> VInspector_ItemEntityOwnerPtr;
27
28//! \class VInspector_ItemPresentableObject
29//! Item for selection entity owner. The parent is sensitive entity item, there are no children
30class VInspector_ItemEntityOwner : public VInspector_ItemBase
31{
32
33public:
34
35 //! Creates an item wrapped by a shared pointer
36 static VInspector_ItemEntityOwnerPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
37 { return VInspector_ItemEntityOwnerPtr (new VInspector_ItemEntityOwner (theParent, theRow, theColumn)); }
38
39 //! Destructor
40 virtual ~VInspector_ItemEntityOwner() Standard_OVERRIDE {};
41
42 //! Inits the item, fills internal containers
43 Standard_EXPORT virtual void Init() Standard_OVERRIDE;
44
45 //! Resets cached values
46 Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
47
48 //! Returns the current entity owner
49 Handle(SelectBasics_EntityOwner) EntityOwner() const { return myOwner; }
50
51protected:
52 //! \return number of children.
53 virtual int initRowCount() const Standard_OVERRIDE{ return 0; }
54
55 //! Returns item information for the given role. Fills internal container if it was not filled yet
56 //! \param theItemRole a value role
57 //! \return the value
58 virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
59
60 //! Initialize the current item. It is empty because Reset() is also empty.
61 virtual void initItem() const Standard_OVERRIDE;
62
63protected:
64
65 //! Creates a child item in the given position.
66 //! \param theRow the child row position
67 //! \param theColumn the child column position
68 //! \return the created item
69 virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE
70 { (void)theRow; (void)theColumn; return TreeModel_ItemBasePtr(); }
71
72private:
73
74 //! Constructor
75 //! param theParent a parent item
76 VInspector_ItemEntityOwner(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
77 : VInspector_ItemBase(theParent, theRow, theColumn) {}
78
79private:
80
81 //! Returns the current entity owner. Initializes the item if it was not initialized yet
82 Handle(SelectBasics_EntityOwner) getEntityOwner() const;
83
84private:
85
86 Handle(SelectBasics_EntityOwner) myOwner; //!< the current entity owner
87};
88
89#endif