Back to index

salome-geom  6.5.0
Functions
Decompose objects
Creating Advanced Geometrical Objects
Collaboration diagram for Decompose objects:

Functions

def geompyDC.geompyDC.GetExistingSubObjects
 Get all sub-shapes and groups of theShape, that were created already by any other methods.
def geompyDC.geompyDC.GetGroups
 Get all groups of theShape, that were created already by any other methods.
def geompyDC.geompyDC.SubShapeAll
 Explode a shape on sub-shapes of a given type.
def geompyDC.geompyDC.SubShapeAllIDs
 Explode a shape on sub-shapes of a given type.
def geompyDC.geompyDC.SubShape
 Obtain a compound of sub-shapes of aShape, selected by they indices in list of all sub-shapes of type aType.
def geompyDC.geompyDC.SubShapeAllSortedCentres
 Explode a shape on sub-shapes of a given type.
def geompyDC.geompyDC.SubShapeAllSortedCentresIDs
 Explode a shape on sub-shapes of a given type.
def geompyDC.geompyDC.SubShapeSortedCentres
 Obtain a compound of sub-shapes of aShape, selected by they indices in sorted list of all sub-shapes of type aType.
def geompyDC.geompyDC.ExtractShapes
 Extract shapes (excluding the main shape) of given type.
def geompyDC.geompyDC.SubShapes
 Get a set of sub-shapes defined by their unique IDs inside aShape

Function Documentation

def geompyDC.geompyDC.ExtractShapes (   self,
  aShape,
  aType,
  isSorted = False 
)

Extract shapes (excluding the main shape) of given type.

Parameters:
aShapeThe shape.
aTypeThe shape type (see ShapeType())
isSortedBoolean flag to switch sorting on/off.
Returns:
List of sub-shapes of type aType, contained in aShape.

Example

Extract shapes (excluding the main shape) of given type.

Parameters:
    aShape The shape.
    aType  The shape type (see geompy.ShapeType)
    isSorted Boolean flag to switch sorting on/off.

Returns:     
    List of sub-shapes of type aType, contained in aShape.

Definition at line 4168 of file geompyDC.py.

04168 
04169         def ExtractShapes(self, aShape, aType, isSorted = False):
04170             """
04171             Extract shapes (excluding the main shape) of given type.
04172 
04173             Parameters:
04174                 aShape The shape.
04175                 aType  The shape type (see geompy.ShapeType)
04176                 isSorted Boolean flag to switch sorting on/off.
04177 
04178             Returns:     
04179                 List of sub-shapes of type aType, contained in aShape.
04180             """
04181             # Example: see GEOM_TestAll.py
04182             ListObj = self.ShapesOp.ExtractSubShapes(aShape, aType, isSorted)
04183             RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
04184             return ListObj

Here is the call graph for this function:

def geompyDC.geompyDC.GetExistingSubObjects (   self,
  theShape,
  theGroupsOnly = False 
)

Get all sub-shapes and groups of theShape, that were created already by any other methods.

Parameters:
theShapeAny shape.
theGroupsOnlyIf this parameter is TRUE, only groups will be returned, else all found sub-shapes and groups.
Returns:
List of existing sub-objects of theShape.

Example

Get all sub-shapes and groups of theShape,
that were created already by any other methods.

Parameters:
    theShape Any shape.
    theGroupsOnly If this parameter is TRUE, only groups will be
         returned, else all found sub-shapes and groups.

Returns:
    List of existing sub-objects of theShape.

Definition at line 3965 of file geompyDC.py.

03965 
03966         def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
03967             """
03968             Get all sub-shapes and groups of theShape,
03969             that were created already by any other methods.
03970 
03971             Parameters:
03972                 theShape Any shape.
03973                 theGroupsOnly If this parameter is TRUE, only groups will be
03974                                  returned, else all found sub-shapes and groups.
03975 
03976             Returns:
03977                 List of existing sub-objects of theShape.
03978             """
03979             # Example: see GEOM_TestAll.py
03980             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
03981             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
03982             return ListObj

Here is the call graph for this function:

def geompyDC.geompyDC.GetGroups (   self,
  theShape 
)

Get all groups of theShape, that were created already by any other methods.

Parameters:
theShapeAny shape.
Returns:
List of existing groups of theShape.

Example

Get all groups of theShape,
that were created already by any other methods.

Parameters:
    theShape Any shape.

Returns:
    List of existing groups of theShape.

Definition at line 3989 of file geompyDC.py.

03989 
03990         def GetGroups(self, theShape):
03991             """
03992             Get all groups of theShape,
03993             that were created already by any other methods.
03994 
03995             Parameters:
03996                 theShape Any shape.
03997 
03998             Returns:
03999                 List of existing groups of theShape.
04000             """
04001             # Example: see GEOM_TestAll.py
04002             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
04003             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
04004             return ListObj

Here is the call graph for this function:

def geompyDC.geompyDC.SubShape (   self,
  aShape,
  aType,
  ListOfInd 
)

Obtain a compound of sub-shapes of aShape, selected by they indices in list of all sub-shapes of type aType.

Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]

Parameters:
aShapeShape to get sub-shape of.
ListOfIndList of sub-shapes indices.
aTypeType of sub-shapes to be retrieved (see ShapeType())
Returns:
A compound of sub-shapes of aShape.

Example

Obtain a compound of sub-shapes of aShape,
selected by they indices in list of all sub-shapes of type aType.
Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]

Parameters:
    aShape Shape to get sub-shape of.
    ListOfID List of sub-shapes indices.
    aType Type of sub-shapes to be retrieved (see geompy.ShapeType)

Returns:
    A compound of sub-shapes of aShape.

Definition at line 4059 of file geompyDC.py.

04059 
04060         def SubShape(self, aShape, aType, ListOfInd):
04061             """
04062             Obtain a compound of sub-shapes of aShape,
04063             selected by they indices in list of all sub-shapes of type aType.
04064             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
04065             
04066             Parameters:
04067                 aShape Shape to get sub-shape of.
04068                 ListOfID List of sub-shapes indices.
04069                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
04070 
04071             Returns:
04072                 A compound of sub-shapes of aShape.
04073             """
04074             # Example: see GEOM_TestAll.py
04075             ListOfIDs = []
04076             AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
04077             for ind in ListOfInd:
04078                 ListOfIDs.append(AllShapeIDsList[ind - 1])
04079             anObj = self.GetSubShape(aShape, ListOfIDs)
04080             return anObj

Here is the call graph for this function:

def geompyDC.geompyDC.SubShapeAll (   self,
  aShape,
  aType 
)

Explode a shape on sub-shapes of a given type.

If the shape itself matches the type, it is also returned.

Parameters:
aShapeShape to be exploded.
aTypeType of sub-shapes to be retrieved (see ShapeType())
Returns:
List of sub-shapes of type theShapeType, contained in theShape.

Example

Explode a shape on sub-shapes of a given type.
If the shape itself matches the type, it is also returned.

Parameters:
    aShape Shape to be exploded.
    aType Type of sub-shapes to be retrieved (see geompy.ShapeType) 

Returns:
    List of sub-shapes of type theShapeType, contained in theShape.

Definition at line 4012 of file geompyDC.py.

04012 
04013         def SubShapeAll(self, aShape, aType):
04014             """
04015             Explode a shape on sub-shapes of a given type.
04016             If the shape itself matches the type, it is also returned.
04017 
04018             Parameters:
04019                 aShape Shape to be exploded.
04020                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType) 
04021 
04022             Returns:
04023                 List of sub-shapes of type theShapeType, contained in theShape.
04024             """
04025             # Example: see GEOM_TestAll.py
04026             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
04027             RaiseIfFailed("SubShapeAll", self.ShapesOp)
04028             return ListObj

Here is the call graph for this function:

Here is the caller graph for this function:

def geompyDC.geompyDC.SubShapeAllIDs (   self,
  aShape,
  aType 
)

Explode a shape on sub-shapes of a given type.

Parameters:
aShapeShape to be exploded.
aTypeType of sub-shapes to be retrieved (see ShapeType())
Returns:
List of IDs of sub-shapes.

Example

Explode a shape on sub-shapes of a given type.

Parameters:
    aShape Shape to be exploded (see geompy.ShapeType) 
    aType Type of sub-shapes to be retrieved (see geompy.ShapeType)

Returns:
    List of IDs of sub-shapes.

Definition at line 4035 of file geompyDC.py.

04035 
04036         def SubShapeAllIDs(self, aShape, aType):
04037             """
04038             Explode a shape on sub-shapes of a given type.
04039 
04040             Parameters:
04041                 aShape Shape to be exploded (see geompy.ShapeType) 
04042                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
04043 
04044             Returns:
04045                 List of IDs of sub-shapes.
04046             """
04047             ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
04048             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
04049             return ListObj

Here is the call graph for this function:

Here is the caller graph for this function:

def geompyDC.geompyDC.SubShapeAllSortedCentres (   self,
  aShape,
  aType 
)

Explode a shape on sub-shapes of a given type.

Sub-shapes will be sorted by coordinates of their gravity centers. If the shape itself matches the type, it is also returned.

Parameters:
aShapeShape to be exploded.
aTypeType of sub-shapes to be retrieved (see ShapeType())
Returns:
List of sub-shapes of type theShapeType, contained in theShape.

Example

Explode a shape on sub-shapes of a given type.
Sub-shapes will be sorted by coordinates of their gravity centers.
If the shape itself matches the type, it is also returned.

Parameters: 
    aShape Shape to be exploded.
    aType Type of sub-shapes to be retrieved (see geompy.ShapeType)

Returns: 
    List of sub-shapes of type theShapeType, contained in theShape.

Definition at line 4089 of file geompyDC.py.

04089 
04090         def SubShapeAllSortedCentres(self, aShape, aType):
04091             """
04092             Explode a shape on sub-shapes of a given type.
04093             Sub-shapes will be sorted by coordinates of their gravity centers.
04094             If the shape itself matches the type, it is also returned.
04095 
04096             Parameters: 
04097                 aShape Shape to be exploded.
04098                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
04099 
04100             Returns: 
04101                 List of sub-shapes of type theShapeType, contained in theShape.
04102             """
04103             # Example: see GEOM_TestAll.py
04104             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
04105             RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
04106             return ListObj

Here is the call graph for this function:

def geompyDC.geompyDC.SubShapeAllSortedCentresIDs (   self,
  aShape,
  aType 
)

Explode a shape on sub-shapes of a given type.

Sub-shapes will be sorted by coordinates of their gravity centers.

Parameters:
aShapeShape to be exploded.
aTypeType of sub-shapes to be retrieved (see ShapeType())
Returns:
List of IDs of sub-shapes.

Example

Explode a shape on sub-shapes of a given type.
Sub-shapes will be sorted by coordinates of their gravity centers.

Parameters: 
    aShape Shape to be exploded.
    aType Type of sub-shapes to be retrieved (see geompy.ShapeType)

Returns: 
    List of IDs of sub-shapes.

Definition at line 4114 of file geompyDC.py.

04114 
04115         def SubShapeAllSortedCentresIDs(self, aShape, aType):
04116             """
04117             Explode a shape on sub-shapes of a given type.
04118             Sub-shapes will be sorted by coordinates of their gravity centers.
04119 
04120             Parameters: 
04121                 aShape Shape to be exploded.
04122                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
04123 
04124             Returns: 
04125                 List of IDs of sub-shapes.
04126             """
04127             ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
04128             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
04129             return ListIDs

Here is the call graph for this function:

Here is the caller graph for this function:

def geompyDC.geompyDC.SubShapes (   self,
  aShape,
  anIDs 
)

Get a set of sub-shapes defined by their unique IDs inside aShape

Parameters:
aShapeMain shape.
anIDsList of unique IDs of sub-shapes inside aShape.
Returns:
List of GEOM.GEOM_Object, corresponding to found sub-shapes.

Example

Get a set of sub-shapes defined by their unique IDs inside theMainShape

Parameters:
    aShape Main shape.
    anIDs List of unique IDs of sub-shapes inside theMainShape.

Returns:      
    List of GEOM.GEOM_Object, corresponding to found sub-shapes.

Definition at line 4191 of file geompyDC.py.

04191 
04192         def SubShapes(self, aShape, anIDs):
04193             """
04194             Get a set of sub-shapes defined by their unique IDs inside theMainShape
04195 
04196             Parameters:
04197                 aShape Main shape.
04198                 anIDs List of unique IDs of sub-shapes inside theMainShape.
04199 
04200             Returns:      
04201                 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
04202             """
04203             # Example: see GEOM_TestAll.py
04204             ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
04205             RaiseIfFailed("SubShapes", self.ShapesOp)
04206             return ListObj

Here is the call graph for this function:

def geompyDC.geompyDC.SubShapeSortedCentres (   self,
  aShape,
  aType,
  ListOfInd 
)

Obtain a compound of sub-shapes of aShape, selected by they indices in sorted list of all sub-shapes of type aType.

Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]

Parameters:
aShapeShape to get sub-shape of.
ListOfIndList of sub-shapes indices.
aTypeType of sub-shapes to be retrieved (see ShapeType())
Returns:
A compound of sub-shapes of aShape.

Example

Obtain a compound of sub-shapes of aShape,
selected by they indices in sorted list of all sub-shapes of type aType.
Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]

Parameters:
    aShape Shape to get sub-shape of.
    ListOfID List of sub-shapes indices.
    aType Type of sub-shapes to be retrieved (see geompy.ShapeType)

Returns:
    A compound of sub-shapes of aShape.

Definition at line 4139 of file geompyDC.py.

04139 
04140         def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
04141             """
04142             Obtain a compound of sub-shapes of aShape,
04143             selected by they indices in sorted list of all sub-shapes of type aType.
04144             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
04145 
04146             Parameters:
04147                 aShape Shape to get sub-shape of.
04148                 ListOfID List of sub-shapes indices.
04149                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
04150 
04151             Returns:
04152                 A compound of sub-shapes of aShape.
04153             """
04154             # Example: see GEOM_TestAll.py
04155             ListOfIDs = []
04156             AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
04157             for ind in ListOfInd:
04158                 ListOfIDs.append(AllShapeIDsList[ind - 1])
04159             anObj = self.GetSubShape(aShape, ListOfIDs)
04160             return anObj

Here is the call graph for this function: