0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / BRepAlgo / BRepAlgo_BooleanOperations.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-10-14
2// Created by: Prestataire Mary FABIEN
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _BRepAlgo_BooleanOperations_HeaderFile
18#define _BRepAlgo_BooleanOperations_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <BRepAlgo_DSAccess.hxx>
25#include <TopoDS_Shape.hxx>
26#include <TopTools_MapOfShape.hxx>
27#include <Standard_Integer.hxx>
28#include <Standard_Real.hxx>
29#include <Standard_Boolean.hxx>
30#include <TopAbs_State.hxx>
31#include <TopTools_ListOfShape.hxx>
32class TopoDS_Shape;
33class TopOpeBRepDS_HDataStructure;
34class TopOpeBRepBuild_HBuilder;
35class BRepAlgo_DSAccess;
36
37
38
39class BRepAlgo_BooleanOperations
40{
41public:
42
43 DEFINE_STANDARD_ALLOC
44
45
46 Standard_EXPORT BRepAlgo_BooleanOperations();
47
48 //! S1 is a Shell with ALL faces supported by the SAME S2 is
49 //! an Edge INCLUDED in that surface with pcurve.
50 //! this avoids a time-consuming 3D operation, compared to Shapes.
51 Standard_EXPORT void Shapes2d (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
52
53 //! Defines the arguments.
54 Standard_EXPORT void Shapes (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
55
56 //! Sets different parameters for the curve approximations :
57 //! NbPntMax : Maximum number of points to be approximated at
58 //! the same time in one curve.
59 //! Tol3D, Tol2D : Tolerances to be reached by the approximation.
60 //! RelativeTol : The given tolerances are relative.
4e14c88f 61 Standard_EXPORT void SetApproxParameters (const Standard_Integer NbPntMax, const Standard_Real Tol3D, const Standard_Real Tol2D);
42cf5bc1 62
63 Standard_EXPORT void Define (const TopoDS_Shape& S1, const TopoDS_Shape& S2, Handle(TopOpeBRepDS_HDataStructure)& HDS);
64
65 //! returns the common part of the shapes.
66 Standard_EXPORT const TopoDS_Shape& Common();
67
68 //! returns the fuse part of the shapes.
69 Standard_EXPORT const TopoDS_Shape& Fus();
70
71 //! returns the cut part of the shapes.
72 Standard_EXPORT const TopoDS_Shape& Cut();
73
74 //! returns the intersection of the shapes.
75 Standard_EXPORT const TopoDS_Shape& Section();
76
77 //! returns the result of the boolean operation.
78 Standard_EXPORT const TopoDS_Shape& Shape();
79
80 //! Returns the shape(s) resulting of the boolean operation
81 //! issued from the shape <S>.
82 Standard_EXPORT const TopoDS_Shape& ShapeFrom (const TopoDS_Shape& S);
83
84 //! Returns the list of the descendant shapes of the shape <S>.
85 Standard_EXPORT const TopTools_ListOfShape& Modified (const TopoDS_Shape& S);
86
87 //! Returns the fact that the shape <S> has been deleted or not
88 //! by the boolean operation.
89 Standard_EXPORT Standard_Boolean IsDeleted (const TopoDS_Shape& S);
90
91 Standard_EXPORT const Handle(TopOpeBRepDS_HDataStructure)& DataStructure() const;
92
93 Standard_EXPORT Handle(TopOpeBRepDS_HDataStructure)& ChangeDataStructure();
94
95 Standard_EXPORT const Handle(TopOpeBRepBuild_HBuilder)& Builder() const;
96
97 Standard_EXPORT Handle(TopOpeBRepBuild_HBuilder)& ChangeBuilder();
98
99 //! returns the member myDSA. It is useful to then access
100 //! the method GetSectionEdgeSet (wich is a member of DSAccess)
101 Standard_EXPORT BRepAlgo_DSAccess& DataStructureAccess();
102
103
104
105
106protected:
107
108
109
110
111
112private:
113
114
115 //! Performs the global boolean operation.
116 Standard_EXPORT void Perform();
117
118 //! Performs the global boolean operation and build the
119 //! result in regards of the given states.
120 Standard_EXPORT void Perform (const TopAbs_State State1, const TopAbs_State State2);
121
122
123 BRepAlgo_DSAccess myDSA;
124 TopoDS_Shape myS1;
125 TopoDS_Shape myS2;
126 TopoDS_Shape myShape;
127 TopTools_MapOfShape myMapShape;
128 TopoDS_Shape myResult;
129 Standard_Integer myApproxNbPntMax;
130 Standard_Real myApproxTol3D;
131 Standard_Real myApproxTol2D;
42cf5bc1 132};
133
134
135
136
137
138
139
140#endif // _BRepAlgo_BooleanOperations_HeaderFile