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> |
1155d05a |
25 | #include <BOPAlgo_Algo.hxx> |
42cf5bc1 |
26 | #include <BOPAlgo_Operation.hxx> |
27 | #include <BOPAlgo_ListOfCheckResult.hxx> |
28 | #include <Standard_Real.hxx> |
42cf5bc1 |
29 | #include <TopAbs_ShapeEnum.hxx> |
30 | class TopoDS_Shape; |
31 | |
32 | |
33 | //! check the validity of argument(s) for Boolean Operations |
34 | class BOPAlgo_ArgumentAnalyzer : public BOPAlgo_Algo |
35 | { |
36 | public: |
37 | |
38 | DEFINE_STANDARD_ALLOC |
39 | |
40 | |
41 | //! empty constructor |
42 | Standard_EXPORT BOPAlgo_ArgumentAnalyzer(); |
43 | Standard_EXPORT virtual ~BOPAlgo_ArgumentAnalyzer(); |
44 | |
45 | //! sets object shape |
46 | Standard_EXPORT void SetShape1 (const TopoDS_Shape& TheShape); |
47 | |
48 | //! sets tool shape |
49 | Standard_EXPORT void SetShape2 (const TopoDS_Shape& TheShape); |
50 | |
51 | //! returns object shape; |
52 | Standard_EXPORT const TopoDS_Shape& GetShape1() const; |
53 | |
54 | //! returns tool shape |
55 | Standard_EXPORT const TopoDS_Shape& GetShape2() const; |
56 | |
57 | //! returns ref |
58 | Standard_EXPORT BOPAlgo_Operation& OperationType(); |
59 | |
60 | //! returns ref |
61 | Standard_EXPORT Standard_Boolean& StopOnFirstFaulty(); |
62 | |
63 | //! Returns (modifiable) mode |
64 | //! that means checking types of shapes. |
65 | Standard_Boolean& ArgumentTypeMode(); |
66 | |
67 | //! Returns (modifiable) mode that means |
68 | //! checking of self-intersection of shapes. |
69 | Standard_Boolean& SelfInterMode(); |
70 | |
71 | //! Returns (modifiable) mode that means |
72 | //! checking of small edges. |
73 | Standard_Boolean& SmallEdgeMode(); |
74 | |
75 | //! Returns (modifiable) mode that means |
76 | //! checking of possibility to split or rebuild faces. |
77 | Standard_Boolean& RebuildFaceMode(); |
78 | |
79 | //! Returns (modifiable) mode that means |
80 | //! checking of tangency between subshapes. |
81 | Standard_Boolean& TangentMode(); |
82 | |
83 | //! Returns (modifiable) mode that means |
84 | //! checking of problem of merging vertices. |
85 | Standard_Boolean& MergeVertexMode(); |
86 | |
87 | //! Returns (modifiable) mode that means |
88 | //! checking of problem of merging edges. |
89 | Standard_Boolean& MergeEdgeMode(); |
90 | |
91 | //! Returns (modifiable) mode that means |
92 | //! checking of problem of continuity of the shape. |
93 | Standard_Boolean& ContinuityMode(); |
94 | |
95 | //! Returns (modifiable) mode that means |
96 | //! checking of problem of invalid curve on surface. |
97 | Standard_Boolean& CurveOnSurfaceMode(); |
98 | |
99 | //! performs analysis |
100 | Standard_EXPORT void Perform(); |
101 | |
102 | //! result of test |
103 | Standard_EXPORT Standard_Boolean HasFaulty() const; |
104 | |
105 | //! returns a result of test |
106 | Standard_EXPORT const BOPAlgo_ListOfCheckResult& GetCheckResult() const; |
107 | |
42cf5bc1 |
108 | |
109 | protected: |
110 | |
111 | |
112 | //! Prepares data; |
113 | Standard_EXPORT void Prepare(); |
114 | |
115 | Standard_EXPORT void TestTypes(); |
116 | |
117 | Standard_EXPORT void TestSelfInterferences(); |
118 | |
119 | Standard_EXPORT void TestSmallEdge(); |
120 | |
121 | Standard_EXPORT void TestRebuildFace(); |
122 | |
123 | Standard_EXPORT void TestTangent(); |
124 | |
125 | Standard_EXPORT void TestMergeSubShapes (const TopAbs_ShapeEnum theType); |
126 | |
127 | Standard_EXPORT void TestMergeVertex(); |
128 | |
129 | Standard_EXPORT void TestMergeEdge(); |
130 | |
131 | Standard_EXPORT void TestContinuity(); |
132 | |
133 | Standard_EXPORT void TestCurveOnSurface(); |
134 | |
42cf5bc1 |
135 | |
136 | private: |
137 | |
138 | |
42cf5bc1 |
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; |
42cf5bc1 |
155 | |
156 | }; |
157 | |
158 | |
159 | #include <BOPAlgo_ArgumentAnalyzer.lxx> |
160 | |
161 | |
42cf5bc1 |
162 | #endif // _BOPAlgo_ArgumentAnalyzer_HeaderFile |