1 // Created on: 2021-04-27
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2021 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 VInspector_ItemGraphic3dCLight_H
17 #define VInspector_ItemGraphic3dCLight_H
19 #include <Standard.hxx>
20 #include <inspector/VInspector_ItemBase.hxx>
22 #include <Graphic3d_CLight.hxx>
24 class VInspector_ItemGraphic3dCLight;
25 typedef QExplicitlySharedDataPointer<VInspector_ItemGraphic3dCLight> VInspector_ItemGraphic3dCLightPtr;
27 //! \class VInspector_ItemGraphic3dCLight
28 //! Parent item is context properties, that corresponds to AIS_InteractiveContext
29 class VInspector_ItemGraphic3dCLight : public VInspector_ItemBase
33 //! Creates an item wrapped by a shared pointer
34 static VInspector_ItemGraphic3dCLightPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
35 { return VInspector_ItemGraphic3dCLightPtr (new VInspector_ItemGraphic3dCLight (theParent, theRow, theColumn)); }
38 virtual ~VInspector_ItemGraphic3dCLight() Standard_OVERRIDE {};
40 //! Inits the item, fills internal containers
41 Standard_EXPORT virtual void Init() Standard_OVERRIDE;
43 //! Resets cached values
44 Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
46 //! Returns data object of the item.
48 virtual const Handle(Standard_Transient)& Object() const { initItem(); return myLight; }
50 //! Returns the current light, init item if it was not initialized yet
51 //! \return interactive object
52 Handle(Graphic3d_CLight) GetLight() const { return Handle(Graphic3d_CLight)::DownCast (Object()); }
54 //! Updates item by the item properties value
55 virtual void StoreItemProperties (const int theRow, const int theColumn, const QVariant& theValue) Standard_OVERRIDE;
58 //! Initializes the current item. It is empty because Reset() is also empty.
59 virtual void initItem() const Standard_OVERRIDE;
61 //! Returns number of displayed presentations
62 //! \return rows count
63 Standard_EXPORT virtual int initRowCount() const Standard_OVERRIDE;
65 //! Returns item information for the given role. Fills internal container if it was not filled yet
66 //! \param theItemRole a value role
68 Standard_EXPORT virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
70 //! Returns stream value of the item to fulfill property panel.
71 //! \return stream value or dummy
72 Standard_EXPORT virtual void initStream (Standard_OStream& theOStream) const Standard_OVERRIDE;
77 //! param theParent a parent item
78 //! \param theRow the item row positition in the parent item
79 //! \param theColumn the item column positition in the parent item
80 VInspector_ItemGraphic3dCLight(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
81 : VInspector_ItemBase(theParent, theRow, theColumn) {}
85 Handle(Graphic3d_CLight) myLight; //!< the current light