]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModelHighAPI/ModelHighAPI_Interface.cpp
Salome HOME
Copyright update 2022
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Interface.cpp
index b75b0f59e4087bddd9ba4b96a046c29774bd52c5..82917af4e89c5e8236cf16a904ae243d70ad8fa0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -82,17 +82,20 @@ void ModelHighAPI_Interface::execute(bool isForce)
   Events_Loop* aLoop = Events_Loop::loop();
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
-  //aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
+  aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
   //aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED));
 }
 
-void ModelHighAPI_Interface::setName(const std::string& theName)
+void ModelHighAPI_Interface::setName(const std::wstring& theName)
 {
-  if (feature().get())
+  if (feature().get() && feature()->data()->isValid())
     feature()->data()->setName(theName);
+  else {
+    std::cout<<"Error: set name "<<theName.c_str()<<" for an invalid feature"<<std::endl;
+  }
 }
 
-std::string ModelHighAPI_Interface::name() const
+std::wstring ModelHighAPI_Interface::name() const
 {
   return feature()->data()->name();
 }
@@ -107,7 +110,7 @@ ModelHighAPI_Selection ModelHighAPI_Interface::result() const
 
 std::list<ModelHighAPI_Selection> ModelHighAPI_Interface::results() const
 {
-  const_cast<ModelHighAPI_Interface*>(this)->execute(true);
+  const_cast<ModelHighAPI_Interface*>(this)->execute();
 
   std::list<ModelHighAPI_Selection> aSelectionList;