-// Copyright (C) 2014-2023 CEA, EDF
+// Copyright (C) 2014-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <sstream>
#include <iomanip>
-#define PRECISION 6
-#define TOLERANCE (1.e-7)
+#define PRECISION 5
+#define TOLERANCE (1.e-6)
ModelHighAPI_FeatureStore::ModelHighAPI_FeatureStore(ObjectPtr theObject) {
storeData(theObject->data(), myAttrs);
GeomAPI_Shape::ShapeType aType = GeomAPI_Shape::COMPOUND;
for (; aType <= GeomAPI_Shape::VERTEX; aType = GeomAPI_Shape::ShapeType((int)aType + 1)) {
GeomAPI_ShapeExplorer anExp(theShape, aType);
- int aCount = 0;
- for (; anExp.more(); anExp.next()) aCount++;
- aResult << anExp.current()->shapeTypeStr().c_str() << ": " << aCount << std::endl;
+ if (anExp.more()) {
+ std::string aTypeStr = anExp.current()->shapeTypeStr();
+ int aCount = 0;
+ for (; anExp.more(); anExp.next()) aCount++;
+ aResult << aTypeStr.c_str() << ": " << aCount << std::endl;
+ }
}
// output the main characteristics
double aVolume = GeomAlgoAPI_ShapeTools::volume(theShape);