]> SALOME platform Git repositories - modules/shaper.git/blob - src/PythonFeaturesPlugin/PythonFeaturesPlugin_Box.py
Salome HOME
Patch by Renaud: a test plugin written in python
[modules/shaper.git] / src / PythonFeaturesPlugin / PythonFeaturesPlugin_Box.py
1 from ModelAPI import *
2
3 class PythonFeaturesPlugin_Box(ModelAPI_Feature):
4   "Feature to create a box by drawing a sketch and extruding it"
5   def __init__(self):
6     pass
7
8   def ID(self):
9     return "Box"
10
11   def WIDTH_ID(self):
12     return "box_width"
13   
14   def LENGTH_ID(self):
15     return "box_length"
16   
17   def HEIGHT_ID(self):
18     return "box_height"
19
20   def initAttributes(self):
21     self.data().addAttribute(self.WIDTH_ID(), ModelAPI_AttributeDouble.type())
22     self.data().addAttribute(self.LENGTH_ID(), ModelAPI_AttributeDouble.type())
23     self.data().addAttribute(self.HEIGHT_ID(), ModelAPI_AttributeDouble.type())
24
25   def execute(self):
26     aWidth  = self.data().attribute(self.WIDTH_ID()).value()
27     aLength = self.data().attribute(self.LENGTH_ID()).value()
28     aHeight = self.data().attribute(self.HEIGHT_ID()).value()
29
30     aResult = document().createBody(data())
31     #aResult.store(UserPackage.makeBox(aLength, aWidth, aHeight)
32
33     #self.setResult(aResult)
34
35
36     
37
38