summaryrefslogtreecommitdiff
path: root/src/IGESDraw/IGESDraw_PerspectiveView.cxx
blob: c358775d0ccb79513a222896508ac685cde271d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
//--------------------------------------------------------------------
//
//  File Name : IGESDraw_PerspectiveView.cxx
//  Date      :
//  Author    : CKY / Contract Toubro-Larsen
//  Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------

#include <IGESDraw_PerspectiveView.ixx>
#include <gp_GTrsf.hxx>


    IGESDraw_PerspectiveView::IGESDraw_PerspectiveView ()    {  }


// This class inherits from IGESData_ViewKindEntity

    void IGESDraw_PerspectiveView::Init
  (const Standard_Integer aViewNumber,
   const Standard_Real    aScaleFactor,
   const gp_XYZ&          aViewNormalVector,
   const gp_XYZ&          aViewReferencePoint,
   const gp_XYZ&          aCenterOfProjection,
   const gp_XYZ&          aViewUpVector,
   const Standard_Real    aViewPlaneDistance,
   const gp_XY&           aTopLeft,
   const gp_XY&           aBottomRight,
   const Standard_Integer aDepthClip,
   const Standard_Real    aBackPlaneDistance,
   const Standard_Real    aFrontPlaneDistance)
{
  theViewNumber         = aViewNumber;
  theScaleFactor        = aScaleFactor;
  theViewNormalVector   = aViewNormalVector;
  theViewReferencePoint = aViewReferencePoint;
  theCenterOfProjection = aCenterOfProjection;
  theViewUpVector       = aViewUpVector;
  theViewPlaneDistance  = aViewPlaneDistance;
  theTopLeft            = aTopLeft;
  theBottomRight        = aBottomRight;
  theDepthClip          = aDepthClip;
  theBackPlaneDistance  = aBackPlaneDistance;
  theFrontPlaneDistance = aFrontPlaneDistance;
  InitTypeAndForm(410,1);
}

    Standard_Boolean IGESDraw_PerspectiveView::IsSingle () const
{
  return Standard_True;
}

    Standard_Integer IGESDraw_PerspectiveView::NbViews () const
{  return 1;  }

    Handle(IGESData_ViewKindEntity)  IGESDraw_PerspectiveView::ViewItem
  (const Standard_Integer) const
{  return Handle(IGESData_ViewKindEntity)::DownCast (This());  }


    Standard_Integer IGESDraw_PerspectiveView::ViewNumber () const
{
  return theViewNumber;
}

    Standard_Real IGESDraw_PerspectiveView::ScaleFactor () const
{
  return theScaleFactor;
}

    gp_Vec IGESDraw_PerspectiveView::ViewNormalVector () const
{
  gp_Vec tempRes(theViewNormalVector);
  return tempRes;
}

    gp_Pnt IGESDraw_PerspectiveView::ViewReferencePoint () const
{
  gp_Pnt tempRes(theViewReferencePoint);
  return tempRes;
}

    gp_Pnt IGESDraw_PerspectiveView::CenterOfProjection () const
{
  gp_Pnt tempRes(theCenterOfProjection);
  return tempRes;
}

    gp_Vec IGESDraw_PerspectiveView::ViewUpVector () const
{
  gp_Vec tempRes(theViewUpVector);
  return tempRes;
}

    Standard_Real IGESDraw_PerspectiveView::ViewPlaneDistance () const
{
  return theViewPlaneDistance;
}

    gp_Pnt2d IGESDraw_PerspectiveView::TopLeft () const
{
  gp_Pnt2d tempRes(theTopLeft);
  return tempRes;
}

    gp_Pnt2d IGESDraw_PerspectiveView::BottomRight () const
{
  gp_Pnt2d tempRes(theBottomRight);
  return tempRes;
}

    Standard_Integer IGESDraw_PerspectiveView::DepthClip () const
{
  return theDepthClip;
}

    Standard_Real IGESDraw_PerspectiveView::BackPlaneDistance () const
{
  return theBackPlaneDistance;
}

    Standard_Real IGESDraw_PerspectiveView::FrontPlaneDistance () const
{
  return theFrontPlaneDistance;
}

    Handle(IGESData_TransfEntity) IGESDraw_PerspectiveView::ViewMatrix () const
{
  return (Transf());
}

    gp_XYZ IGESDraw_PerspectiveView::ModelToView
  (const gp_XYZ& coords) const
{
  gp_XYZ tempCoords = coords;
  Location().Transforms(tempCoords);
  return (tempCoords);
}