0032308: Configuration - make Xlib dependency optional
[occt.git] / src / AIS / AIS_ManipulatorOwner.cxx
1 // Created on: 2015-12-23
2 // Created by: Anastasia BORISOVA
3 // Copyright (c) 2015 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 #include <AIS_ManipulatorOwner.hxx>
17
18 IMPLEMENT_STANDARD_RTTIEXT(AIS_ManipulatorOwner,SelectMgr_EntityOwner)
19 //=======================================================================
20 //function : Constructor
21 //purpose  : 
22 //=======================================================================
23 AIS_ManipulatorOwner::AIS_ManipulatorOwner (const Handle(SelectMgr_SelectableObject)& theSelObject,
24                                             const Standard_Integer theIndex,
25                                             const AIS_ManipulatorMode theMode,
26                                             const Standard_Integer thePriority)
27 : SelectMgr_EntityOwner(theSelObject, thePriority),
28   myIndex (theIndex),
29   myMode (theMode)
30 {
31   //
32 }
33
34 //=======================================================================
35 //function : HilightWithColor
36 //purpose  : 
37 //=======================================================================
38 void AIS_ManipulatorOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePM,
39                                              const Handle(Prs3d_Drawer)& theStyle,
40                                              const Standard_Integer theMode)
41 {
42   if (theMode == 0)
43   {
44     SelectMgr_EntityOwner::HilightWithColor (thePM, theStyle, theMode);
45     return;
46   }
47
48   Selectable()->HilightOwnerWithColor (thePM, theStyle, this);
49 }
50
51 //=======================================================================
52 //function : IsHilighted
53 //purpose  : 
54 //=======================================================================
55 Standard_Boolean AIS_ManipulatorOwner::IsHilighted (const Handle(PrsMgr_PresentationManager)& thePM,
56                                                     const Standard_Integer /*theMode*/) const
57 {
58   if (!HasSelectable())
59   {
60     return Standard_False;
61   }
62
63   return thePM->IsHighlighted (Selectable(), myMode);
64 }
65
66 //=======================================================================
67 //function : Unhilight
68 //purpose  : 
69 //=======================================================================
70 void AIS_ManipulatorOwner::Unhilight (const Handle(PrsMgr_PresentationManager)& thePM,
71                                       const Standard_Integer /*theMode*/)
72 {
73   if (!HasSelectable())
74   {
75     return;
76   }
77
78   thePM->Unhighlight (Selectable());
79 }