]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Some obsolete interface python interfaces are removed
authormpv <mpv@opencascade.com>
Fri, 11 Nov 2016 15:51:09 +0000 (18:51 +0300)
committermpv <mpv@opencascade.com>
Fri, 11 Nov 2016 15:51:09 +0000 (18:51 +0300)
src/PythonAPI/CMakeLists.txt
src/PythonAPI/Test/TestFeatures.py
src/PythonAPI/extension/__init__.py [deleted file]
src/PythonAPI/extension/box.py [deleted file]
src/PythonAPI/geom/__init__.py
src/PythonAPI/geom/missed.py [deleted file]
src/PythonAPI/model/roots.py

index 4de4d106269dfa0f2496c4c85cafe53d86a8ec67..16ce02a1b126e1a9f9ad232e8ff32ba3fd0cfb00 100644 (file)
@@ -3,7 +3,7 @@
 
 SET(CMAKE_AUTOMOC ON)
 
-INSTALL(DIRECTORY extension geom model examples DESTINATION ${SHAPER_INSTALL_PYTHON_API})
+INSTALL(DIRECTORY geom model examples DESTINATION ${SHAPER_INSTALL_PYTHON_API})
 INSTALL(FILES shaper.py DESTINATION ${SHAPER_INSTALL_PYTHON_API})
 
 # --------- Unit tests -----------
index 4a071252f9d859c0f064974d4eaecc7c2b0e871d..549d6583b1929d8ff6475d66390d198953c1b15d 100644 (file)
@@ -74,7 +74,9 @@ class FeaturesTestCase(FeaturesFixture):
         FeaturesAPI.FeaturesAPI_Placement(self.part.addFeature("Placement"))
         FeaturesAPI.FeaturesAPI_Rotation(self.part.addFeature("Rotation"))
         FeaturesAPI.FeaturesAPI_Translation(self.part.addFeature("Translation"))
-        FeaturesAPI.FeaturesAPI_Group(self.part.addFeature("Group"))
+
+        import CollectionAPI
+        CollectionAPI.CollectionAPI_Group(self.part.addFeature("Group"))
 
         import PrimitivesAPI
         PrimitivesAPI.PrimitivesAPI_Box(self.part.addFeature("Box"))
diff --git a/src/PythonAPI/extension/__init__.py b/src/PythonAPI/extension/__init__.py
deleted file mode 100644 (file)
index 1429590..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-"""User-defined features.
-"""
-
-from box import addBoxScript
\ No newline at end of file
diff --git a/src/PythonAPI/extension/box.py b/src/PythonAPI/extension/box.py
deleted file mode 100644 (file)
index 5897da2..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-"""Box macro-feature Interface
-Author: Daniel Brunier-Coulin
-Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-"""
-
-from model import Interface
-from macros.box.feature import BoxFeature as MY
-
-
-def addBoxScript(part, *args):
-    """Add Box feature to the part and return Box.
-
-    Pass all args to Box __init__ function.
-    """
-    feature = part.addFeature(MY.ID())
-    return Box(feature, *args)
-
-
-class Box(Interface):
-    """Executes the macro-feature Box.
-
-    Box(feature) -> feature interface without initialization
-    Extrusion(feature, dx, dy, dz) ->
-        feature interface initialized from arguments:
-        - dx, dy, dz -- box dimensions
-    """
-
-    def __init__(self, feature, *args):
-        """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
-        Interface.__init__(self, feature)
-        assert(self._feature.getKind() == MY.ID())
-
-        self._width = self._feature.real(MY.WIDTH_ID())
-        self._length = self._feature.real(MY.LENGTH_ID())
-        self._height = self._feature.real(MY.HEIGHT_ID())
-
-        assert(self._width)
-        assert(self._length)
-        assert(self._height)
-
-        if not args:
-            return
-
-        assert(len(args) == 3)
-        dx, dy, dz = args
-        self.setWidth(dx)
-        self.setLength(dy)
-        self.setHeight(dz)
-
-        self.execute()
-        pass
-
-    def setWidth(self, width):
-        """B.setWidth(float) -- modify width attribute"""
-        self._width.setValue(width)
-        pass
-
-    def setLength(self, length):
-        """B.setLength(float) -- modify length attribute"""
-        self._length.setValue(length)
-        pass
-
-    def setHeight(self, height):
-        """B.setHeight(float) -- modify height attribute"""
-        self._height.setValue(height)
-        pass
index c6faa27e3512780b64ac000fa1f411a8e30a45e9..8718d8cd3f7fc5a22e21208681b906fef63106b1 100644 (file)
@@ -20,7 +20,3 @@ from GeomAPI import GeomAPI_Shape  as Shape
 
 from GeomAlgoAPI import GeomAlgoAPI_Boolean   as Boolean
 
-
-# Emulation of interfaces not yet swigged
-
-from missed  import *
\ No newline at end of file
diff --git a/src/PythonAPI/geom/missed.py b/src/PythonAPI/geom/missed.py
deleted file mode 100644 (file)
index 247cfef..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# Direct Geometry API not yet swigged
-# Author: Daniel Brunier-Coulin
-# -----------------------------
-
-#from GeomAPI import *
-
-
-class Ax3:
-  """A class to represent a Coordinate system object"""
-
-  def __init__(self, origin, normal, dirx):
-    """Constructor"""
-    ### Create an origin point
-    self.o  = origin
-    ### Create a normal vector
-    self.n  = normal
-    ### Create X axis direction
-    self.dx = dirx
-
-  def location (self):
-    """Returns origin point"""
-    return self.o
-
-  def direction (self):
-    """Returns normal direction"""
-    return self.n
-
-  def xDirection (self):
-    """Returns direction of X axis"""
-    return self.dx
-
-  def yDirection (self):
-    """Returns direction of Y axis"""
-    return self.n.cross(self.dx)
index 77a2335ce0274578c858d439174a96ce3340f986..31316103e34d389ec447cb48c0fe2e69891d9cc2 100644 (file)
@@ -32,51 +32,3 @@ class Feature(ModelAPI.ModelAPI_Feature):
         body.store(shape)
         self.setResult(body)
 
-
-class Interface():
-    """Base class of high level Python interfaces to features."""
-
-    def __init__(self, feature):
-        """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
-        self._feature = feature
-
-    def feature(self):
-        """Return ModelAPI_Feature."""
-        return self._feature
-
-    def getKind(self):
-        """Return the unique kind of the feature"""
-        return self._feature.getKind()
-
-    def results(self):
-        """Return current results of the feature"""
-        return self._feature.results()
-
-    def firstResult(self):
-        """Return the first result in the list of results"""
-        return self._feature.firstResult()
-
-    def lastResult(self):
-        """Return the last result in the list of results"""
-        return self._feature.lastResult()
-
-    def setRealInput(self, inputid, value):
-        """I.setRealInput(str, float) -- set real value to the attribute"""
-        self._feature.data().real(inputid).setValue(value)
-
-    def areInputValid(self):
-        """I.areInputValid() -> True or False validation result"""
-        validators = ModelAPI.ModelAPI_Session.get().validators()
-        return validators.validate(self._feature)
-
-    def execute(self):
-        """I.execute() -- validate and execute the feature.
-
-        Raises RuntimeError if validation fails.
-        """
-        if self.areInputValid():
-            self._feature.execute()
-        else:
-            raise RuntimeError("Can not execute %s: %s" %
-                               (self._feature.getKind(), self._feature.error())
-                               )