- GProp_GProps aSystem;
- gp_Pnt aCenterMass;
-
- if (aShapeBase.ShapeType() == TopAbs_VERTEX) {
- aCenterMass = BRep_Tool::Pnt(TopoDS::Vertex(aShapeBase));
- } else if (aShapeBase.ShapeType() == TopAbs_EDGE || aShapeBase.ShapeType() == TopAbs_WIRE) {
- BRepGProp::LinearProperties(aShapeBase, aSystem);
- aCenterMass = aSystem.CentreOfMass();
- } else if (aShapeBase.ShapeType() == TopAbs_FACE || aShapeBase.ShapeType() == TopAbs_SHELL) {
- BRepGProp::SurfaceProperties(aShapeBase, aSystem);
- aCenterMass = aSystem.CentreOfMass();
- } else {
- BRepGProp::VolumeProperties(aShapeBase, aSystem);
- aCenterMass = aSystem.CentreOfMass();
- }
-
+ gp_Ax3 aPos = GEOMImpl_IMeasureOperations::GetPosition(aShapeBase);
+ gp_Pnt aCenterMass = aPos.Location();