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