Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Construction of vertices/edges/faces on the base of sketch: clear list attribute...
[modules/shaper.git]
/
src
/
PythonAPI
/
modeler
/
roots.py
diff --git
a/src/PythonAPI/modeler/roots.py
b/src/PythonAPI/modeler/roots.py
index 62288ebb3dfb67a121adfa932a3489e8907ec685..181fd7efc816da21b18ceeb623b26c609b7e8898 100644
(file)
--- a/
src/PythonAPI/modeler/roots.py
+++ b/
src/PythonAPI/modeler/roots.py
@@
-10,15
+10,19
@@
class Feature(ModelAPI_Feature):
"""Base class of user-defined Python features."""
def __init__(self):
"""Base class of user-defined Python features."""
def __init__(self):
+ """Constructor"""
ModelAPI_Feature.__init__(self)
def addRealInput (self, inputid):
ModelAPI_Feature.__init__(self)
def addRealInput (self, inputid):
+ """Add double input"""
self.data().addAttribute(inputid, ModelAPI_AttributeDouble_typeId())
def getRealInput (self, inputid):
self.data().addAttribute(inputid, ModelAPI_AttributeDouble_typeId())
def getRealInput (self, inputid):
+ """Returns double input"""
return self.data().real(inputid).value()
def addResult (self, result):
return self.data().real(inputid).value()
def addResult (self, result):
+ """Add result"""
shape = result.shape()
body = self.document().createBody( self.data() )
body.store(shape)
shape = result.shape()
body = self.document().createBody( self.data() )
body.store(shape)
@@
-29,13
+33,18
@@
class Interface():
"""Base class of hight level Python interfaces to features."""
def __init__(self, container, fid):
"""Base class of hight level Python interfaces to features."""
def __init__(self, container, fid):
+ """Constructor"""
+ ### Create the feature
self.my = container.addFeature(fid)
def setRealInput (self, inputid, value):
self.my = container.addFeature(fid)
def setRealInput (self, inputid, value):
+ """Set real value"""
self.my.data().real(inputid).setValue(value)
def areInputValid (self):
self.my.data().real(inputid).setValue(value)
def areInputValid (self):
+ """Returns True if the input is valid"""
return ModelAPI_Session.get().validators().validate(self.my)
def execute (self):
return ModelAPI_Session.get().validators().validate(self.my)
def execute (self):
+ """Build the feature result"""
self.my.execute()
\ No newline at end of file
self.my.execute()
\ No newline at end of file