Salome HOME
Merge commit 'f709219506b7cd587e94abc5ebed18d629df92d8'
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Sphere.cpp
index 43cfaa1ae7573e3f960aaaa3e8b01d4187275cf8..ce4a51bc261785fcd6cd2d435638605c9fd1c624 100644 (file)
@@ -125,12 +125,7 @@ void PrimitivesAPI_Sphere::dump(ModelHighAPI_Dumper& theDumper) const
 
   std::string aCreationMethod = aBase->string(PrimitivesPlugin_Sphere::CREATION_METHOD())->value();
 
-  if(aCreationMethod == PrimitivesPlugin_Sphere::CREATION_METHOD_BY_PT_RADIUS()) {
-    AttributeSelectionPtr anAttrCenterPoint =
-        aBase->selection(PrimitivesPlugin_Sphere::CENTER_POINT_ID());
-    AttributeDoublePtr anAttrRadius = aBase->real(PrimitivesPlugin_Sphere::RADIUS_ID());
-    theDumper << ", " << anAttrCenterPoint << ", " << anAttrRadius;
-  } else if(aCreationMethod == PrimitivesPlugin_Sphere::CREATION_METHOD_BY_DIMENSIONS()) {
+  if (aCreationMethod == PrimitivesPlugin_Sphere::CREATION_METHOD_BY_DIMENSIONS()) {
     AttributeDoublePtr anAttrRMin = aBase->real(PrimitivesPlugin_Sphere::RMIN_ID());
     AttributeDoublePtr anAttrRMax = aBase->real(PrimitivesPlugin_Sphere::RMAX_ID());
     AttributeDoublePtr anAttrPhiMin = aBase->real(PrimitivesPlugin_Sphere::PHIMIN_ID());
@@ -140,6 +135,11 @@ void PrimitivesAPI_Sphere::dump(ModelHighAPI_Dumper& theDumper) const
     theDumper << ", " << anAttrRMin << ", " << anAttrRMax;
     theDumper << ", " << anAttrPhiMin << ", " << anAttrPhiMax;
     theDumper << ", " << anAttrThetaMin << ", " << anAttrThetaMax;
+  } else { // CREATION_METHOD_BY_PT_RADIUS by default to support versions with undefined method
+    AttributeSelectionPtr anAttrCenterPoint =
+        aBase->selection(PrimitivesPlugin_Sphere::CENTER_POINT_ID());
+    AttributeDoublePtr anAttrRadius = aBase->real(PrimitivesPlugin_Sphere::RADIUS_ID());
+    theDumper << ", " << anAttrCenterPoint << ", " << anAttrRadius;
   }
 
   theDumper << ")" << std::endl;