0032161: Coding Rules - deprecate obsolete alias PrsMgr_PresentationManager3d
[occt.git] / src / StdSelect / StdSelect_BRepOwner.hxx
CommitLineData
42cf5bc1 1// Created on: 1995-03-08
2// Created by: Mister rmi
3// Copyright (c) 1995-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _StdSelect_BRepOwner_HeaderFile
18#define _StdSelect_BRepOwner_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Standard_Integer.hxx>
24#include <Standard_Boolean.hxx>
25#include <TopoDS_Shape.hxx>
26#include <SelectMgr_EntityOwner.hxx>
decbff0d 27#include <PrsMgr_PresentationManager.hxx>
42cf5bc1 28#include <Quantity_NameOfColor.hxx>
29#include <Graphic3d_ZLayerId.hxx>
30class StdSelect_Shape;
31class TopoDS_Shape;
32class SelectMgr_SelectableObject;
33class PrsMgr_PresentationManager;
34class TopLoc_Location;
35
42cf5bc1 36DEFINE_STANDARD_HANDLE(StdSelect_BRepOwner, SelectMgr_EntityOwner)
37
38//! Defines Specific Owners for Sensitive Primitives
39//! (Sensitive Segments,Circles...).
40//! Used in Dynamic Selection Mechanism.
41//! A BRepOwner has an Owner (the shape it represents)
42//! and Users (One or More Transient entities).
43//! The highlight-unhighlight methods are empty and
44//! must be redefined by each User.
45class StdSelect_BRepOwner : public SelectMgr_EntityOwner
46{
f838dac4 47 DEFINE_STANDARD_RTTIEXT(StdSelect_BRepOwner, SelectMgr_EntityOwner)
42cf5bc1 48public:
49
42cf5bc1 50 //! Constructs an owner specification framework defined
51 //! by the priority aPriority.
52 Standard_EXPORT StdSelect_BRepOwner(const Standard_Integer aPriority);
53
54 //! Constructs an owner specification framework defined
55 //! by the shape aShape and the priority aPriority.
56 //! aShape and aPriority are stored in this framework. If
57 //! more than one owner are detected during dynamic
58 //! selection, the one with the highest priority is the one stored.
59 Standard_EXPORT StdSelect_BRepOwner(const TopoDS_Shape& aShape, const Standard_Integer aPriority = 0, const Standard_Boolean ComesFromDecomposition = Standard_False);
60
61 //! Constructs an owner specification framework defined
62 //! by the shape aShape, the selectable object theOrigin
63 //! and the priority aPriority.
64 //! aShape, theOrigin and aPriority are stored in this
65 //! framework. If more than one owner are detected
66 //! during dynamic selection, the one with the highest
67 //! priority is the one stored.
68 Standard_EXPORT StdSelect_BRepOwner(const TopoDS_Shape& aShape, const Handle(SelectMgr_SelectableObject)& theOrigin, const Standard_Integer aPriority = 0, const Standard_Boolean FromDecomposition = Standard_False);
69
70 //! returns False if no shape was set
f838dac4 71 Standard_Boolean HasShape() const { return !myShape.IsNull(); }
72
6e3a8b03 73 //! Returns the shape.
f838dac4 74 const TopoDS_Shape& Shape() const { return myShape; }
42cf5bc1 75
76 //! Returns true if this framework has a highlight mode defined for it.
f838dac4 77 Standard_Boolean HasHilightMode() const { return myCurMode == -1; }
42cf5bc1 78
79 //! Sets the highlight mode for this framework.
80 //! This defines the type of display used to highlight the
81 //! owner of the shape when it is detected by the selector.
82 //! The default type of display is wireframe, defined by the index 0.
f838dac4 83 void SetHilightMode (const Standard_Integer theMode) { myCurMode = theMode; }
84
42cf5bc1 85 //! Resets the higlight mode for this framework.
86 //! This defines the type of display used to highlight the
87 //! owner of the shape when it is detected by the selector.
88 //! The default type of display is wireframe, defined by the index 0.
f838dac4 89 void ResetHilightMode() { myCurMode = -1; }
90
42cf5bc1 91 //! Returns the highlight mode for this framework.
92 //! This defines the type of display used to highlight the
93 //! owner of the shape when it is detected by the selector.
94 //! The default type of display is wireframe, defined by the index 0.
f838dac4 95 Standard_Integer HilightMode() const { return myCurMode; }
96
42cf5bc1 97 //! Returns true if an object with the selection mode
98 //! aMode is highlighted in the presentation manager aPM.
99 Standard_EXPORT virtual Standard_Boolean IsHilighted (const Handle(PrsMgr_PresentationManager)& aPM, const Standard_Integer aMode = 0) const Standard_OVERRIDE;
100
decbff0d 101 Standard_EXPORT virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePM,
102 const Handle(Prs3d_Drawer)& theStyle,
103 const Standard_Integer theMode) Standard_OVERRIDE;
42cf5bc1 104
105 //! Removes highlighting from the type of shape
106 //! identified the selection mode aMode in the presentation manager aPM.
107 Standard_EXPORT virtual void Unhilight (const Handle(PrsMgr_PresentationManager)& aPM, const Standard_Integer aMode = 0) Standard_OVERRIDE;
108
109 //! Clears the presentation manager object aPM of all
110 //! shapes with the selection mode aMode.
111 Standard_EXPORT virtual void Clear (const Handle(PrsMgr_PresentationManager)& aPM, const Standard_Integer aMode = 0) Standard_OVERRIDE;
112
113 Standard_EXPORT virtual void SetLocation (const TopLoc_Location& aLoc) Standard_OVERRIDE;
42cf5bc1 114
5396886c 115 //! Implements immediate application of location transformation of parent object to dynamic highlight structure
116 Standard_EXPORT virtual void UpdateHighlightTrsf (const Handle(V3d_Viewer)& theViewer,
decbff0d 117 const Handle(PrsMgr_PresentationManager)& theManager,
5396886c 118 const Standard_Integer theDispMode) Standard_OVERRIDE;
42cf5bc1 119
bc73b006 120 //! Dumps the content of me into the stream
121 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
122
42cf5bc1 123protected:
124
42cf5bc1 125 TopoDS_Shape myShape;
42cf5bc1 126 Handle(StdSelect_Shape) myPrsSh;
127 Standard_Integer myCurMode;
128
42cf5bc1 129};
130
42cf5bc1 131#endif // _StdSelect_BRepOwner_HeaderFile