SHAPER  9.15.0
GeomAlgoAPI_Offset.h
1 // Copyright (C) 2019-2025 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef GeomAlgoAPI_Offset_H_
21 #define GeomAlgoAPI_Offset_H_
22 
23 #include <GeomAlgoAPI.h>
24 #include <GeomAlgoAPI_MakeShape.h>
25 
26 class GeomAPI_Pln;
27 
36 enum class GeomAlgoAPI_OffsetJoint { KeepDistance, Arcs, Lines };
37 
42 {
43 public:
47  GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset(const GeomShapePtr& theShape,
48  const double theOffsetValue);
49 
54  GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset
55  (const GeomShapePtr& theShape,
56  const double theOffsetValue,
57  const bool isPipeJoint);
58 
63  GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset
64  (const GeomShapePtr& theShape,
65  const ListOfShape& theFaces,
66  const double theOffsetValue);
67 
73  GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset
74  (const std::shared_ptr<GeomAPI_Pln>& thePlane,
75  const GeomShapePtr& theEdgeOrWire,
76  const double theOffsetValue,
77  const GeomAlgoAPI_OffsetJoint theJoint = GeomAlgoAPI_OffsetJoint::KeepDistance,
78  const bool theIsApprox = false);
79 
83  GEOMALGOAPI_EXPORT virtual void generated(const GeomShapePtr theOldShape,
84  ListOfShape& theNewShapes);
85 
86 private:
88  void buildSimple(const GeomShapePtr& theShape,
89  const double theOffsetValue);
90 
92  void buildByJoin(const GeomShapePtr& theShape,
93  const double theOffsetValue,
94  const bool isPipeJoint);
95 
97  void buildPartial(const GeomShapePtr& theShape,
98  const ListOfShape& theFaces,
99  const double theOffsetValue);
100 
102  void build2d(const std::shared_ptr<GeomAPI_Pln>& thePlane,
103  const GeomShapePtr& theEdgeOrWire,
104  const double theOffsetValue,
105  const GeomAlgoAPI_OffsetJoint theJoint = GeomAlgoAPI_OffsetJoint::KeepDistance,
106  const bool theIsApprox = false);
107 };
108 
109 #endif
\Plane in 3D place, defined by normal, center and x-direction.
Definition: GeomAPI_Pln.h:38
Interface to the root class of all topological shapes constructions.
Definition: GeomAlgoAPI_MakeShape.h:35
Perform 3D offset for the shape.
Definition: GeomAlgoAPI_Offset.h:42
virtual GEOMALGOAPI_EXPORT void generated(const GeomShapePtr theOldShape, ListOfShape &theNewShapes)
Definition: GeomAlgoAPI_Offset.cpp:63
GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset(const GeomShapePtr &theShape, const double theOffsetValue)
Perform simple offset.
Definition: GeomAlgoAPI_Offset.cpp:34