-// Copyright (C) 2017-2021 CEA/DEN, EDF R&D
+// Copyright (C) 2017-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
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());
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;