Salome HOME
Merge branch 'Dev_1.2.0' of newgeom:newgeom into Dev_1.2.0
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_ShapeProps.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_ShapeProps.cpp
4 // Created:     8 May 2015
5 // Author:      Dmitry Bobylev
6
7 #include <GeomAlgoAPI_ShapeProps.h>
8
9 #include <BRepGProp.hxx>
10 #include <GProp_GProps.hxx>
11 #include <TopoDS_Shape.hxx>
12
13
14 double GeomAlgoAPI_ShapeProps::volume(std::shared_ptr<GeomAPI_Shape> theShape)
15 {
16   GProp_GProps aGProps;
17   TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
18   BRepGProp::VolumeProperties(aShape, aGProps);
19   return aGProps.Mass();
20 }