+// LCOV_EXCL_STOP
+}
+
+bool isValidFace(const GeomShapePtr theShape,
+ const GeomAbs_SurfaceType theFaceType,
+ Events_InfoMessage& theError)
+{
+ GeomFacePtr aGeomFace = theShape->face();
+
+ if (!aGeomFace.get()) {
+ theError = "The shape is not a face.";
+ return false;
+ }
+
+ bool aValid = true;
+
+ switch (theFaceType) {
+ case GeomAbs_Plane: {
+ aValid = aGeomFace->isPlanar();
+ if (!aValid) theError = "The shape is not a plane.";
+ break;
+ }
+ case GeomAbs_Cylinder: {
+ aValid = aGeomFace->isCylindrical();
+ if (!aValid) theError = "The shape is not a cylinder.";
+ break;
+ }
+ default: {
+ aValid = false;
+ theError = "The shape is not an available face.";
+ break;
+ }
+ }
+
+ return aValid;