//
#include "OperaAPI_Volume.h"
+
+
#include <ModelHighAPI_Dumper.h>
+#include <ModelHighAPI_Double.h>
#include <ModelHighAPI_Tools.h>
#include <locale> // std::wstring_convert
//==================================================================================================
OperaAPI_Volume::OperaAPI_Volume(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::string& theMedium,
+ const ModelHighAPI_Double& theMedium,
const std::list<ModelHighAPI_Selection>& theObjectList)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- fillAttribute(theMedium, medium());
+
+ std::wstring w_medium = theMedium.string();
+ std::wstring_convert<std::codecvt_utf8<wchar_t>,wchar_t> cv;
+ std::string medium_str = cv.to_bytes(w_medium);
+
+ fillAttribute(medium_str, medium());
setObjectList(theObjectList);
}
}
OperaAPI_Volume::~OperaAPI_Volume() {}
//==================================================================================================
-void OperaAPI_Volume::setMedium(const std::string& theMedium)
+void OperaAPI_Volume::setMedium(const ModelHighAPI_Double& theMedium)
{
fillAttribute(OperaPlugin_Volume::MEDIUM_ID(), medium());
execute();
//==================================================================================================
VolumePtr addVolume(const std::shared_ptr<ModelAPI_Document>& thePart,
- const std::string& theMedium,
+ const ModelHighAPI_Double& theMedium,
const std::list<ModelHighAPI_Selection>& theObjectList)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(OperaAPI_Volume::ID());
#include <ModelHighAPI_Interface.h>
#include <ModelHighAPI_Macro.h>
+class ModelHighAPI_Double;
class ModelHighAPI_Selection;
/// \class OperaAPI_Volume
/// Constructor with values.
OPERAAPI_EXPORT
explicit OperaAPI_Volume(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::string& theMedium,
+ const ModelHighAPI_Double& theMedium,
const std::list<ModelHighAPI_Selection>& theObjectList);
/// Destructor.
/// Set medium
OPERAAPI_EXPORT
- void setMedium(const std::string& theMedium);
+ void setMedium(const ModelHighAPI_Double& theMedium);
/// Set main objects list.
OPERAAPI_EXPORT
/// \brief Create Volume feature.
OPERAAPI_EXPORT
VolumePtr addVolume(const std::shared_ptr<ModelAPI_Document>& thePart,
- const std::string& theMedium,
+ const ModelHighAPI_Double& theMedium,
const std::list<ModelHighAPI_Selection>& theObjectList);
#endif // OperaAPI_Volume_H_