-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-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::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
data()->attribute(NORM_ID()));
- if (!anOrigin || !aNorm)
- return std::shared_ptr<GeomAPI_Pln>();
+ if (anOrigin.get() && aNorm.get() && anOrigin->isInitialized() && aNorm->isInitialized())
+ return std::shared_ptr<GeomAPI_Pln>(new GeomAPI_Pln(anOrigin->pnt(), aNorm->dir()));
- return std::shared_ptr<GeomAPI_Pln>(new GeomAPI_Pln(anOrigin->pnt(), aNorm->dir()));
+ return std::shared_ptr<GeomAPI_Pln>();
}
/// Returns currently defined plane as an object of Ax3