Salome HOME
Merge branch 'mbs/32757' of https://codev-tuleap.cea.fr/plugins/git/salome/shaper...
[modules/shaper.git] / src / PythonAddons / macros / compoundVertices / feature.py
old mode 100644 (file)
new mode 100755 (executable)
index 492594c..157341a
@@ -1,8 +1,26 @@
+# Copyright (C) 2016-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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
 """compound of vertices Feature
 Author: Nathalie Gore
 """
 
-from qtsalome import QMessageBox
 from salome.shaper import model
 from salome.shaper import geom
 import ModelAPI
@@ -42,8 +60,8 @@ class compoundVertices(model.Feature):
     def initAttributes(self):
         """Override Feature.initAttributes()"""
         # Creating the input argument of the feature
-        self.data().addAttribute(self.FILE_ID(), ModelAPI.ModelAPI_AttributeString_typeId())
-        self.data().addAttribute(self.SEPARATOR_ID(), ModelAPI.ModelAPI_AttributeString_typeId())
+        self.data().addAttribute(self.FILE_ID(), ModelAPI.ModelAPI_AttributeString.typeId())
+        self.data().addAttribute(self.SEPARATOR_ID(), ModelAPI.ModelAPI_AttributeString.typeId())
 
         self.lfeatures = []
         self.folder = None
@@ -79,12 +97,11 @@ class compoundVertices(model.Feature):
                 for line in file:
                     coord = line.split(self.separator)
                     if len(coord) != 3:
-                        #QMessageBox.warning( self, 'Error!', '3D coords waited!' )
                         return
                     x = float(coord[0]); y = float(coord[1]); z = float(coord[2]);
                     point = model.addPoint(part, x,y,z); point.execute(True); self.lfeatures.append(point)
-                    vertex = model.addVertex(part, [point.result()]); vertex.execute(True); self.lfeatures.append(vertex)
-                    lVertices.append(vertex.result())
+                    #vertex = model.addVertex(part, [point.result()]); vertex.execute(True); self.lfeatures.append(vertex)
+                    lVertices.append(point.result())
                 file.close()
                 compound = model.addCompound(part, lVertices)
                 compound.execute(True); self.lfeatures.append(compound)