7fd59977 |
1 | #include "stdafx.h" |
2 | |
3 | #include "ISession2D_ObjectOwner.h" |
4 | #include <PrsMgr_PresentationManager2d.hxx> |
5 | |
6 | IMPLEMENT_STANDARD_HANDLE(ISession2D_ObjectOwner,SelectMgr_EntityOwner) |
7 | IMPLEMENT_STANDARD_RTTIEXT(ISession2D_ObjectOwner,SelectMgr_EntityOwner) |
8 | |
9 | ISession2D_ObjectOwner::ISession2D_ObjectOwner(const Standard_Integer aPriority) //= 0 |
10 | :SelectMgr_EntityOwner(aPriority) |
11 | {} |
12 | ISession2D_ObjectOwner::ISession2D_ObjectOwner(const Handle(SelectMgr_SelectableObject)& aSO, |
13 | const Standard_Integer aPriority ) //= 0 |
14 | :SelectMgr_EntityOwner(aSO,aPriority) |
15 | {} |
16 | |
17 | |
18 | // Presentation Management |
19 | void ISession2D_ObjectOwner::Hilight(const Handle(PrsMgr_PresentationManager)& aPM, |
20 | const Standard_Integer aMode) // = 0 |
21 | { |
22 | ASSERT(aPM->IsKind(STANDARD_TYPE(PrsMgr_PresentationManager2d))); |
23 | if (myGo.IsNull()) |
24 | { |
25 | Handle(Graphic2d_View) aView = Handle(PrsMgr_PresentationManager2d)::DownCast(aPM)->StructureManager(); |
26 | myGo = new Graphic2d_GraphicObject(aView); |
27 | } |
28 | |
29 | Handle(Graphic2d_Text) text; |
30 | text = new Graphic2d_Text(myGo, myDumpMessage, 0, 0, 0,Aspect_TOT_SOLID,1.5); |
31 | text->SetZoomable(Standard_False); |
32 | myGo->Display(); |
33 | } |
34 | |
35 | void ISession2D_ObjectOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& aPM, |
36 | const Standard_Integer aMode) // = 0 |
37 | { |
38 | if (myGo.IsNull()) return; |
39 | myGo->RemovePrimitives(); |
40 | myGo->Display(); |
41 | myGo->Remove(); |
42 | } |
43 | |