1 // Created on: 2004-09-03
2 // Created by: Oleg FEDYAEV
3 // Copyright (c) 2004-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _BOPAlgo_ArgumentAnalyzer_HeaderFile
17 #define _BOPAlgo_ArgumentAnalyzer_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <TopoDS_Shape.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <BOPAlgo_Algo.hxx>
26 #include <BOPAlgo_Operation.hxx>
27 #include <BOPAlgo_ListOfCheckResult.hxx>
28 #include <Standard_Real.hxx>
29 #include <TopAbs_ShapeEnum.hxx>
33 //! check the validity of argument(s) for Boolean Operations
34 class BOPAlgo_ArgumentAnalyzer : public BOPAlgo_Algo
42 Standard_EXPORT BOPAlgo_ArgumentAnalyzer();
43 Standard_EXPORT virtual ~BOPAlgo_ArgumentAnalyzer();
46 Standard_EXPORT void SetShape1 (const TopoDS_Shape& TheShape);
49 Standard_EXPORT void SetShape2 (const TopoDS_Shape& TheShape);
51 //! returns object shape;
52 Standard_EXPORT const TopoDS_Shape& GetShape1() const;
54 //! returns tool shape
55 Standard_EXPORT const TopoDS_Shape& GetShape2() const;
58 Standard_EXPORT BOPAlgo_Operation& OperationType();
61 Standard_EXPORT Standard_Boolean& StopOnFirstFaulty();
63 //! Returns (modifiable) mode
64 //! that means checking types of shapes.
65 Standard_Boolean& ArgumentTypeMode();
67 //! Returns (modifiable) mode that means
68 //! checking of self-intersection of shapes.
69 Standard_Boolean& SelfInterMode();
71 //! Returns (modifiable) mode that means
72 //! checking of small edges.
73 Standard_Boolean& SmallEdgeMode();
75 //! Returns (modifiable) mode that means
76 //! checking of possibility to split or rebuild faces.
77 Standard_Boolean& RebuildFaceMode();
79 //! Returns (modifiable) mode that means
80 //! checking of tangency between subshapes.
81 Standard_Boolean& TangentMode();
83 //! Returns (modifiable) mode that means
84 //! checking of problem of merging vertices.
85 Standard_Boolean& MergeVertexMode();
87 //! Returns (modifiable) mode that means
88 //! checking of problem of merging edges.
89 Standard_Boolean& MergeEdgeMode();
91 //! Returns (modifiable) mode that means
92 //! checking of problem of continuity of the shape.
93 Standard_Boolean& ContinuityMode();
95 //! Returns (modifiable) mode that means
96 //! checking of problem of invalid curve on surface.
97 Standard_Boolean& CurveOnSurfaceMode();
100 Standard_EXPORT void Perform();
103 Standard_EXPORT Standard_Boolean HasFaulty() const;
105 //! returns a result of test
106 Standard_EXPORT const BOPAlgo_ListOfCheckResult& GetCheckResult() const;
113 Standard_EXPORT void Prepare();
115 Standard_EXPORT void TestTypes();
117 Standard_EXPORT void TestSelfInterferences();
119 Standard_EXPORT void TestSmallEdge();
121 Standard_EXPORT void TestRebuildFace();
123 Standard_EXPORT void TestTangent();
125 Standard_EXPORT void TestMergeSubShapes (const TopAbs_ShapeEnum theType);
127 Standard_EXPORT void TestMergeVertex();
129 Standard_EXPORT void TestMergeEdge();
131 Standard_EXPORT void TestContinuity();
133 Standard_EXPORT void TestCurveOnSurface();
139 TopoDS_Shape myShape1;
140 TopoDS_Shape myShape2;
141 Standard_Boolean myStopOnFirst;
142 BOPAlgo_Operation myOperation;
143 Standard_Boolean myArgumentTypeMode;
144 Standard_Boolean mySelfInterMode;
145 Standard_Boolean mySmallEdgeMode;
146 Standard_Boolean myRebuildFaceMode;
147 Standard_Boolean myTangentMode;
148 Standard_Boolean myMergeVertexMode;
149 Standard_Boolean myMergeEdgeMode;
150 Standard_Boolean myContinuityMode;
151 Standard_Boolean myCurveOnSurfaceMode;
152 Standard_Boolean myEmpty1;
153 Standard_Boolean myEmpty2;
154 BOPAlgo_ListOfCheckResult myResult;
159 #include <BOPAlgo_ArgumentAnalyzer.lxx>
162 #endif // _BOPAlgo_ArgumentAnalyzer_HeaderFile