blob: c1ba041abb7412b829c458d7ec9377f6017e6617 (
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
--
-- File : PerspectiveView.cdl
-- Created : Wed 3 Feb 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class PerspectiveView from IGESDraw inherits ViewKindEntity
---Purpose: defines IGESPerspectiveView, Type <410> Form <1>
-- in package IGESDraw
--
-- Supports a perspective view.
-- Any geometric projection is defined by a view plane
-- and the projectors that pass through the view plane.
-- Projectors can be visualized as rays of light that
-- form an image by passing through the viewed object
-- and striking the view plane.
-- The projectors are defined via a point called the
-- Centre-of-Projection or the eye-point.
-- A perspective view is formed by all projectors that
-- emanate from the Centre-of-Projection and pass
-- through the view plane.
uses
TransfEntity from IGESData,
Vec from gp,
XY from gp,
XYZ from gp,
Pnt2d from gp,
Pnt from gp
raises OutOfRange
is
Create returns mutable PerspectiveView;
-- Specific Methods pertaining to the class
Init (me : mutable;
aViewNumber : Integer;
aScaleFactor : Real;
aViewNormalVector : XYZ;
aViewReferencePoint : XYZ;
aCenterOfProjection : XYZ;
aViewUpVector : XYZ;
aViewPlaneDistance : Real;
aTopLeft : XY;
aBottomRight : XY;
aDepthClip : Integer;
aBackPlaneDistance : Real;
aFrontPlaneDistance : Real);
---Purpose : This method is used to set the fields of the class
-- PerspectiveView
-- - aViewNumber : The desired view
-- - aScaleFactor : Scale factor
-- - aViewNormalVector : View plane normal vector (model space)
-- - aViewReferencePoint : View reference point (model space)
-- - aCenterOfProjection : Center Of Projection (model space)
-- - aViewUpVector : View up vector (model space)
-- - aViewPlaneDistance : View plane distance (model space)
-- - aTopLeft : Top-left point of clipping window
-- - aBottomRight : Bottom-right point of clipping window
-- - aDepthClip : Depth clipping indicator
-- - aBackPlaneDistance : Distance of back clipping plane
-- - aFrontPlaneDistance : Distance of front clipping plane
IsSingle (me) returns Boolean;
---Purpose : Returns True (for a single view)
NbViews (me) returns Integer;
---Purpose : Returns 1 (single view)
ViewItem (me; num : Integer) returns ViewKindEntity raises OutOfRange;
---Purpose : For a single view, returns <me> whatever <num>
ViewNumber (me) returns Integer;
---Purpose : returns the view number associated with <me>
ScaleFactor (me) returns Real;
---Purpose : returns the scale factor associated with <me>
ViewNormalVector (me) returns Vec;
---Purpose : returns the View plane normal vector (model space)
ViewReferencePoint (me) returns Pnt;
---Purpose : returns the View reference point (model space)
CenterOfProjection (me) returns Pnt;
---Purpose : returns the Center Of Projection (model space)
ViewUpVector (me) returns Vec;
---Purpose : returns the View up vector (model space)
ViewPlaneDistance (me) returns Real;
---Purpose : returns the View plane distance (model space)
TopLeft (me) returns Pnt2d;
---Purpose : returns the top left point of the clipping window
BottomRight (me) returns Pnt2d;
---Purpose : returns the bottom right point of the clipping window
DepthClip (me) returns Integer;
---Purpose : returns the Depth clipping indicator
-- 0 = No depth clipping
-- 1 = Back clipping plane ON
-- 2 = Front clipping plane ON
-- 3 = Back and front clipping planes ON
BackPlaneDistance (me) returns Real;
---Purpose : returns the View coordinate denoting the location of
-- the back clipping plane
FrontPlaneDistance (me) returns Real;
---Purpose : returns the View coordinate denoting the location of
-- the front clipping plane
ViewMatrix (me) returns TransfEntity;
---Purpose : returns the Transformation Matrix
ModelToView (me; coords : XYZ) returns XYZ;
---Purpose : returns XYX from the Model space to the View space by
-- applying the View Matrix
fields
--
-- Class : IGESDraw_PerspectiveView
--
-- Purpose : Declaration of the variables specific to a
-- PerspectiveView Entity.
--
-- Reminder : A PerspectiveView Entity is defined by :
-- - The desired view
-- - Scale factor
-- - View plane normal vector (model space)
-- - View reference point (model space)
-- - Center Of Projection (model space)
-- - View up vector (model space)
-- - View plane distance (model space)
-- - Top-left point of clipping window
-- - Bottom-right point of clipping window
-- - Depth clipping indicator
-- 0 = No depth clipping
-- 1 = Back clipping plane ON
-- 2 = Front clipping plane ON
-- 3 = Back and front clipping planes ON
-- - Distance of back clipping plane
-- - Distance of front clipping plane
--
theViewNumber : Integer;
theScaleFactor : Real;
theViewNormalVector : XYZ;
theViewReferencePoint : XYZ;
theCenterOfProjection : XYZ;
theViewUpVector : XYZ;
theViewPlaneDistance : Real;
theTopLeft : XY;
theBottomRight : XY;
theDepthClip : Integer;
theBackPlaneDistance : Real;
theFrontPlaneDistance : Real;
end PerspectiveView;
|