Integration of OCCT 6.5.0 from SVN
[occt.git] / samples / mfc / standard / 02_Modeling / src / ISession_Direction.cpp
1 // ISession_Direction.cpp: implementation of the ISession_Direction class.
2 //
3 //////////////////////////////////////////////////////////////////////
4
5 #include "stdafx.h"
6 #include "ISession_Direction.h"
7
8 #ifdef _DEBUG
9 #undef THIS_FILE
10 static char THIS_FILE[]=__FILE__;
11 #endif
12
13 IMPLEMENT_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject)
14 IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
15
16 #include "DsgPrs_LengthPresentation.hxx"
17 #include "Prs3d_ArrowAspect.hxx"
18 #include "AIS_Drawer.hxx"
19 //////////////////////////////////////////////////////////////////////
20 // Construction/Destruction
21 //////////////////////////////////////////////////////////////////////
22
23
24 ISession_Direction::ISession_Direction(gp_Pnt& aPnt,gp_Pnt& aPnt2)
25 :myStartPnt(aPnt),myEndPnt(aPnt2)
26 {}
27
28 ISession_Direction::ISession_Direction(gp_Pnt& aPnt,gp_Vec& aVec)
29 :myStartPnt(aPnt)
30 {
31   myEndPnt = myStartPnt.Translated(aVec);
32 }
33
34
35 void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
36                              const Handle(Prs3d_Presentation)& aPresentation,
37                              const Standard_Integer aMode)
38 {
39     Handle(Prs3d_ArrowAspect) anArrowAspect = myDrawer->ArrowAspect();
40     anArrowAspect->SetLength(myStartPnt.Distance(myEndPnt));
41     myDrawer->SetArrowAspect(anArrowAspect);
42
43     DsgPrs_LengthPresentation::Add(aPresentation,myDrawer,
44                                            myStartPnt,myEndPnt,
45                                                                    DsgPrs_AS_LASTAR);
46 }
47
48