Salome HOME
Merge with Dev_1.5.0
authorspo <sergey.pokhodenko@opencascade.com>
Tue, 3 Nov 2015 14:12:45 +0000 (17:12 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Tue, 3 Nov 2015 14:12:45 +0000 (17:12 +0300)
1  2 
env_linux.sh
src/Model/Model_AttributeSelection.cpp
src/ModelAPI/ModelAPI_AttributeSelectionList.h
src/ModelAPI/ModelAPI_Document.h
src/ModelAPI/ModelAPI_Feature.h
src/PythonAddons/addons_Features.py
src/PythonAddons/macros/box/feature.py
src/SketchPlugin/plugin-Sketch.xml

diff --cc env_linux.sh
index 39157d4728f97769a8135aff3dec76f1e29e2399,379bdd24c0acdb28eaccf2fd6166be3170dcb83a..8d6cdc892908ecdd31b2699d5cedd5c405102274
@@@ -25,9 -38,8 +38,8 @@@ export PATH=${CASROOT}:${PATH
  ##
  
  #------ NewGEOM ------
- export NEWGEOM_ROOT_DIR=${INSTALL_DIR}
  export PATH=${NEWGEOM_ROOT_DIR}/bin:${NEWGEOM_ROOT_DIR}/plugins:${PATH}
 -export PYTHONPATH=${NEWGEOM_ROOT_DIR}/swig:${NEWGEOM_ROOT_DIR}/plugins:${NEWGEOM_ROOT_DIR}/addons:${NEWGEOM_ROOT_DIR}/pythonAPI:${PYTHONPATH}
 +export PYTHONPATH=${NEWGEOM_ROOT_DIR}/swig:${NEWGEOM_ROOT_DIR}/plugins:${NEWGEOM_ROOT_DIR}/addons:${NEWGEOM_ROOT_DIR}/PythonAPI:${PYTHONPATH}
  export LD_LIBRARY_PATH=${NEWGEOM_ROOT_DIR}/bin:${NEWGEOM_ROOT_DIR}/swig:${NEWGEOM_ROOT_DIR}/plugins:${LD_LIBRARY_PATH}
  export NEW_GEOM_CONFIG_FILE=${NEWGEOM_ROOT_DIR}/plugins
  export NewGeomResources=${NEWGEOM_ROOT_DIR}/resources
Simple merge
Simple merge
index 3ff9f26ddfa2648a0c765a5bf2c051759d88b5d4,0c92f1be1b77f1f6bb466e7a0625e92adf1b791e..3fef980a8e2638086adb4f5c53d4310b8a042bd6
@@@ -6,13 -6,10 +6,13 @@@ from macros.box.feature      import Box
  
  
  class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin):
-     """Class for Python features plugin.
 -"""Implementation of features plugin"""
++    """Implementation of features plugin.
 +
 +    PythonFeaturesPlugin() -> plugin object
 +    """
  
      def __init__(self):
 -        """Constructor"""
 +        """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
          ModelAPI.ModelAPI_Plugin.__init__(self)
          aSession = ModelAPI.ModelAPI_Session.get()
          aSession.registerPlugin(self)
@@@ -30,6 -27,6 +30,6 @@@
  
          return aFeature
  
 -### The plugin object
++# The plugin object
  plugin = PythonFeaturesPlugin()
  plugin.__disown__()
index 8c6687c77701b6efb0e2027bb41395cc4965b915,1f581be4aafb04b7d0ae67871f1469c18c08749c..ca037ba1f14d813a64c592e984bfce370ec610e4
@@@ -7,100 -7,96 +7,103 @@@ import mode
  import geom
  
  
 -class BoxFeature(modeler.Feature):
 -  """An example of Box feature implementation"""
 +class BoxFeature(model.Feature):
-     """Box feature.
++    """An example of Box feature implementation.
 +
 +    BoxFeature() -> Box
 +    """
  
  # Initializations
  
 -  def __init__(self):
 -    """Constructor"""
 -    modeler.Feature.__init__(self)
 +    def __init__(self):
 +        """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
 +        model.Feature.__init__(self)
 +
 +    @staticmethod
 +    def ID():
-         """String constant."""
++        """Return Id of the feature."""
 +        return "Box"
  
 -  @staticmethod
 -  def ID():
 -    """Return Id of the feature"""
 -    return "Box"
 +    @staticmethod
 +    def WIDTH_ID():
-         """String constant."""
++        """Returns ID of Width parameter."""
 +        return "width"
  
 -  @staticmethod
 -  def WIDTH_ID():
 -    """Returns ID of Width parameter"""
 -    return "width"
 +    @staticmethod
 +    def LENGTH_ID():
-         """String constant."""
++        """Returns ID of Length parameter."""
 +        return "length"
  
 -  @staticmethod
 -  def LENGTH_ID():
 -    """Returns ID of Length parameter"""
 -    return "length"
 +    @staticmethod
 +    def HEIGHT_ID():
-         """String constant."""
++        """Returns ID of Height parameter."""
 +        return "height"
  
 -  @staticmethod
 -  def HEIGHT_ID():
 -    """Returns ID of Height parameter"""
 -    return "height"
 +    def getKind(self):
 +        """Override Feature.getKind()"""
 +        return BoxFeature.ID()
  
 -  def getKind(self):
 -    """Returns ID of еру ауфегку"""
 -    return BoxFeature.ID()
  
 -      
  # Creation of the box at default size
  
 -  def initAttributes(self):
 -    """Initialise attributes of the feature"""
 -    # Creating the input arguments of the feature
 -    self.addRealInput( self.WIDTH_ID() )
 -    self.addRealInput( self.LENGTH_ID() )
 -    self.addRealInput( self.HEIGHT_ID() )
 +    def initAttributes(self):
 +        """Override Feature.initAttributes()"""
 +        # Creating the input arguments of the feature
 +        self.addRealInput(self.WIDTH_ID())
 +        self.addRealInput(self.LENGTH_ID())
 +        self.addRealInput(self.HEIGHT_ID())
  
 -    # Creating the base of the box with unit values
 -    mypart = modeler.activeDocument()
 -    xoy    = modeler.defaultPlane("XOY")
 +        # Creating the base of the box with unit values
 +        mypart = model.activeDocument()
 +        xoy = model.defaultPlane("XOY")
  
 -    ### A base of the geometry
 -    self.base = modeler.addSketch( mypart, xoy )
++        # A base of the geometry
 +        self.base = model.addSketch(mypart, xoy)
  
 -    p1 = geom.Pnt2d( 0, 0 )
 -    p2 = geom.Pnt2d( 0, 1 )
 -    p3 = geom.Pnt2d( 1, 1 )
 -    p4 = geom.Pnt2d( 1, 0 )
 +        p1 = geom.Pnt2d(0, 0)
 +        p2 = geom.Pnt2d(0, 1)
 +        p3 = geom.Pnt2d(1, 1)
 +        p4 = geom.Pnt2d(1, 0)
  
 -    line = self.base.addPolygon(p1, p2, p3, p4)
 +        line = self.base.addPolygon(p1, p2, p3, p4)
  
 -    self.base.setParallel( line[0].result(), line[2].result() )
 -    self.base.setParallel( line[1].result(), line[3].result() )
 -    self.base.setPerpendicular( line[0].result(), line[3].result() )
 +        self.base.setParallel(line[0].result(), line[2].result())
 +        self.base.setParallel(line[1].result(), line[3].result())
 +        self.base.setPerpendicular(line[0].result(), line[3].result())
  
 -    # Setting the size of the base with default values
 -    ### Width
 -    self.width  = self.base.setLength( line[0].result(), 50 )   # Keeps the constraint for edition
 -    ### Length
 -    self.length = self.base.setLength( line[3].result(), 50 )   # Keeps the constraint for edition
 +        # Setting the size of the base with default values
++        # Width
 +        self.width = self.base.setLength(line[0].result(), 50)  # Keeps the constraint for edition
++        # Length
 +        self.length = self.base.setLength(line[3].result(), 50)  # Keeps the constraint for edition
  
 -    # Creating the extrusion (the box) at default size
 -    ### A box result
 -    self.box = modeler.addExtrusion( mypart, self.base.selectFace(), 50 )
 +        # Creating the extrusion (the box) at default size
++        # A box result
 +        self.box = model.addExtrusion(mypart, self.base.selectFace(), 50)
  
 -      
  # Edition of the box at user size
  
 -  def execute(self):
 -    """Compute the feature result"""
 -    # Retrieving the user inputs
 -    width  = self.getRealInput( self.WIDTH_ID() )
 -    length = self.getRealInput( self.LENGTH_ID() )
 -    height = self.getRealInput( self.HEIGHT_ID() )
 -
 -    # Editing the box
 -    self.base.setValue( self.width,  width )
 -    self.base.setValue( self.length, length )
 -    self.box.setSize( height )
 -
 -    # Publishing the result: not needed for Macro feature
 -    #self.addResult( self.box.result() )
 -  
 -  def isMacro(self):
 -    """Returns True"""
 -    # Box feature is macro: removes itself on the creation transaction finish
 -    return True
 +    def execute(self):
 +        """F.execute() -- execute the feature"""
 +        # Retrieving the user inputs
 +        width = self.getRealInput(self.WIDTH_ID())
 +        length = self.getRealInpuut(self.WIDTH_ID())
 +        length = self.getRealInt(self.LENGTH_ID())
 +        height = self.getRealInput(self.HEIGHT_ID())
 +
 +        # Editing the box
 +        self.base.setValue(self.width, width)
 +        self.base.setValue(self.length, length)
 +        self.box.setSize(height)
 +
 +        # Publishing the result: not needed for Macro feature
 +        # self.addResult( self.box.result() )
 +
 +    def isMacro(self):
 +        """Override Feature.initAttributes().
 +        F.isMacro() -> True
 +
 +        Box feature is macro: removes itself on the creation transaction
 +        finish.
 +        """
 +        return True
Simple merge