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()
30 //=======================================================================
31 //function : BRepGProp_Sinert
32 //purpose : Constructor
33 //=======================================================================
34 BRepGProp_Sinert::BRepGProp_Sinert (const BRepGProp_Face& theSurface,
35 const gp_Pnt& theLocation)
37 SetLocation(theLocation);
41 //=======================================================================
42 //function : BRepGProp_Sinert
43 //purpose : Constructor
44 //=======================================================================
45 BRepGProp_Sinert::BRepGProp_Sinert(BRepGProp_Face& theSurface,
46 BRepGProp_Domain& theDomain,
47 const gp_Pnt& theLocation)
49 SetLocation(theLocation);
50 Perform(theSurface, theDomain);
53 //=======================================================================
54 //function : BRepGProp_Sinert
55 //purpose : Constructor
56 //=======================================================================
57 BRepGProp_Sinert::BRepGProp_Sinert(BRepGProp_Face& theSurface,
58 const gp_Pnt& theLocation,
59 const Standard_Real theEps)
61 SetLocation(theLocation);
62 Perform(theSurface, theEps);
65 //=======================================================================
66 //function : BRepGProp_Sinert
67 //purpose : Constructor
68 //=======================================================================
69 BRepGProp_Sinert::BRepGProp_Sinert(BRepGProp_Face& theSurface,
70 BRepGProp_Domain& theDomain,
71 const gp_Pnt& theLocation,
72 const Standard_Real theEps)
74 SetLocation(theLocation);
75 Perform(theSurface, theDomain, theEps);
78 //=======================================================================
79 //function : SetLocation
81 //=======================================================================
82 void BRepGProp_Sinert::SetLocation(const gp_Pnt& theLocation)
87 //=======================================================================
90 //=======================================================================
91 void BRepGProp_Sinert::Perform(const BRepGProp_Face& theSurface)
95 BRepGProp_Gauss aGauss(BRepGProp_Gauss::Sinert);
96 aGauss.Compute(theSurface, loc, dim, g, inertia);
99 //=======================================================================
102 //=======================================================================
103 void BRepGProp_Sinert::Perform(BRepGProp_Face& theSurface,
104 BRepGProp_Domain& theDomain)
108 BRepGProp_Gauss aGauss(BRepGProp_Gauss::Sinert);
109 aGauss.Compute(theSurface, theDomain, loc, dim, g, inertia);
112 //=======================================================================
115 //=======================================================================
116 Standard_Real BRepGProp_Sinert::Perform(BRepGProp_Face& theSurface,
117 const Standard_Real theEps)
119 BRepGProp_Domain anEmptyDomian;
120 return Perform(theSurface, anEmptyDomian, theEps);
123 //=======================================================================
126 //=======================================================================
127 Standard_Real BRepGProp_Sinert::Perform(BRepGProp_Face& theSurface,
128 BRepGProp_Domain& theDomain,
129 const Standard_Real theEps)
131 BRepGProp_Gauss aGauss(BRepGProp_Gauss::Sinert);
132 return myEpsilon = aGauss.Compute(theSurface, theDomain, loc, theEps, dim, g, inertia);
135 //=======================================================================
136 //function : GetEpsilon
138 //=======================================================================
139 Standard_Real BRepGProp_Sinert::GetEpsilon()