Integration of OCCT 6.5.0 from SVN
[occt.git] / src / IGESSolid / IGESSolid_RightAngularWedge.cxx
1 //--------------------------------------------------------------------
2 //
3 //  File Name : IGESSolid_RightAngularWedge.cxx
4 //  Date      :
5 //  Author    : CKY / Contract Toubro-Larsen
6 //  Copyright : MATRA-DATAVISION 1993
7 //
8 //--------------------------------------------------------------------
9
10 #include <IGESSolid_RightAngularWedge.ixx>
11 #include <gp_GTrsf.hxx>
12
13
14     IGESSolid_RightAngularWedge::IGESSolid_RightAngularWedge ()    {  }
15
16
17     void  IGESSolid_RightAngularWedge::Init
18   (const gp_XYZ& aSize,   const Standard_Real LowX,
19    const gp_XYZ& aCorner, const gp_XYZ& anXAxis, const gp_XYZ& anZAxis)
20 {
21   theSize         = aSize;
22   theXSmallLength = LowX;
23   theCorner       = aCorner;         // default (0,0,0)
24   theXAxis        = anXAxis;         // default (1,0,0)
25   theZAxis        = anZAxis;         // default (0,0,1)
26   InitTypeAndForm(152,0);
27 }
28
29     gp_XYZ  IGESSolid_RightAngularWedge::Size () const
30 {
31   return theSize;
32 }
33
34     Standard_Real  IGESSolid_RightAngularWedge::XBigLength () const
35 {
36   return theSize.X();
37 }
38
39     Standard_Real  IGESSolid_RightAngularWedge::XSmallLength () const
40 {
41   return theXSmallLength;
42 }
43
44     Standard_Real  IGESSolid_RightAngularWedge::YLength () const
45 {
46   return theSize.Y();
47 }
48
49     Standard_Real  IGESSolid_RightAngularWedge::ZLength () const
50 {
51   return theSize.Z();
52 }
53
54     gp_Pnt  IGESSolid_RightAngularWedge::Corner () const
55 {
56   return gp_Pnt(theCorner);
57 }
58
59     gp_Pnt  IGESSolid_RightAngularWedge::TransformedCorner () const
60 {
61   if (!HasTransf()) return gp_Pnt(theCorner);
62   else
63     {
64       gp_XYZ tmp = theCorner;
65       Location().Transforms(tmp);
66       return gp_Pnt(tmp);
67     }
68 }
69
70     gp_Dir  IGESSolid_RightAngularWedge::XAxis () const
71 {
72   return gp_Dir(theXAxis);
73 }
74
75     gp_Dir  IGESSolid_RightAngularWedge::TransformedXAxis () const
76 {
77   if (!HasTransf()) return gp_Dir(theXAxis);
78   else
79     {
80       gp_XYZ tmp = theXAxis;
81       gp_GTrsf loc = Location();
82       loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
83       loc.Transforms(tmp);
84       return gp_Dir(tmp);
85     }
86 }
87
88     gp_Dir  IGESSolid_RightAngularWedge::YAxis () const
89 {
90   return gp_Dir(theXAxis ^ theZAxis);     // ^ overloaded
91 }
92
93     gp_Dir  IGESSolid_RightAngularWedge::TransformedYAxis () const
94 {
95   if (!HasTransf()) return gp_Dir(theXAxis ^ theZAxis);
96   else
97     {
98       gp_XYZ tmp = theXAxis ^ theZAxis;
99       gp_GTrsf loc = Location();
100       loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
101       loc.Transforms(tmp);
102       return gp_Dir(tmp);
103     }
104 }
105
106     gp_Dir  IGESSolid_RightAngularWedge::ZAxis () const
107 {
108   return gp_Dir(theZAxis);
109 }
110
111     gp_Dir  IGESSolid_RightAngularWedge::TransformedZAxis () const
112 {
113   if (!HasTransf()) return gp_Dir(theZAxis);
114   else
115     {
116       gp_XYZ tmp = theZAxis;
117       gp_GTrsf loc = Location();
118       loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
119       loc.Transforms(tmp);
120       return gp_Dir(tmp);
121     }
122 }