0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / samples / mfc / standard / 02_Modeling / src / ISession_Direction.cpp
CommitLineData
7fd59977 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
10static char THIS_FILE[]=__FILE__;
11#endif
12
7fd59977 13IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
14
15#include "DsgPrs_LengthPresentation.hxx"
16#include "Prs3d_ArrowAspect.hxx"
6262338c 17#include "Prs3d_Drawer.hxx"
7fd59977 18//////////////////////////////////////////////////////////////////////
19// Construction/Destruction
20//////////////////////////////////////////////////////////////////////
21
22
5c573e69 23ISession_Direction::ISession_Direction(const gp_Pnt& aPnt,const gp_Pnt& aPnt2)
7fd59977 24:myStartPnt(aPnt),myEndPnt(aPnt2)
25{}
26
5c573e69 27ISession_Direction::ISession_Direction(const gp_Pnt& aPnt,const gp_Vec& aVec)
7fd59977 28:myStartPnt(aPnt)
29{
30 myEndPnt = myStartPnt.Translated(aVec);
31}
32
33
decbff0d 34void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager)& /*aPresentationManager*/,
5c573e69 35 const Handle(Prs3d_Presentation)& aPresentation,
36 const Standard_Integer /*aMode*/)
7fd59977 37{
e5b32824 38 // Set style for arrow
39 Handle(Prs3d_ArrowAspect) anArrowAspect = myDrawer->ArrowAspect();
40
41 // Draw Line
42 Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments (2);
43 aPrims->AddVertex (myStartPnt);
44 aPrims->AddVertex (myEndPnt);
d6c48921 45 aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
46 aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims);
e5b32824 47 // Draw arrow
d6c48921 48 Prs3d_Arrow::Draw (aPresentation->CurrentGroup(),
e5b32824 49 myEndPnt,
50 gp_Dir (gp_Vec(myStartPnt, myEndPnt)),
51 anArrowAspect->Angle(),
52 anArrowAspect->Length());
7fd59977 53}