-
-class Interface():
- """Base class of high level Python interfaces to features."""
-
- def __init__(self, feature):
- self._feature = feature
-
- def __getattr__(self, name):
- """Process missing attributes.
-
- Add get*() methods for access feature attributes.
- Redirect missing attributes to the feature.
- """
- if name.startswith("get"):
- possible_names = [
- "_" + name[3:],
- "_" + convert_to_underscore(name[3:]),
- ]
- for possible_name in possible_names:
- if hasattr(self, possible_name):
- def getter():
- return get_value(getattr(self, possible_name))
- return getter
-
- return self._feature.__getattribute__(name)
-
- def setRealInput(self, inputid, value):
- self._feature.data().real(inputid).setValue(value)
-
- def areInputValid(self):
- validators = ModelAPI.ModelAPI_Session.get().validators()
- return validators.validate(self._feature)
-
- def execute(self):
- self._feature.execute()