summaryrefslogtreecommitdiff
path: root/src/IGESSolid/IGESSolid_Sphere.cxx
blob: bbffe2210bba560d0ff4bd719c2fea3272e2b96b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//--------------------------------------------------------------------
//
//  File Name : IGESSolid_Sphere.cxx
//  Date      :
//  Author    : CKY / Contract Toubro-Larsen
//  Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------

#include <IGESSolid_Sphere.ixx>
#include <gp_GTrsf.hxx>


    IGESSolid_Sphere::IGESSolid_Sphere ()    {  }


    void  IGESSolid_Sphere::Init
  (const Standard_Real aRadius, const gp_XYZ& aCenter)
{
  theRadius = aRadius;
  theCenter = aCenter;            // default (0,0,0)
  InitTypeAndForm(158,0);
}

    Standard_Real  IGESSolid_Sphere::Radius () const
{
  return theRadius;
}

    gp_Pnt  IGESSolid_Sphere::Center () const
{
  return gp_Pnt(theCenter);
}

    gp_Pnt  IGESSolid_Sphere::TransformedCenter () const
{
  if (!HasTransf()) return gp_Pnt(theCenter);
  else
    {
      gp_XYZ tmp = theCenter;
      Location().Transforms(tmp);
      return gp_Pnt(tmp);
    }
}