7fd59977 |
1 | //-------------------------------------------------------------------- |
2 | // |
3 | // File Name : IGESSolid_ConeFrustum.cxx |
4 | // Date : |
5 | // Author : CKY / Contract Toubro-Larsen |
6 | // Copyright : MATRA-DATAVISION 1993 |
7 | // |
8 | //-------------------------------------------------------------------- |
9 | |
10 | #include <IGESSolid_ConeFrustum.ixx> |
11 | #include <gp_GTrsf.hxx> |
12 | |
13 | |
14 | IGESSolid_ConeFrustum::IGESSolid_ConeFrustum () { } |
15 | |
16 | |
17 | void IGESSolid_ConeFrustum::Init |
18 | (const Standard_Real Ht, const Standard_Real R1, const Standard_Real R2, |
19 | const gp_XYZ& Center, const gp_XYZ& anAxis) |
20 | { |
21 | theHeight = Ht; |
22 | theR1 = R1; |
23 | theR2 = R2; // default 0 |
24 | theFaceCenter = Center; // default (0,0,0) |
25 | theAxis = anAxis; // default (0,0,1) |
26 | InitTypeAndForm(156,0); |
27 | } |
28 | |
29 | Standard_Real IGESSolid_ConeFrustum::Height () const |
30 | { |
31 | return theHeight; |
32 | } |
33 | |
34 | Standard_Real IGESSolid_ConeFrustum::LargerRadius () const |
35 | { |
36 | return theR1; |
37 | } |
38 | |
39 | Standard_Real IGESSolid_ConeFrustum::SmallerRadius () const |
40 | { |
41 | return theR2; |
42 | } |
43 | |
44 | gp_Pnt IGESSolid_ConeFrustum::FaceCenter () const |
45 | { |
46 | return gp_Pnt(theFaceCenter); |
47 | } |
48 | |
49 | gp_Pnt IGESSolid_ConeFrustum::TransformedFaceCenter () const |
50 | { |
51 | if (!HasTransf()) return gp_Pnt(theFaceCenter); |
52 | else |
53 | { |
54 | gp_XYZ tmp = theFaceCenter; |
55 | Location().Transforms(tmp); |
56 | return gp_Pnt(tmp); |
57 | } |
58 | } |
59 | |
60 | gp_Dir IGESSolid_ConeFrustum::Axis () const |
61 | { |
62 | return gp_Dir(theAxis); |
63 | } |
64 | |
65 | gp_Dir IGESSolid_ConeFrustum::TransformedAxis () const |
66 | { |
67 | if (!HasTransf()) return gp_Dir(theAxis); |
68 | else |
69 | { |
70 | gp_XYZ xyz = theAxis; |
71 | gp_GTrsf loc = Location(); |
72 | loc.SetTranslationPart(gp_XYZ(0.,0.,0.)); |
73 | loc.Transforms(xyz); |
74 | return gp_Dir(xyz); |
75 | } |
76 | } |