Salome HOME
The ability to register python plugins added
[modules/shaper.git] / src / PythonFeaturesPlugin / PythonFeaturesPlugin_Box.py
index 800fbbeb8edcf16418e88a73e4b03ec714492eb0..e67278b2204b68547fdc441482813d312fe52b9b 100644 (file)
@@ -5,27 +5,31 @@ class PythonFeaturesPlugin_Box(ModelAPI_Feature):
   def __init__(self):
     pass
 
-  def ID(self):
+  @staticmethod
+  def ID():
     return "Box"
 
-  def WIDTH_ID(self):
+  @staticmethod
+  def WIDTH_ID():
     return "box_width"
   
-  def LENGTH_ID(self):
+  @staticmethod
+  def LENGTH_ID():
     return "box_length"
   
-  def HEIGHT_ID(self):
+  @staticmethod
+  def HEIGHT_ID():
     return "box_height"
 
   def initAttributes(self):
-    self.data().addAttribute(self.WIDTH_ID(), ModelAPI_AttributeDouble.type())
-    self.data().addAttribute(self.LENGTH_ID(), ModelAPI_AttributeDouble.type())
-    self.data().addAttribute(self.HEIGHT_ID(), ModelAPI_AttributeDouble.type())
+    self.data().addAttribute(PythonFeaturesPlugin_Box.WIDTH_ID(), ModelAPI_AttributeDouble.type())
+    self.data().addAttribute(PythonFeaturesPlugin_Box.LENGTH_ID(), ModelAPI_AttributeDouble.type())
+    self.data().addAttribute(PythonFeaturesPlugin_Box.HEIGHT_ID(), ModelAPI_AttributeDouble.type())
 
   def execute(self):
-    aWidth  = self.data().attribute(self.WIDTH_ID()).value()
-    aLength = self.data().attribute(self.LENGTH_ID()).value()
-    aHeight = self.data().attribute(self.HEIGHT_ID()).value()
+    aWidth  = self.attribute(PythonFeaturesPlugin_Box.WIDTH_ID()).value()
+    aLength = self.attribute(PythonFeaturesPlugin_Box.LENGTH_ID()).value()
+    aHeight = self.attribute(PythonFeaturesPlugin_Box.HEIGHT_ID()).value()
 
     aResult = document().createBody(data())
     #aResult.store(UserPackage.makeBox(aLength, aWidth, aHeight)