1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File: GEOMAlgo_GetInPlaceAPI.hxx
24 // Author: Sergey KHROMOV
26 #ifndef _GEOMAlgo_GetInPlaceAPI_HeaderFile
27 #define _GEOMAlgo_GetInPlaceAPI_HeaderFile
32 class GEOMAlgo_GetInPlace;
33 class Handle_GEOM_Function;
34 class BRepExtrema_DistShapeShape;
37 class TopTools_IndexedMapOfShape;
38 class TopTools_ListOfShape;
42 * This is an API class for all GetInPlace algorithm.
43 * It facilitates using different GetInPlace algorithms:
44 * a new one(GEOMAlgo_GetInPlace), an old one and
45 * GetInPlaceByHistory.
47 class GEOMAlgo_GetInPlaceAPI
53 * \brief New GetInPlace method implementation.
54 * Initializes the GEOMAlgo_GetInPlace object with correct parameters and
55 * performs computation (calls theGIP's method Perform. Returns
56 * Standard_True in face of success; Standard_False otherwise.
58 Standard_EXPORT static Standard_Boolean GetInPlace
59 (const TopoDS_Shape &theWhere,
60 const TopoDS_Shape &theWhat,
61 GEOMAlgo_GetInPlace &theGIP);
64 * \brief Old implementation of GetInPlace algoritm.
65 * This method searches among sub shapes of the shape theWhere parts that are
66 * coincident with the shape theWhat. The result list of shape is returned as
67 * an output parameter. It returns the error code with the following possible
70 * 1 - theWhere and/or theWhat TopoDS_Shape are Null;
71 * 2 - An attempt to extract a shape of not supported type;
72 * 3 - Not found any Results.
74 Standard_EXPORT static Standard_Integer GetInPlaceOld
75 (const TopoDS_Shape &theWhere,
76 const TopoDS_Shape &theWhat,
77 TopTools_ListOfShape &theShapesInPlace);
81 * \brief GetInPlaceByHistory method implementation.
82 * Returns Standard_True if something is found. Warning: theShapesInPlace
83 * list is not cleared at first.
85 Standard_EXPORT static Standard_Boolean GetInPlaceByHistory
86 (const Handle_GEOM_Function &theWhereFunction,
87 const TopTools_IndexedMapOfShape &theWhereIndices,
88 const TopoDS_Shape &theWhat,
89 TopTools_ListOfShape &theShapesInPlace);
94 * \brief Return normal to face at extrema point
96 static gp_Vec GetNormal(const TopoDS_Face &theFace,
97 const BRepExtrema_DistShapeShape &theExtrema);
100 * Return the global properties of the shape: center of mass and
101 * a size (length, area or volume depending on the shape type).
103 static void GetShapeProperties(const TopoDS_Shape &theShape,
104 Standard_Real theTab[],