1 // Created on: 2012-12-17
2 // Created by: Eugeny MALTCHIKOV
3 // Copyright (c) 2012-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 _BRepAlgoAPI_Check_HeaderFile
17 #define _BRepAlgoAPI_Check_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <TopoDS_Shape.hxx>
24 #include <BOPAlgo_PArgumentAnalyzer.hxx>
25 #include <BOPAlgo_ListOfCheckResult.hxx>
26 #include <Standard_Real.hxx>
27 #include <BRepAlgoAPI_Algo.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <BOPAlgo_Operation.hxx>
34 //! The class Check provides a diagnostic tool for checking
35 //! single shape or couple of shapes.
36 //! Single shape is checking on topological validity, small edges
37 //! and self-interference. For couple of shapes added check
38 //! on validity for boolean operation of given type.
40 //! The class provides two ways of checking shape(-s)
42 //! BRepAlgoAPI_Check aCh(theS);
43 //! Standard_Boolean bV=aCh.IsValid();
44 //! 2. Methods SetData and Perform
45 //! BRepAlgoAPI_Check aCh;
46 //! aCh.SetData(theS1, theS2, BOPAlgo_FUSE, Standard_False);
48 //! Standard_Boolean bV=aCh.IsValid();
49 class BRepAlgoAPI_Check : public BRepAlgoAPI_Algo
56 //! Empty constructor.
57 Standard_EXPORT BRepAlgoAPI_Check();
58 Standard_EXPORT virtual ~BRepAlgoAPI_Check();
60 //! Constructor for checking single shape.
62 //! Init(theS, TopoDS_Shape(), BOPAlgo_UNKNOWN, bTestSE, bTestSI)
65 //! theS - the shape that should be checked;
66 //! bTestSE - flag that specifies whether check on small edges
67 //! should be performed; by default it is set to TRUE;
68 //! bTestSI - flag that specifies whether check on self-interference
69 //! should be performed; by default it is set to TRUE;
70 Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS, const Standard_Boolean bTestSE = Standard_True, const Standard_Boolean bTestSI = Standard_True);
72 //! Constructor for couple of shapes.
74 //! Init(theS1, theS2, theOp, bTestSE, bTestSI) and Perform().
76 //! theS1, theS2 - the initial shapes.
77 //! theOp - the type of Boolean Operation;
78 //! if it is not defined (set to UNKNOWN) for each shape
79 //! performed check as for single shape.
80 //! bTestSE - flag that specifies whether check on small edges
81 //! should be performed; by default it is set to TRUE;
82 //! bTestSI - flag that specifies whether check on self-interference
83 //! should be performed; by default it is set to TRUE;
84 Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS1, const TopoDS_Shape& theS2, const BOPAlgo_Operation theOp = BOPAlgo_UNKNOWN, const Standard_Boolean bTestSE = Standard_True, const Standard_Boolean bTestSI = Standard_True);
86 //! Sets data for check by Init method.
87 //! The method provides alternative way for checking single shape.
88 Standard_EXPORT void SetData (const TopoDS_Shape& theS, const Standard_Boolean bTestSE = Standard_True, const Standard_Boolean bTestSI = Standard_True);
90 //! Sets data for check by Init method.
91 //! The method provides alternative way for checking couple of shapes.
92 Standard_EXPORT void SetData (const TopoDS_Shape& theS1, const TopoDS_Shape& theS2, const BOPAlgo_Operation theOp = BOPAlgo_UNKNOWN, const Standard_Boolean bTestSE = Standard_True, const Standard_Boolean bTestSI = Standard_True);
94 //! Performs the check.
95 Standard_EXPORT void Perform();
97 //! Shows whether shape(s) valid or not.
98 Standard_EXPORT Standard_Boolean IsValid();
100 //! Returns faulty shapes.
101 Standard_EXPORT const BOPAlgo_ListOfCheckResult& Result();
103 //! Sets the additional tolerance
104 Standard_EXPORT void SetFuzzyValue (const Standard_Real theFuzz);
106 //! Returns the additional tolerance
107 Standard_EXPORT Standard_Real FuzzyValue() const;
115 //! Initialyzes data.
116 Standard_EXPORT void Init (const TopoDS_Shape& theS1, const TopoDS_Shape& theS2, const BOPAlgo_Operation theOp, const Standard_Boolean bTestSE, const Standard_Boolean bTestSI);
121 BOPAlgo_PArgumentAnalyzer myAnalyzer;
122 BOPAlgo_ListOfCheckResult myResult;
123 Standard_Real myFuzzyValue;
140 #endif // _BRepAlgoAPI_Check_HeaderFile