1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: NMTDS_BndSphere.lxx
22 // Author: Peter KURNEV
24 //=======================================================================
25 //function : SetCenter
27 //=======================================================================
28 inline void NMTDS_BndSphere::SetCenter(const gp_Pnt& theP)
33 //=======================================================================
36 //=======================================================================
37 inline const gp_Pnt& NMTDS_BndSphere::Center()const
41 //=======================================================================
42 //function : SetRadius
44 //=======================================================================
45 inline void NMTDS_BndSphere::SetRadius(const Standard_Real theR)
49 //=======================================================================
52 //=======================================================================
53 inline Standard_Real NMTDS_BndSphere::Radius()const
57 //=======================================================================
60 //=======================================================================
61 inline void NMTDS_BndSphere::SetGap(const Standard_Real theGap)
65 //=======================================================================
68 //=======================================================================
69 inline Standard_Real NMTDS_BndSphere::Gap()const
73 //=======================================================================
76 //=======================================================================
77 inline void NMTDS_BndSphere::Add(const NMTDS_BndSphere& theOther)
79 Standard_Real aTmax, aR, aT, aTOther;
82 aPc.SetXYZ(0.5*(myCenter.XYZ()+theOther.myCenter.XYZ()));
84 aR=aPc.Distance(myCenter);
87 aTOther=theOther.myRadius+theOther.myGap;
88 aTmax=(aT>aTOther) ? aT: aTOther;
95 //=======================================================================
96 //function : SquareExtent
98 //=======================================================================
99 inline Standard_Real NMTDS_BndSphere::SquareExtent()const