1 // Created on: 1996-12-05
2 // Created by: Odile Olivier
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _PrsDim_DimensionOwner_HeaderFile
18 #define _PrsDim_DimensionOwner_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <PrsDim_DimensionSelectionMode.hxx>
24 #include <SelectMgr_EntityOwner.hxx>
25 #include <Standard_Integer.hxx>
26 #include <PrsMgr_PresentationManager.hxx>
27 #include <Quantity_NameOfColor.hxx>
28 #include <Standard_Boolean.hxx>
30 class SelectMgr_SelectableObject;
31 class PrsMgr_PresentationManager;
33 DEFINE_STANDARD_HANDLE(PrsDim_DimensionOwner, SelectMgr_EntityOwner)
35 //! The owner is the entity which makes it possible to link
36 //! the sensitive primitives and the reference shapes that
37 //! you want to detect. It stocks the various pieces of
38 //! information which make it possible to find objects. An
39 //! owner has a priority which you can modulate, so as to
40 //! make one entity more selectable than another. You
41 //! might want to make edges more selectable than
42 //! faces, for example. In that case, you could attribute sa
43 //! higher priority to the one compared to the other. An
44 //! edge, could have priority 5, for example, and a face,
45 //! priority 4. The default priority is 5.
46 class PrsDim_DimensionOwner : public SelectMgr_EntityOwner
48 DEFINE_STANDARD_RTTIEXT(PrsDim_DimensionOwner, SelectMgr_EntityOwner)
51 //! Initializes the dimension owner, theSO, and attributes it
52 //! the priority, thePriority.
53 Standard_EXPORT PrsDim_DimensionOwner(const Handle(SelectMgr_SelectableObject)& theSelObject, const PrsDim_DimensionSelectionMode theSelMode, const Standard_Integer thePriority = 0);
55 PrsDim_DimensionSelectionMode SelectionMode() const { return mySelectionMode; }
57 Standard_EXPORT virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePM,
58 const Handle(Prs3d_Drawer)& theStyle,
59 const Standard_Integer theMode) Standard_OVERRIDE;
61 //! Returns true if an object with the selection mode
62 //! aMode is highlighted in the presentation manager aPM.
63 Standard_EXPORT virtual Standard_Boolean IsHilighted (const Handle(PrsMgr_PresentationManager)& thePM, const Standard_Integer theMode = 0) const Standard_OVERRIDE;
65 //! Removes highlighting from the selected part of dimension.
66 Standard_EXPORT virtual void Unhilight (const Handle(PrsMgr_PresentationManager)& thePM, const Standard_Integer theMode = 0) Standard_OVERRIDE;
70 PrsDim_DimensionSelectionMode mySelectionMode;
74 #endif // _AIS_DimensionOwner_HeaderFile