X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=idl%2FGEOM_Gen.idl;h=febb9b324b3f4166c098ade03e9d40c4f44f8e13;hb=91bcf72966607b9ec3fc704bcd12706cc0c2fc41;hp=5615e85fc7ee3af7015b5624bd264ce53f47da2c;hpb=732211808796539fcf1de34e06038e7fb015ece9;p=modules%2Fgeom.git diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 5615e85fc..febb9b324 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -1,3 +1,24 @@ +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File : GEOM_Gen.idl // Author : Sergey RUIN @@ -7,6 +28,7 @@ #include "SALOME_Exception.idl" #include "SALOME_Component.idl" #include "SALOMEDS.idl" +#include "SALOMEDS_Attributes.idl" #include "SALOME_GenericObj.idl" @@ -16,8 +38,19 @@ module GEOM * Topological types of shapes (like Open Cascade types) */ enum shape_type { COMPOUND, COMPSOLID, SOLID, SHELL, - FACE, WIRE, EDGE, VERTEX, SHAPE }; + FACE, WIRE, EDGE, VERTEX, SHAPE }; + /*! + * Marker type + */ + enum marker_type { MT_NONE, MT_POINT, MT_PLUS, MT_STAR, MT_O, MT_X, MT_O_POINT, MT_O_PLUS, + MT_O_STAR, MT_O_X, MT_BALL, MT_RING1, MT_RING2, MT_RING3, MT_USER }; + + /*! + * Marker size + */ + enum marker_size { MS_NONE, MS_10, MS_15, MS_20, MS_25, MS_30, MS_35, + MS_40, MS_45, MS_50, MS_55, MS_60, MS_65, MS_70 }; /*! * State of shape relatively geometrical surface like plane, sphere or cylinder. @@ -56,8 +89,71 @@ module GEOM ST_ONIN }; + /*! + * Kind of method to find inside one main shape some subshapes, + * corresponding to other given shape (its argument) + * Is used in functions GEOM_Gen.RestoreSubShapes() + */ + enum find_shape_method + { + /*! Use GetInPlace functionality. Suits all cases, except transformations */ + FSM_GetInPlace, + + /*! To be used only for transformation result, to find subshapes of argument. + * Only this method can be used after transformation. + */ + FSM_Transformed, + + /*! To find only shared subshapes, not modified by the operation */ + FSM_GetSame, + + /*! Use GetShapesOnShape method (can work only on solids) */ + FSM_GetShapesOnShape, + + /*! Use GetInPlaceByHistory method (can work only after Partition) */ + FSM_GetInPlaceByHistory, + + /*! To be used only for multi-transformation result. + * Only this method can be used after multi-transformation. + */ + FSM_MultiTransformed + }; + + /*! + * Kind of method to perform filling operation + * Is used in functions GEOM_Gen.MakeFilling() + */ + enum filling_oper_method + { + /*! Default (standard behaviour) */ + FOM_Default, + + /*! Use edges orientation */ + FOM_UseOri, + + /*! Auto-correct edges orientation */ + FOM_AutoCorrect + }; + + /*! + * Kind of the curves. + * Used in the function GEOM_Gen.MakeCurveParametric() + */ + enum curve_type { + /*! Polyline curve */ + Polyline, + + /*! Bezier curve */ + Bezier, + + /*! Interpolation, curve */ + Interpolation + }; + + typedef sequence string_array; typedef sequence short_array; + typedef sequence ListOfBool; typedef sequence ListOfLong; typedef sequence ListOfDouble; @@ -91,6 +187,33 @@ module GEOM */ shape_type GetShapeType(); + /*! + * Get the topology type of the object value. + * In contrast to the shape type, this function returns type of the most + * top-level sub-shape of the COMPOUND or COMPSOLID, if there is only one + * sub-shape there. + * \sa GetShapeType() + */ + shape_type GetTopologyType(); + + /*! + * Get a minimal type of the top-level shapes contained in the object. + * This function is useful for the compounds only; for simple shapes it + * exactly the same value as GetShapeType(). + * Note, that compounds are procesed recursively. + * \sa GetShapeType(), GetTopologyType(), GetMaxShapeType() + */ + shape_type GetMinShapeType(); + + /*! + * Get a maximal type of the top-level shapes contained in the object. + * This function is useful for the compounds only; for simple shapes it + * exactly the same value as GetShapeType(). + * Note, that compounds are procesed recursively. + * \sa GetShapeType(), GetTopologyType(), GetMinShapeType() + */ + shape_type GetMaxShapeType(); + /*! * Set name of the object. * \param theName is a name which will be associated with this object. @@ -102,6 +225,60 @@ module GEOM */ string GetName(); + /*! + * Set color of the object. + * \param theColor is a color of the object. + */ + void SetColor(in SALOMEDS::Color theColor); + + /*! + * Get color of the object. + */ + SALOMEDS::Color GetColor(); + + /*! + * Toggle auto color mode on the object. + * \param theAtoColor is a flag which toggles auto color mode. + */ + void SetAutoColor(in boolean theAutoColor); + + /*! + * Get flag of object's auto color mode. + */ + boolean GetAutoColor(); + + /*! + * Set standard point marker for the object + * \param theType standard marker type + * \param theSize marker relative size + */ + void SetMarkerStd(in marker_type theType, in marker_size theSize ); + + /*! + * Set custom point marker for the object. The texture can be added + * by LoadTexture() or AddTexture() functions. + * \param theTextureId texture ID + */ + void SetMarkerTexture(in long theTextureId); + + /*! + * Get type of the point marker assigned to the object + * \return current marker type (MT_NONE if no marker is set) + */ + marker_type GetMarkerType(); + + /*! + * Get size of the point marker assigned to the object + * \return current marker relative size (MS_NONE if no marker is set) + */ + marker_size GetMarkerSize(); + + /*! + * Get texture idenifier of the point marker assigned to the object + * \return marker texture ID (0 if no marker set) + */ + long GetMarkerTexture(); + /*! * Set a Study entry where this object was published. */ @@ -128,7 +305,7 @@ module GEOM /*! * Get the TopoDS_Shape, for colocated case only. */ - long getShape(); + long long getShape(); /*! ###################################################################### @@ -163,6 +340,24 @@ module GEOM * For example, method return false for GEOM_MARKER */ boolean IsShape(); + + /* + * Return true if passed object is identical to this object + * \param other object being compared with this one + */ + boolean IsSame(in GEOM_Object other); + + /*! + * Set list of parameters + * \param theParameters is a string containing the notebook variables separated by ":" symbol, + * used for object creation + */ + void SetParameters (in string theParameters); + + /*! + * Return list of notebook variables used for object creation separated by ":" symbol + */ + string GetParameters(); }; @@ -234,7 +429,7 @@ module GEOM * \return New GEOM_Object, containing the created point. */ GEOM_Object MakePointWithReference (in GEOM_Object theReference, - in double theX, in double theY, in double theZ); + in double theX, in double theY, in double theZ); /*! * Create a point, corresponding to the given parameter on the given curve. @@ -243,7 +438,78 @@ module GEOM * \return New GEOM_Object, containing the created point. */ GEOM_Object MakePointOnCurve (in GEOM_Object theRefCurve, - in double theParameter); + in double theParameter); + + /*! + * Create a point, corresponding to the given length on the given curve. + * \param theRefCurve The referenced curve. + * \param theLength Length on the referenced curve. It can be negative. + * \param theStartPoint Any vertex close to one of edge's + * ends to select start point among them. + * If NULL, fist vertex is used. + * \return New GEOM_Object, containing the created point. + */ + GEOM_Object MakePointOnCurveByLength (in GEOM_Object theRefCurve, + in double theLength, + in GEOM_Object theStartPoint); + + /*! + * Create a point on the given curve, projecting given point + * \param theRefCurve The referenced curve. + * \param theXParameter X co-ordinate of point to project on curve + * \param theYParameter Y co-ordinate of point to project on curve + * \param theZParameter Z co-ordinate of point to project on curve + * \return New GEOM_Object, containing the created point. + */ + GEOM_Object MakePointOnCurveByCoord (in GEOM_Object theRefCurve, + in double theXParameter, + in double theYarameter, + in double theZPameter); + + /*! + * Create a point, corresponding to the given parameters on the + * given surface. + * \param theRefSurf The referenced surface. + * \param theUParameter Value of U-parameter on the referenced surface. + * \param theVParameter Value of V-parameter on the referenced surface. + * \return New GEOM_Object, containing the created point. + */ + GEOM_Object MakePointOnSurface (in GEOM_Object theRefSurf, + in double theUParameter, + in double theVParameter); + + /*! + * Create a point on the given surface, projecting given point + * \param theRefSurf The referenced surface. + * \param theXParameter X co-ordinate of point to project on curve + * \param theYParameter Y co-ordinate of point to project on curve + * \param theZParameter Z co-ordinate of point to project on curve + * \return New GEOM_Object, containing the created point. + */ + GEOM_Object MakePointOnSurfaceByCoord (in GEOM_Object theRefSurf, + in double theXParameter, + in double theYarameter, + in double theZPameter); + + + /*! + * Create a point, on two lines intersection. + * \param theRefLine1, theRefLine2 The referenced lines. + * \return New GEOM_Object, containing the created point. + */ + GEOM_Object MakePointOnLinesIntersection (in GEOM_Object theRefLine1, + in GEOM_Object theRefLine2); + + /*! + * Create a vector, corresponding to tangent to the given parameter on the given curve. + * \param theRefCurve The referenced curve. + * \param theParameter Value of parameter on the referenced curve.This value should be have value + * \between 0. and 1.. Value of 0. corresponds first parameter of curve value 1. corresponds + * \last parameter of curve. + * \return New GEOM_Object, containing the created point. + */ + GEOM_Object MakeTangentOnCurve (in GEOM_Object theRefCurve, + in double theParameter); /*! * Create a vector with the given components. @@ -253,8 +519,8 @@ module GEOM * \return New GEOM_Object, containing the created vector. */ GEOM_Object MakeVectorDXDYDZ (in double theDX, - in double theDY, - in double theDZ); + in double theDY, + in double theDZ); /*! * Create a vector between two points. @@ -281,6 +547,14 @@ module GEOM */ GEOM_Object MakeLineTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2); + /*! + * Create a line, given by two faces intersection. + * \param theFace1 First of two faces, defining the line. + * \param theFace2 Second of two faces, defining the line. + * \return New GEOM_Object, containing the created line. + */ + GEOM_Object MakeLineTwoFaces (in GEOM_Object theFace1, in GEOM_Object theFace2); + /*! * Create a plane, passing through the three given points * \param thePnt1 First of three points, defining the plane. @@ -290,9 +564,9 @@ module GEOM * \return New GEOM_Object, containing the created plane. */ GEOM_Object MakePlaneThreePnt (in GEOM_Object thePnt1, - in GEOM_Object thePnt2, - in GEOM_Object thePnt3, - in double theTrimSize); + in GEOM_Object thePnt2, + in GEOM_Object thePnt3, + in double theTrimSize); /*! * Create a plane, passing through the given point @@ -303,17 +577,39 @@ module GEOM * \return New GEOM_Object, containing the created plane. */ GEOM_Object MakePlanePntVec (in GEOM_Object thePnt, - in GEOM_Object theVec, - in double theTrimSize); + in GEOM_Object theVec, + in double theTrimSize); /*! * Create a plane, similar to the existing one, but with another size of representing face. - * \param theFace Referenced plane. + * \param theFace Referenced plane or LCS(Marker). * \param theTrimSize New half size of a side of quadrangle face, representing the plane. * \return New GEOM_Object, containing the created plane. */ GEOM_Object MakePlaneFace (in GEOM_Object theFace, - in double theTrimSize); + in double theTrimSize); + + /*! + * Create a plane, by two vectors. + * \param theVec1 Vector1, the plane has to pass through first point of this vector. + * \param theVec Vector2, defining the plane normal direction. + * \param theTrimSize Half size of a side of quadrangle face, representing the plane. + * \return New GEOM_Object, containing the created plane. + */ + GEOM_Object MakePlane2Vec (in GEOM_Object theVec1, + in GEOM_Object theVec2, + in double theTrimSize); + + /*! + * Create a plane, defined by local coordinate system. + * \param theLCS Referenced LCS(Marker). + * \param theTrimSize Half size of a side of quadrangle face, representing the plane. + * \param theOrientation OXY, OYZ or OZX orientation = (1, 2 or 3). + * \return New GEOM_Object, containing the created plane. + */ + GEOM_Object MakePlaneLCS (in GEOM_Object theLCS, + in double theTrimSize, + in double theOrientation); /*! * Create a local coordinate system. @@ -323,8 +619,39 @@ module GEOM * \return New GEOM_Object, containing the created coordinate system. */ GEOM_Object MakeMarker (in double theOX , in double theOY , in double theOZ, - in double theXDX, in double theXDY, in double theXDZ, - in double theYDX, in double theYDY, in double theYDZ); + in double theXDX, in double theXDY, in double theXDZ, + in double theYDX, in double theYDY, in double theYDZ); + + /*! + * Create a local coordinate system from shape. + * \param theShape The initial shape to detect the coordinate system. + * \return New GEOM_Object, containing the created coordinate system. + */ + GEOM_Object MakeMarkerFromShape (in GEOM_Object theShape); + + /*! + * Create a local coordinate system from point and two vectors (DX, DY). + * \param theOrigin Point of coordinate system origin. + * \param theXVec Vector of X direction. + * \param theYVec Vector of Y direction. + * \return New GEOM_Object, containing the created coordinate system. + */ + GEOM_Object MakeMarkerPntTwoVec (in GEOM_Object theOrigin, + in GEOM_Object theXVec, in GEOM_Object theYVec); + + /*! + * Create a tangent plane to specified face in the point with specified parameters. + * Values of parameters should be between 0. and 1.0 + * \param theFace - face for which tangent plane shuold be built. + * \param theParameterU - value of parameter by U + * \param theParameterV - value of parameter Vthe + * \param theTrimSize - defines sizes of created face + * \return New GEOM_Object, containing the face built on tangent plane. + */ + GEOM_Object MakeTangentPlaneOnFace(in GEOM_Object theFace, + in double theParameterU, + in double theParameterV, + in double theTrimSize); }; interface GEOM_ITransformOperations : GEOM_IOperations @@ -337,8 +664,8 @@ module GEOM * \return theObject. */ GEOM_Object TranslateTwoPoints (in GEOM_Object theObject, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2); + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); /*! * Translate the given object along the vector, specified @@ -349,7 +676,7 @@ module GEOM * \return New GEOM_Object, containing the translated object. */ GEOM_Object TranslateTwoPointsCopy (in GEOM_Object theObject, - in GEOM_Object thePoint1, + in GEOM_Object thePoint1, in GEOM_Object thePoint2); /*! @@ -359,7 +686,7 @@ module GEOM * \return theObject. */ GEOM_Object TranslateDXDYDZ (in GEOM_Object theObject, - in double theDX, in double theDY, in double theDZ); + in double theDX, in double theDY, in double theDZ); /*! * Translate the given object along the vector, specified @@ -369,7 +696,7 @@ module GEOM * \return New GEOM_Object, containing the translated object. */ GEOM_Object TranslateDXDYDZCopy (in GEOM_Object theObject, - in double theDX, in double theDY, in double theDZ); + in double theDX, in double theDY, in double theDZ); /*! @@ -379,7 +706,7 @@ module GEOM * \return theObject. */ GEOM_Object TranslateVector (in GEOM_Object theObject, - in GEOM_Object theVector); + in GEOM_Object theVector); /*! * Translate the given object along the given vector, @@ -389,7 +716,21 @@ module GEOM * \return New GEOM_Object, containing the translated object. */ GEOM_Object TranslateVectorCopy (in GEOM_Object theObject, - in GEOM_Object theVector); + in GEOM_Object theVector); + + /*! + * Translate the given object along the given vector on given distance, + * creating its copy before the translation. + * \param theObject The object to be translated. + * \param theVector Translation vector, giving a direction. + * \param theDistance Translation distance, giving a distance. + * \param theCope Translation copy, creating its copy if true. + * \return New GEOM_Object, containing the translated object. + */ + GEOM_Object TranslateVectorDistance (in GEOM_Object theObject, + in GEOM_Object theVector, + in double theDistance, + in boolean theCopy); /*! * Translate the given object along the given vector a given number times @@ -401,9 +742,9 @@ module GEOM * the shapes, obtained after each translation. */ GEOM_Object MultiTranslate1D (in GEOM_Object theObject, - in GEOM_Object theVector, - in double theStep, - in long theNbTimes); + in GEOM_Object theVector, + in double theStep, + in long theNbTimes); /*! * Conseqently apply two specified translations to theObject specified number of times. @@ -418,12 +759,40 @@ module GEOM * the shapes, obtained after each translation. */ GEOM_Object MultiTranslate2D (in GEOM_Object theObject, - in GEOM_Object theVector1, - in double theStep1, - in long theNbTimes1, - in GEOM_Object theVector2, - in double theStep2, - in long theNbTimes2); + in GEOM_Object theVector1, + in double theStep1, + in long theNbTimes1, + in GEOM_Object theVector2, + in double theStep2, + in long theNbTimes2); + + /*! + * Rotate given object around vector perpendicular to plane containing three points. + * \param theObject The object to be rotated. + * \param theCentPoint central point - the axis is the vector perpendicular to the plane + * containing the three points. + * \param thePoint1 and thePoint2 - in a perpendicular plan of the axis. + * \return theObject. + */ + GEOM_Object RotateThreePoints (in GEOM_Object theObject, + in GEOM_Object theCentPoint, + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); + + + /*! + * Rotate given object around vector perpendicular to plane containing three points. + * Creating its copy before the rotatation. + * \param theObject The object to be rotated. + * \param theCentPoint central point - the axis is the vector perpendicular to the plane + * containing the three points. + * \param thePoint1 and thePoint2 - in a perpendicular plan of the axis. + * \return New GEOM_Object, containing the rotated object. + */ + GEOM_Object RotateThreePointsCopy (in GEOM_Object theObject, + in GEOM_Object theCentPoint, + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); /*! * Rotate the given object around the given axis on the given angle. @@ -433,8 +802,9 @@ module GEOM * \return theObject. */ GEOM_Object Rotate (in GEOM_Object theObject, - in GEOM_Object theAxis, - in double theAngle); + in GEOM_Object theAxis, + in double theAngle); + /*! * Rotate the given object around the given axis @@ -445,8 +815,9 @@ module GEOM * \return New GEOM_Object, containing the rotated object. */ GEOM_Object RotateCopy (in GEOM_Object theObject, - in GEOM_Object theAxis, - in double theAngle); + in GEOM_Object theAxis, + in double theAngle); + /*! * Rotate the given object around the given axis a given number times. @@ -458,8 +829,8 @@ module GEOM * shapes, obtained after each rotation. */ GEOM_Object MultiRotate1D (in GEOM_Object theObject, - in GEOM_Object theAxis, - in long theNbTimes); + in GEOM_Object theAxis, + in long theNbTimes); /*! * Rotate the given object around the @@ -477,11 +848,11 @@ module GEOM * shapes, obtained after each transformation. */ GEOM_Object MultiRotate2D (in GEOM_Object theObject, - in GEOM_Object theAxis, - in double theAngle, - in long theNbTimes1, - in double theStep, - in long theNbTimes2); + in GEOM_Object theAxis, + in double theAngle, + in long theNbTimes1, + in double theStep, + in long theNbTimes2); /*! * Replace the given object by an object, @@ -550,6 +921,14 @@ module GEOM */ GEOM_Object OffsetShapeCopy (in GEOM_Object theObject, in double theOffset); + /*! + * Create new object as projection of the given one on a 2D surface. + * \param theSource The source object for the projection. It can be a point, edge or wire. + * \param theTarget The target object. It can be planar or cylindrical face. + * \return New GEOM_Object, containing the projection. + */ + GEOM_Object ProjectShapeCopy (in GEOM_Object theSource, in GEOM_Object theTarget); + /*! * Scale the given object by the factor. * \param theObject The object to be scaled. @@ -558,7 +937,7 @@ module GEOM * \return theObject. */ GEOM_Object ScaleShape (in GEOM_Object theObject, in GEOM_Object thePoint, - in double theFactor); + in double theFactor); /*! * Scale the given object by the factor, creating its copy before the scaling. @@ -568,22 +947,98 @@ module GEOM * \return New GEOM_Object, containing the scaled shape. */ GEOM_Object ScaleShapeCopy (in GEOM_Object theObject, in GEOM_Object thePoint, - in double theFactor); + in double theFactor); /*! - * Modify the Location of the given object by LCS + * Scale the given object by different factors along coordinate axes. + * \param theObject The object to be scaled. + * \param thePoint Center point for scaling. + * \param theFactorX,theFactorY,theFactorZ Scaling factors along each axis. + * \return theObject. + */ + GEOM_Object ScaleShapeAlongAxes (in GEOM_Object theObject, + in GEOM_Object thePoint, + in double theFactorX, + in double theFactorY, + in double theFactorZ); + + /*! + * Scale the given object by different factors along coordinate axes, + * creating its copy before the scaling. + * \param theObject The object to be scaled. + * \param thePoint Center point for scaling. + * \param theFactorX,theFactorY,theFactorZ Scaling factors along each axis. + * \return New GEOM_Object, containing the scaled shape. + */ + GEOM_Object ScaleShapeAlongAxesCopy (in GEOM_Object theObject, + in GEOM_Object thePoint, + in double theFactorX, + in double theFactorY, + in double theFactorZ); + + /*! + * Modify the Location of the given object by LCS. + * \param theObject The object to be displaced. + * \param theStartLCS Coordinate system to perform displacement from it. + * If \a theStartLCS is NULL, displacement + * will be performed from global CS. + * If \a theObject itself is used as \a theStartLCS, + * its location will be changed to \a theEndLCS. + * \param theEndLCS Coordinate system to perform displacement to it. + * \return theObject. */ GEOM_Object PositionShape (in GEOM_Object theObject, - in GEOM_Object theStartLCS, - in GEOM_Object theEndLCS); + in GEOM_Object theStartLCS, + in GEOM_Object theEndLCS); /*! - * Modify the Location of the given object by LCS - * creating its copy before the setting + * Modify the Location of the given object by LCS, + * creating its copy before the setting. + * \param theObject The object to be displaced. + * \param theStartLCS Coordinate system to perform displacement from it. + * If \a theStartLCS is NULL, displacement + * will be performed from global CS. + * If \a theObject itself is used as \a theStartLCS, + * its location will be changed to \a theEndLCS. + * \param theEndLCS Coordinate system to perform displacement to it. + * \return New GEOM_Object, containing the displaced shape. */ GEOM_Object PositionShapeCopy (in GEOM_Object theObject, - in GEOM_Object theStartLCS, - in GEOM_Object theEndLCS); + in GEOM_Object theStartLCS, + in GEOM_Object theEndLCS); + + /*! + * Modify the Location of the given object by Path, + * \param theObject The object to be displaced. + * \param thePath Wire or Edge along that the object will be translated. + * \param theDistance progress of Path (0 = actual location, 1 = end of path location). + * \param theCopy is a true or false parameter. true is to create a copy, false to move the object. + * \param theCopy is a true or false parameter. true is to reverse direction, false is to move normal direction. + * \return New GEOM_Object, containing the displaced shape. + */ + GEOM_Object PositionAlongPath (in GEOM_Object theObject, + in GEOM_Object thePath, + in double theDistance, + in boolean theCopy, + in boolean theReverse); + + /*! + * Transform the shape in the same way what was used for the sample shape creation. + * \param theObject The object to be transformed. + * \param theSample The object containing information about required transformation. + * \note Implementation of this method is limited by multi-transformations now. + * \note Internal method. + * \return New GEOM_Object, containing the transformed shape. + */ + GEOM_Object TransformLikeOtherCopy (in GEOM_Object theObject, + in GEOM_Object theSample); + + /*! + * Recompute the shape from its arguments. + * \param theObject The object to be recomputed. + * \return theObject. + */ + GEOM_Object RecomputeObject (in GEOM_Object theObject); }; /*! @@ -613,6 +1068,53 @@ module GEOM */ GEOM_Object MakeBoxTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2); + /*! + * Create a face specified dimensions along OX-OY coordinate axes, + * with edges parallel to the coordinate axes. + * Center of the face will be at point (0, 0, 0). + * \param theH Height of the Face. + * \param theW Width of the Face. + * \param theOrientation Orientation belong axis OXY OYZ OZX + * \return New GEOM_Object, containing the created face. + */ + GEOM_Object MakeFaceHW (in double theH, in double theW, in short theOrientation); + /*! + * Create a face by normale vector or edge and two specified sizes, + * vertical (H) and horisontal (W). + * \param theVec defines plane. + * \param theH vertical size (height). + * \param theW horisontal size (width). + * \return New GEOM_Object, containing the created face. + */ + GEOM_Object MakeFaceObjHW (in GEOM_Object theObj, in double theH, in double theW); + /*! + * Create a Disk (circular face) with given center, normal vector and radius. + * \param thePnt disk center. + * \param theVec Vector, normal to the plane of the disk. + * \param theR Disk radius. + * \return New GEOM_Object, containing the created disk. + */ + GEOM_Object MakeDiskPntVecR (in GEOM_Object thePnt, + in GEOM_Object theVec, + in double theR); + /*! + * Create a disk (circular face), passing through three given points + * \param thePnt1, thePnt2, thePnt3 Points, defining the disk. + * \return New GEOM_Object, containing the created disk. + */ + GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1, + in GEOM_Object thePnt2, + in GEOM_Object thePnt3); + + /*! + * Create a disk specified dimensions along OX-OY coordinate axes, + * Center of the disk at point (0, 0, 0). + * \param theR of the Disk. + * \param theOrientation Orientation belong axis OXY OYZ OZX + * \return New GEOM_Object, containing the created disk. + */ + GEOM_Object MakeDiskR (in double theR, in short theOrientation); + /*! * Create a cylinder with given radius and height at * the origin of coordinate system. Axis of the cylinder @@ -632,9 +1134,9 @@ module GEOM * \return New GEOM_Object, containing the created cylinder. */ GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt, - in GEOM_Object theAxis, - in double theR, - in double theH); + in GEOM_Object theAxis, + in double theR, + in double theH); /*! * Create a cone with given height and radiuses at @@ -661,10 +1163,10 @@ module GEOM * \return New GEOM_Object, containing the created cone. */ GEOM_Object MakeConePntVecR1R2H (in GEOM_Object thePnt, - in GEOM_Object theAxis, - in double theR1, - in double theR2, - in double theH); + in GEOM_Object theAxis, + in double theR1, + in double theR2, + in double theH); /*! * Create a torus with given radiuses at the origin of coordinate system. @@ -673,7 +1175,7 @@ module GEOM * \return New GEOM_Object, containing the created torus. */ GEOM_Object MakeTorusRR (in double theRMajor, - in double theRMinor); + in double theRMinor); /*! * Create a torus with given center, normal vector and radiuses. @@ -684,9 +1186,9 @@ module GEOM * \return New GEOM_Object, containing the created torus. */ GEOM_Object MakeTorusPntVecRR (in GEOM_Object thePnt, - in GEOM_Object theVec, - in double theRMajor, - in double theRMinor); + in GEOM_Object theVec, + in double theRMajor, + in double theRMinor); /*! * Create a sphere with given radius at the origin of coordinate system. @@ -713,8 +1215,17 @@ module GEOM * \return New GEOM_Object, containing the created prism. */ GEOM_Object MakePrismVecH (in GEOM_Object theBase, - in GEOM_Object theVec, - in double theH); + in GEOM_Object theVec, + in double theH); + /* The Same Prism but in 2 directions (forward&backward) */ + GEOM_Object MakePrismVecH2Ways (in GEOM_Object theBase, + in GEOM_Object theVec, + in double theH); + /* The Same as MakePrismVecH but with scaling */ + GEOM_Object MakePrismVecHWithScaling (in GEOM_Object theBase, + in GEOM_Object theVec, + in double theH, + in double theScaleFactor); /*! * Create a shape by extrusion of the base shape along a vector, defined by two points. @@ -724,8 +1235,33 @@ module GEOM * \return New GEOM_Object, containing the created prism. */ GEOM_Object MakePrismTwoPnt (in GEOM_Object theBase, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2); + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); + /* The same prism but in two directions forward&backward */ + GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase, + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); + /* The Same as MakePrismTwoPnt but with scaling */ + GEOM_Object MakePrismTwoPntWithScaling (in GEOM_Object theBase, + in GEOM_Object thePoint1, + in GEOM_Object thePoint2, + in double theScaleFactor); + + /*! + * Create a shape by extrusion of the base shape along a vector, defined by DX DY DZ. + * \param theBase Base shape to be extruded. + * \param DX, DY, DZ end of extrusion vector. + * \return New GEOM_Object, containing the created prism. + */ + GEOM_Object MakePrismDXDYDZ (in GEOM_Object theBase, + in double theDX, in double theDY, in double theDZ); + /* The same prism but in two directions forward&backward */ + GEOM_Object MakePrismDXDYDZ2Ways (in GEOM_Object theBase, + in double theDX, in double theDY, in double theDZ); + /* The Same as MakePrismDXDYDZ but with scaling */ + GEOM_Object MakePrismDXDYDZWithScaling (in GEOM_Object theBase, + in double theDX, in double theDY, in double theDZ, + in double theScaleFactor); /*! * Create a shape by extrusion of the base shape along @@ -746,22 +1282,111 @@ module GEOM * \return New GEOM_Object, containing the created revolution. */ GEOM_Object MakeRevolutionAxisAngle (in GEOM_Object theBase, - in GEOM_Object theAxis, - in double theAngle); + in GEOM_Object theAxis, + in double theAngle); + /* The Same Revolution but in both ways forward&backward */ + GEOM_Object MakeRevolutionAxisAngle2Ways (in GEOM_Object theBase, + in GEOM_Object theAxis, + in double theAngle); /*! * Create a filling from the given compound of contours. - * \param theMinDeg a minimal degree - * \param theMaxDeg a maximal degree - * \param theTol2D a 2d tolerance - * \param theTol3D a 3d tolerance - * \param theNbIter a number of iteration + * \param theMinDeg a minimal degree of BSpline surface to create + * \param theMaxDeg a maximal degree of BSpline surface to create + * \param theTol2D a 2d tolerance to be reached + * \param theTol3D a 3d tolerance to be reached + * \param theNbIter a number of iteration of approximation algorithm + * \param theMethod Kind of method to perform filling operation. * \return New GEOM_Object, containing the created filling surface. */ GEOM_Object MakeFilling (in GEOM_Object theShape, - in long theMinDeg, in long theMaxDeg, - in double theTol2D, in double theTol3D, - in long theNbIter); + in long theMinDeg, in long theMaxDeg, + in double theTol2D, in double theTol3D, + in long theNbIter, + in filling_oper_method theMethod, + in boolean theApprox); + + /*! + * Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices. + * \param theSeqSections - set of specified sections. + * \param theModeSolid - mode defining building solid or shell + * \param thePreci - precision 3D used for smoothing by default 1.e-6 + * \param theRuled - mode defining type of the result surfaces (ruled or smoothed). + * \return New GEOM_Object, containing the created shell or solid. + */ + GEOM_Object MakeThruSections(in ListOfGO theSeqSections, + in boolean theModeSolid, + in double thePreci, + in boolean theRuled); + + /*! + * Create a shape by extrusion of the profile shape along + * the path shape. The path shape can be a wire or an edge. + * the several profiles can be specified in the several locations of path. + * \param theSeqBases - list of Bases shape to be extruded. + * \param theLocations - list of locations on the path corresponding + * specified list of the Bases shapes. Number of locations + * should be equal to number of bases or list of locations can be empty. + * \param thePath - Path shape to extrude the base shape along it. + * \param theWithContact - the mode defining that the section is translated to be in + * contact with the spine. + * \param - WithCorrection - defining that the section is rotated to be + * orthogonal to the spine tangent in the correspondent point + * \return New GEOM_Object, containing the created pipe. + */ + GEOM_Object MakePipeWithDifferentSections (in ListOfGO theSeqBases, + in ListOfGO theLocations, + in GEOM_Object thePath, + in boolean theWithContact , + in boolean theWithCorrection ); + + /*! + * Create a shape by extrusion of the profile shape along + * the path shape. The path shape can be a shell or a face. + * the several profiles can be specified in the several locations of path. + * \param theSeqBases - list of Bases shape to be extruded. + * \param theSeqSubBases - list of corresponding subshapes of section shapes. + * \param theLocations - list of locations on the path corresponding + * specified list of the Bases shapes. Number of locations + * should be equal to number of bases. + * \param thePath - Path shape to extrude the base shape along it. + * \param theWithContact - the mode defining that the section is translated to be in + * contact with the spine. + * \param - WithCorrection - defining that the section is rotated to be + * orthogonal to the spine tangent in the correspondent point + * \return New GEOM_Object, containing the created pipe. + */ + GEOM_Object MakePipeWithShellSections (in ListOfGO theSeqBases, + in ListOfGO theSeqSubBases, + in ListOfGO theLocations, + in GEOM_Object thePath, + in boolean theWithContact , + in boolean theWithCorrection ); + + /*! + * Create solids between given sections + * \param theSeqBases - list of sections (shell or face). + * \param theLocations - list of corresponding vertexes + * \return New GEOM_Object, containing the created solids. + */ + GEOM_Object MakePipeShellsWithoutPath (in ListOfGO theSeqBases, + in ListOfGO theLocations); + + /*! + * Create a shape by extrusion of the base shape along + * the path shape with constant bi-normal direction along the given vector. + * The path shape can be a wire or an edge. + * \param theBase Base shape to be extruded. + * \param thePath Path shape to extrude the base shape along it. + * \param theVec Vector defines a constant binormal direction to keep the + * same angle beetween the Direction and the sections + * along the sweep surface. + * \return New GEOM_Object, containing the created pipe. + */ + GEOM_Object MakePipeBiNormalAlongVector (in GEOM_Object theBase, + in GEOM_Object thePath, + in GEOM_Object theVec); + }; /*! @@ -779,16 +1404,44 @@ module GEOM */ GEOM_Object MakeEdge (in GEOM_Object thePnt1, in GEOM_Object thePnt2); + /*! + * Create an edge on another edge, corresponding to the given length on the given edge. + * \param theRefCurve The referenced edge. + * \param theLength Length on the referenced edge. It can be + * negative for extrapolation on base curve. + * \param theStartPoint Any vertex close to one of edge's + * ends to select start point among them. + * If NULL, fist vertex is used. + * \return New GEOM_Object, containing the created edge. + */ + GEOM_Object MakeEdgeOnCurveByLength (in GEOM_Object theRefCurve, + in double theLength, + in GEOM_Object theStartPoint); + + /*! + * Create an edge from specified wire. + * \param theWire source Wire. + * \param theLinearTolerance linear tolerance value + * \param theAngularTolerance angular tolerance value + * \return New GEOM_Object, containing the created edge. + */ + GEOM_Object MakeEdgeWire (in GEOM_Object theWire, + in double theLinearTolerance, + in double theAngularTolerance); + /*! * Create a wire from the set of edges and wires. * \param theEdgesAndWires List of edge and/or wires. + * \param theTolerance Maximum distance between vertices, that will be merged. + * Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()). * \return New GEOM_Object, containing the created wire. */ - GEOM_Object MakeWire (in ListOfGO theEdgesAndWires); + GEOM_Object MakeWire (in ListOfGO theEdgesAndWires, + in double theTolerance); /*! * Create a face on the given wire. - * \param theWire Wire to build the face on. + * \param theWire closed Wire or Edge to build the face on. * \param isPlanarWanted If TRUE, only planar face will be built. * If impossible, NULL object will be returned. * \return New GEOM_Object, containing the created face. @@ -797,7 +1450,7 @@ module GEOM /*! * Create a face on the given wires set. - * \param theWires List of wires to build the face on. + * \param theWires List of closed wires or edges to build the face on. * \param isPlanarWanted If TRUE, only planar face will be built. * If impossible, NULL object will be returned. * \return New GEOM_Object, containing the created face. @@ -836,43 +1489,178 @@ module GEOM * Replace coincident faces in theShape by one face. * \param theShape Initial shape. * \param theTolerance Maximum distance between faces, which can be considered as coincident. + * \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes. * \return New GEOM_Object, containing a copy of theShape without coincident faces. */ - GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance); + GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance, in boolean doKeepNonSolids); /*! - * Explode a shape on subshapes of a given type. + * Find coincident faces in theShape for possible gluing. + * \param theShape Initial shape. + * \param theTolerance Maximum distance between faces, which can be considered as coincident. + * \return ListOfGO + */ + ListOfGO GetGlueFaces (in GEOM_Object theShape, in double theTolerance); + + /*! + * Replace coincident faces in theShape by one face + * in compliance with given list of faces + * \param theShape Initial shape. + * \param theTolerance Maximum distance between faces, which can be considered as coincident. + * \param theFaces List of faces for gluing. + * \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes. + * \param doGlueAllEdges If TRUE, all coincident edges of theShape + * will be glued, otherwise only the edges, + * belonging to theFaces. + * \return New GEOM_Object, containing a copy of theShape without some faces. + */ + GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, in double theTolerance, + in ListOfGO theFaces, in boolean doKeepNonSolids, + in boolean doGlueAllEdges); + + /*! + * Replace coincident edges in theShape by one edge. + * \param theShape Initial shape. + * \param theTolerance Maximum distance between edges, which can be considered as coincident. + * \return New GEOM_Object, containing a copy of theShape without coincident edges. + */ + GEOM_Object MakeGlueEdges (in GEOM_Object theShape, in double theTolerance); + + /*! + * Find coincident edges in theShape for possible gluing. + * \param theShape Initial shape. + * \param theTolerance Maximum distance between edges, which can be considered as coincident. + * \return ListOfGO + */ + ListOfGO GetGlueEdges (in GEOM_Object theShape, in double theTolerance); + + /*! + * Replace coincident edges in theShape by one edge + * in compliance with given list of edges + * \param theShape Initial shape. + * \param theTolerance Maximum distance between edges, which can be considered as coincident. + * \param theFaces List of edges for gluing. + * \return New GEOM_Object, containing a copy of theShape without some edges. + */ + GEOM_Object MakeGlueEdgesByList (in GEOM_Object theShape, + in double theTolerance, + in ListOfGO theEdges); + + /*! + * Get all sub-shapes and groups of \a theShape, + * that were created already by any other methods. + * \param theShape Any shape. + * \param theGroupsOnly If this parameter is TRUE, only groups will be + * returned, else all found sub-shapes and groups. + * \return List of existing sub-objects of \a theShape. + */ + ListOfGO GetExistingSubObjects (in GEOM_Object theShape, + in boolean theGroupsOnly); + + /*! + * Deprecated method. Use MakeAllSubShapes() instead. + */ + ListOfGO MakeExplode (in GEOM_Object theShape, + in long theShapeType, + in boolean isSorted); + + /*! + * Explode a shape on subshapes of a given type. If the + * shape itself has the given type, it is also returned. * \param theShape Shape to be exploded. * \param theShapeType Type of sub-shapes to be retrieved. * \param isSorted If this parameter is TRUE, sub-shapes will be * sorted by coordinates of their gravity centers. * \return List of sub-shapes of type theShapeType, contained in theShape. */ - ListOfGO MakeExplode (in GEOM_Object theShape, - in long theShapeType, - in boolean isSorted); + ListOfGO MakeAllSubShapes (in GEOM_Object theShape, + in long theShapeType, + in boolean isSorted); + + /*! + * Extract all subshapes of the given type from + * the given shape, excluding the shape itself. + * \param theShape Shape to be exploded. + * \param theShapeType Type of sub-shapes to be retrieved. + * \param isSorted If this parameter is TRUE, sub-shapes will be + * sorted by coordinates of their gravity centers. + * \return List of sub-shapes of type theShapeType, contained in theShape. + */ + ListOfGO ExtractSubShapes (in GEOM_Object theShape, + in long theShapeType, + in boolean isSorted); + + /*! + * Deprecated method. Use GetAllSubShapesIDs() instead. + */ + ListOfLong SubShapeAllIDs (in GEOM_Object theShape, + in long theShapeType, + in boolean isSorted); /*! * Explode a shape on subshapes of a given type. - * Does the same, as the above method, but returns IDs of sub-shapes, - * not GEOM_Objects. It works faster. + * Does the same, as MakeAllSubShapes, but returns IDs of + * sub-shapes, not GEOM_Objects. It works faster. * \param theShape Shape to be exploded. * \param theShapeType Type of sub-shapes to be retrieved. * \param isSorted If this parameter is TRUE, sub-shapes will be * sorted by coordinates of their gravity centers. * \return List of IDs of sub-shapes of type theShapeType, contained in theShape. */ - ListOfLong SubShapeAllIDs (in GEOM_Object theShape, - in long theShapeType, - in boolean isSorted); + ListOfLong GetAllSubShapesIDs (in GEOM_Object theShape, + in long theShapeType, + in boolean isSorted); + + /*! + * Get a sub shape defined by its unique ID inside \a theMainShape + * \param theMainShape Main shape. + * \param theID Unique ID of sub shape inside \a theMainShape. + * \return GEOM_Object, corresponding to found sub shape. + * \note The sub shape GEOM_Objects can has ONLY ONE function. + * Don't try to apply modification operations (without copy) on them. + */ + GEOM_Object GetSubShape (in GEOM_Object theMainShape, + in long theID); + + /*! + * Get a set of sub shapes defined by their unique IDs inside \a theMainShape + * \param theMainShape Main shape. + * \param theIndices List of unique IDs of sub shapes inside \a theMainShape. + * \return List of GEOM_Objects, corresponding to found sub shapes. + * \note The sub shape GEOM_Objects can has ONLY ONE function. + * Don't try to apply modification operations (without copy) on them. + */ + ListOfGO MakeSubShapes (in GEOM_Object theMainShape, + in ListOfLong theIndices); + + /*! + * Get global index of \a theSubShape in \a theMainShape. + * \param theMainShape Main shape. + * \param theSubShape Sub-shape of the main shape. + * \return global index of \a theSubShape in \a theMainShape. + */ + long GetSubShapeIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape); /*! - * Get a sub shape defined by its unique ID inside \a theMainShape - * \note The sub shape GEOM_Objects can has ONLY ONE function. - * Don't try to apply modification operations on them. + * Get index of \a theSubShape in \a theMainShape, unique among sub-shapes of the same type. + * Together with method GetShapeTypeString() it can be used + * to generate automatic names for sub-shapes, when publishing them in a study. + * \param theMainShape Main shape. + * \param theSubShape Sub-shape of the main shape. + * \return index of \a theSubShape in a list of all sub-shapes of \a theMainShape of the same type. */ - GEOM_Object GetSubShape (in GEOM_Object theMainShape, - in long theID); + long GetTopologyIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape); + + /*! + * \brief Get name of type of \a theShape. + * + * Use wide type notation, taking into consideration both topology and geometry of the shape. + * Together with method GetTopologyIndex() it can be used + * to generate automatic names for sub-shapes, when publishing them in a study. + * \param theShape The shape to get a type of. + * \return String, containing a type name of \a theShape. + */ + string GetShapeTypeString (in GEOM_Object theShape); /*! * Count number of faces in the given shape. @@ -888,6 +1676,15 @@ module GEOM */ long NumberOfEdges (in GEOM_Object theShape); + /*! + * Count number of subshapes of type \a theShapeType in the given shape. + * \param theShape Shape to count subshapes in. + * \param theShapeType The type of subshapes to count. + * \return Number of subshapes of type \a theShapeType in \a theShape. + */ + long NumberOfSubShapes (in GEOM_Object theShape, + in long theShapeType); + /*! * Reverses an orientation the given shape. * \param theShape Shape to be reversed. @@ -911,8 +1708,17 @@ module GEOM * \return List of sub-shapes of theShape1, shared with theShape2. */ ListOfGO GetSharedShapes (in GEOM_Object theShape1, - in GEOM_Object theShape2, - in long theShapeType); + in GEOM_Object theShape2, + in long theShapeType); + + /*! + * Get all sub-shapes, shared by all shapes in the list \a theShapes. + * \param theShapes Shapes to find common sub-shapes of. + * \param theShapeType Type of sub-shapes to be retrieved. + * \return List of objects, that are sub-shapes of all given shapes. + */ + ListOfGO GetSharedShapesMulti (in ListOfGO theShapes, + in long theShapeType); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -925,9 +1731,27 @@ module GEOM * \return List of all found sub-shapes. */ ListOfGO GetShapesOnPlane (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theAx1, - in shape_state theState); + in long theShapeType, + in GEOM_Object theAx1, + in shape_state theState); + /*! + * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively + * the specified plane by the certain way, defined through \a theState parameter. + * \param theShape Shape to find sub-shapes of. + * \param theShapeType Type of sub-shapes to be retrieved. + * \param theAx1 Vector (or line, or linear edge), specifying normal + * direction of the plane to find shapes on. + * \param thePnt Point specifying location of the plane to find shapes on. + * \param theState The state of the subshapes to find. + * \return List of all found sub-shapes. + */ + ListOfGO GetShapesOnPlaneWithLocation (in GEOM_Object theShape, + in long theShapeType, + in GEOM_Object theAx1, + in GEOM_Object thePnt, + in shape_state theState); + + /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -941,10 +1765,29 @@ module GEOM * \return List of all found sub-shapes. */ ListOfGO GetShapesOnCylinder (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theAxis, - in double theRadius, - in shape_state theState); + in long theShapeType, + in GEOM_Object theAxis, + in double theRadius, + in shape_state theState); + + /*! + * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively + * the specified cylinder by the certain way, defined through \a theState parameter. + * \param theShape Shape to find sub-shapes of. + * \param theShapeType Type of sub-shapes to be retrieved. + * \param theAxis Vector (or line, or linear edge), specifying + * axis of the cylinder to find shapes on. + * \param thePnt Point specifying location of the bottom of the cylinder. + * \param theRadius Radius of the cylinder to find shapes on. + * \param theState The state of the subshapes to find. + * \return List of all found sub-shapes. + */ + ListOfGO GetShapesOnCylinderWithLocation (in GEOM_Object theShape, + in long theShapeType, + in GEOM_Object theAxis, + in GEOM_Object thePnt, + in double theRadius, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -957,10 +1800,30 @@ module GEOM * \return List of all found sub-shapes. */ ListOfGO GetShapesOnSphere (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theCenter, - in double theRadius, - in shape_state theState); + in long theShapeType, + in GEOM_Object theCenter, + in double theRadius, + in shape_state theState); + + /*! + * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively + * the specified quadrangle by the certain way, defined through \a theState parameter. + * \param theShape Shape to find sub-shapes of. + * \param theShapeType Type of sub-shapes to be retrieved. + * \param theTopLeftPoint Top left quadrangle corner + * \param theTopRigthPoint Top right quadrangle corner + * \param theBottomLeftPoint Bottom left quadrangle corner + * \param theBottomRigthPoint Bottom right quadrangle corner + * \param theState The state of the subshapes to find. + * \return List of all found sub-shapes. + */ + ListOfGO GetShapesOnQuadrangle (in GEOM_Object theShape, + in long theShapeType, + in GEOM_Object theTopLeftPoint, + in GEOM_Object theTopRigthPoint, + in GEOM_Object theBottomLeftPoint, + in GEOM_Object theBottomRigthPoint, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -973,9 +1836,26 @@ module GEOM * \return List of IDs of all found sub-shapes. */ ListOfLong GetShapesOnPlaneIDs (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theAx1, - in shape_state theState); + in long theShapeType, + in GEOM_Object theAx1, + in shape_state theState); + + /*! + * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively + * the specified plane by the certain way, defined through \a theState parameter. + * \param theShape Shape to find sub-shapes of. + * \param theShapeType Type of sub-shapes to be retrieved. + * \param theAx1 Vector (or line, or linear edge), specifying normal + * direction of the plane to find shapes on. + * \param thePnt Point specifying location of the plane to find shapes on. + * \param theState The state of the subshapes to find. + * \return List of IDs of all found sub-shapes. + */ + ListOfLong GetShapesOnPlaneWithLocationIDs (in GEOM_Object theShape, + in long theShapeType, + in GEOM_Object theAx1, + in GEOM_Object thePnt, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -989,10 +1869,29 @@ module GEOM * \return List of IDs of all found sub-shapes. */ ListOfLong GetShapesOnCylinderIDs (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theAxis, - in double theRadius, - in shape_state theState); + in long theShapeType, + in GEOM_Object theAxis, + in double theRadius, + in shape_state theState); + + /*! + * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively + * the specified cylinder by the certain way, defined through \a theState parameter. + * \param theShape Shape to find sub-shapes of. + * \param theShapeType Type of sub-shapes to be retrieved. + * \param theAxis Vector (or line, or linear edge), specifying + * axis of the cylinder to find shapes on. + * \param thePnt Point specifying location of the bottom of the cylinder. + * \param theRadius Radius of the cylinder to find shapes on. + * \param theState The state of the subshapes to find. + * \return List of IDs all found sub-shapes. + */ + ListOfLong GetShapesOnCylinderWithLocationIDs (in GEOM_Object theShape, + in long theShapeType, + in GEOM_Object theAxis, + in GEOM_Object thePnt, + in double theRadius, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -1005,20 +1904,132 @@ module GEOM * \return List of IDs of all found sub-shapes. */ ListOfLong GetShapesOnSphereIDs (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theCenter, - in double theRadius, - in shape_state theState); + in long theShapeType, + in GEOM_Object theCenter, + in double theRadius, + in shape_state theState); /*! - * Get sub-shape(s) of theShapeWhere, which are + * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively + * the specified quadrangle by the certain way, defined through \a theState parameter. + * \param theShape Shape to find sub-shapes of. + * \param theShapeType Type of sub-shapes to be retrieved. + * \param theTopLeftPoint Top left quadrangle corner + * \param theTopRigthPoint Top right quadrangle corner + * \param theBottomLeftPoint Bottom left quadrangle corner + * \param theBottomRigthPoint Bottom right quadrangle corner + * \param theState The state of the subshapes to find. + * \return List of IDs of all found sub-shapes. + */ + ListOfLong GetShapesOnQuadrangleIDs (in GEOM_Object theShape, + in long theShapeType, + in GEOM_Object theTopLeftPoint, + in GEOM_Object theTopRigthPoint, + in GEOM_Object theBottomLeftPoint, + in GEOM_Object theBottomRigthPoint, + in shape_state theState); + + /*! + * \brief Find subshapes complying with given status + * \param theBox - the box to check state of subshapes against + * \param theShape - the shape to explore + * \param theShapeType - type of subshape of theShape + * \param theState - required state + * \return List of IDs of all found sub-shapes. + */ + ListOfLong GetShapesOnBoxIDs (in GEOM_Object theBox, + in GEOM_Object theShape, + in long theShapeType, + in shape_state theState); + + /*! + * \brief Find subshapes complying with given status + * \param theBox - the box to check state of subshapes against + * \param theShape - the shape to explore + * \param theShapeType - type of subshape of theShape + * \param theState - required state + * \return List of all found sub-shapes. + */ + ListOfGO GetShapesOnBox (in GEOM_Object theBox, + in GEOM_Object theShape, + in long theShapeType, + in shape_state theState); + + /*! + * \brief Find subshapes complying with given status + * \param theCheckShape - the shape to check state of subshapes against. It must be a solid. + * \param theShape - the shape to explore + * \param theShapeType - type of subshape of theShape + * \param theState - required state + * \return List of IDs of all found sub-shapes. + */ + ListOfLong GetShapesOnShapeIDs (in GEOM_Object theCheckShape, + in GEOM_Object theShape, + in short theShapeType, + in shape_state theState); + + /*! + * \brief Find subshapes complying with given status + * \param theCheckShape - the shape to check state of subshapes against. It must be a solid. + * \param theShape - the shape to explore + * \param theShapeType - type of subshape of theShape + * \param theState - required state + * \return List of all found sub-shapes. + */ + ListOfGO GetShapesOnShape (in GEOM_Object theCheckShape, + in GEOM_Object theShape, + in short theShapeType, + in shape_state theState); + + /*! + * \brief Find subshapes complying with given status + * \param theCheckShape - the shape to check state of subshapes against. It must be a solid. + * \param theShape - the shape to explore + * \param theShapeType - type of subshape of theShape + * \param theState - required state + * \return compound includes all found sub-shapes. + */ + GEOM_Object GetShapesOnShapeAsCompound (in GEOM_Object theCheckShape, + in GEOM_Object theShape, + in short theShapeType, + in shape_state theState); + + /*! + * Get sub-shape(s) of \a 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. * \return Group of all found sub-shapes or a single found sub-shape. */ GEOM_Object GetInPlace (in GEOM_Object theShapeWhere, - in GEOM_Object theShapeWhat); + in GEOM_Object theShapeWhat); + + /*! + * Get sub-shape(s) of \a theShapeWhere, which are + * coincident with \a theShapeWhat or could be a part of it. + * + * Implementation of this method is based on a saved history of an operation, + * produced \a theShapeWhere. The \a theShapeWhat must be among this operation's + * arguments (an argument shape or a sub-shape of an argument shape). + * The operation could be the Partition or one of boolean operations, + * performed on simple shapes (not on compounds). + * + * \param theShapeWhere Shape to find sub-shapes of. + * \param theShapeWhat Shape, specifying what to find. + * \return Group of all found sub-shapes or a single found sub-shape. + */ + GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere, + in GEOM_Object theShapeWhat); + + /*! + * Get sub-shape of theShapeWhere, which are + * coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX. + * \param theShapeWhere Shape to find sub-shapes of. + * \param theShapeWhat Shape, specifying what to find. + * \return found sub-shape. + */ + GEOM_Object GetSame (in GEOM_Object theShapeWhere, + in GEOM_Object theShapeWhat); }; /*! @@ -1039,9 +2050,9 @@ module GEOM * \return New GEOM_Object, containing the created face. */ GEOM_Object MakeQuad (in GEOM_Object theEdge1, - in GEOM_Object theEdge2, - in GEOM_Object theEdge3, - in GEOM_Object theEdge4); + in GEOM_Object theEdge2, + in GEOM_Object theEdge3, + in GEOM_Object theEdge4); /*! * Create a quadrangle face on two edges. @@ -1050,7 +2061,7 @@ module GEOM * \return New GEOM_Object, containing the created face. */ GEOM_Object MakeQuad2Edges (in GEOM_Object theEdge1, - in GEOM_Object theEdge2); + in GEOM_Object theEdge2); /*! * Create a quadrangle face with specified corners. @@ -1059,9 +2070,9 @@ module GEOM * \return New GEOM_Object, containing the created face. */ GEOM_Object MakeQuad4Vertices (in GEOM_Object thePnt1, - in GEOM_Object thePnt2, - in GEOM_Object thePnt3, - in GEOM_Object thePnt4); + in GEOM_Object thePnt2, + in GEOM_Object thePnt3, + in GEOM_Object thePnt4); /*! * Create a hexahedral solid, bounded by the six given faces. Order of @@ -1070,11 +2081,11 @@ module GEOM * \return New GEOM_Object, containing the created solid. */ GEOM_Object MakeHexa (in GEOM_Object theFace1, - in GEOM_Object theFace2, - in GEOM_Object theFace3, - in GEOM_Object theFace4, - in GEOM_Object theFace5, - in GEOM_Object theFace6); + in GEOM_Object theFace2, + in GEOM_Object theFace3, + in GEOM_Object theFace4, + in GEOM_Object theFace5, + in GEOM_Object theFace6); /*! * Create a hexahedral solid between two given faces. @@ -1083,7 +2094,7 @@ module GEOM * \return New GEOM_Object, containing the created solid. */ GEOM_Object MakeHexa2Faces (in GEOM_Object theFace1, - in GEOM_Object theFace2); + in GEOM_Object theFace2); /*! * Extract elements of blocks and blocks compounds @@ -1098,10 +2109,19 @@ module GEOM * \return New GEOM_Object, containing the found vertex. */ GEOM_Object GetPoint (in GEOM_Object theShape, - in double theX, - in double theY, - in double theZ, - in double theEpsilon); + in double theX, + in double theY, + in double theZ, + in double theEpsilon); + + /*! + * Find a vertex of the given shape, which has minimal distance to the given point. + * \param theShape Any shape. + * \param thePoint Point, close to the desired vertex. + * \return New GEOM_Object, containing the found vertex. + */ + GEOM_Object GetVertexNearPoint (in GEOM_Object theShape, + in GEOM_Object thePoint); /*! * Get an edge, found in the given shape by two given vertices. @@ -1110,8 +2130,8 @@ module GEOM * \return New GEOM_Object, containing the found edge. */ GEOM_Object GetEdge (in GEOM_Object theShape, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2); + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); /*! * Find an edge of the given shape, which has minimal distance to the given point. @@ -1120,7 +2140,7 @@ module GEOM * \return New GEOM_Object, containing the found edge. */ GEOM_Object GetEdgeNearPoint (in GEOM_Object theShape, - in GEOM_Object thePoint); + in GEOM_Object thePoint); /*! * Returns a face, found in the given shape by four given corner vertices. @@ -1129,10 +2149,10 @@ module GEOM * \return New GEOM_Object, containing the found face. */ GEOM_Object GetFaceByPoints (in GEOM_Object theShape, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2, - in GEOM_Object thePoint3, - in GEOM_Object thePoint4); + in GEOM_Object thePoint1, + in GEOM_Object thePoint2, + in GEOM_Object thePoint3, + in GEOM_Object thePoint4); /*! * Get a face of block, found in the given shape by two given edges. @@ -1141,8 +2161,8 @@ module GEOM * \return New GEOM_Object, containing the found face. */ GEOM_Object GetFaceByEdges (in GEOM_Object theShape, - in GEOM_Object theEdge1, - in GEOM_Object theEdge2); + in GEOM_Object theEdge1, + in GEOM_Object theEdge2); /*! * Find a face, opposite to the given one in the given block. @@ -1151,7 +2171,7 @@ module GEOM * \return New GEOM_Object, containing the found face. */ GEOM_Object GetOppositeFace (in GEOM_Object theBlock, - in GEOM_Object theFace); + in GEOM_Object theFace); /*! * Find a face of the given shape, which has minimal distance to the given point. @@ -1160,7 +2180,7 @@ module GEOM * \return New GEOM_Object, containing the found face. */ GEOM_Object GetFaceNearPoint (in GEOM_Object theShape, - in GEOM_Object thePoint); + in GEOM_Object thePoint); /*! * Find a face of block, whose outside normale has minimal angle with the given vector. @@ -1169,7 +2189,23 @@ module GEOM * \return New GEOM_Object, containing the found face. */ GEOM_Object GetFaceByNormale (in GEOM_Object theBlock, - in GEOM_Object theVector); + in GEOM_Object theVector); + + /*! + * Find all subshapes of type \a theShapeType of the given shape, + * which have minimal distance to the given point. + * \param theShape Any shape. + * \param thePoint Point, close to the desired shape. + * \param theShapeType Defines what kind of subshapes is searched. + * \param theTolerance The tolerance for distances comparison. All shapes + * with distances to the given point in interval + * [minimal_distance, minimal_distance + theTolerance] will be gathered. + * \return New GEOM_Object, containing a group of all found shapes. + */ + GEOM_Object GetShapesNearPoint (in GEOM_Object theShape, + in GEOM_Object thePoint, + in long theShapeType, + in double theTolerance); /*! * Extract blocks from blocks compounds @@ -1185,9 +2221,9 @@ module GEOM * \return theNbBlocks Number of specified blocks in theCompound. */ boolean IsCompoundOfBlocks (in GEOM_Object theCompound, - in long theMinNbFaces, - in long theMaxNbFaces, - out long theNbBlocks); + in long theMinNbFaces, + in long theMaxNbFaces, + out long theNbBlocks); /*! * Enumeration of Blocks Compound defects. @@ -1238,7 +2274,7 @@ module GEOM * \return theErrors Structure, containing discovered errors and incriminated sub-shapes. */ boolean CheckCompoundOfBlocks (in GEOM_Object theCompound, - out BCErrors theErrors); + out BCErrors theErrors); /*! * Convert sequence of Blocks Compound errors, returned by @@ -1248,15 +2284,20 @@ module GEOM * \return String, describing all the errors in form, suitable for printing. */ string PrintBCErrors (in GEOM_Object theCompound, - in BCErrors theErrors); + in BCErrors theErrors); /*! * Remove all seam and degenerated edges from \a theShape. * Unite faces and edges, sharing one surface. * \param theShape The compound or single solid to remove irregular edges from. + * \param theOptimumNbFaces If more than zero, unite faces only for those solids, + * that have more than theOptimumNbFaces faces. If zero, unite faces always, + * regardsless their quantity in the solid. If negative, do not unite faces at all. + * For blocks repairing recommended value is 6. * \return Improved shape. */ - GEOM_Object RemoveExtraEdges (in GEOM_Object theShape); + GEOM_Object RemoveExtraEdges (in GEOM_Object theShape, + in long theOptimumNbFaces); /*! * Check, if the given shape is a blocks compound. @@ -1276,8 +2317,8 @@ module GEOM * \return List of GEOM_Objects, containing the retrieved blocks. */ ListOfGO ExplodeCompoundOfBlocks (in GEOM_Object theCompound, - in long theMinNbFaces, - in long theMaxNbFaces); + in long theMinNbFaces, + in long theMaxNbFaces); /*! * Find block, containing the given point inside its volume or on boundary. @@ -1287,7 +2328,7 @@ module GEOM * \return New GEOM_Object, containing the found block. */ GEOM_Object GetBlockNearPoint (in GEOM_Object theCompound, - in GEOM_Object thePoint); + in GEOM_Object thePoint); /*! * Find block, containing all the elements, passed as the parts, or maximum quantity of them. @@ -1296,7 +2337,7 @@ module GEOM * \return New GEOM_Object, containing the found block. */ GEOM_Object GetBlockByParts (in GEOM_Object theCompound, - in ListOfGO theParts); + in ListOfGO theParts); /*! * Return all blocks, containing all the elements, passed as the parts. @@ -1305,7 +2346,7 @@ module GEOM * \return List of GEOM_Objects, containing the found blocks. */ ListOfGO GetBlocksByParts (in GEOM_Object theCompound, - in ListOfGO theParts); + in ListOfGO theParts); /*! * Operations on blocks with gluing of result @@ -1319,13 +2360,13 @@ module GEOM * \param theDirFace2 Second direction face global index. * \param theNbTimes Quantity of transformations to be done. * \note Global index of sub-shape can be obtained, using method - * GEOM_ILocalOperations.GetSubShapeIndex(). + * GEOM_IShapesOperations.GetSubShapeIndex(). * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeMultiTransformation1D (in GEOM_Object theBlock, - in long theDirFace1, - in long theDirFace2, - in long theNbTimes); + in long theDirFace1, + in long theDirFace2, + in long theNbTimes); /*! * Multi-transformate block and glue the result. @@ -1336,12 +2377,12 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeMultiTransformation2D (in GEOM_Object theBlock, - in long theDirFace1U, - in long theDirFace2U, - in long theNbTimesU, - in long theDirFace1V, - in long theDirFace2V, - in long theNbTimesV); + in long theDirFace1U, + in long theDirFace2U, + in long theNbTimesU, + in long theDirFace1V, + in long theDirFace2V, + in long theNbTimesV); /*! * Special operation - propagation @@ -1372,29 +2413,64 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeBoolean (in GEOM_Object theShape1, - in GEOM_Object theShape2, - in long theOperation); + in GEOM_Object theShape2, + in long theOperation); /*! * Perform partition operation. * \param theShapes Shapes to be intersected. * \param theTools Shapes to intersect theShapes. + * \note Each compound from ListShapes and ListTools will be exploded in order + * to avoid possible intersection between shapes from this compound. + * \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum). + * \param KeepNonlimitShapes: if this parameter == 0, then only shapes of + * target type (equal to Limit) are kept in the result, + * else standalone shapes of lower dimension + * are kept also (if they exist). + * + * After implementation new version of PartitionAlgo (October 2006) + * other parameters are ignored by current functionality. They are kept + * in this function only for supporting old versions. + * Ignored parameters: * \param theKeepInside Shapes, outside which the results will be deleted. * Each shape from theKeepInside must belong to theShapes also. * \param theRemoveInside Shapes, inside which the results will be deleted. * Each shape from theRemoveInside must belong to theShapes also. - * \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum). * \param theRemoveWebs If TRUE, perform Glue 3D algorithm. * \param theMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE. + * * \return New GEOM_Object, containing the result shapes. */ GEOM_Object MakePartition (in ListOfGO theShapes, - in ListOfGO theTools, - in ListOfGO theKeepInside, - in ListOfGO theRemoveInside, - in short theLimit, - in boolean theRemoveWebs, - in ListOfLong theMaterials); + in ListOfGO theTools, + in ListOfGO theKeepInside, + in ListOfGO theRemoveInside, + in short theLimit, + in boolean theRemoveWebs, + in ListOfLong theMaterials, + in short theKeepNonlimitShapes); + + /*! + * Perform partition operation. + * This method may be usefull if it is needed to make a partition for + * a compound containing nonintersected shapes. Performance will be better + * since intersection between shapes from compound is not performed. + * + * Description of all parameters as in previous method MakePartition() + * + * \note Passed compounds (via ListShapes or via ListTools) + * have to consist of nonintersecting shapes. + * + * \return New GEOM_Object, containing the result shapes. + */ + GEOM_Object MakePartitionNonSelfIntersectedShape (in ListOfGO theShapes, + in ListOfGO theTools, + in ListOfGO theKeepInside, + in ListOfGO theRemoveInside, + in short theLimit, + in boolean theRemoveWebs, + in ListOfLong theMaterials, + in short theKeepNonlimitShapes); /*! * Perform partition of the Shape with the Plane @@ -1403,7 +2479,7 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeHalfPartition (in GEOM_Object theShape, - in GEOM_Object thePlane); + in GEOM_Object thePlane); }; /*! @@ -1420,17 +2496,25 @@ module GEOM * \return New GEOM_Object, containing the created circle. */ GEOM_Object MakeCirclePntVecR (in GEOM_Object thePnt, - in GEOM_Object theVec, - in double theR); + in GEOM_Object theVec, + in double theR); /*! * Create a circle, passing through three given points * \param thePnt1,thePnt2,thePnt3 Points, defining the circle. * \return New GEOM_Object, containing the created circle. */ GEOM_Object MakeCircleThreePnt (in GEOM_Object thePnt1, - in GEOM_Object thePnt2, - in GEOM_Object thePnt3); - + in GEOM_Object thePnt2, + in GEOM_Object thePnt3); + /*! + * Create a circle with given center, with a radius equals the distance from center to Point1 + * and on a plane defined by all of three points. + * \param thePnt1,thePnt2,thePnt3 Points, defining the circle. + * \return New GEOM_Object, containing the created circle. + */ + GEOM_Object MakeCircleCenter2Pnt (in GEOM_Object thePnt1, + in GEOM_Object thePnt2, + in GEOM_Object thePnt3); /*! * Create an ellipse with given center, normal vector and radiuses. * \param thePnt Ellipse center. @@ -1440,9 +2524,24 @@ module GEOM * \return New GEOM_Object, containing the created ellipse. */ GEOM_Object MakeEllipse (in GEOM_Object thePnt, - in GEOM_Object theVec, - in double theRMajor, - in double theRMinor); + in GEOM_Object theVec, + in double theRMajor, + in double theRMinor); + + /*! + * Create an ellipse with given center, normal vector, main axis vector and radiuses. + * \param thePnt Ellipse center. + * \param theVec Vector, normal to the plane of the ellipse. + * \param theRMajor Major ellipse radius. + * \param theRMinor Minor ellipse radius. + * \param theVecMaj Vector, direction of the ellipse's main axis. + * \return New GEOM_Object, containing the created ellipse. + */ + GEOM_Object MakeEllipseVec (in GEOM_Object thePnt, + in GEOM_Object theVec, + in double theRMajor, + in double theRMinor, + in GEOM_Object theVecMaj); /*! * Create an arc of circle, passing through three given points. @@ -1452,29 +2551,83 @@ module GEOM * \return New GEOM_Object, containing the created arc. */ GEOM_Object MakeArc (in GEOM_Object thePnt1, - in GEOM_Object thePnt2, - in GEOM_Object thePnt3); + in GEOM_Object thePnt2, + in GEOM_Object thePnt3); + + /*! + * Create an arc of circle of center C from one point to another + * \param theCenter Center point of the arc. + * \param thePnt1 Start point of the arc. + * \param thePnt2 End point of the arc. + * \param theSense Orientation of the arc + * \return New GEOM_Object, containing the created arc. + */ + GEOM_Object MakeArcCenter (in GEOM_Object theCenter, + in GEOM_Object thePnt1, + in GEOM_Object thePnt2, + in boolean theSense); + + /*! + * Create an arc of ellipse of center C and two points P1 P2. + * \param theCenter Center point of the arc. + * \param thePnt1 Major radius is distance from center to Pnt1. + * \param thePnt2 define a plane and Minor radius as a shortest + * distance from Pnt2 to vector Center->Pnt1. + * \return New GEOM_Object, containing the created arc. + */ + GEOM_Object MakeArcOfEllipse (in GEOM_Object theCenter, + in GEOM_Object thePnt1, + in GEOM_Object thePnt2); + /*! * Create a polyline on the set of points. * \param thePoints Sequence of points for the polyline. + * \param theIsClosed If TRUE, build a closed wire. * \return New GEOM_Object, containing the created polyline. */ - GEOM_Object MakePolyline (in ListOfGO thePoints); + GEOM_Object MakePolyline (in ListOfGO thePoints, + in boolean theIsClosed); /*! * Create bezier curve on the set of points. * \param thePoints Sequence of points for the bezier curve. + * \param theIsClosed If TRUE, build a closed curve. * \return New GEOM_Object, containing the created bezier curve. */ - GEOM_Object MakeSplineBezier (in ListOfGO thePoints); + GEOM_Object MakeSplineBezier (in ListOfGO thePoints, + in boolean theIsClosed); /*! * Create B-Spline curve on the set of points. * \param thePoints Sequence of points for the B-Spline curve. + * \param theIsClosed If TRUE, build a closed curve. + * \param theDoReordering If TRUE, the algo does not follow the order of + * \a thePoints but searches for the closest vertex. * \return New GEOM_Object, containing the created B-Spline curve. */ - GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints); + GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints, + in boolean theIsClosed, + in boolean theDoReordering); + + /*! + * Creates a curve using the parametric definition of the basic points. + * \param thexExpr parametric equation of the coordinates X. + * \param theyExpr parametric equation of the coordinates Y. + * \param thezExpr parametric equation of the coordinates Z. + * \param theParamMin the minimal value of the parameter. + * \param theParamMax the maximum value of the parameter. + * \param theParamStep the step of the parameter. + * \param theCurveType the type of the curve. + * \return New GEOM_Object, containing the created curve. + */ + GEOM_Object MakeCurveParametric(in string thexExpr, + in string theyExpr, + in string thezExpr, + in double theParamMin, + in double theParamMax, + in double theParamStep, + in curve_type theCurveType); /*! * Create a sketcher (wire or face), following the textual description, @@ -1511,6 +2664,27 @@ module GEOM * \return New GEOM_Object, containing the created wire. */ GEOM_Object MakeSketcher (in string theCommand, in ListOfDouble theWorkingPlane); + + /*! + * Create a 3D sketcher, following the numerical description, + * passed through points created by \a theCoordinates argument. \n + * Format of the description string have to be the following: + * + * "Make3DSketcher[x1, y1, z1, x2, y2, z2, ..., xN, yN, zN]" + */ + + GEOM_Object Make3DSketcher (in ListOfDouble theCoordinates); + + /*! + * Create a sketcher (wire or face), following the textual description, + * passed through \a theCommand argument. \n + * For format of the description string see the previous method.\n + * \param theCommand String, defining the sketcher in local + * coordinates of the working plane. + * \param theWorkingPlane Planar Face or LCS(Marker) of the working plane. + * \return New GEOM_Object, containing the created wire. + */ + GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane); }; /*! @@ -1525,31 +2699,70 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeFilletAll (in GEOM_Object theShape, - in double theR); + in double theR); /*! * Perform a fillet on the specified edges of the given shape * \param theShape Shape, to perform fillet on. * \param theR Fillet radius. * \param theEdges Global indices of edges to perform fillet on. - * \note Global index of sub-shape can be obtained, using method GetSubShapeIndex(). + * \note Global index of sub-shape can be obtained, using method + * GEOM_IShapesOperations.GetSubShapeIndex(). * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeFilletEdges (in GEOM_Object theShape, - in double theR, - in ListOfLong theEdges); + in double theR, + in ListOfLong theEdges); + GEOM_Object MakeFilletEdgesR1R2 (in GEOM_Object theShape, + in double theR1, + in double theR2, + in ListOfLong theEdges); /*! * Perform a fillet on all edges of the specified faces of the given shape. * \param theShape Shape, to perform fillet on. * \param theR Fillet radius. * \param theFaces Global indices of faces to perform fillet on. - * \note Global index of sub-shape can be obtained, using method GetSubShapeIndex(). + * \note Global index of sub-shape can be obtained, using method + * GEOM_IShapesOperations.GetSubShapeIndex(). * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeFilletFaces (in GEOM_Object theShape, - in double theR, - in ListOfLong theFaces); + in double theR, + in ListOfLong theFaces); + + GEOM_Object MakeFilletFacesR1R2 (in GEOM_Object theShape, + in double theR1, + in double theR2, + in ListOfLong theFaces); + + /*! + * Perform a fillet on face of the specified vertexes of the given shape. + * \param theShape Shape, to perform fillet on. + * \param theR Fillet radius. + * \param theVertexes Global indices of vertexes to perform fillet on. + * \note Global index of sub-shape can be obtained, using method + * GEOM_IShapesOperations.GetSubShapeIndex(). + * \return New GEOM_Object, containing the result shape. + */ + GEOM_Object MakeFillet2D (in GEOM_Object theShape, + in double theR, + in ListOfLong theVertexes); + + /*! + * Perform a fillet on edges of the specified vertexes of the given wire. + * \param theShape Shape, to perform fillet on. + * \param theR Fillet radius. + * \param theVertexes Global indices of vertexes to perform fillet on. + * \note Global index of sub-shape can be obtained, using method + * GEOM_IShapesOperations.GetSubShapeIndex(). + * \note The list of vertices coudl be empty, in this case fillet fill be done + * at all vertices in given wire + * \return New GEOM_Object, containing the result shape. + */ + GEOM_Object MakeFillet1D (in GEOM_Object theShape, + in double theR, + in ListOfLong theVertexes); /*! * Perform a symmetric chamfer on all edges of the given shape. @@ -1558,7 +2771,7 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeChamferAll (in GEOM_Object theShape, - in double theD); + in double theD); /*! * Perform a chamfer on edges, common to the specified faces. @@ -1567,12 +2780,20 @@ module GEOM * \param theD1 Chamfer size along \a theFace1. * \param theD2 Chamfer size along \a theFace2. * \param theFace1,theFace2 Global indices of two faces of \a theShape. - * \note Global index of sub-shape can be obtained, using method GetSubShapeIndex(). + * \note Global index of sub-shape can be obtained, using method + * GEOM_IShapesOperations.GetSubShapeIndex(). * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeChamferEdge (in GEOM_Object theShape, - in double theD1, in double theD2, - in long theFace1, in long theFace2); + in double theD1, in double theD2, + in long theFace1, in long theFace2); + /*! + * The Same but with params theD = Chamfer Lenght + * and theAngle = Chamfer Angle (Angle in radians) + */ + GEOM_Object MakeChamferEdgeAD (in GEOM_Object theShape, + in double theD, in double theAngle, + in long theFace1, in long theFace2); /*! * Perform a chamfer on all edges of the specified faces. @@ -1583,12 +2804,39 @@ module GEOM * will be get along face, which is nearer to \a theFaces beginning. * \param theD2 Chamfer size along another of two faces, connected to the edge. * \param theFaces Sequence of global indices of faces of \a theShape. - * \note Global index of sub-shape can be obtained, using method GetSubShapeIndex(). + * \note Global index of sub-shape can be obtained, using method + * GEOM_IShapesOperations.GetSubShapeIndex(). * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeChamferFaces (in GEOM_Object theShape, - in double theD1, in double theD2, - in ListOfLong theFaces); + in double theD1, in double theD2, + in ListOfLong theFaces); + /*! + * The Same but with params theD = Chamfer Lenght + * and theAngle = Chamfer Angle (Angle in radians) + */ + GEOM_Object MakeChamferFacesAD (in GEOM_Object theShape, + in double theD, in double theAngle, + in ListOfLong theFaces); + + /*! + * Perform a chamfer on edges, + * with distance D1 on the first specified face (if several for one edge) + * \param theShape Shape, to perform chamfer on. + * \param theD1 theD2 Chamfer size + * \param theEdges Sequence of edges of \a theShape. + * \return New GEOM_Object, containing the result shape. + */ + GEOM_Object MakeChamferEdges (in GEOM_Object theShape, + in double theD1, in double theD2, + in ListOfLong theEdges); + /*! + * The Same but with params theD = Chamfer Lenght + * and theAngle = Chamfer Angle (Angle in radians) + */ + GEOM_Object MakeChamferEdgesAD (in GEOM_Object theShape, + in double theD, in double theAngle, + in ListOfLong theEdges); /*! * Perform an Archimde operation on the given shape with given parameters. @@ -1601,15 +2849,13 @@ module GEOM * by a plane, corresponding to water level. */ GEOM_Object MakeArchimede (in GEOM_Object theShape, - in double theWeight, - in double theWaterDensity, - in double theMeshDeflection); + in double theWeight, + in double theWaterDensity, + in double theMeshDeflection); /*! - * Get global index of \a theSubShape in \a theShape. - * \param theShape Main shape. - * \param theSubShape Sub-shape of the main shape. - * \return global index of \a theSubShape in \a theShape. + * Duplicates GEOM_IShapesOperations.GetSubShapeIndex(). + * Present here only for compatibility. */ long GetSubShapeIndex (in GEOM_Object theShape, in GEOM_Object theSubShape); }; @@ -1631,9 +2877,9 @@ module GEOM * \return New GEOM_Object, containing processed shape. */ GEOM_Object ProcessShape (in GEOM_Object theShapes, - in string_array theOperators, - in string_array theParameters, - in string_array theValues); + in string_array theOperators, + in string_array theParameters, + in string_array theValues); /*! * Get default sequence of operators, their parameters and parameters' values @@ -1645,8 +2891,8 @@ module GEOM * as parameters are listed in \a theParameters list. */ void GetShapeProcessParameters (out string_array theOperators, - out string_array theParameters, - out string_array theValues); + out string_array theParameters, + out string_array theValues); /*! * Get parameters and parameters' values for the given Shape Process operation. * In the current implementation the defaults are @@ -1657,8 +2903,8 @@ module GEOM * as parameters are listed in \a theParameters list. */ void GetOperatorParameters (in string theOperator, - out string_array theParameters, - out string_array theValues); + out string_array theParameters, + out string_array theValues); /*! * Remove faces from the given object (shape). @@ -1679,7 +2925,7 @@ module GEOM * \return New GEOM_Object, containing processed shape. */ GEOM_Object CloseContour (in GEOM_Object theObject, in short_array theWires, - in boolean isCommonVertex); + in boolean isCommonVertex); /*! * Remove internal wires and edges from the given object (face). @@ -1719,7 +2965,7 @@ module GEOM * \return New GEOM_Object, containing processed shape. */ GEOM_Object DivideEdge (in GEOM_Object theObject, in short theEdgeIndex, - in double theValue, in boolean isByParameter); + in double theValue, in boolean isByParameter); /*! * Get a list of wires (wrapped in GEOM_Object-s), @@ -1730,8 +2976,25 @@ module GEOM * \return FALSE, if an error(s) occured during the method execution. */ boolean GetFreeBoundary (in GEOM_Object theObject, - out ListOfGO theClosedWires, - out ListOfGO theOpenWires); + out ListOfGO theClosedWires, + out ListOfGO theOpenWires); + + /*! + * Change orientation of the given object. + * \param theObject Shape to be processed. + * \return New GEOM_Object, containing processed shape. + */ + GEOM_Object ChangeOrientation (in GEOM_Object theObject); + GEOM_Object ChangeOrientationCopy (in GEOM_Object theObject); + + /*! + * Try to limit tolerance of the given object by value \a theTolerance. + * \param theObject Shape to be processed. + * \param theTolerance Required tolerance value. + * \return New GEOM_Object, containing processed shape. + */ + GEOM_Object LimitTolerance (in GEOM_Object theObject, in double theTolerance); + }; /*! @@ -1760,9 +3023,11 @@ module GEOM * \param theFileName The file, containing the shape. * \param theFormatName Specify format for the file reading. * Available formats can be obtained with ImportTranslators() method. + * If format 'IGES_SCALE' is used instead 'IGES' length unit will be + * set to 'meter' and result model will be scaled. * \return New GEOM_Object, containing the imported shape. */ - GEOM_Object Import (in string theFileName, in string theFormatName); + GEOM_Object ImportFile (in string theFileName, in string theFormatName); /*! * Get the supported import formats and corresponding patterns for File dialog. @@ -1771,7 +3036,7 @@ module GEOM * \return Returns available formats and patterns through the arguments. */ void ImportTranslators (out string_array theFormats, - out string_array thePatterns); + out string_array thePatterns); /*! * Get the supported export formats and corresponding patterns for File dialog. @@ -1780,9 +3045,88 @@ module GEOM * \return Returns available formats and patterns through the arguments. */ void ExportTranslators (out string_array theFormats, - out string_array thePatterns); + out string_array thePatterns); + + /*! + * Load texture from file + * \param theTextureFile texture file name + * \return unique texture identifier + */ + long LoadTexture(in string theTextureFile); + + /*! + * Add texture to the study + * \param theWidth texture width in pixels + * \param theHeight texture height in pixels + * \param theTexture texture byte array + * \return unique texture identifier + */ + long AddTexture(in long theWidth, in long theHeight, in SALOMEDS::TMPFile theTexture); + + /*! + * Get previously loaded texture data + * \param theID texture identifier + * \param theWidth texture width in pixels + * \param theHeight texture height in pixels + * \return texture byte array + */ + SALOMEDS::TMPFile GetTexture(in long theID, out long theWidth, out long theHeight); + + /*! + * Get list of all avaiable texture IDs + * \return list of all texture IDs avaiable for the current study + */ + ListOfLong GetAllTextures(); + }; + + /*! + * GEOM_IKindOfShape: namespace for shape_kind enumeration. + */ + interface GEOM_IKindOfShape + { + enum shape_kind { + NO_SHAPE, + // COMPOSITEs + COMPOUND, + COMPSOLID, + SHELL, + WIRE, + // SOLIDs + SPHERE, // full sphere + CYLINDER, // cylinder + BOX, // box with faces, parallel to global coordinate planes + ROTATED_BOX, // other box + TORUS, // full torus + CONE, // cone + POLYHEDRON, // solid, bounded by polygons + SOLID, // other solid + // FACEs + SPHERE2D, // spherical face (closed) + CYLINDER2D, // cylindrical face with defined height + TORUS2D, // toroidal face (closed) + CONE2D, // conical face with defined height + DISK_CIRCLE, // planar, bounded by circle + DISK_ELLIPSE, // planar, bounded by ellipse + POLYGON, // planar, bounded by segments + PLANE, // infinite planar + PLANAR, // other planar + FACE, // other face + // EDGEs + CIRCLE, // full circle + ARC_CIRCLE, // arc of circle + ELLIPSE, // full ellipse + ARC_ELLIPSE, // arc of ellipse + LINE, // infinite segment + SEGMENT, // segment + EDGE, // other edge + // VERTEX + VERTEX, + // ADVANCED shapes + ADVANCED // all advanced shapes (temporary implementation) + }; }; + /*! * GEOM_IMeasureOperations: Interface for measurement (distance, whatis) and * properties calculation (like Centre of Mass, Inertia, etc.). @@ -1790,6 +3134,37 @@ module GEOM */ interface GEOM_IMeasureOperations : GEOM_IOperations { + /*! + * Get kind of theShape. + * \param theShape Shape to get a kind of. + * \param theIntegers Output. Integer and enumerated shape's parameters + * (kind of surface, closed/unclosed, number of edges, etc.) + * \param theDoubles Output. Double shape's parameters (coordinates, dimensions, etc.) + * \note Concrete meaning of each value, returned via \a theIntegers + * or \a theDoubles list depends on the kind of the shape. + * \return Returns a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration. + */ + //short KindOfShape (in GEOM_Object theShape, + GEOM_IKindOfShape::shape_kind KindOfShape (in GEOM_Object theShape, + out ListOfLong theIntegers, + out ListOfDouble theDoubles); + + /*! + * Get position (LCS) of theShape. + * \param theShape Shape to calculate position of. + * \param Ox,Oy,Oz Output. Coordinates of shape's location origin. + * Origin of the LCS is situated at the shape's center of mass. + * \param Zx,Zy,Zz Output. Coordinates of shape's location normal(main) direction. + * \param Xx,Xy,Xz Output. Coordinates of shape's location X direction. + * Axes of the LCS are obtained from shape's location or, + * if the shape is a planar face, from position of its plane. + * \return Returns position of the shape through the last nine arguments. + */ + void GetPosition (in GEOM_Object theShape, + out double Ox, out double Oy, out double Oz, + out double Zx, out double Zy, out double Zz, + out double Xx, out double Xy, out double Xz); + /*! * Get summarized length of all wires, * area of surface and volume of the given shape. @@ -1800,9 +3175,9 @@ module GEOM * \return Returns shape properties through the last three arguments. */ void GetBasicProperties (in GEOM_Object theShape, - out double theLength, - out double theSurfArea, - out double theVolume); + out double theLength, + out double theSurfArea, + out double theVolume); /*! * Get a point, situated at the centre of mass of theShape. @@ -1811,6 +3186,25 @@ module GEOM */ GEOM_Object GetCentreOfMass (in GEOM_Object theShape); + /* + * Get the vertex by index for 1D objects depends the edge/wire orientation + * \param theShape Shape (wire or edge) to find the vertex on it + * \param theIndex Index of vertex subshape + * \return New GEOM_Object, vertex. + */ + GEOM_Object GetVertexByIndex( in GEOM_Object theShape, in long index ); + + /*! + * Get a vector, representing the normal of theFace. + * If the face is not planar, theOptionalPoint is obligatory. + * \param theFace Shape (face) to define the normal of. + * \param theOptionalPoint Shape (point) to define the normal at. + * Can be NULL in case of planar face. + * \return New GEOM_Object, containing the created normal vector. + */ + GEOM_Object GetNormal (in GEOM_Object theFace, + in GEOM_Object theOptionalPoint); + /*! * Get inertia matrix and moments of inertia of theShape. * \param theShape Shape to calculate inertia of. @@ -1819,10 +3213,10 @@ module GEOM * \return Returns inertia through the last twelve arguments. */ void GetInertia (in GEOM_Object theShape, - out double I11, out double I12, out double I13, - out double I21, out double I22, out double I23, - out double I31, out double I32, out double I33, - out double Ix , out double Iy , out double Iz); + out double I11, out double I12, out double I13, + out double I21, out double I22, out double I23, + out double I31, out double I32, out double I33, + out double Ix , out double Iy , out double Iz); /*! * Get parameters of bounding box of the given shape @@ -1833,9 +3227,9 @@ module GEOM * \return Returns parameters of bounding box through the last six arguments. */ void GetBoundingBox (in GEOM_Object theShape, - out double Xmin, out double Xmax, - out double Ymin, out double Ymax, - out double Zmin, out double Zmax); + out double Xmin, out double Xmax, + out double Ymin, out double Ymax, + out double Zmin, out double Zmax); /*! * Get min and max tolerances of sub-shapes of theShape @@ -1846,9 +3240,9 @@ module GEOM * \return Returns shape tolerances through the last six arguments. */ void GetTolerance (in GEOM_Object theShape, - out double FaceMin, out double FaceMax, - out double EdgeMin, out double EdgeMax, - out double VertMin, out double VertMax); + out double FaceMin, out double FaceMax, + out double EdgeMin, out double EdgeMax, + out double VertMin, out double VertMax); /*! * Check a topology of the given shape. @@ -1857,7 +3251,23 @@ module GEOM * \return TRUE, if the shape "seems to be valid" from the topological point of view. */ boolean CheckShape (in GEOM_Object theShape, - out string theDescription); + out string theDescription); + + /*! + * Check a topology and a geometry of the given shape. + * \param theShape Shape to check validity of. + * \param theDescription Output. Description of problems in the shape, if they are. + * \return TRUE, if the shape "seems to be valid". + */ + boolean CheckShapeWithGeometry (in GEOM_Object theShape, + out string theDescription); + + /*! + * Check if the given shape can be an argument for MakeSolid operation + * \param theShape Shape to be described. + * \return Empty string if a solid can be made on this shape, error code otherwise. + */ + string IsGoodForSolid (in GEOM_Object theShape); /*! * Obtain description of the given shape @@ -1866,6 +3276,16 @@ module GEOM */ string WhatIs (in GEOM_Object theShape); + /*! + * Check if points defined by coords = [x1, y1, z1, x2, y2, z2, ...] are inside or on + * the shape theShape. + * \param theShape Shape to check. + * \param coords list of coordinates. + * \param tolerance tolerance. + * \return list of boolean. + */ + ListOfBool AreCoordsInside(in GEOM_Object theShape, in ListOfDouble coords, in double tolerance); + /*! * Get minimal distance between the given shapes. * \param theShape1,theShape2 Shapes to find minimal distance between. @@ -1874,14 +3294,80 @@ module GEOM * \return Value of the minimal distance between the given shapes. */ double GetMinDistance (in GEOM_Object theShape1, in GEOM_Object theShape2, - out double X1, out double Y1, out double Z1, - out double X2, out double Y2, out double Z2); + out double X1, out double Y1, out double Z1, + out double X2, out double Y2, out double Z2); + + /*! + * Get angle between the given lines or linear edges. + * \param theShape1,theShape2 Shapes to find angle between. Lines or linear edges. + * \return Value of the angle between the given shapes. + */ + double GetAngle (in GEOM_Object theShape1, in GEOM_Object theShape2); + /*! + * Get angle between the given vectors. + * \param theShape1,theShape2 Vectors to find angle between. + * \return Value of the angle between the given vectors. + */ + double GetAngleBtwVectors (in GEOM_Object theShape1, in GEOM_Object theShape2); /*! * Get point coordinates */ void PointCoordinates (in GEOM_Object theShape, out double X, out double Y, out double Z); + + /*! + * Get radius of curvature of curve in the point determinated by param + * \param theShape - curve. + * \param theParam - parameter on curve + * \return Value of curvature. + */ + double CurveCurvatureByParam (in GEOM_Object theShape, in double theParam); + + /*! + * Get radius of curvature of curve in the given point + * \param theShape - curve. + * \param thePoint - point + * \return Value of curvature. + */ + double CurveCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint); + + /*! + * Get max radius of curvature of surface in the point determinated by params + * \param theShape - surface. + * \param theUParam - U-parameter on surface + * \param theVParam - V-parameter on surface + * \return Value of curvature. + */ + double MaxSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam, + in double theVParam); + + /*! + * Get max radius of curvature of surface in the given point + * \param theShape - surface. + * \param thePoint - point + * \return Value of curvature. + */ + double MaxSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint); + + /*! + * Get min radius of curvature of surface in the point determinated by params + * \param theShape - surface. + * \param theUParam - U-parameter on surface + * \param theVParam - V-parameter on surface + * \return Value of curvature. + */ + double MinSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam, + in double theVParam); + + /*! + * Get min radius of curvature of surface in the given point + * \param theShape - surface. + * \param thePoint - point + * \return Value of curvature. + */ + double MinSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint); + }; @@ -1902,7 +3388,7 @@ module GEOM * Adds a sub object with ID theSubShapeId to the group * \param theGroup is a GEOM group to which the new sub shape is added * \param theSubShapeId is a sub shape ID in the main object. - * \note Use method ILocalOperations.GetSubShapeIndex() to get an ID by the sub shape + * \note Use method GEOM_IShapesOperations.GetSubShapeIndex() to get an ID by the sub shape */ void AddObject (in GEOM_Object theGroup, in long theSubShapeId); @@ -1910,7 +3396,7 @@ module GEOM * Removes a sub object with ID \a theSubShapeId from the group * \param theGroup is a GEOM group from which the sub shape is removed. * \param theSubShapeId is a sub shape ID in the main object. - * \note Use method ILocalOperations.GetSubShapeIndex() to get an ID by the sub shape + * \note Use method GEOM_IShapesOperations.GetSubShapeIndex() to get an ID by the sub shape */ void RemoveObject (in GEOM_Object theGroup, in long theSubShapeId); @@ -1963,11 +3449,140 @@ module GEOM }; + /*! + * GEOM_IAdvancedOperations: Interface for advanced modeling functions. + */ + interface GEOM_IAdvancedOperations : GEOM_IOperations + { + /*! + * Create a T-shape object with specified caracteristics for the main and + * the incident pipes (radius, width, half-length). + * Center of the shape is (0,0,0). The main plane of the T-shape is XOY. + * \param theR1 Internal radius of main pipe + * \param theW1 Width of main pipe + * \param theL1 Half-length of main pipe + * \param theR2 Internal radius of incident pipe (R2 < R1) + * \param theW2 Width of incident pipe (R2+W2 < R1+W1) + * \param theL2 Half-length of incident pipe + * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true) + * \return List of GEOM_Objects, containing the created shape and propagation groups. + */ + ListOfGO MakePipeTShape (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in boolean theHexMesh); + /*! + * Create a T-shape object with specified caracteristics for the main and + * the incident pipes (radius, width, half-length). + * The extremities of the main pipe are located on junctions points P1 and P2. + * The extremity of the incident pipe is located on junction point P3. + * \param theR1 Internal radius of main pipe + * \param theW1 Width of main pipe + * \param theL1 Half-length of main pipe + * \param theR2 Internal radius of incident pipe (R2 < R1) + * \param theW2 Width of incident pipe (R2+W2 < R1+W1) + * \param theL2 Half-length of incident pipe + * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true) + * \param theP1 1st junction point of main pipe + * \param theP2 2nd junction point of main pipe + * \param theP3 Junction point of incident pipe + * \return List of GEOM_Objects, containing the created shape and propagation groups. + */ + ListOfGO MakePipeTShapeWithPosition (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in boolean theHexMesh, + in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3); + /*! + * Create a T-shape object with specified caracteristics for the main and + * the incident pipes (radius, width, half-length). A chamfer is created + * on the junction of the pipes. + * Center of the shape is (0,0,0). The main plane of the T-shape is XOY. + * \param theR1 Internal radius of main pipe + * \param theW1 Width of main pipe + * \param theL1 Half-length of main pipe + * \param theR2 Internal radius of incident pipe (R2 < R1) + * \param theW2 Width of incident pipe (R2+W2 < R1+W1) + * \param theL2 Half-length of incident pipe + * \param theH Height of the chamfer. + * \param theW Width of the chamfer. + * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true) + * \return List of GEOM_Objects, containing the created shape and propagation groups. + */ + ListOfGO MakePipeTShapeChamfer (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in double theH, in double theW, in boolean theHexMesh); + /*! + * Create a T-shape object with specified caracteristics for the main and + * the incident pipes (radius, width, half-length). A chamfer is created + * on the junction of the pipes. + * The extremities of the main pipe are located on junctions points P1 and P2. + * The extremity of the incident pipe is located on junction point P3. + * \param theR1 Internal radius of main pipe + * \param theW1 Width of main pipe + * \param theL1 Half-length of main pipe + * \param theR2 Internal radius of incident pipe (R2 < R1) + * \param theW2 Width of incident pipe (R2+W2 < R1+W1) + * \param theL2 Half-length of incident pipe + * \param theH Height of the chamfer. + * \param theW Width of the chamfer. + * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true) + * \param theP1 1st junction point of main pipe + * \param theP2 2nd junction point of main pipe + * \param theP3 Junction point of incident pipe + * \return List of GEOM_Objects, containing the created shape and propagation groups. + */ + ListOfGO MakePipeTShapeChamferWithPosition (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in double theH, in double theW, in boolean theHexMesh, + in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3); + /*! + * Create a T-shape object with specified caracteristics for the main and + * the incident pipes (radius, width, half-length). A fillet is created + * on the junction of the pipes. + * Center of the shape is (0,0,0). The main plane of the T-shape is XOY. + * \param theR1 Internal radius of main pipe + * \param theW1 Width of main pipe + * \param theL1 Half-length of main pipe + * \param theR2 Internal radius of incident pipe (R2 < R1) + * \param theW2 Width of incident pipe (R2+W2 < R1+W1) + * \param theL2 Half-length of incident pipe + * \param theRF Radius of curvature of fillet. + * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true) + * \return List of GEOM_Objects, containing the created shape and propagation groups. + */ + ListOfGO MakePipeTShapeFillet (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in double theRF, in boolean theHexMesh); + /*! + * Create a T-shape object with specified caracteristics for the main and + * the incident pipes (radius, width, half-length). A fillet is created + * on the junction of the pipes. + * The extremities of the main pipe are located on junctions points P1 and P2. + * The extremity of the incident pipe is located on junction point P3. + * \param theR1 Internal radius of main pipe + * \param theW1 Width of main pipe + * \param theL1 Half-length of main pipe + * \param theR2 Internal radius of incident pipe (R2 < R1) + * \param theW2 Width of incident pipe (R2+W2 < R1+W1) + * \param theL2 Half-length of incident pipe + * \param theRF Radius of curvature of fillet. + * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true) + * \param theP1 1st junction point of main pipe + * \param theP2 2nd junction point of main pipe + * \param theP3 Junction point of incident pipe + * \return List of GEOM_Objects, containing the created shape and propagation groups. + */ + ListOfGO MakePipeTShapeFilletWithPosition (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in double theRF, in boolean theHexMesh, + in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3); + /*@@ insert new functions before this line @@ do not remove this line @@*/ + }; + /*! * GEOM_Gen: Interface to access other GEOM interfaces. * Also contains some methods to access and manage GEOM objects. */ - interface GEOM_Gen : Engines::Component,SALOMEDS::Driver + interface GEOM_Gen : Engines::EngineComponent,SALOMEDS::Driver { /*! * Undo/Redo Management @@ -1978,15 +3593,88 @@ module GEOM void Redo (in long theStudyID); /*! - * Publishing manangement + * Publishing management * Adds in theStudy a object theObject under with a name theName, * if theFather is not NULL the object is placed under thFather's SObject. * Returns a SObject where theObject is placed */ SALOMEDS::SObject AddInStudy (in SALOMEDS::Study theStudy, - in GEOM_Object theObject, - in string theName, - in GEOM_Object theFather); + in GEOM_Object theObject, + in string theName, + in GEOM_Object theFather); + + /*! + * Publish sub-shapes, standing for arguments and sub-shapes of arguments + * To be used from python scripts out of geompy.addToStudy (non-default usage) + * \param theStudy the study, in which theObject is published already, + * and in which the arguments will be published + * \param theObject published GEOM object, arguments of which will be published + * \param theArgs list of GEOM_Object, operation arguments to be published. + * If this list is empty, all operation arguments will be published + * \param theFindMethod method to search subshapes, corresponding to arguments and + * their subshapes. Value from enumeration GEOM::find_shape_method. + * \param theInheritFirstArg set properties of the first argument for \a theObject. + * Do not publish subshapes in place of arguments, but only + * in place of subshapes of the first argument, + * because the whole shape corresponds to the first argument. + * Mainly to be used after transformations, but it also can be + * usefull after partition with one object shape, and some other + * operations, where only the first argument has to be considered. + * If theObject has only one argument shape, this flag is automatically + * considered as True, not regarding really passed value. + * \param theAddPrefix add prefix "from_" to names of restored sub-shapes, + * and prefix "from_subshapes_of_" to names of partially restored subshapes. + * \return list of published sub-shapes + */ + ListOfGO RestoreSubShapesO (in SALOMEDS::Study theStudy, + in GEOM_Object theObject, + in ListOfGO theArgs, + in find_shape_method theFindMethod, + in boolean theInheritFirstArg, + in boolean theAddPrefix); + + /*! + * Publish sub-shapes, standing for arguments and sub-shapes of arguments + * To be used from python scripts out of geompy.addToStudy (non-default usage) + * \param theStudy the study, in which theObject is published already, + * and in which the arguments will be published + * \param theObject published GEOM object, arguments of which will be published + * \param theArgs list of GEOM_Object, operation arguments to be published. + * If this list is empty, all operation arguments will be published + * \param theFindMethod method to search subshapes, corresponding to arguments and + * their subshapes. Value from enumeration GEOM::find_shape_method. + * \param theInheritFirstArg set properties of the first argument for \a theObject. + * Do not publish subshapes in place of arguments, but only + * in place of subshapes of the first argument, + * because the whole shape corresponds to the first argument. + * Mainly to be used after transformations, but it also can be + * usefull after partition with one object shape, and some other + * operations, where only the first argument has to be considered. + * If theObject has only one argument shape, this flag is automatically + * considered as True, not regarding really passed value. + * \param theAddPrefix add prefix "from_" to names of restored sub-shapes, + * and prefix "from_subshapes_of_" to names of partially restored subshapes. + * \return list of published sub-shapes + */ + ListOfGO RestoreGivenSubShapesO (in SALOMEDS::Study theStudy, + in GEOM_Object theObject, + in ListOfGO theArgs, + in find_shape_method theFindMethod, + in boolean theInheritFirstArg, + in boolean theAddPrefix); + + /*! + * Publish sub-shapes, standing for arguments and sub-shapes of arguments + * To be used from GUI and from geompy.addToStudy. + * Work like the above method, but accepts study object theSObject instead of GEOM_Object. + * \param theSObject study object, referencing GEOM object, arguments of which will be published + */ + ListOfGO RestoreSubShapesSO (in SALOMEDS::Study theStudy, + in SALOMEDS::SObject theSObject, + in ListOfGO theArgs, + in find_shape_method theFindMethod, + in boolean theInheritFirstArg, + in boolean theAddPrefix); /*! * Methods to access interfaces for objects creation and transformation @@ -2003,6 +3691,7 @@ module GEOM GEOM_IMeasureOperations GetIMeasureOperations (in long theStudyID) raises (SALOME::SALOME_Exception); GEOM_IBlocksOperations GetIBlocksOperations (in long theStudyID) raises (SALOME::SALOME_Exception); GEOM_IGroupOperations GetIGroupOperations (in long theStudyID) raises (SALOME::SALOME_Exception); + GEOM_IAdvancedOperations GetIAdvancedOperations (in long theStudyID) raises (SALOME::SALOME_Exception); /*! * Objects Management @@ -2024,7 +3713,7 @@ module GEOM /*! * Add a sub shape defined by indices in \a theIndices - * (contains unique IDs of sub shapes inside theMainShape) + * (contains unique IDs of sub shapes inside \a theMainShape) * \note The sub shape GEOM_Objects can has ONLY ONE function. * Don't try to apply modification operations on them. * \note Internal method @@ -2058,6 +3747,15 @@ module GEOM * into python script to avoid the same names in SMESH script */ string_array GetAllDumpNames(); + + /*! + * Publishes the named subshapes of given object in the study. + * \param theStudy The study in which the object is published + * \param theObject The object which named subshapes are published + */ + ListOfGO PublishNamedShapesInStudy(in SALOMEDS::Study theStudy, + //in SObject theSObject, + in Object theObject); }; };