0031836: Modeling Algorithms - Boolean cut failed between a Cone and a Torus
[occt.git] / src / BOPAlgo / BOPAlgo_CheckResult.hxx
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_CheckResult_HeaderFile
17 #define _BOPAlgo_CheckResult_HeaderFile
18
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
22
23 #include <TopoDS_Shape.hxx>
24 #include <BOPAlgo_CheckStatus.hxx>
25 #include <TopTools_ListOfShape.hxx>
26 #include <Standard_Real.hxx>
27 class TopoDS_Shape;
28
29
30 //! contains information about faulty shapes and faulty types
31 //! can't be processed by Boolean Operations
32 class BOPAlgo_CheckResult 
33 {
34 public:
35
36   DEFINE_STANDARD_ALLOC
37
38   
39   //! empty constructor
40   Standard_EXPORT BOPAlgo_CheckResult();
41   
42   //! sets ancestor shape (object) for faulty sub-shapes
43   Standard_EXPORT void SetShape1 (const TopoDS_Shape& TheShape);
44   
45   //! adds faulty sub-shapes from object to a list
46   Standard_EXPORT void AddFaultyShape1 (const TopoDS_Shape& TheShape);
47   
48   //! sets ancestor shape (tool) for faulty sub-shapes
49   Standard_EXPORT void SetShape2 (const TopoDS_Shape& TheShape);
50   
51   //! adds faulty sub-shapes from tool to a list
52   Standard_EXPORT void AddFaultyShape2 (const TopoDS_Shape& TheShape);
53   
54   //! returns ancestor shape (object) for faulties
55   Standard_EXPORT const TopoDS_Shape& GetShape1() const;
56   
57   //! returns ancestor shape (tool) for faulties
58   Standard_EXPORT const TopoDS_Shape& GetShape2() const;
59   
60   //! returns list of faulty shapes for object
61   Standard_EXPORT const TopTools_ListOfShape& GetFaultyShapes1() const;
62   
63   //! returns list of faulty shapes for tool
64   Standard_EXPORT const TopTools_ListOfShape& GetFaultyShapes2() const;
65   
66   //! set status of faulty
67   Standard_EXPORT void SetCheckStatus (const BOPAlgo_CheckStatus TheStatus);
68   
69   //! gets status of faulty
70   Standard_EXPORT BOPAlgo_CheckStatus GetCheckStatus() const;
71   
72   //! Sets max distance for the first shape
73   Standard_EXPORT void SetMaxDistance1 (const Standard_Real theDist);
74   
75   //! Sets max distance for the second shape
76   Standard_EXPORT void SetMaxDistance2 (const Standard_Real theDist);
77   
78   //! Sets the parameter for the first shape
79   Standard_EXPORT void SetMaxParameter1 (const Standard_Real thePar);
80   
81   //! Sets the parameter for the second shape
82   Standard_EXPORT void SetMaxParameter2 (const Standard_Real thePar);
83   
84   //! Returns the distance for the first shape
85   Standard_EXPORT Standard_Real GetMaxDistance1() const;
86   
87   //! Returns the distance for the second shape
88   Standard_EXPORT Standard_Real GetMaxDistance2() const;
89   
90   //! Returns the parameter for the fircst shape
91   Standard_EXPORT Standard_Real GetMaxParameter1() const;
92   
93   //! Returns the parameter for the second shape
94   Standard_EXPORT Standard_Real GetMaxParameter2() const;
95
96
97
98
99 protected:
100
101
102
103
104
105 private:
106
107
108
109   TopoDS_Shape myShape1;
110   TopoDS_Shape myShape2;
111   BOPAlgo_CheckStatus myStatus;
112   TopTools_ListOfShape myFaulty1;
113   TopTools_ListOfShape myFaulty2;
114   Standard_Real myMaxDist1;
115   Standard_Real myMaxDist2;
116   Standard_Real myMaxPar1;
117   Standard_Real myMaxPar2;
118
119
120 };
121
122
123
124
125
126
127
128 #endif // _BOPAlgo_CheckResult_HeaderFile