1 // File: Select3D_Projector.lxx
2 // Created: Thu Jul 9 12:50:25 1992
3 // Author: Christophe MARION
6 #include <Standard_NoSuchObject.hxx>
10 #include <V3d_View.hxx>
13 //=======================================================================
14 //function : Perspective
16 //=======================================================================
18 inline Standard_Boolean Select3D_Projector::Perspective() const
21 //=======================================================================
22 //function : Transformation
24 //=======================================================================
26 inline const gp_GTrsf& Select3D_Projector::Transformation() const
29 //=======================================================================
30 //function : InvertedTransformation
32 //=======================================================================
34 inline const gp_GTrsf& Select3D_Projector::InvertedTransformation() const
37 //=======================================================================
38 //function : FullTransformation
40 //=======================================================================
42 inline const gp_Trsf& Select3D_Projector::FullTransformation() const
43 { return myScaledTrsf; }
45 //=======================================================================
48 //=======================================================================
50 inline Standard_Real Select3D_Projector::Focus() const
52 Standard_NoSuchObject_Raise_if(!myPersp,
53 "Select3D_Projector::Not a Perpective");
57 //=======================================================================
58 //function : Transform
60 //=======================================================================
62 inline void Select3D_Projector::Transform (gp_Vec& D) const
64 gp_XYZ coord = D.XYZ();
65 if (myGTrsf.Form() == gp_Identity || myGTrsf.Form() == gp_Translation) { }
66 else if (myGTrsf.Form() == gp_PntMirror) { coord.Reverse(); }
67 else { coord.Multiply (myGTrsf.VectorialPart()); }
71 //=======================================================================
72 //function : Transform
74 //=======================================================================
76 inline void Select3D_Projector::Transform (gp_Pnt& Pnt) const
78 gp_XYZ xyz = Pnt.XYZ();
79 myGTrsf.Transforms(xyz);
84 inline const Handle(V3d_View)& Select3D_Projector::View() const
87 inline void Select3D_Projector::Transform (gp_Lin& Lin, const gp_GTrsf& T) const
89 gp_Ax1 ax1 = Lin.Position();
90 gp_XYZ xyz = ax1.Location().XYZ();
92 ax1.SetLocation(gp_Pnt(xyz));
93 gp_Dir dir = ax1.Direction();
94 gp_XYZ coord = dir.XYZ();
95 if (T.Form() == gp_Identity || T.Form() == gp_Translation) { }
96 else if (T.Form() == gp_PntMirror) { coord.Reverse(); }
98 coord.Multiply (T.VectorialPart());
99 Standard_Real D = coord.Modulus();
103 ax1.SetDirection(dir);
104 Lin.SetPosition(ax1);
107 inline void Select3D_Projector::Transform (gp_Pnt& Pnt, const gp_GTrsf& T) const
109 gp_XYZ xyz = Pnt.XYZ();
114 inline Standard_Real Select3D_Projector::DepthMin() const
119 inline Standard_Real Select3D_Projector::DepthMax() const