0031456: Visualization - move out Dimensions and Relations from package AIS to PrsDims
[occt.git] / src / PrsDim / PrsDim_DimensionOwner.hxx
42cf5bc1 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.
787ff240 17#ifndef _PrsDim_DimensionOwner_HeaderFile
18#define _PrsDim_DimensionOwner_HeaderFile
42cf5bc1 19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
787ff240 23#include <PrsDim_DimensionSelectionMode.hxx>
42cf5bc1 24#include <SelectMgr_EntityOwner.hxx>
25#include <Standard_Integer.hxx>
26#include <PrsMgr_PresentationManager3d.hxx>
27#include <Quantity_NameOfColor.hxx>
28#include <Standard_Boolean.hxx>
f838dac4 29
42cf5bc1 30class SelectMgr_SelectableObject;
31class PrsMgr_PresentationManager;
787ff240 33DEFINE_STANDARD_HANDLE(PrsDim_DimensionOwner, SelectMgr_EntityOwner)
42cf5bc1 34
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.
787ff240 46class PrsDim_DimensionOwner : public SelectMgr_EntityOwner
42cf5bc1 47{
787ff240 48 DEFINE_STANDARD_RTTIEXT(PrsDim_DimensionOwner, SelectMgr_EntityOwner)
42cf5bc1 49public:
42cf5bc1 51 //! Initializes the dimension owner, theSO, and attributes it
52 //! the priority, thePriority.
787ff240 53 Standard_EXPORT PrsDim_DimensionOwner(const Handle(SelectMgr_SelectableObject)& theSelObject, const PrsDim_DimensionSelectionMode theSelMode, const Standard_Integer thePriority = 0);
42cf5bc1 54
787ff240 55 PrsDim_DimensionSelectionMode SelectionMode() const { return mySelectionMode; }
42cf5bc1 56
8e5fb5ea 57 Standard_EXPORT virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM,
f838dac4 58 const Handle(Prs3d_Drawer)& theStyle,
8e5fb5ea 59 const Standard_Integer theMode = 0) Standard_OVERRIDE;
42cf5bc1 60
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;
42cf5bc1 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;
42cf5bc1 68private:
787ff240 70 PrsDim_DimensionSelectionMode mySelectionMode;
42cf5bc1 71
42cf5bc1 72};
42cf5bc1 74#endif // _AIS_DimensionOwner_HeaderFile