From cd9b05d9797222a0dde2a54f2855da1ad85b767a Mon Sep 17 00:00:00 2001 From: Nicolas RECHATIN Date: Tue, 3 Aug 2021 15:21:46 +0200 Subject: [PATCH] fix OperaAPI ModelAPI_Double to std::string --- src/OperaAPI/OperaAPI_Volume.cpp | 16 ++++------------ src/OperaAPI/OperaAPI_Volume.h | 7 +++---- src/OperaPlugin/doc/TUI_volume.rst | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/OperaAPI/OperaAPI_Volume.cpp b/src/OperaAPI/OperaAPI_Volume.cpp index 2612060d1..6aca64e49 100644 --- a/src/OperaAPI/OperaAPI_Volume.cpp +++ b/src/OperaAPI/OperaAPI_Volume.cpp @@ -18,10 +18,7 @@ // #include "OperaAPI_Volume.h" - - #include -#include #include #include // std::wstring_convert @@ -37,17 +34,12 @@ OperaAPI_Volume::OperaAPI_Volume(const std::shared_ptr& theFea //================================================================================================== OperaAPI_Volume::OperaAPI_Volume(const std::shared_ptr& theFeature, - const ModelHighAPI_Double& theMedium, + const std::string& theMedium, const std::list& theObjectList) : ModelHighAPI_Interface(theFeature) { if(initialize()) { - - std::wstring w_medium = theMedium.string(); - std::wstring_convert,wchar_t> cv; - std::string medium_str = cv.to_bytes(w_medium); - - fillAttribute(medium_str, medium()); + fillAttribute(theMedium, medium()); setObjectList(theObjectList); } } @@ -56,7 +48,7 @@ OperaAPI_Volume::OperaAPI_Volume(const std::shared_ptr& theFea OperaAPI_Volume::~OperaAPI_Volume() {} //================================================================================================== -void OperaAPI_Volume::setMedium(const ModelHighAPI_Double& theMedium) +void OperaAPI_Volume::setMedium(const std::string& theMedium) { fillAttribute(OperaPlugin_Volume::MEDIUM_ID(), medium()); execute(); @@ -84,7 +76,7 @@ void OperaAPI_Volume::dump(ModelHighAPI_Dumper& theDumper) const //================================================================================================== VolumePtr addVolume(const std::shared_ptr& thePart, - const ModelHighAPI_Double& theMedium, + const std::string& theMedium, const std::list& theObjectList) { std::shared_ptr aFeature = thePart->addFeature(OperaAPI_Volume::ID()); diff --git a/src/OperaAPI/OperaAPI_Volume.h b/src/OperaAPI/OperaAPI_Volume.h index 46842b018..a7bad217d 100644 --- a/src/OperaAPI/OperaAPI_Volume.h +++ b/src/OperaAPI/OperaAPI_Volume.h @@ -26,7 +26,6 @@ #include #include -class ModelHighAPI_Double; class ModelHighAPI_Selection; /// \class OperaAPI_Volume @@ -42,7 +41,7 @@ public: /// Constructor with values. OPERAAPI_EXPORT explicit OperaAPI_Volume(const std::shared_ptr& theFeature, - const ModelHighAPI_Double& theMedium, + const std::string& theMedium, const std::list& theObjectList); /// Destructor. @@ -57,7 +56,7 @@ public: /// Set medium OPERAAPI_EXPORT - void setMedium(const ModelHighAPI_Double& theMedium); + void setMedium(const std::string& theMedium); /// Set main objects list. OPERAAPI_EXPORT @@ -75,7 +74,7 @@ typedef std::shared_ptr VolumePtr; /// \brief Create Volume feature. OPERAAPI_EXPORT VolumePtr addVolume(const std::shared_ptr& thePart, - const ModelHighAPI_Double& theMedium, + const std::string& theMedium, const std::list& theObjectList); #endif // OperaAPI_Volume_H_ diff --git a/src/OperaPlugin/doc/TUI_volume.rst b/src/OperaPlugin/doc/TUI_volume.rst index f136686c6..436076ca3 100644 --- a/src/OperaPlugin/doc/TUI_volume.rst +++ b/src/OperaPlugin/doc/TUI_volume.rst @@ -1,7 +1,7 @@ .. tui_create_volume: -Create Box by points +Create Volume ==================== .. literalinclude:: examples/volume.py -- 2.39.2