| // Copyright (c) 2025 OPEN CASCADE SAS | |
| // | |
| // This file is part of Open CASCADE Technology software library. | |
| // | |
| // This library is free software; you can redistribute it and/or modify it under | |
| // the terms of the GNU Lesser General Public License version 2.1 as published | |
| // by the Free Software Foundation, with special exception defined in the file | |
| // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |
| // distribution for complete text of the license and disclaimer of any warranty. | |
| // | |
| // Alternatively, this file may be used under the terms of Open CASCADE | |
| // commercial license or contractual agreement. | |
| #ifndef _RWStepVisual_RWSurfaceSide_HeaderFile | |
| #define _RWStepVisual_RWSurfaceSide_HeaderFile | |
| #include <StepVisual_SurfaceSide.hxx> | |
| #include <Standard_CString.hxx> | |
| namespace RWStepVisual_RWSurfaceSide | |
| { | |
| static constexpr char ssNegative[] = ".NEGATIVE."; | |
| static constexpr char ssPositive[] = ".POSITIVE."; | |
| static constexpr char ssBoth[] = ".BOTH."; | |
| //! Convert StepVisual_SurfaceSide to string | |
| //! @param theSourceEnum The StepVisual_SurfaceSide value to convert | |
| //! @return The corresponding string representation or nullptr if not found | |
| inline const char* ConvertToString(const StepVisual_SurfaceSide theSourceEnum) | |
| { | |
| switch (theSourceEnum) | |
| { | |
| case StepVisual_ssNegative: | |
| return ssNegative; | |
| case StepVisual_ssPositive: | |
| return ssPositive; | |
| case StepVisual_ssBoth: | |
| return ssBoth; | |
| } | |
| return nullptr; | |
| } | |
| //! Convert string to StepVisual_SurfaceSide | |
| //! @param theSideStr The string to convert | |
| //! @param theResultEnum The corresponding StepVisual_SurfaceSide value | |
| //! @return true if the conversion was successful, false otherwise | |
| inline bool ConvertToEnum(const char* const theSideStr, StepVisual_SurfaceSide& theResultEnum) | |
| { | |
| if (IsEqual(theSideStr, ssNegative)) | |
| { | |
| theResultEnum = StepVisual_ssNegative; | |
| } | |
| else if (IsEqual(theSideStr, ssPositive)) | |
| { | |
| theResultEnum = StepVisual_ssPositive; | |
| } | |
| else if (IsEqual(theSideStr, ssBoth)) | |
| { | |
| theResultEnum = StepVisual_ssBoth; | |
| } | |
| else | |
| { | |
| return false; | |
| } | |
| return true; | |
| } | |
| } // namespace RWStepVisual_RWSurfaceSide | |
| #endif // _RWStepVisual_RWSurfaceSide_HeaderFile |