]> SALOME platform Git repositories - modules/shaper.git/blob - src/PythonFeaturesPlugin/PythonFeaturesPlugin_Box.py
Salome HOME
The ability to register python plugins added
[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   @staticmethod
9   def ID():
10     return "Box"
11
12   @staticmethod
13   def WIDTH_ID():
14     return "box_width"
15   
16   @staticmethod
17   def LENGTH_ID():
18     return "box_length"
19   
20   @staticmethod
21   def HEIGHT_ID():
22     return "box_height"
23
24   def initAttributes(self):
25     self.data().addAttribute(PythonFeaturesPlugin_Box.WIDTH_ID(), ModelAPI_AttributeDouble.type())
26     self.data().addAttribute(PythonFeaturesPlugin_Box.LENGTH_ID(), ModelAPI_AttributeDouble.type())
27     self.data().addAttribute(PythonFeaturesPlugin_Box.HEIGHT_ID(), ModelAPI_AttributeDouble.type())
28
29   def execute(self):
30     aWidth  = self.attribute(PythonFeaturesPlugin_Box.WIDTH_ID()).value()
31     aLength = self.attribute(PythonFeaturesPlugin_Box.LENGTH_ID()).value()
32     aHeight = self.attribute(PythonFeaturesPlugin_Box.HEIGHT_ID()).value()
33
34     aResult = document().createBody(data())
35     #aResult.store(UserPackage.makeBox(aLength, aWidth, aHeight)
36
37     #self.setResult(aResult)
38
39
40     
41
42