Back to index

salome-geom  6.5.0
Public Member Functions | Private Attributes
GEOM_PY.structelem.parts.SubShapeID Class Reference

List of all members.

Public Member Functions

def __init__
def getObj
def __eq__
def __hash__

Private Attributes

 _mainShape
 _id

Detailed Description

This class enables the use of sub-shapes in sets or as dictionary keys.
It implements __eq__ and __hash__ methods so that sub-shapes with the same
CORBA object `mainShape` and the same `id` are considered equal.

Definition at line 78 of file parts.py.


Constructor & Destructor Documentation

def GEOM_PY.structelem.parts.SubShapeID.__init__ (   self,
  mainShape,
  id 
)

Definition at line 85 of file parts.py.

00085 
00086     def __init__(self, mainShape, id):
00087         self._mainShape = mainShape
00088         self._id = id


Member Function Documentation

def GEOM_PY.structelem.parts.SubShapeID.__eq__ (   self,
  other 
)

Definition at line 96 of file parts.py.

00096 
00097     def __eq__(self, other):
00098         return self._mainShape._is_equivalent(other._mainShape) and \
00099                self._id == other._id
    

Definition at line 100 of file parts.py.

00100 
00101     def __hash__(self):
00102         return self._mainShape._hash(2147483647) ^ self._id
00103 

def GEOM_PY.structelem.parts.SubShapeID.getObj (   self,
  geom 
)
Return the sub-shape (GEOM object). `geom` is a pseudo-geompy object
used to find the geometrical object.

Definition at line 89 of file parts.py.

00089 
00090     def getObj(self, geom):
00091         """
00092         Return the sub-shape (GEOM object). `geom` is a pseudo-geompy object
00093         used to find the geometrical object.
00094         """
00095         return geom.GetSubShape(self._mainShape, [self._id])
    

Member Data Documentation

Definition at line 87 of file parts.py.

Definition at line 86 of file parts.py.


The documentation for this class was generated from the following file: