- if (aGeomFace.get() != NULL) {
- switch(aFaceType) {
- case GeomAbs_Plane:
- aValid = aGeomFace->isPlanar();
- break;
- case GeomAbs_Cylinder:
- aValid = aGeomFace->isCylindrical();
- break;
- default:
- break;
+ if (!aGeomFace.get()) {
+ aValid = false;
+ theError = "The shape is not a face.";
+ }
+ else {
+ GeomAbs_SurfaceType aFaceType = GeomAbs_Plane;
+ if (theArguments.size() == 1)
+ aFaceType = faceType(theArguments.front());
+
+ switch (aFaceType) {
+ 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;
+ }