[bos #29603][EDF](2024-T1) Create group: don't find all subshapes.

Add new GetInPlaceCombined method, which combines results of GetInPlace(_) (the "new" one) and GetInPlaceByHistory(_).
This commit is contained in:
dish 2024-10-25 10:56:30 +00:00
parent 55b640ee17
commit d42545a1e4
6 changed files with 377 additions and 155 deletions

View File

@ -37,25 +37,25 @@ module GEOM
/*! /*!
* \brief Topological types of shapes (like Open Cascade types) * \brief Topological types of shapes (like Open Cascade types)
*/ */
enum shape_type enum shape_type
{ {
/*! A collection of arbitrary shapes */ /*! A collection of arbitrary shapes */
COMPOUND, COMPOUND,
/*! A collection of solids */ /*! A collection of solids */
COMPSOLID, COMPSOLID,
/*! A part of 3D space bound by a shell */ /*! A part of 3D space bound by a shell */
SOLID, SOLID,
/*! A collection of faces connected by some edges of their wire boundaries */ /*! A collection of faces connected by some edges of their wire boundaries */
SHELL, SHELL,
/*! Part of a plane (in 2D geometry) or a surface (in 3D geometry) bounded by a closed wire */ /*! Part of a plane (in 2D geometry) or a surface (in 3D geometry) bounded by a closed wire */
FACE, FACE,
/*! A sequence of edges connected by their vertices */ /*! A sequence of edges connected by their vertices */
WIRE, WIRE,
/*! Edge, a shape corresponding to a curve, and bound by a vertex at each extremity */ /*! Edge, a shape corresponding to a curve, and bound by a vertex at each extremity */
EDGE, EDGE,
/*! A zero-dimensional shape corresponding to a point in geometry */ /*! A zero-dimensional shape corresponding to a point in geometry */
VERTEX, VERTEX,
/*! Arbitrary shape in a Compound (used for processing of Compounds in some operations) */ /*! Arbitrary shape in a Compound (used for processing of Compounds in some operations) */
SHAPE, SHAPE,
/*! Flat (top-level) contents of a Compound (used for processing of Compounds in some operations) */ /*! Flat (top-level) contents of a Compound (used for processing of Compounds in some operations) */
FLAT FLAT
@ -89,7 +89,7 @@ module GEOM
* For sphere and cylinder it means outside of volume, bounded by the surface. * For sphere and cylinder it means outside of volume, bounded by the surface.
*/ */
ST_OUT, ST_OUT,
/*! /*!
* Shape is in the direction defined by the normal and on surface. * Shape is in the direction defined by the normal and on surface.
* ONOUT = ON || OUT * ONOUT = ON || OUT
@ -156,13 +156,13 @@ module GEOM
/*! Default (standard behaviour) */ /*! Default (standard behaviour) */
FOM_Default, FOM_Default,
/*! Use edges orientation - orientation of edges is used: if the edge is /*! Use edges orientation - orientation of edges is used: if the edge is
* reversed, the curve from this edge is reversed before using it in * reversed, the curve from this edge is reversed before using it in
* the filling algorithm. * the filling algorithm.
*/ */
FOM_UseOri, FOM_UseOri,
/*! Auto-correct edges orientation - changes the orientation of the curves /*! Auto-correct edges orientation - changes the orientation of the curves
* using minimization of sum of distances between the end points of the edges. * using minimization of sum of distances between the end points of the edges.
*/ */
FOM_AutoCorrect FOM_AutoCorrect
@ -177,7 +177,7 @@ module GEOM
enum curve_type { enum curve_type {
/*! Polyline curve */ /*! Polyline curve */
Polyline, Polyline,
/*! Bezier curve */ /*! Bezier curve */
Bezier, Bezier,
@ -312,8 +312,8 @@ module GEOM
/*! /*!
* \brief Get internal (unique) entry of the object in the GEOM component's data tree. * \brief Get internal (unique) entry of the object in the GEOM component's data tree.
* \note This is not an entry of the data object in SALOME study. * \note This is not an entry of the data object in SALOME study.
* This is internal function of GEOM component, though it can be used outside it for * This is internal function of GEOM component, though it can be used outside it for
appropriate reason (e.g. for unique identification of geometry object). appropriate reason (e.g. for unique identification of geometry object).
*/ */
string GetEntry(); string GetEntry();
@ -476,7 +476,7 @@ module GEOM
void SetMarkerStd(in marker_type theType, in marker_size theSize ); void SetMarkerStd(in marker_type theType, in marker_size theSize );
/*! /*!
* \brief Set custom point marker for the object. * \brief Set custom point marker for the object.
* *
* The texture can be added by LoadTexture() or AddTexture() functions. * The texture can be added by LoadTexture() or AddTexture() functions.
* \param theTextureId texture ID * \param theTextureId texture ID
@ -1500,7 +1500,7 @@ module GEOM
in double theAngleLength, in double theAngleLength,
in double theAngleRotation); in double theAngleRotation);
}; };
/*! /*!
* \brief Interface for 3D primitives creation * \brief Interface for 3D primitives creation
* *
@ -1631,7 +1631,7 @@ module GEOM
/*! /*!
* \brief Create a cone with given height and radiuses at * \brief Create a cone with given height and radiuses at
* the origin of coordinate system. * the origin of coordinate system.
* *
* Axis of the cone will be collinear to the OZ axis of the coordinate system. * Axis of the cone will be collinear to the OZ axis of the coordinate system.
* \param theR1 Radius of the first cone base. * \param theR1 Radius of the first cone base.
@ -1759,18 +1759,18 @@ module GEOM
/*! /*!
* \brief Add / Remove material to / from a solid by extrusion of the base shape on the given distance. * \brief Add / Remove material to / from a solid by extrusion of the base shape on the given distance.
* \param theInitShape Initial shape on which to perform the feature.It has to be a solid or * \param theInitShape Initial shape on which to perform the feature.It has to be a solid or
* a compound made of a single solid * a compound made of a single solid
* \param theBase Edge or wire defining the base shape to be extruded. * \param theBase Edge or wire defining the base shape to be extruded.
* \param theHeight Prism dimension along the normal of the face. * \param theHeight Prism dimension along the normal of the face.
* \param theAngle Draft angel in degrees * \param theAngle Draft angel in degrees
* \param theFuse If true material is added else material is removed * \param theFuse If true material is added else material is removed
* \param theInvert If true material changes the direction * \param theInvert If true material changes the direction
* \return New GEOM_Object, containing the modified shape * \return New GEOM_Object, containing the modified shape
*/ */
GEOM_Object MakeDraftPrism (in GEOM_Object theInitShape, GEOM_Object MakeDraftPrism (in GEOM_Object theInitShape,
in GEOM_Object theBase, in GEOM_Object theBase,
in double theHeight, in double theHeight,
in double theAngle, in double theAngle,
in boolean theFuse, in boolean theFuse,
in boolean theInvert); in boolean theInvert);
@ -1793,7 +1793,7 @@ module GEOM
/*! /*!
* \brief Create a shape by revolution of the base shape around the axis * \brief Create a shape by revolution of the base shape around the axis
* on the given angle. * on the given angle.
* *
* All the space, transfixed by the base * All the space, transfixed by the base
* shape during its rotation around the axis on the given angle. * shape during its rotation around the axis on the given angle.
@ -1844,7 +1844,7 @@ module GEOM
/*! /*!
* \brief Create a shape by extrusion of the profile shape along * \brief Create a shape by extrusion of the profile shape along
* the path shape. * the path shape.
* *
* The path shape can be a wire or an edge. * The path shape can be a wire or an edge.
* the several profiles can be specified in the several locations of path. * the several profiles can be specified in the several locations of path.
@ -1878,7 +1878,7 @@ module GEOM
/*! /*!
* \brief Create a shape by extrusion of the profile shape along * \brief Create a shape by extrusion of the profile shape along
* the path shape. * the path shape.
* *
* The path shape can be a shell or a face. * The path shape can be a shell or a face.
* the several profiles can be specified in the several locations of path. * the several profiles can be specified in the several locations of path.
@ -1967,7 +1967,7 @@ module GEOM
in boolean isCopy, in boolean isCopy,
in boolean isInside); in boolean isInside);
/*! /*!
* \brief Build a middle path of a pipe-like shape. * \brief Build a middle path of a pipe-like shape.
* *
@ -2148,7 +2148,7 @@ module GEOM
* \return New GEOM_Object, containing the created solid (or compound of solids). * \return New GEOM_Object, containing the created solid (or compound of solids).
*/ */
GEOM_Object MakeSolidFromConnectedFaces (in ListOfGO theFacesOrShells, in boolean isIntersect); GEOM_Object MakeSolidFromConnectedFaces (in ListOfGO theFacesOrShells, in boolean isIntersect);
/*! /*!
* \brief Replace coincident faces in \a theShapes by one face. * \brief Replace coincident faces in \a theShapes by one face.
* \param theShapes Initial shapes. * \param theShapes Initial shapes.
@ -2222,7 +2222,7 @@ module GEOM
in boolean theGroupsOnly); in boolean theGroupsOnly);
/*! /*!
* \brief Deprecated method. * \brief Deprecated method.
* *
* Use MakeAllSubShapes() instead. * Use MakeAllSubShapes() instead.
*/ */
@ -2231,7 +2231,7 @@ module GEOM
in boolean isSorted); in boolean isSorted);
/*! /*!
* \brief Explode a shape on sub-shapes of a given type. * \brief Explode a shape on sub-shapes of a given type.
* *
* If the shape itself has the given type, it is also returned. * If the shape itself has the given type, it is also returned.
* \param theShape Shape to be exploded. * \param theShape Shape to be exploded.
@ -2413,10 +2413,10 @@ module GEOM
* \param theMultiShare Specifies what type of shares should be checked: * \param theMultiShare Specifies what type of shares should be checked:
* - \c TRUE: search sub-shapes from 1st input shape shared with all other input shapes; * - \c TRUE: search sub-shapes from 1st input shape shared with all other input shapes;
* - \c FALSE: causes to search sub-shapes shared between couples of input shapes. * - \c FALSE: causes to search sub-shapes shared between couples of input shapes.
* \note If \a theShapes contains single compound, the shares between all possible couples of * \note If \a theShapes contains single compound, the shares between all possible couples of
* its top-level shapes are returned; otherwise, only shares between 1st input shape * its top-level shapes are returned; otherwise, only shares between 1st input shape
* and all rest input shapes are returned. * and all rest input shapes are returned.
* *
* \return List of all found sub-shapes. * \return List of all found sub-shapes.
*/ */
ListOfGO GetSharedShapesMulti (in ListOfGO theShapes, ListOfGO GetSharedShapesMulti (in ListOfGO theShapes,
@ -2697,12 +2697,23 @@ module GEOM
in short theShapeType, in short theShapeType,
in shape_state theState); in shape_state theState);
/*!
* \brief Get sub-shape(s) of \a theShapeWhere, which are coincident with \a theShapeWhat or could be a part of it.
* Combines results of new GetInPlace(_) and GetInPlaceByHistory(_).
* \param theShapeWhere Shape to find sub-shapes of.
* \param theShapeWhat Shape, specifying what to find.
* \return Compound which includes all found sub-shapes if they have different types;
* or group of all found shapes of the equal type; or a single found sub-shape.
*/
GEOM_Object GetInPlaceCombined (in GEOM_Object theShapeWhere,
in GEOM_Object theShapeWhat);
/*! /*!
* \brief Get sub-shape(s) of \a theShapeWhere, which are * \brief Get sub-shape(s) of \a theShapeWhere, which are
* coincident with \a theShapeWhat or could be a part of it. * coincident with \a theShapeWhat or could be a part of it.
* \param theShapeWhere Shape to find sub-shapes of. * \param theShapeWhere Shape to find sub-shapes of.
* \param theShapeWhat Shape, specifying what to find. * \param theShapeWhat Shape, specifying what to find.
* \return Compound which includes all found sub-shapes if they have different types; * \return Compound which includes all found sub-shapes if they have different types;
* or group of all found shapes of the equal type; or a single found sub-shape. * or group of all found shapes of the equal type; or a single found sub-shape.
*/ */
GEOM_Object GetInPlace (in GEOM_Object theShapeWhere, GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
@ -2726,17 +2737,17 @@ module GEOM
* *
* \param theShapeWhere Shape to find sub-shapes of. * \param theShapeWhere Shape to find sub-shapes of.
* \param theShapeWhat Shape, specifying what to find. * \param theShapeWhat Shape, specifying what to find.
* \return Compound which includes all found sub-shapes if they have different types; * \return Compound which includes all found sub-shapes if they have different types;
* or group of all found shapes of the equal type; or a single found sub-shape. * or group of all found shapes of the equal type; or a single found sub-shape.
*/ */
GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere, GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
in GEOM_Object theShapeWhat); in GEOM_Object theShapeWhat);
/*! /*!
* \brief A sort of GetInPlace functionality, returning for each sub-shape ID of * \brief A sort of GetInPlace functionality, returning for each sub-shape ID of
* \a theShapeWhat a list of corresponding sub-shape IDs of \a theShapeWhere. * \a theShapeWhat a list of corresponding sub-shape IDs of \a theShapeWhere.
* For example, if theShapeWhat is a box and theShapeWhere is this box cut into * For example, if theShapeWhat is a box and theShapeWhere is this box cut into
* two parts by a plane, then the result can be as this: * two parts by a plane, then the result can be as this:
* len( result_list ) = 35, * len( result_list ) = 35,
* result_list[ 1 ] = [ 2, 36 ], which means that the box turned into two solids * result_list[ 1 ] = [ 2, 36 ], which means that the box turned into two solids
* with IDs 2 and 36 within theShapeWhere * with IDs 2 and 36 within theShapeWhere
@ -2879,7 +2890,7 @@ module GEOM
}; };
// # GEOM_IBlocksOperations: // # GEOM_IBlocksOperations:
/*! /*!
* \brief Interface for Blocks construction * \brief Interface for Blocks construction
* Face from points or edges, Block from faces, * Face from points or edges, Block from faces,
@ -2887,7 +2898,7 @@ module GEOM
*/ */
interface GEOM_IBlocksOperations : GEOM_IOperations interface GEOM_IBlocksOperations : GEOM_IOperations
{ {
// # Creation of blocks // # Creation of blocks
/*! /*!
@ -2925,7 +2936,7 @@ module GEOM
/*! /*!
* \brief Create a hexahedral solid, bounded by the six given faces. Order of * \brief Create a hexahedral solid, bounded by the six given faces. Order of
* faces is not important. * faces is not important.
* *
* It is not necessary that Faces share the same edge. * It is not necessary that Faces share the same edge.
* \param theFace1,theFace2,theFace3,theFace4,theFace5,theFace6 Faces for the hexahedral solid. * \param theFace1,theFace2,theFace3,theFace4,theFace5,theFace6 Faces for the hexahedral solid.
@ -2948,9 +2959,9 @@ module GEOM
GEOM_Object MakeHexa2Faces (in GEOM_Object theFace1, GEOM_Object MakeHexa2Faces (in GEOM_Object theFace1,
in GEOM_Object theFace2); in GEOM_Object theFace2);
// # Extract elements of blocks and blocks compounds // # Extract elements of blocks and blocks compounds
/*! /*!
* \brief Get a vertex, found in the given shape by its coordinates. * \brief Get a vertex, found in the given shape by its coordinates.
@ -3060,7 +3071,7 @@ module GEOM
in double theTolerance); in double theTolerance);
// # Extract blocks from blocks compounds // # Extract blocks from blocks compounds
/*! /*!
* \brief Check, if the compound contains only specified blocks. * \brief Check, if the compound contains only specified blocks.
@ -3268,7 +3279,7 @@ module GEOM
in long theNbTimesV); in long theNbTimesV);
// # Special operation - propagation // # Special operation - propagation
/*! /*!
* \brief Build all possible propagation groups. * \brief Build all possible propagation groups.
@ -3419,7 +3430,7 @@ module GEOM
* \param theShape Shape to be intersected. * \param theShape Shape to be intersected.
* \param thePlane Tool shape, to intersect theShape. * \param thePlane Tool shape, to intersect theShape.
* \return New GEOM_Object, containing the result shape. * \return New GEOM_Object, containing the result shape.
* *
* \note This operation is a shortcut to the more general \ref MakePartition * \note This operation is a shortcut to the more general \ref MakePartition
* operation, where \a theShape specifies single "object" (shape being partitioned) * operation, where \a theShape specifies single "object" (shape being partitioned)
* and \a thePlane specifies single "tool" (intersector shape). Other parameters of * and \a thePlane specifies single "tool" (intersector shape). Other parameters of
@ -3602,7 +3613,7 @@ module GEOM
* \param theFuzzyParam The fuzzy tolerance to be used in the partition * \param theFuzzyParam The fuzzy tolerance to be used in the partition
* algorithm, if the value is positive. * algorithm, if the value is positive.
* \return New GEOM_Object, containing the result shape. * \return New GEOM_Object, containing the result shape.
* *
* \note This operation is a shortcut to the more general \ref MakePartition * \note This operation is a shortcut to the more general \ref MakePartition
* operation, where \a theShape specifies single "object" (shape being partitioned) * operation, where \a theShape specifies single "object" (shape being partitioned)
* and \a thePlane specifies single "tool" (intersector shape). Other parameters of * and \a thePlane specifies single "tool" (intersector shape). Other parameters of
@ -3770,7 +3781,7 @@ module GEOM
* \param theParamStep the step of the parameter. * \param theParamStep the step of the parameter.
* \param theCurveType the type of the curve. * \param theCurveType the type of the curve.
* \return New GEOM_Object, containing the created curve. * \return New GEOM_Object, containing the created curve.
*/ */
GEOM_Object MakeCurveParametric(in string thexExpr, GEOM_Object MakeCurveParametric(in string thexExpr,
in string theyExpr, in string theyExpr,
in string thezExpr, in string thezExpr,
@ -3789,7 +3800,7 @@ module GEOM
* \param theParamNbStep the number of steps of the parameter discretization. * \param theParamNbStep the number of steps of the parameter discretization.
* \param theCurveType the type of the curve. * \param theCurveType the type of the curve.
* \return New GEOM_Object, containing the created curve. * \return New GEOM_Object, containing the created curve.
*/ */
GEOM_Object MakeCurveParametricNew(in string thexExpr, GEOM_Object MakeCurveParametricNew(in string thexExpr,
in string theyExpr, in string theyExpr,
in string thezExpr, in string thezExpr,
@ -3851,7 +3862,7 @@ module GEOM
/*! /*!
* \brief Create a sketcher (wire or face), following the textual description, * \brief Create a sketcher (wire or face), following the textual description,
* passed through \a theCommand argument. * passed through \a theCommand argument.
* *
* For format of the description string see the previous method.\n * For format of the description string see the previous method.\n
* *
@ -3864,7 +3875,7 @@ module GEOM
/*! /*!
* \brief Create a 3D sketcher, following the textual description, * \brief Create a 3D sketcher, following the textual description,
* passed through \a theCommand argument. * passed through \a theCommand argument.
* *
* Format of the description string has to be the following: * Format of the description string has to be the following:
* *
@ -3890,7 +3901,7 @@ module GEOM
/*! /*!
* \brief Create a 3D sketcher, made of a straight segments, joining points * \brief Create a 3D sketcher, made of a straight segments, joining points
* with coordinates passed through \a theCoordinates argument. * with coordinates passed through \a theCoordinates argument.
* *
* Order of coordinates has to be the following: * Order of coordinates has to be the following:
* x1, y1, z1, x2, y2, z2, ..., xN, yN, zN * x1, y1, z1, x2, y2, z2, ..., xN, yN, zN
@ -4149,7 +4160,7 @@ module GEOM
long GetSubShapeIndex (in GEOM_Object theShape, in GEOM_Object theSubShape); long GetSubShapeIndex (in GEOM_Object theShape, in GEOM_Object theSubShape);
}; };
// # GEOM_IHealingOperations: // # GEOM_IHealingOperations:
/*! /*!
* \brief Interface for shape healing operations * \brief Interface for shape healing operations
* *
@ -4174,7 +4185,7 @@ module GEOM
/*! /*!
* \brief Get default sequence of operators, their parameters and parameters' values * \brief Get default sequence of operators, their parameters and parameters' values
* of Shape Process operation. * of Shape Process operation.
* *
* In the current implementation the defaults are * In the current implementation the defaults are
* read from the file pointed by CSF_ShHealingDefaults environmental variable. * read from the file pointed by CSF_ShHealingDefaults environmental variable.
@ -4492,22 +4503,22 @@ module GEOM
/*! box with faces, parallel to global coordinate planes */ /*! box with faces, parallel to global coordinate planes */
BOX, BOX,
/*! other box */ /*! other box */
ROTATED_BOX, ROTATED_BOX,
/*! full torus */ /*! full torus */
TORUS, TORUS,
/*! cone */ /*! cone */
CONE, CONE,
/*! solid, bounded by polygons */ /*! solid, bounded by polygons */
POLYHEDRON, POLYHEDRON,
/*! other solid */ /*! other solid */
SOLID, SOLID,
// FACEs // FACEs
/*! spherical face (closed) */ /*! spherical face (closed) */
SPHERE2D, SPHERE2D,
/*! cylindrical face with defined height */ /*! cylindrical face with defined height */
CYLINDER2D, CYLINDER2D,
/*! toroidal face (closed) */ /*! toroidal face (closed) */
TORUS2D, TORUS2D,
/*! conical face with defined height */ /*! conical face with defined height */
CONE2D, CONE2D,
/*! planar, bounded by circle */ /*! planar, bounded by circle */
@ -4515,42 +4526,42 @@ module GEOM
/*! planar, bounded by ellipse */ /*! planar, bounded by ellipse */
DISK_ELLIPSE, DISK_ELLIPSE,
/*! planar, bounded by segments */ /*! planar, bounded by segments */
POLYGON, POLYGON,
/*! infinite planar */ /*! infinite planar */
PLANE, PLANE,
/*! other planar */ /*! other planar */
PLANAR, PLANAR,
/*! other face */ /*! other face */
FACE, FACE,
// EDGEs // EDGEs
/*! full circle */ /*! full circle */
CIRCLE, CIRCLE,
/*! arc of circle */ /*! arc of circle */
ARC_CIRCLE, ARC_CIRCLE,
/*! full ellipse */ /*! full ellipse */
ELLIPSE, ELLIPSE,
/*! arc of ellipse */ /*! arc of ellipse */
ARC_ELLIPSE, ARC_ELLIPSE,
/*! infinite segment */ /*! infinite segment */
LINE, LINE,
/*! segment */ /*! segment */
SEGMENT, SEGMENT,
/*! B-Spline curve */ /*! B-Spline curve */
CRV_BSPLINE, CRV_BSPLINE,
/*! Bezier curve */ /*! Bezier curve */
CRV_BEZIER, CRV_BEZIER,
/*! hyperbola */ /*! hyperbola */
HYPERBOLA, HYPERBOLA,
/*! parabola */ /*! parabola */
PARABOLA, PARABOLA,
/*! other edge */ /*! other edge */
EDGE, EDGE,
// VERTEX // VERTEX
VERTEX, VERTEX,
// ADVANCED shapes // ADVANCED shapes
LCS, LCS,
/*! all advanced shapes (temporary implementation) */ /*! all advanced shapes (temporary implementation) */
ADVANCED ADVANCED
}; };
}; };
@ -5059,7 +5070,7 @@ module GEOM
* - edges intersecting by inner points; * - edges intersecting by inner points;
* - edge touching/intersecting face in the inner point; * - edge touching/intersecting face in the inner point;
* - faces intersection by inner point * - faces intersection by inner point
* *
* \param theResults result of check - list of failed checks and sub-shapes. * \param theResults result of check - list of failed checks and sub-shapes.
* \param theShapeType1 Type of shape. * \param theShapeType1 Type of shape.
* \param theShapeType2 Type of shape. * \param theShapeType2 Type of shape.
@ -5241,7 +5252,7 @@ module GEOM
/*! /*!
* \brief Cut of lists of groups. * \brief Cut of lists of groups.
* New group is created. It will contain only entities * New group is created. It will contain only entities
* which are present in groups listed in theGList1 but * which are present in groups listed in theGList1 but
* are not present in groups from theGList2. * are not present in groups from theGList2.
* \param theGList1 is a list of GEOM groups to include elements of. * \param theGList1 is a list of GEOM groups to include elements of.
* \param theGList2 is a list of GEOM groups to exclude elements of. * \param theGList2 is a list of GEOM groups to exclude elements of.
@ -5279,7 +5290,7 @@ module GEOM
/*! /*!
* \brief Creates a field * \brief Creates a field
*/ */
GEOM_Field CreateField(in GEOM_Object shape, GEOM_Field CreateField(in GEOM_Object shape,
in string name, in string name,
in field_data_type type, in field_data_type type,
in short dimension, in short dimension,
@ -5522,7 +5533,7 @@ module GEOM
GEOM_Object AddSubShape (in GEOM_Object theMainShape, in ListOfLong theIndices); GEOM_Object AddSubShape (in GEOM_Object theMainShape, in ListOfLong theIndices);
// # GEOM_Objects IOR Management // # GEOM_Objects IOR Management
/*! /*!
* \brief Returns a GEOM_Object defined by its IOR * \brief Returns a GEOM_Object defined by its IOR
* \param theIOR a string containing an IOR of the requested GEOM_Object * \param theIOR a string containing an IOR of the requested GEOM_Object
@ -5561,7 +5572,7 @@ module GEOM
* Folder will have name theName. * Folder will have name theName.
* If theFather is not NULL, the folder is placed under theFather object. * If theFather is not NULL, the folder is placed under theFather object.
* Otherwise, the folder takes place under root 'Geometry' object. * Otherwise, the folder takes place under root 'Geometry' object.
* *
* \param theName name of the folder * \param theName name of the folder
* \param theFather parent object * \param theFather parent object
* \return SObject represented the created folder. * \return SObject represented the created folder.
@ -5598,8 +5609,8 @@ module GEOM
* \param where parent object where objects are moved to * \param where parent object where objects are moved to
* \param row position in the parent object's children list at which objects are moved * \param row position in the parent object's children list at which objects are moved
*/ */
void Move( in object_list what, void Move( in object_list what,
in SALOMEDS::SObject where, in SALOMEDS::SObject where,
in long row ); in long row );
/*! /*!

View File

@ -152,7 +152,7 @@ namespace
gp_Pnt aPoint = BRep_Tool::Pnt(theVertex); gp_Pnt aPoint = BRep_Tool::Pnt(theVertex);
TopExp_Explorer anExp(theWhere, TopAbs_VERTEX); TopExp_Explorer anExp(theWhere, TopAbs_VERTEX);
TopTools_MapOfShape aMap; TopTools_MapOfShape aMap;
for(; anExp.More(); anExp.Next()) { for(; anExp.More(); anExp.Next()) {
const TopoDS_Shape &aLocalShape = anExp.Current(); const TopoDS_Shape &aLocalShape = anExp.Current();
@ -1529,7 +1529,7 @@ GEOMImpl_IShapesOperations::GetExistingSubObjects(Handle(GEOM_Object) theShap
pd << "] = geompy.GetExistingSubObjects("; pd << "] = geompy.GetExistingSubObjects(";
pd << theShape << ", " << (bool)theGroupsOnly << ")"; pd << theShape << ", " << (bool)theGroupsOnly << ")";
} }
return results; return results;
} }
@ -1961,23 +1961,23 @@ Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::GetSubShapesIndic
{ {
MESSAGE("GEOMImpl_IShapesOperations::GetSubShapesIndices"); MESSAGE("GEOMImpl_IShapesOperations::GetSubShapesIndices");
SetErrorCode(KO); SetErrorCode(KO);
Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger; Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger;
TopoDS_Shape aMainShape = theMainShape->GetValue(); TopoDS_Shape aMainShape = theMainShape->GetValue();
if (aMainShape.IsNull()) if (aMainShape.IsNull())
{ {
MESSAGE("NULL main shape"); MESSAGE("NULL main shape");
return NULL; return NULL;
} }
TopTools_IndexedMapOfShape anIndices; TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(aMainShape, anIndices); TopExp::MapShapes(aMainShape, anIndices);
std::list<Handle(GEOM_Object)>::iterator it; std::list<Handle(GEOM_Object)>::iterator it;
for (it=theSubShapes.begin(); it != theSubShapes.end(); ++it) for (it=theSubShapes.begin(); it != theSubShapes.end(); ++it)
{ {
TopoDS_Shape aSubShape = (*it)->GetValue(); TopoDS_Shape aSubShape = (*it)->GetValue();
if (aSubShape.IsNull()) if (aSubShape.IsNull())
{ {
MESSAGE("NULL subshape"); MESSAGE("NULL subshape");
@ -1985,8 +1985,8 @@ Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::GetSubShapesIndic
} }
int id = anIndices.FindIndex(aSubShape); int id = anIndices.FindIndex(aSubShape);
aSeq->Append(id); aSeq->Append(id);
} }
SetErrorCode(OK); SetErrorCode(OK);
return aSeq; return aSeq;
} }
@ -2219,12 +2219,12 @@ Standard_Integer GEOMImpl_IShapesOperations::NumberOfSubShapes
for (iType = 0; iType < TopAbs_SHAPE; ++iType) for (iType = 0; iType < TopAbs_SHAPE; ++iType)
nbTypes[iType] = 0; nbTypes[iType] = 0;
nbTypes[aShape.ShapeType()]++; nbTypes[aShape.ShapeType()]++;
TopTools_MapOfShape aMapOfShape; TopTools_MapOfShape aMapOfShape;
aMapOfShape.Add(aShape); aMapOfShape.Add(aShape);
TopTools_ListOfShape aListOfShape; TopTools_ListOfShape aListOfShape;
aListOfShape.Append(aShape); aListOfShape.Append(aShape);
TopTools_ListIteratorOfListOfShape itL (aListOfShape); TopTools_ListIteratorOfListOfShape itL (aListOfShape);
for (; itL.More(); itL.Next()) { for (; itL.More(); itL.Next()) {
TopoDS_Iterator it (itL.Value()); TopoDS_Iterator it (itL.Value());
@ -2236,7 +2236,7 @@ Standard_Integer GEOMImpl_IShapesOperations::NumberOfSubShapes
} }
} }
} }
if (TopAbs_ShapeEnum(theShapeType) == TopAbs_SHAPE) if (TopAbs_ShapeEnum(theShapeType) == TopAbs_SHAPE)
nbShapes = aMapOfShape.Extent(); nbShapes = aMapOfShape.Extent();
else else
@ -2439,7 +2439,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetSharedShapes
//purpose : //purpose :
// //
// NOTE on the implementation // NOTE on the implementation
// //
// 1) Resulting sub-shapes are published as a children of the 1st input shape // 1) Resulting sub-shapes are published as a children of the 1st input shape
// from theShapes list. Due to this reason only direct sub-shapes of the 1st // from theShapes list. Due to this reason only direct sub-shapes of the 1st
// shape can be contained in the result of the operation (i.e. shares between // shape can be contained in the result of the operation (i.e. shares between
@ -2521,7 +2521,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetSharedShapes
int nbIters = theMultiShare || theShapes.size() > 1 ? 1 : shapeSeq.Length()-1; int nbIters = theMultiShare || theShapes.size() > 1 ? 1 : shapeSeq.Length()-1;
// numShares factor to search (i.e. by what nb of shapes each found sub-shape should be shared) // numShares factor to search (i.e. by what nb of shapes each found sub-shape should be shared)
int nbShares = theMultiShare ? shapeSeq.Length()-1 : 1; int nbShares = theMultiShare ? shapeSeq.Length()-1 : 1;
for ( int iter = 1; iter <= nbIters; iter++) { for ( int iter = 1; iter <= nbIters; iter++) {
for ( int ind = iter+1; ind <= shapeSeq.Length(); ind++) { for ( int ind = iter+1; ind <= shapeSeq.Length(); ind++) {
if ( ind-1+nbShares > shapeSeq.Length() ) break; if ( ind-1+nbShares > shapeSeq.Length() ) break;
@ -3340,7 +3340,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeExtraction
// Fill in statistics. // Fill in statistics.
theStats.clear(); theStats.clear();
Handle(TColStd_HArray1OfInteger) aStatIDsArray[3] = Handle(TColStd_HArray1OfInteger) aStatIDsArray[3] =
{ aCI.GetRemovedIDs(), aCI.GetModifiedIDs(), aCI.GetAddedIDs() }; { aCI.GetRemovedIDs(), aCI.GetModifiedIDs(), aCI.GetAddedIDs() };
int i; int i;
int j; int j;
@ -4538,6 +4538,137 @@ Handle(TColStd_HSequenceOfInteger)
return aSeqOfIDs; return aSeqOfIDs;
} }
Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceCombined(
Handle(GEOM_Object) theShapeWhere,
Handle(GEOM_Object) theShapeWhat)
{
SetErrorCode(KO);
if (theShapeWhere.IsNull() || theShapeWhat.IsNull())
return NULL;
TopoDS_Shape aWhere = theShapeWhere->GetValue();
TopoDS_Shape aWhat = theShapeWhat->GetValue();
if (aWhere.IsNull() || aWhat.IsNull()) {
SetErrorCode("Error: aWhere and aWhat TopoDS_Shape are Null.");
return NULL;
}
/** Type of shape to be returned. */
Standard_Integer aResultShapeType = -1;
/** Return value is a wrapped array of shapes. The map maintains uniqueness of the array content. */
TopTools_MapOfShape aResultShapes;
/** Return value is a wrapped array of shapes. The list maintains order of the array content as in return value of GEOMImpl_IShapesOperations::GetInPlace(_). */
TopTools_ListOfShape aResultShapeList;
// Fill array of Where's indices.
TopTools_IndexedMapOfShape aWhereIndices;
TopExp::MapShapes(aWhere, aWhereIndices);
{ // Search for the sub-shapes inside the aWhere shape using InPlace algorithm.
GEOMAlgo_GetInPlace aGIP;
if (!GEOMAlgo_GetInPlaceAPI::GetInPlace(aWhere, aWhat, aGIP)) {
SetErrorCode("Error in GEOMAlgo_GetInPlace");
return NULL;
}
const TopoDS_Shape& aGIPResult = aGIP.Result();
if (!aGIPResult.IsNull()) {
for (TopoDS_Iterator anIt(aGIPResult); anIt.More(); anIt.Next()) {
const TopoDS_Shape& aGIPResultSubShape = anIt.Value();
if (aWhereIndices.Contains(aGIPResultSubShape) && aResultShapes.Add(aGIPResultSubShape)) {
const TopAbs_ShapeEnum aType = aGIPResultSubShape.ShapeType();
if (aResultShapeType == -1) {
// Initialization.
aResultShapeType = aType;
} else if (aResultShapeType != TopAbs_SHAPE && aResultShapeType != aType) {
// Different types.
aResultShapeType = TopAbs_SHAPE;
}
aResultShapeList.Append(aGIPResultSubShape);
}
}
}
} // Search for the sub-shapes inside the aWhere shape using InPlace algorithm.
{ // Search for the sub-shapes inside the aWhere shape using InPlaceByHistory algorithm.
Handle(GEOM_Function) aWhereFunction = theShapeWhere->GetLastFunction();
if (aWhereFunction.IsNull() && aResultShapes.IsEmpty()) {
SetErrorCode("Error: Both GetInPlace and GetInPlaceByHistory algorithms found no shapes.");
return NULL;
}
TopTools_ListOfShape aGIPBHShapeList;
const bool isFound = GEOMAlgo_GetInPlaceAPI::GetInPlaceByHistory(aWhereFunction, aWhereIndices, aWhat, aGIPBHShapeList);
if ( (!isFound || aGIPBHShapeList.Extent() < 1) && aResultShapes.IsEmpty() ) {
SetErrorCode("Error: Both GetInPlace and GetInPlaceByHistory algorithms found no shapes.");
return NULL;
}
for (TopTools_ListIteratorOfListOfShape anItGIPBHShapeList(aGIPBHShapeList); anItGIPBHShapeList.More(); anItGIPBHShapeList.Next()) {
const TopoDS_Shape& aGIPBHResultShape = anItGIPBHShapeList.Value();
if (aWhereIndices.Contains(aGIPBHResultShape) && aResultShapes.Add(aGIPBHResultShape)) {
const TopAbs_ShapeEnum aType = aGIPBHResultShape.ShapeType();
if (aResultShapeType == -1) {
// Initialization.
aResultShapeType = aType;
} else if (aResultShapeType != TopAbs_SHAPE && aResultShapeType != aType) {
// Different types.
aResultShapeType = TopAbs_SHAPE;
}
aResultShapeList.Append(aGIPBHResultShape);
}
}
} // Search for the sub-shapes inside the aWhere shape using InPlaceByHistory algorithm.
Handle(TColStd_HArray1OfInteger) aResultShapeArray = new TColStd_HArray1OfInteger (1, aResultShapeList.Extent());
TopTools_ListIteratorOfListOfShape anItResultShapeList(aResultShapeList);
for (Standard_Integer arrIdx = 1; anItResultShapeList.More(); anItResultShapeList.Next(), arrIdx++) {
aResultShapeArray->SetValue(arrIdx, aWhereIndices.FindIndex(anItResultShapeList.Value()));
}
//Add a new object
Handle(GEOM_Object) aResult = GetEngine()->AddSubShape(theShapeWhere, aResultShapeArray);
if (aResult.IsNull()) {
SetErrorCode("Error in algorithm: result found, but cannot be returned.");
return NULL;
}
const Standard_Boolean isSameType = (aResultShapeType != TopAbs_SHAPE);
if ((aResultShapeArray->Length() > 1 && isSameType) || theShapeWhat->GetType() == GEOM_GROUP) {
//Set a GROUP type
aResult->SetType(GEOM_GROUP);
//Set a sub-shape type
TopoDS_Shape aFirstFound = aResultShapeList.First();
TopAbs_ShapeEnum aShapeType = aFirstFound.ShapeType();
TDF_Label aFreeLabel = aResult->GetFreeLabel();
TDataStd_Integer::Set(aFreeLabel, (Standard_Integer)aShapeType);
}
//Make a Python command
Handle(GEOM_Function) aFunction = aResult->GetFunction(1);
GEOM::TPythonDump(aFunction) << aResult << " = geompy.GetInPlaceCombined(" << theShapeWhere << ", " << theShapeWhat << ")";
SetErrorCode(OK);
return aResult;
}
//============================================================================= //=============================================================================
/*! /*!
* case GetInPlace: * case GetInPlace:

View File

@ -115,7 +115,7 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
Standard_EXPORT Handle(GEOM_Object) MakeWrappedFace(std::list<Handle(GEOM_Object)> theEdges, Standard_EXPORT Handle(GEOM_Object) MakeWrappedFace(std::list<Handle(GEOM_Object)> theEdges,
std::list<Handle(GEOM_Object)> theVertices, std::list<Handle(GEOM_Object)> theVertices,
const Standard_Real theTolerance); const Standard_Real theTolerance);
Standard_EXPORT Handle(GEOM_Object) MakeFaceWithConstraints (std::list<Handle(GEOM_Object)> theConstraints); Standard_EXPORT Handle(GEOM_Object) MakeFaceWithConstraints (std::list<Handle(GEOM_Object)> theConstraints);
Standard_EXPORT Handle(GEOM_Object) MakeShell (std::list<Handle(GEOM_Object)> theShapes); Standard_EXPORT Handle(GEOM_Object) MakeShell (std::list<Handle(GEOM_Object)> theShapes);
@ -152,7 +152,7 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
const Standard_Boolean theGroupsOnly); const Standard_Boolean theGroupsOnly);
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects(Handle(GEOM_Object) theShape, Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects(Handle(GEOM_Object) theShape,
const Standard_Integer theTypes = All); const Standard_Integer theTypes = All);
enum ExplodeType { enum ExplodeType {
EXPLODE_OLD_INCLUDE_MAIN, EXPLODE_OLD_INCLUDE_MAIN,
EXPLODE_NEW_INCLUDE_MAIN, EXPLODE_NEW_INCLUDE_MAIN,
@ -180,7 +180,7 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
Standard_EXPORT Standard_Integer GetSubShapeIndex (Handle(GEOM_Object) theMainShape, Standard_EXPORT Standard_Integer GetSubShapeIndex (Handle(GEOM_Object) theMainShape,
Handle(GEOM_Object) theSubShape); Handle(GEOM_Object) theSubShape);
Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetSubShapesIndices (Handle(GEOM_Object) theMainShape, Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetSubShapesIndices (Handle(GEOM_Object) theMainShape,
std::list<Handle(GEOM_Object)> theSubShapes); std::list<Handle(GEOM_Object)> theSubShapes);
@ -332,6 +332,12 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
Handle(GEOM_Object) theCenter, Handle(GEOM_Object) theCenter,
const Standard_Real theRadius); const Standard_Real theRadius);
/*! \returns Combined result of GetInPlace(_) and GetInPlaceByHistory(_). */
Standard_EXPORT Handle(GEOM_Object) GetInPlaceCombined( Handle(GEOM_Object) theShapeWhere,
Handle(GEOM_Object) theShapeWhat);
/*! \brief If theShapeWhere has curved subshapes, and centers of mass of these subshapes are closer
* to theShapeWhat than to subshapes themselves, such subshapes are not included into result.*/
Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere, Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
Handle(GEOM_Object) theShapeWhat); Handle(GEOM_Object) theShapeWhat);
@ -461,7 +467,7 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
const Standard_Real theUMax, const Standard_Real theUMax,
const Standard_Real theVMin, const Standard_Real theVMin,
const Standard_Real theVMax); const Standard_Real theVMax);
/*! /*!
* \brief Make a surface from a face. This function takes some face as * \brief Make a surface from a face. This function takes some face as
* input parameter and creates new GEOM_Object, i.e. topological shape * input parameter and creates new GEOM_Object, i.e. topological shape

View File

@ -1020,11 +1020,11 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetSubShapesIndices
(GEOM::GEOM_Object_ptr theMainShape, const GEOM::ListOfGO& theSubShapes) (GEOM::GEOM_Object_ptr theMainShape, const GEOM::ListOfGO& theSubShapes)
{ {
GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong; GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
//Get the reference main shape //Get the reference main shape
Handle(::GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape); Handle(::GEOM_Object) aMainShapeRef = GetObjectImpl(theMainShape);
if (aMainShapeRef.IsNull()) return aSeq._retn(); if (aMainShapeRef.IsNull()) return aSeq._retn();
//Get the subshapes //Get the subshapes
std::list<Handle(::GEOM_Object)> aShapes; std::list<Handle(::GEOM_Object)> aShapes;
int aLen = theSubShapes.length(); int aLen = theSubShapes.length();
@ -1039,14 +1039,14 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetSubShapesIndices
} }
//Get the IDs of <theSubShapes> inside <theMainShape> //Get the IDs of <theSubShapes> inside <theMainShape>
Handle(TColStd_HSequenceOfInteger) aHSeq = Handle(TColStd_HSequenceOfInteger) aHSeq =
GetOperations()->GetSubShapesIndices(aMainShapeRef, aShapes); GetOperations()->GetSubShapesIndices(aMainShapeRef, aShapes);
if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn(); if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn();
Standard_Integer aLength = aHSeq->Length(); Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength); aSeq->length(aLength);
for (Standard_Integer i = 1; i <= aLength; i++) for (Standard_Integer i = 1; i <= aLength; i++)
aSeq[i-1] = aHSeq->Value(i); aSeq[i-1] = aHSeq->Value(i);
@ -1952,6 +1952,36 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs
} }
//=============================================================================
/*!
* GetInPlaceCombined
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceCombined(
GEOM::GEOM_Object_ptr theShapeWhere,
GEOM::GEOM_Object_ptr theShapeWhat
) {
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference objects
Handle(::GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
Handle(::GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
if (aShapeWhere.IsNull() ||
aShapeWhat.IsNull()) return aGEOMObject._retn();
//Get Shapes in place of aShapeWhat
Handle(::GEOM_Object) anObject = GetOperations()->GetInPlaceCombined(aShapeWhere, aShapeWhat);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//============================================================================= //=============================================================================
/*! /*!
* GetInPlace * GetInPlace

View File

@ -73,7 +73,7 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
const CORBA::Double theTolerance); const CORBA::Double theTolerance);
GEOM::GEOM_Object_ptr MakeFaceWithConstraints (const GEOM::ListOfGO& theConstraints); GEOM::GEOM_Object_ptr MakeFaceWithConstraints (const GEOM::ListOfGO& theConstraints);
GEOM::GEOM_Object_ptr MakeShell (const GEOM::ListOfGO& theFacesAndShells); GEOM::GEOM_Object_ptr MakeShell (const GEOM::ListOfGO& theFacesAndShells);
GEOM::GEOM_Object_ptr MakeSolidShell (GEOM::GEOM_Object_ptr theShell); GEOM::GEOM_Object_ptr MakeSolidShell (GEOM::GEOM_Object_ptr theShell);
@ -142,7 +142,7 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
CORBA::Long GetSubShapeIndex (GEOM::GEOM_Object_ptr theMainShape, CORBA::Long GetSubShapeIndex (GEOM::GEOM_Object_ptr theMainShape,
GEOM::GEOM_Object_ptr theSubShape); GEOM::GEOM_Object_ptr theSubShape);
GEOM::ListOfLong* GetSubShapesIndices (GEOM::GEOM_Object_ptr theMainShape, GEOM::ListOfLong* GetSubShapesIndices (GEOM::GEOM_Object_ptr theMainShape,
const GEOM::ListOfGO& theSubShapes); const GEOM::ListOfGO& theSubShapes);
@ -275,6 +275,9 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
CORBA::Short theShapeType, CORBA::Short theShapeType,
GEOM::shape_state theState); GEOM::shape_state theState);
GEOM::GEOM_Object_ptr GetInPlaceCombined (GEOM::GEOM_Object_ptr theShapeWhere,
GEOM::GEOM_Object_ptr theShapeWhat);
GEOM::GEOM_Object_ptr GetInPlace (GEOM::GEOM_Object_ptr theShapeWhere, GEOM::GEOM_Object_ptr GetInPlace (GEOM::GEOM_Object_ptr theShapeWhere,
GEOM::GEOM_Object_ptr theShapeWhat); GEOM::GEOM_Object_ptr theShapeWhat);

View File

@ -3113,7 +3113,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
anObj.SetParameters(Parameters) anObj.SetParameters(Parameters)
self._autoPublish(anObj, theName, "cylinder") self._autoPublish(anObj, theName, "cylinder")
return anObj return anObj
## Create a portion of cylinder with given base point, axis, radius, height and angle. ## Create a portion of cylinder with given base point, axis, radius, height and angle.
# @param thePnt Central point of cylinder base. # @param thePnt Central point of cylinder base.
# @param theAxis Cylinder axis. # @param theAxis Cylinder axis.
@ -3196,7 +3196,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
anObj.SetParameters(Parameters) anObj.SetParameters(Parameters)
self._autoPublish(anObj, theName, "cylinder") self._autoPublish(anObj, theName, "cylinder")
return anObj return anObj
## Create a portion of cylinder with given radius, height and angle at ## Create a portion of cylinder with given radius, height and angle at
# the origin of coordinate system. Axis of the cylinder # the origin of coordinate system. Axis of the cylinder
# will be collinear to the OZ axis of the coordinate system. # will be collinear to the OZ axis of the coordinate system.
@ -3999,7 +3999,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created pipe if # @return New GEOM.GEOM_Object, containing the created pipe if
# \a IsGenerateGroups is not set. Otherwise it returns a # \a IsGenerateGroups is not set. Otherwise it returns a
# list of GEOM.GEOM_Object. Its first element is the created pipe, the # list of GEOM.GEOM_Object. Its first element is the created pipe, the
# remaining ones are created groups. # remaining ones are created groups.
@ -4039,7 +4039,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
New GEOM.GEOM_Object, containing the created pipe if New GEOM.GEOM_Object, containing the created pipe if
IsGenerateGroups is not set. Otherwise it returns a IsGenerateGroups is not set. Otherwise it returns a
list of GEOM.GEOM_Object. Its first element is the created pipe, the list of GEOM.GEOM_Object. Its first element is the created pipe, the
remaining ones are created groups. remaining ones are created groups.
@ -4076,7 +4076,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created pipe if # @return New GEOM.GEOM_Object, containing the created pipe if
# \a IsGenerateGroups is not set. Otherwise it returns new # \a IsGenerateGroups is not set. Otherwise it returns new
# GEOM.ListOfGO. Its first element is the created pipe, the # GEOM.ListOfGO. Its first element is the created pipe, the
# remaining ones are created groups. # remaining ones are created groups.
@ -4112,7 +4112,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
New GEOM.GEOM_Object, containing the created pipe if New GEOM.GEOM_Object, containing the created pipe if
IsGenerateGroups is not set. Otherwise it returns new IsGenerateGroups is not set. Otherwise it returns new
GEOM.ListOfGO. Its first element is the created pipe, the GEOM.ListOfGO. Its first element is the created pipe, the
remaining ones are created groups. remaining ones are created groups.
@ -4197,7 +4197,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created solids if # @return New GEOM.GEOM_Object, containing the created solids if
# \a IsGenerateGroups is not set. Otherwise it returns new # \a IsGenerateGroups is not set. Otherwise it returns new
# GEOM.ListOfGO. Its first element is the created solids, the # GEOM.ListOfGO. Its first element is the created solids, the
# remaining ones are created groups. # remaining ones are created groups.
@ -4242,7 +4242,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
New GEOM.GEOM_Object, containing the created solids if New GEOM.GEOM_Object, containing the created solids if
IsGenerateGroups is not set. Otherwise it returns new IsGenerateGroups is not set. Otherwise it returns new
GEOM.ListOfGO. Its first element is the created solids, the GEOM.ListOfGO. Its first element is the created solids, the
remaining ones are created groups. remaining ones are created groups.
@ -4320,7 +4320,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created solids if # @return New GEOM.GEOM_Object, containing the created solids if
# \a IsGenerateGroups is not set. Otherwise it returns new # \a IsGenerateGroups is not set. Otherwise it returns new
# GEOM.ListOfGO. Its first element is the created solids, the # GEOM.ListOfGO. Its first element is the created solids, the
# remaining ones are created groups. # remaining ones are created groups.
@ -4345,7 +4345,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
New GEOM.GEOM_Object, containing the created solids if New GEOM.GEOM_Object, containing the created solids if
IsGenerateGroups is not set. Otherwise it returns new IsGenerateGroups is not set. Otherwise it returns new
GEOM.ListOfGO. Its first element is the created solids, the GEOM.ListOfGO. Its first element is the created solids, the
remaining ones are created groups. remaining ones are created groups.
@ -4378,7 +4378,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created pipe if # @return New GEOM.GEOM_Object, containing the created pipe if
# \a IsGenerateGroups is not set. Otherwise it returns new # \a IsGenerateGroups is not set. Otherwise it returns new
# GEOM.ListOfGO. Its first element is the created pipe, the # GEOM.ListOfGO. Its first element is the created pipe, the
# remaining ones are created groups. # remaining ones are created groups.
@ -4408,7 +4408,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
New GEOM.GEOM_Object, containing the created pipe if New GEOM.GEOM_Object, containing the created pipe if
IsGenerateGroups is not set. Otherwise it returns new IsGenerateGroups is not set. Otherwise it returns new
GEOM.ListOfGO. Its first element is the created pipe, the GEOM.ListOfGO. Its first element is the created pipe, the
remaining ones are created groups. remaining ones are created groups.
@ -4433,7 +4433,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# @param theThickness Thickness of the resulting solid # @param theThickness Thickness of the resulting solid
# @param theFacesIDs the list of face IDs to be removed from the # @param theFacesIDs the list of face IDs to be removed from the
# result. It is ignored if \a theShape is a face or a shell. # result. It is ignored if \a theShape is a face or a shell.
# It is empty by default. # It is empty by default.
# @param theInside If true the thickness is applied towards inside # @param theInside If true the thickness is applied towards inside
# @param theName Object name; when specified, this parameter is used # @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
@ -4456,7 +4456,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
theThickness Thickness of the resulting solid theThickness Thickness of the resulting solid
theFacesIDs the list of face IDs to be removed from the theFacesIDs the list of face IDs to be removed from the
result. It is ignored if theShape is a face or a result. It is ignored if theShape is a face or a
shell. It is empty by default. shell. It is empty by default.
theInside If true the thickness is applied towards inside theInside If true the thickness is applied towards inside
theName Object name; when specified, this parameter is used theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic for result publication in the study. Otherwise, if automatic
@ -4483,7 +4483,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# @param theThickness Thickness of the resulting solid # @param theThickness Thickness of the resulting solid
# @param theFacesIDs the list of face IDs to be removed from the # @param theFacesIDs the list of face IDs to be removed from the
# result. It is ignored if \a theShape is a face or a shell. # result. It is ignored if \a theShape is a face or a shell.
# It is empty by default. # It is empty by default.
# @param theInside If true the thickness is applied towards inside # @param theInside If true the thickness is applied towards inside
# #
# @return The modified shape # @return The modified shape
@ -4503,7 +4503,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
theThickness Thickness of the resulting solid theThickness Thickness of the resulting solid
theFacesIDs the list of face IDs to be removed from the theFacesIDs the list of face IDs to be removed from the
result. It is ignored if \a theShape is a face or result. It is ignored if \a theShape is a face or
a shell. It is empty by default. a shell. It is empty by default.
theInside If true the thickness is applied towards inside theInside If true the thickness is applied towards inside
Returns: Returns:
@ -4960,7 +4960,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp) RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
self._autoPublish(anObj, theName, "face") self._autoPublish(anObj, theName, "face")
return anObj return anObj
## Create a non-planar face from a list of closed edges and a list of vertices. ## Create a non-planar face from a list of closed edges and a list of vertices.
# @param theEdges list of Edges(must be closed but not nesessarily belong to the same plane). # @param theEdges list of Edges(must be closed but not nesessarily belong to the same plane).
# @param theVertices list of vertices through which the result face must pass. # @param theVertices list of vertices through which the result face must pass.
@ -4993,7 +4993,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakeWrappedFace", self.ShapesOp) RaiseIfFailed("MakeWrappedFace", self.ShapesOp)
self._autoPublish(anObj, theName, "face") self._autoPublish(anObj, theName, "face")
return anObj return anObj
## Create a face from a set of edges with the given constraints. ## Create a face from a set of edges with the given constraints.
# @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples): # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
# - edges should form a closed wire; # - edges should form a closed wire;
@ -5002,9 +5002,9 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# @param theName Object name; when specified, this parameter is used # @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return New GEOM.GEOM_Object, containing the created face. # @return New GEOM.GEOM_Object, containing the created face.
# #
# @ref tui_creation_face "Example" # @ref tui_creation_face "Example"
@ManageTransactions("ShapesOp") @ManageTransactions("ShapesOp")
def MakeFaceWithConstraints(self, theConstraints, theName=None): def MakeFaceWithConstraints(self, theConstraints, theName=None):
@ -5123,7 +5123,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakeCompound", self.ShapesOp) RaiseIfFailed("MakeCompound", self.ShapesOp)
self._autoPublish(anObj, theName, "compound") self._autoPublish(anObj, theName, "compound")
return anObj return anObj
## Create a solid (or solids) from the set of faces and/or shells. ## Create a solid (or solids) from the set of faces and/or shells.
# @param theFacesOrShells List of faces and/or shells. # @param theFacesOrShells List of faces and/or shells.
# @param isIntersect If TRUE, forces performing intersections # @param isIntersect If TRUE, forces performing intersections
@ -5368,7 +5368,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @note If @a theShapes contains single compound, the shares between all possible couples of # @note If @a theShapes contains single compound, the shares between all possible couples of
# its top-level shapes are returned; otherwise, only shares between 1st input shape # its top-level shapes are returned; otherwise, only shares between 1st input shape
# and all rest input shapes are returned. # and all rest input shapes are returned.
# #
@ -5392,7 +5392,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
for result publication in the study. Otherwise, if automatic for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Note: if theShapes contains single compound, the shares between all possible couples of Note: if theShapes contains single compound, the shares between all possible couples of
its top-level shapes are returned; otherwise, only shares between 1st input shape its top-level shapes are returned; otherwise, only shares between 1st input shape
and all rest input shapes are returned. and all rest input shapes are returned.
@ -6052,6 +6052,47 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp) RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
return aList return aList
## Get sub-shape(s) of theShapeWhere, which are
# coincident with \a theShapeWhat or could be a part of it.
# @param theShapeWhere Shape to find sub-shapes of.
# @param theShapeWhat Shape, specifying what to find.
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @return Compound which includes all found sub-shapes if they have different types;
# or group of all found shapes of the equal type; or a single found sub-shape.
#
# @note Combines results of new GetInPlace(_) and GetInPlaceByHistory(_).
#
# @ref swig_GetInPlace "Example"
@ManageTransactions("ShapesOp")
def GetInPlaceCombined(self, theShapeWhere, theShapeWhat, theName=None):
"""
Get sub-shape(s) of theShapeWhere, which are
coincident with theShapeWhat or could be a part of it.
Parameters:
theShapeWhere Shape to find sub-shapes of.
theShapeWhat Shape, specifying what to find.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
Returns:
Compound which includes all found sub-shapes if they have different types;
or group of all found shapes of the equal type; or a single found sub-shape.
Note:
Combines results of new GetInPlace(_) and GetInPlaceByHistory(_).
"""
anObj = self.ShapesOp.GetInPlaceCombined(theShapeWhere, theShapeWhat)
RaiseIfFailed("GetInPlaceCombined", self.ShapesOp)
self._autoPublish(anObj, theName, "inplace")
return anObj
## Get sub-shape(s) of theShapeWhere, which are ## Get sub-shape(s) of theShapeWhere, which are
# coincident with \a theShapeWhat or could be a part of it. # coincident with \a theShapeWhat or could be a part of it.
# @param theShapeWhere Shape to find sub-shapes of. # @param theShapeWhere Shape to find sub-shapes of.
@ -6062,7 +6103,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return Compound which includes all found sub-shapes if they have different types; # @return Compound which includes all found sub-shapes if they have different types;
# or group of all found shapes of the equal type; or a single found sub-shape. # or group of all found shapes of the equal type; or a single found sub-shape.
# #
# @note This function has a restriction on argument shapes. # @note This function has a restriction on argument shapes.
@ -6088,7 +6129,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
Compound which includes all found sub-shapes if they have different types; Compound which includes all found sub-shapes if they have different types;
or group of all found shapes of the equal type; or a single found sub-shape. or group of all found shapes of the equal type; or a single found sub-shape.
@ -6125,7 +6166,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# for result publication in the study. Otherwise, if automatic # for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name. # publication is switched on, default value is used for result name.
# #
# @return Compound which includes all found sub-shapes if they have different types; # @return Compound which includes all found sub-shapes if they have different types;
# or group of all found shapes of the equal type; or a single found sub-shape. # or group of all found shapes of the equal type; or a single found sub-shape.
# #
# @ref swig_GetInPlace "Example" # @ref swig_GetInPlace "Example"
@ -6147,7 +6188,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
publication is switched on, default value is used for result name. publication is switched on, default value is used for result name.
Returns: Returns:
Compound which includes all found sub-shapes if they have different types; Compound which includes all found sub-shapes if they have different types;
or group of all found shapes of the equal type; or a single found sub-shape. or group of all found shapes of the equal type; or a single found sub-shape.
""" """
# Example: see GEOM_TestOthers.py # Example: see GEOM_TestOthers.py
@ -6159,8 +6200,8 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
## A sort of GetInPlace functionality, returning IDs of sub-shapes. ## A sort of GetInPlace functionality, returning IDs of sub-shapes.
# For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape # For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
# IDs of @a theShapeWhere. # IDs of @a theShapeWhere.
# For example, if theShapeWhat is a box and theShapeWhere is this box cut into # For example, if theShapeWhat is a box and theShapeWhere is this box cut into
# two parts by a plane, then the result can be as this: # two parts by a plane, then the result can be as this:
# len( result_list ) = 35, # len( result_list ) = 35,
# result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two # result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
# solids with IDs 2 and 36 within theShapeWhere # solids with IDs 2 and 36 within theShapeWhere
@ -6173,8 +6214,8 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
A sort of GetInPlace functionality, returning IDs of sub-shapes. A sort of GetInPlace functionality, returning IDs of sub-shapes.
For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
IDs of @a theShapeWhere. IDs of @a theShapeWhere.
For example, if theShapeWhat is a box and theShapeWhere is this box cut into For example, if theShapeWhat is a box and theShapeWhere is this box cut into
two parts by a plane, then the result can be as this: two parts by a plane, then the result can be as this:
len( result_list ) = 35, len( result_list ) = 35,
result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
solids with IDs 2 and 36 within theShapeWhere solids with IDs 2 and 36 within theShapeWhere
@ -6839,7 +6880,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
faces, edges and vertices only. E.g. for theShapeType FACE, faces, edges and vertices only. E.g. for theShapeType FACE,
theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
all faces of theShape that have tolerances greater then 1.e7. all faces of theShape that have tolerances greater then 1.e7.
Parameters: Parameters:
theShape the shape to be exploded theShape the shape to be exploded
theShapeType the type of sub-shapes to be returned (see theShapeType the type of sub-shapes to be returned (see
@ -6875,7 +6916,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0): def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
""" """
Check if the object is a sub-object of another GEOM object. Check if the object is a sub-object of another GEOM object.
Parameters: Parameters:
aSubObject Checked sub-object (or its parent object, in case if aSubObject Checked sub-object (or its parent object, in case if
\a theSubObjectIndex is non-zero). \a theSubObjectIndex is non-zero).
@ -8594,7 +8635,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
Returns: Returns:
New GEOM.GEOM_Object, containing the result shape. New GEOM.GEOM_Object, containing the result shape.
Note: This operation is a shortcut to the more general MakePartition Note: This operation is a shortcut to the more general MakePartition
operation, where theShape specifies single "object" (shape being partitioned) operation, where theShape specifies single "object" (shape being partitioned)
and thePlane specifies single "tool" (intersector shape). Other parameters of and thePlane specifies single "tool" (intersector shape). Other parameters of
@ -8602,7 +8643,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
- Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape) - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
- KeepNonlimitShapes: 0 - KeepNonlimitShapes: 0
- KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
I.e. the following two operations are equivalent: I.e. the following two operations are equivalent:
Result = geompy.MakeHalfPartition(Object, Plane) Result = geompy.MakeHalfPartition(Object, Plane)
Result = geompy.MakePartition([Object], [Plane]) Result = geompy.MakePartition([Object], [Plane])
@ -11879,7 +11920,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
- GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
- GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
- GEOM.SI_ALL(5) - all interferences. - GEOM.SI_ALL(5) - all interferences.
Returns: Returns:
TRUE, if the shape contains no self-intersections. TRUE, if the shape contains no self-intersections.
""" """
@ -11910,7 +11951,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
theTolerance Specifies a distance between shapes used for detecting gaps: theTolerance Specifies a distance between shapes used for detecting gaps:
- if theTolerance <= 0, algorithm detects intersections (default behavior) - if theTolerance <= 0, algorithm detects intersections (default behavior)
- if theTolerance > 0, algorithm detects gaps - if theTolerance > 0, algorithm detects gaps
Returns: Returns:
TRUE, if the shape contains no self-intersections. TRUE, if the shape contains no self-intersections.
""" """
@ -11963,7 +12004,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
- if theTolerance > 0, algorithm detects gaps - if theTolerance > 0, algorithm detects gaps
theDeflection Linear deflection coefficient that specifies quality of tessellation: theDeflection Linear deflection coefficient that specifies quality of tessellation:
- if theDeflection <= 0, default deflection 0.001 is used - if theDeflection <= 0, default deflection 0.001 is used
Returns: Returns:
TRUE, if there are intersections (gaps) between source shapes TRUE, if there are intersections (gaps) between source shapes
List of sub-shapes IDs from 1st shape that localize intersection. List of sub-shapes IDs from 1st shape that localize intersection.
@ -12166,7 +12207,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
Note: this function is deprecated, it is kept for backward compatibility only Note: this function is deprecated, it is kept for backward compatibility only
Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import. Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
Parameters: Parameters:
theFileName The file, containing the shape. theFileName The file, containing the shape.
theFormatName Specify format for the file reading. theFormatName Specify format for the file reading.
Available formats can be obtained with geompy.InsertOp.ImportTranslators() method. Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
@ -12213,7 +12254,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# @note As the byte-stream representing the shape data can be quite large, this method # @note As the byte-stream representing the shape data can be quite large, this method
# is not automatically dumped to the Python script with the DumpStudy functionality; # is not automatically dumped to the Python script with the DumpStudy functionality;
# so please use this method carefully, only for strong reasons. # so please use this method carefully, only for strong reasons.
# #
# @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
# data stream. # data stream.
# #
@ -12272,8 +12313,8 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
Note: this function is deprecated, it is kept for backward compatibility only Note: this function is deprecated, it is kept for backward compatibility only
Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export. Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
Parameters: Parameters:
theObject Shape to be stored in the file. theObject Shape to be stored in the file.
theFileName Name of the file to store the given shape in. theFileName Name of the file to store the given shape in.
theFormatName Specify format for the shape storage. theFormatName Specify format for the shape storage.
@ -14528,7 +14569,7 @@ def New( instance=None):
return geom return geom
# Register methods from the plug-ins in the geomBuilder class # Register methods from the plug-ins in the geomBuilder class
plugins_var = os.environ.get( "GEOM_PluginsList" ) plugins_var = os.environ.get( "GEOM_PluginsList" )
plugins = None plugins = None
@ -14546,7 +14587,7 @@ if plugins is not None:
continue continue
exec( "from salome.%s import %s" % (pluginName, pluginBuilderName)) exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
plugin = eval( pluginBuilderName ) plugin = eval( pluginBuilderName )
# add methods from plugin module to the geomBuilder class # add methods from plugin module to the geomBuilder class
for k in dir( plugin ): for k in dir( plugin ):
if k[0] == '_': continue if k[0] == '_': continue
@ -14558,4 +14599,4 @@ if plugins is not None:
pass pass
del pluginName del pluginName
pass pass
pass pass