Salome HOME
Remove the cylinder macro: only Box is needed
authormpv <mpv@opencascade.com>
Thu, 16 Apr 2015 06:32:01 +0000 (09:32 +0300)
committermpv <mpv@opencascade.com>
Thu, 16 Apr 2015 06:32:01 +0000 (09:32 +0300)
src/PythonAddons/addons_Features.py
src/PythonAddons/addons_Features.xml
src/PythonAddons/macros/cylinder/__init__.py [deleted file]
src/PythonAddons/macros/cylinder/feature.py [deleted file]
src/PythonAddons/macros/cylinder/widget.xml [deleted file]

index 00c72b0274ebaacd5c10dffc49b7726d7517f28d..90b23b9a9b171ded79eef7fc49ac7c3b3a5b7cdc 100644 (file)
@@ -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)
 
index 4fe748a5d2cc6cf91e02537ca92dfa92d71f21df..cc18bfb85b8e5246acac3a92c187639335a8d031 100644 (file)
@@ -1,4 +1,3 @@
 <plugin>
   <source path="../addons/macros/box/widget.xml"/>
-  <source path="../addons/macros/cylinder/widget.xml"/>
 </plugin>
diff --git a/src/PythonAddons/macros/cylinder/__init__.py b/src/PythonAddons/macros/cylinder/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/src/PythonAddons/macros/cylinder/feature.py b/src/PythonAddons/macros/cylinder/feature.py
deleted file mode 100644 (file)
index fd66f38..0000000
+++ /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 (file)
index 8b2101f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<source>
-  <workbench id="Macros" document="Part">
-    <group id="Samples">
-
-      <feature id="Cylinder" title="Cylinder" tooltip="Creates a cylinder on the Z axis by extruding a circle" icon=":pictures/part_ico.png">
-        <doublevalue id="radius" label="Radius: " min="0" step="1.0" default="10" tooltip="Sets the cylinder radius">
-          <validator id="GeomValidators_Positive"/>
-        </doublevalue>
-        <doublevalue id="length" label="Length: " min="0" step="1.0" default="50" tooltip="Sets the cylinder length">
-          <validator id="GeomValidators_Positive"/>
-        </doublevalue>
-      </feature>
-
-    </group>
-  </workbench>  
-</source>