0032768: Coding - get rid of unused headers [BopAlgo to BRepBuilderAPI]
[occt.git] / src / BRepAlgoAPI / BRepAlgoAPI_Defeaturing.cxx
CommitLineData
d9ca2e0c 1// Created by: Eugeny MALTCHIKOV
2// Copyright (c) 2018 OPEN CASCADE SAS
3//
4// This file is part of Open CASCADE Technology software library.
5//
6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License version 2.1 as published
8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
11//
12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
14
15
16#include <BRepAlgoAPI_Defeaturing.hxx>
17
d9ca2e0c 18//=======================================================================
19//function : Build
20//purpose :
21//=======================================================================
8ab0b859 22void BRepAlgoAPI_Defeaturing::Build(const Message_ProgressRange& theRange)
d9ca2e0c 23{
24 // Set not done state for the operation
25 NotDone();
26
27 // Clear the tools performing the operation
28 Clear();
29
30 // Set the inputs to BOPAlgo_RemoveFeatures algorithm
31 myFeatureRemovalTool.SetShape(myInputShape);
32 myFeatureRemovalTool.AddFacesToRemove(myFacesToRemove);
948fe6ca 33 myFeatureRemovalTool.SetToFillHistory(myFillHistory);
d9ca2e0c 34 myFeatureRemovalTool.SetRunParallel(myRunParallel);
35
36 // Perform the features removal
8ab0b859 37 myFeatureRemovalTool.Perform(theRange);
d9ca2e0c 38
39 // Merge the Errors/Warnings from the features removal tool
40 GetReport()->Merge(myFeatureRemovalTool.GetReport());
41
42 if (HasErrors())
43 return;
44
45 // Set done state
46 Done();
47
48 // Get the result shape
49 myShape = myFeatureRemovalTool.Shape();
50}
51
52//=======================================================================
53//function : Modified
54//purpose :
55//=======================================================================
56const TopTools_ListOfShape& BRepAlgoAPI_Defeaturing::Modified(const TopoDS_Shape& theS)
57{
948fe6ca 58 return myFeatureRemovalTool.Modified(theS);
d9ca2e0c 59}
60
61//=======================================================================
62//function : Generated
63//purpose :
64//=======================================================================
65const TopTools_ListOfShape& BRepAlgoAPI_Defeaturing::Generated(const TopoDS_Shape& theS)
66{
948fe6ca 67 return myFeatureRemovalTool.Generated(theS);
d9ca2e0c 68}
69
70//=======================================================================
71//function : IsDeleted
72//purpose :
73//=======================================================================
74Standard_Boolean BRepAlgoAPI_Defeaturing::IsDeleted(const TopoDS_Shape& theS)
75{
948fe6ca 76 return myFeatureRemovalTool.IsDeleted(theS);
77}
78
79//=======================================================================
80//function : HasModified
81//purpose :
82//=======================================================================
83Standard_Boolean BRepAlgoAPI_Defeaturing::HasModified() const
84{
85 return myFeatureRemovalTool.HasModified();
86}
87
88//=======================================================================
89//function : HasGenerated
90//purpose :
91//=======================================================================
92Standard_Boolean BRepAlgoAPI_Defeaturing::HasGenerated() const
93{
94 return myFeatureRemovalTool.HasGenerated();
95}
96
97//=======================================================================
98//function : HasDeleted
99//purpose :
100//=======================================================================
101Standard_Boolean BRepAlgoAPI_Defeaturing::HasDeleted() const
102{
103 return myFeatureRemovalTool.HasDeleted();
d9ca2e0c 104}