From: mpv Date: Thu, 16 Apr 2015 06:32:01 +0000 (+0300) Subject: Remove the cylinder macro: only Box is needed X-Git-Tag: V_1.1.0~23^2~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=70d3f9177165dceb04f47c4660f3d32f23fe5911;p=modules%2Fshaper.git Remove the cylinder macro: only Box is needed --- diff --git a/src/PythonAddons/addons_Features.py b/src/PythonAddons/addons_Features.py index 00c72b027..90b23b9a9 100644 --- a/src/PythonAddons/addons_Features.py +++ b/src/PythonAddons/addons_Features.py @@ -3,7 +3,6 @@ import ModelAPI from macros.box.feature import BoxFeature -from macros.cylinder.feature import CylinderFeature class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin): @@ -20,9 +19,6 @@ class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin): if theFeatureID == BoxFeature.ID(): aFeature = BoxFeature().__disown__() - elif theFeatureID == CylinderFeature.ID(): - aFeature = CylinderFeature().__disown__() - else: raise StandardError("No such feature %s" % theFeatureID) diff --git a/src/PythonAddons/addons_Features.xml b/src/PythonAddons/addons_Features.xml index 4fe748a5d..cc18bfb85 100644 --- a/src/PythonAddons/addons_Features.xml +++ b/src/PythonAddons/addons_Features.xml @@ -1,4 +1,3 @@ - diff --git a/src/PythonAddons/macros/cylinder/__init__.py b/src/PythonAddons/macros/cylinder/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/PythonAddons/macros/cylinder/feature.py b/src/PythonAddons/macros/cylinder/feature.py deleted file mode 100644 index fd66f3836..000000000 --- a/src/PythonAddons/macros/cylinder/feature.py +++ /dev/null @@ -1,68 +0,0 @@ -"""Cylinder macro-feature -Authors: Daniel Brunier-Coulin -Copyright (C) 2014-20xx CEA/DEN, EDF R&D -""" - -import modeler -import geom - - -class CylinderFeature(modeler.Feature): - - -# Initializations - - def __init__(self): - modeler.Feature.__init__(self) - - @staticmethod - def ID(): - return "Cylinder" - - @staticmethod - def RADIUS_ID(): - return "radius" - - @staticmethod - def LENGTH_ID(): - return "length" - - def getKind(self): - return CylinderFeature.ID() - - -# Creation of the cylinder at default size - - def initAttributes(self): - - # Creating the input arguments of the feature - self.addRealInput( self.RADIUS_ID() ) - self.addRealInput( self.LENGTH_ID() ) - - # Creating the base of the cylinder with unit values - mypart = modeler.activeDocument() - xoy = modeler.defaultPlane("XOY") - - self.base = modeler.addSketch( mypart, xoy ) - circle = self.base.addCircle( 0, 0, 1) - - # Setting the radius of the base with default values - self.radius = self.base.setRadius( circle.result(), 10 ) # Keeps the constraint for edition - - # Creating the extrusion (the cylinder) at default size - self.cyl = modeler.addExtrusion( mypart, self.base.selectFace(), 50 ) - - -# Edition of the cylinder at user size - - def execute(self): - # Retrieving the user inputs - radius = self.getRealInput( self.RADIUS_ID() ) - length = self.getRealInput( self.LENGTH_ID() ) - - # Editing the cylinder - self.base.setValue( self.radius, radius ) - self.cyl.setSize( length ) - - # Publishing the result - self.addResult( self.cyl.result() ) \ No newline at end of file diff --git a/src/PythonAddons/macros/cylinder/widget.xml b/src/PythonAddons/macros/cylinder/widget.xml deleted file mode 100644 index 8b2101f9b..000000000 --- a/src/PythonAddons/macros/cylinder/widget.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - -