1 -- File: Select3D_Projector.cdl
2 -- Created: Thu Mar 12 13:32:28 1992
3 -- Author: Christophe MARION
4 -- <cma@sdsun2> copie quasi exacte de HLRAlgo_Projector
5 ---Copyright: Matra Datavision 1992
7 class Projector from Select3D inherits Transient from Standard
8 ---Purpose: A framework to define 3D projectors.
11 Boolean from Standard,
24 NoSuchObject from Standard
28 Create(aView:View from V3d) returns Projector from Select3D;
29 --- Purpose: Constructs the 3D projector object defined by the 3D view aView.
30 Create returns Projector from Select3D;
32 Create(CS : Ax2 from gp)
33 ---Purpose: Creates an axonometric projector. <CS> is the
34 -- viewing coordinate system.
35 returns Projector from Select3D;
37 Create(CS : Ax2 from gp;
38 Focus : Real from Standard)
39 ---Purpose: Creates a perspective projector. <CS> is the
40 -- viewing coordinate system.
41 returns Projector from Select3D;
43 Create(T : Trsf from gp;
44 Persp : Boolean from Standard;
45 Focus : Real from Standard)
46 ---Purpose: build a Projector with automatic minmax directions.
47 returns Projector from Select3D;
49 Create(T : Trsf from gp;
50 Persp : Boolean from Standard;
51 Focus : Real from Standard;
52 v1,v2,v3 : Vec2d from gp)
53 ---Purpose: build a Projector with given minmax directions.
54 returns Projector from Select3D;
56 Create(GT : GTrsf from gp;
57 Persp : Boolean from Standard;
58 Focus : Real from Standard)
59 ---Purpose: build a Projector with automatic minmax directions.
60 returns Projector from Select3D;
64 Persp : Boolean from Standard;
65 Focus : Real from Standard)
69 SetView(me : mutable; V : View from V3d);
70 ---Purpose: Sets the 3D view V used at the time of construction.
72 View(me) returns any View from V3d;
73 ---Purpose: Returns the 3D view used at the time of construction.
78 Directions(me; D1 , D2 , D3 : out Vec2d from gp)
82 Scaled(me : mutable; On : Boolean from Standard = Standard_False)
83 ---Purpose: to compute with the given scale and translation.
86 Perspective(me) returns Boolean
87 ---Purpose: Returns True if there is a perspective transformation.
91 Transformation(me) returns GTrsf from gp
92 ---Purpose: Returns the active transformation.
94 ---C++: return const &
97 InvertedTransformation(me) returns GTrsf from gp
98 ---Purpose: Returns the active inverted transformation.
100 ---C++: return const &
103 FullTransformation(me) returns Trsf from gp
104 ---Purpose: Returns the original transformation.
106 ---C++: return const &
109 Focus(me) returns Real from Standard
110 ---Purpose: Returns the focal length.
113 NoSuchObject from Standard -- if there is no perspective
116 Transform(me; D : in out Vec from gp)
120 Transform(me; Pnt : in out Pnt from gp)
124 Project(me; P : Pnt from gp;
125 Pout : out Pnt2d from gp)
126 ---Purpose: Transform and apply perspective if needed.
129 Project(me; P : Pnt from gp;
130 X,Y,Z : out Real from Standard)
131 ---Purpose: Transform and apply perspective if needed.
134 Project(me; P : Pnt from gp;
136 Pout : out Pnt2d from gp;
137 D1out : out Vec2d from gp)
138 ---Purpose: Transform and apply perspective if needed.
141 BoxAdd(me; P : Pnt2d from gp;
142 B : out Box from Bnd)
143 ---Purpose: Adds to the box <B> the min-max of the point <P>.
146 Shoot(me; X , Y : Real from Standard)
148 ---Purpose: return a line going through the eye towards the
152 DepthMin(me) returns Real from Standard;
153 ---Purpose: Returns the minimum depth value (if clipping plane defined).
154 --- Should be used when call ::Shoot() to compute eyeline.
157 DepthMax(me) returns Real from Standard;
158 ---Purpose: Returns the maximum depth value (if clipping plane defined).
159 --- Should be used when call ::Shoot() to compute eyeline.
162 DepthMinMax(me : mutable;
163 theDepthMin : in Real from Standard;
164 theDepthMax : in Real from Standard);
165 ---Purpose: Setup the min/max depth values (doesn't affect
166 --- projection functionality itself).
167 --- Should be used when call ::Shoot() to compute eyeline.
169 SetDirection(me : mutable)
172 Transform(me; P : in out Pnt from gp;
177 Transform(me; D : in out Lin from gp;
183 myType : Integer from Standard;
185 myPersp : Boolean from Standard is protected;
186 myFocus : Real from Standard is protected;
187 myScaledTrsf : Trsf from gp is protected;
188 myGTrsf : GTrsf from gp is protected;
189 myInvTrsf : GTrsf from gp is protected;
190 myD1 : Vec2d from gp is protected;
191 myD2 : Vec2d from gp is protected;
192 myD3 : Vec2d from gp is protected;
194 myView : View from V3d;
195 myDepthMin : Real from Standard;
196 myDepthMax : Real from Standard;