- if (GeomAlgoAPI_ShapeTools::volume(theShape) > 1.e-5) {
- aResult<<"Volume: "<<
- std::fixed<<setprecision(3)<<GeomAlgoAPI_ShapeTools::volume(theShape)<<std::endl;
+ double aVolume = GeomAlgoAPI_ShapeTools::volume(theShape);
+ if (aVolume > 1.e-5) {
+ aResult<<"Volume: ";
+ // volumes of too huge shapes write in the scientific format
+ if (aVolume >= 1.e5)
+ aResult<<std::scientific<<std::setprecision(7);
+ else
+ aResult<<std::fixed<<std::setprecision(3);
+ aResult<<aVolume<<std::endl;
+ }
+ double anArea = GeomAlgoAPI_ShapeTools::area(theShape);
+ if (anArea > 1.e-5) {
+ aResult << "Area: ";
+ // volumes of too huge shapes write in the scientific format
+ if (anArea >= 1.e5)
+ aResult << std::scientific << std::setprecision(7);
+ else
+ aResult << std::fixed << std::setprecision(3);
+ aResult << anArea << std::endl;