42cf5bc1 |
1 | // Created on: 2004-09-03 |
2 | // Created by: Oleg FEDYAEV |
3 | // Copyright (c) 2004-2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
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. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _BOPAlgo_ArgumentAnalyzer_HeaderFile |
17 | #define _BOPAlgo_ArgumentAnalyzer_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_DefineAlloc.hxx> |
21 | #include <Standard_Handle.hxx> |
22 | |
23 | #include <TopoDS_Shape.hxx> |
24 | #include <Standard_Boolean.hxx> |
25 | #include <BOPAlgo_Operation.hxx> |
26 | #include <BOPAlgo_ListOfCheckResult.hxx> |
27 | #include <Standard_Real.hxx> |
28 | #include <BOPCol_DataMapOfShapeReal.hxx> |
29 | #include <BOPAlgo_Algo.hxx> |
30 | #include <TopAbs_ShapeEnum.hxx> |
31 | class TopoDS_Shape; |
32 | |
33 | |
34 | //! check the validity of argument(s) for Boolean Operations |
35 | class BOPAlgo_ArgumentAnalyzer : public BOPAlgo_Algo |
36 | { |
37 | public: |
38 | |
39 | DEFINE_STANDARD_ALLOC |
40 | |
41 | |
42 | //! empty constructor |
43 | Standard_EXPORT BOPAlgo_ArgumentAnalyzer(); |
44 | Standard_EXPORT virtual ~BOPAlgo_ArgumentAnalyzer(); |
45 | |
46 | //! sets object shape |
47 | Standard_EXPORT void SetShape1 (const TopoDS_Shape& TheShape); |
48 | |
49 | //! sets tool shape |
50 | Standard_EXPORT void SetShape2 (const TopoDS_Shape& TheShape); |
51 | |
52 | //! returns object shape; |
53 | Standard_EXPORT const TopoDS_Shape& GetShape1() const; |
54 | |
55 | //! returns tool shape |
56 | Standard_EXPORT const TopoDS_Shape& GetShape2() const; |
57 | |
58 | //! returns ref |
59 | Standard_EXPORT BOPAlgo_Operation& OperationType(); |
60 | |
61 | //! returns ref |
62 | Standard_EXPORT Standard_Boolean& StopOnFirstFaulty(); |
63 | |
64 | //! Returns (modifiable) mode |
65 | //! that means checking types of shapes. |
66 | Standard_Boolean& ArgumentTypeMode(); |
67 | |
68 | //! Returns (modifiable) mode that means |
69 | //! checking of self-intersection of shapes. |
70 | Standard_Boolean& SelfInterMode(); |
71 | |
72 | //! Returns (modifiable) mode that means |
73 | //! checking of small edges. |
74 | Standard_Boolean& SmallEdgeMode(); |
75 | |
76 | //! Returns (modifiable) mode that means |
77 | //! checking of possibility to split or rebuild faces. |
78 | Standard_Boolean& RebuildFaceMode(); |
79 | |
80 | //! Returns (modifiable) mode that means |
81 | //! checking of tangency between subshapes. |
82 | Standard_Boolean& TangentMode(); |
83 | |
84 | //! Returns (modifiable) mode that means |
85 | //! checking of problem of merging vertices. |
86 | Standard_Boolean& MergeVertexMode(); |
87 | |
88 | //! Returns (modifiable) mode that means |
89 | //! checking of problem of merging edges. |
90 | Standard_Boolean& MergeEdgeMode(); |
91 | |
92 | //! Returns (modifiable) mode that means |
93 | //! checking of problem of continuity of the shape. |
94 | Standard_Boolean& ContinuityMode(); |
95 | |
96 | //! Returns (modifiable) mode that means |
97 | //! checking of problem of invalid curve on surface. |
98 | Standard_Boolean& CurveOnSurfaceMode(); |
99 | |
100 | //! performs analysis |
101 | Standard_EXPORT void Perform(); |
102 | |
103 | //! result of test |
104 | Standard_EXPORT Standard_Boolean HasFaulty() const; |
105 | |
106 | //! returns a result of test |
107 | Standard_EXPORT const BOPAlgo_ListOfCheckResult& GetCheckResult() const; |
108 | |
42cf5bc1 |
109 | |
110 | protected: |
111 | |
112 | |
113 | //! Prepares data; |
114 | Standard_EXPORT void Prepare(); |
115 | |
116 | Standard_EXPORT void TestTypes(); |
117 | |
118 | Standard_EXPORT void TestSelfInterferences(); |
119 | |
120 | Standard_EXPORT void TestSmallEdge(); |
121 | |
122 | Standard_EXPORT void TestRebuildFace(); |
123 | |
124 | Standard_EXPORT void TestTangent(); |
125 | |
126 | Standard_EXPORT void TestMergeSubShapes (const TopAbs_ShapeEnum theType); |
127 | |
128 | Standard_EXPORT void TestMergeVertex(); |
129 | |
130 | Standard_EXPORT void TestMergeEdge(); |
131 | |
132 | Standard_EXPORT void TestContinuity(); |
133 | |
134 | Standard_EXPORT void TestCurveOnSurface(); |
135 | |
42cf5bc1 |
136 | |
137 | private: |
138 | |
139 | |
42cf5bc1 |
140 | TopoDS_Shape myShape1; |
141 | TopoDS_Shape myShape2; |
142 | Standard_Boolean myStopOnFirst; |
143 | BOPAlgo_Operation myOperation; |
144 | Standard_Boolean myArgumentTypeMode; |
145 | Standard_Boolean mySelfInterMode; |
146 | Standard_Boolean mySmallEdgeMode; |
147 | Standard_Boolean myRebuildFaceMode; |
148 | Standard_Boolean myTangentMode; |
149 | Standard_Boolean myMergeVertexMode; |
150 | Standard_Boolean myMergeEdgeMode; |
151 | Standard_Boolean myContinuityMode; |
152 | Standard_Boolean myCurveOnSurfaceMode; |
153 | Standard_Boolean myEmpty1; |
154 | Standard_Boolean myEmpty2; |
155 | BOPAlgo_ListOfCheckResult myResult; |
42cf5bc1 |
156 | |
157 | }; |
158 | |
159 | |
160 | #include <BOPAlgo_ArgumentAnalyzer.lxx> |
161 | |
162 | |
42cf5bc1 |
163 | #endif // _BOPAlgo_ArgumentAnalyzer_HeaderFile |