1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
16 #include <BRepGProp_Domain.hxx>
17 #include <BRepGProp_Face.hxx>
18 #include <BRepGProp_Gauss.hxx>
19 #include <BRepGProp_Sinert.hxx>
22 //=======================================================================
23 //function : BRepGProp_Sinert
24 //purpose : Constructor
25 //=======================================================================
26 BRepGProp_Sinert::BRepGProp_Sinert()
31 //=======================================================================
32 //function : BRepGProp_Sinert
33 //purpose : Constructor
34 //=======================================================================
35 BRepGProp_Sinert::BRepGProp_Sinert (const BRepGProp_Face& theSurface,
36 const gp_Pnt& theLocation)
38 SetLocation(theLocation);
42 //=======================================================================
43 //function : BRepGProp_Sinert
44 //purpose : Constructor
45 //=======================================================================
46 BRepGProp_Sinert::BRepGProp_Sinert(BRepGProp_Face& theSurface,
47 BRepGProp_Domain& theDomain,
48 const gp_Pnt& theLocation)
50 SetLocation(theLocation);
51 Perform(theSurface, theDomain);
54 //=======================================================================
55 //function : BRepGProp_Sinert
56 //purpose : Constructor
57 //=======================================================================
58 BRepGProp_Sinert::BRepGProp_Sinert(BRepGProp_Face& theSurface,
59 const gp_Pnt& theLocation,
60 const Standard_Real theEps)
62 SetLocation(theLocation);
63 Perform(theSurface, theEps);
66 //=======================================================================
67 //function : BRepGProp_Sinert
68 //purpose : Constructor
69 //=======================================================================
70 BRepGProp_Sinert::BRepGProp_Sinert(BRepGProp_Face& theSurface,
71 BRepGProp_Domain& theDomain,
72 const gp_Pnt& theLocation,
73 const Standard_Real theEps)
75 SetLocation(theLocation);
76 Perform(theSurface, theDomain, theEps);
79 //=======================================================================
80 //function : SetLocation
82 //=======================================================================
83 void BRepGProp_Sinert::SetLocation(const gp_Pnt& theLocation)
88 //=======================================================================
91 //=======================================================================
92 void BRepGProp_Sinert::Perform(const BRepGProp_Face& theSurface)
96 BRepGProp_Gauss aGauss(BRepGProp_Gauss::Sinert);
97 aGauss.Compute(theSurface, loc, dim, g, inertia);
100 //=======================================================================
103 //=======================================================================
104 void BRepGProp_Sinert::Perform(BRepGProp_Face& theSurface,
105 BRepGProp_Domain& theDomain)
109 BRepGProp_Gauss aGauss(BRepGProp_Gauss::Sinert);
110 aGauss.Compute(theSurface, theDomain, loc, dim, g, inertia);
113 //=======================================================================
116 //=======================================================================
117 Standard_Real BRepGProp_Sinert::Perform(BRepGProp_Face& theSurface,
118 const Standard_Real theEps)
120 BRepGProp_Domain anEmptyDomian;
121 return Perform(theSurface, anEmptyDomian, theEps);
124 //=======================================================================
127 //=======================================================================
128 Standard_Real BRepGProp_Sinert::Perform(BRepGProp_Face& theSurface,
129 BRepGProp_Domain& theDomain,
130 const Standard_Real theEps)
132 BRepGProp_Gauss aGauss(BRepGProp_Gauss::Sinert);
133 return myEpsilon = aGauss.Compute(theSurface, theDomain, loc, theEps, dim, g, inertia);
136 //=======================================================================
137 //function : GetEpsilon
139 //=======================================================================
140 Standard_Real BRepGProp_Sinert::GetEpsilon()