0032961: Coding - get rid of unused headers [IGESAppli to IGESToBRep]
[occt.git] / src / IGESSolid / IGESSolid_RightAngularWedge.cxx
1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
18
19 #include <gp_GTrsf.hxx>
20 #include <gp_Pnt.hxx>
21 #include <gp_XYZ.hxx>
22 #include <IGESSolid_RightAngularWedge.hxx>
23 #include <Standard_Type.hxx>
24
25 IMPLEMENT_STANDARD_RTTIEXT(IGESSolid_RightAngularWedge,IGESData_IGESEntity)
26
27 IGESSolid_RightAngularWedge::IGESSolid_RightAngularWedge ()    {  }
28
29
30     void  IGESSolid_RightAngularWedge::Init
31   (const gp_XYZ& aSize,   const Standard_Real LowX,
32    const gp_XYZ& aCorner, const gp_XYZ& anXAxis, const gp_XYZ& anZAxis)
33 {
34   theSize         = aSize;
35   theXSmallLength = LowX;
36   theCorner       = aCorner;         // default (0,0,0)
37   theXAxis        = anXAxis;         // default (1,0,0)
38   theZAxis        = anZAxis;         // default (0,0,1)
39   InitTypeAndForm(152,0);
40 }
41
42     gp_XYZ  IGESSolid_RightAngularWedge::Size () const
43 {
44   return theSize;
45 }
46
47     Standard_Real  IGESSolid_RightAngularWedge::XBigLength () const
48 {
49   return theSize.X();
50 }
51
52     Standard_Real  IGESSolid_RightAngularWedge::XSmallLength () const
53 {
54   return theXSmallLength;
55 }
56
57     Standard_Real  IGESSolid_RightAngularWedge::YLength () const
58 {
59   return theSize.Y();
60 }
61
62     Standard_Real  IGESSolid_RightAngularWedge::ZLength () const
63 {
64   return theSize.Z();
65 }
66
67     gp_Pnt  IGESSolid_RightAngularWedge::Corner () const
68 {
69   return gp_Pnt(theCorner);
70 }
71
72     gp_Pnt  IGESSolid_RightAngularWedge::TransformedCorner () const
73 {
74   if (!HasTransf()) return gp_Pnt(theCorner);
75   else
76     {
77       gp_XYZ tmp = theCorner;
78       Location().Transforms(tmp);
79       return gp_Pnt(tmp);
80     }
81 }
82
83     gp_Dir  IGESSolid_RightAngularWedge::XAxis () const
84 {
85   return gp_Dir(theXAxis);
86 }
87
88     gp_Dir  IGESSolid_RightAngularWedge::TransformedXAxis () const
89 {
90   if (!HasTransf()) return gp_Dir(theXAxis);
91   else
92     {
93       gp_XYZ tmp = theXAxis;
94       gp_GTrsf loc = Location();
95       loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
96       loc.Transforms(tmp);
97       return gp_Dir(tmp);
98     }
99 }
100
101     gp_Dir  IGESSolid_RightAngularWedge::YAxis () const
102 {
103   return gp_Dir(theXAxis ^ theZAxis);     // ^ overloaded
104 }
105
106     gp_Dir  IGESSolid_RightAngularWedge::TransformedYAxis () const
107 {
108   if (!HasTransf()) return gp_Dir(theXAxis ^ theZAxis);
109   else
110     {
111       gp_XYZ tmp = theXAxis ^ theZAxis;
112       gp_GTrsf loc = Location();
113       loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
114       loc.Transforms(tmp);
115       return gp_Dir(tmp);
116     }
117 }
118
119     gp_Dir  IGESSolid_RightAngularWedge::ZAxis () const
120 {
121   return gp_Dir(theZAxis);
122 }
123
124     gp_Dir  IGESSolid_RightAngularWedge::TransformedZAxis () const
125 {
126   if (!HasTransf()) return gp_Dir(theZAxis);
127   else
128     {
129       gp_XYZ tmp = theZAxis;
130       gp_GTrsf loc = Location();
131       loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
132       loc.Transforms(tmp);
133       return gp_Dir(tmp);
134     }
135 }