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 : Directions
16 //=======================================================================
18 inline void Select3D_Projector::Directions
19 (gp_Vec2d& D1, gp_Vec2d& D2, gp_Vec2d& D3) const
26 //=======================================================================
27 //function : Perspective
29 //=======================================================================
31 inline Standard_Boolean Select3D_Projector::Perspective() const
34 //=======================================================================
35 //function : Transformation
37 //=======================================================================
39 inline const gp_GTrsf& Select3D_Projector::Transformation() const
42 //=======================================================================
43 //function : InvertedTransformation
45 //=======================================================================
47 inline const gp_GTrsf& Select3D_Projector::InvertedTransformation() const
50 //=======================================================================
51 //function : FullTransformation
53 //=======================================================================
55 inline const gp_Trsf& Select3D_Projector::FullTransformation() const
56 { return myScaledTrsf; }
58 //=======================================================================
61 //=======================================================================
63 inline Standard_Real Select3D_Projector::Focus() const
65 Standard_NoSuchObject_Raise_if(!myPersp,
66 "Select3D_Projector::Not a Perpective");
70 //=======================================================================
71 //function : Transform
73 //=======================================================================
75 inline void Select3D_Projector::Transform (gp_Vec& D) const
77 gp_XYZ coord = D.XYZ();
78 if (myGTrsf.Form() == gp_Identity || myGTrsf.Form() == gp_Translation) { }
79 else if (myGTrsf.Form() == gp_PntMirror) { coord.Reverse(); }
80 else { coord.Multiply (myGTrsf.VectorialPart()); }
84 //=======================================================================
85 //function : Transform
87 //=======================================================================
89 inline void Select3D_Projector::Transform (gp_Pnt& Pnt) const
91 gp_XYZ xyz = Pnt.XYZ();
92 myGTrsf.Transforms(xyz);
97 inline const Handle(V3d_View)& Select3D_Projector::View() const
100 inline void Select3D_Projector::Transform (gp_Lin& Lin, const gp_GTrsf& T) const
102 gp_Ax1 ax1 = Lin.Position();
103 gp_XYZ xyz = ax1.Location().XYZ();
105 ax1.SetLocation(gp_Pnt(xyz));
106 gp_Dir dir = ax1.Direction();
107 gp_XYZ coord = dir.XYZ();
108 if (T.Form() == gp_Identity || T.Form() == gp_Translation) { }
109 else if (T.Form() == gp_PntMirror) { coord.Reverse(); }
111 coord.Multiply (T.VectorialPart());
112 Standard_Real D = coord.Modulus();
116 ax1.SetDirection(dir);
117 Lin.SetPosition(ax1);
120 inline void Select3D_Projector::Transform (gp_Pnt& Pnt, const gp_GTrsf& T) const
122 gp_XYZ xyz = Pnt.XYZ();
127 inline Standard_Real Select3D_Projector::DepthMin() const
132 inline Standard_Real Select3D_Projector::DepthMax() const