Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 09:19:43

0001 // Created on: 2004-09-03
0002 // Created by: Oleg FEDYAEV
0003 // Copyright (c) 2004-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _BOPAlgo_ArgumentAnalyzer_HeaderFile
0017 #define _BOPAlgo_ArgumentAnalyzer_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <TopoDS_Shape.hxx>
0024 #include <BOPAlgo_Algo.hxx>
0025 #include <BOPAlgo_Operation.hxx>
0026 #include <BOPAlgo_CheckResult.hxx>
0027 #include <TopAbs_ShapeEnum.hxx>
0028 
0029 //! check the validity of argument(s) for Boolean Operations
0030 class BOPAlgo_ArgumentAnalyzer : public BOPAlgo_Algo
0031 {
0032 public:
0033   DEFINE_STANDARD_ALLOC
0034 
0035   //! empty constructor
0036   Standard_EXPORT BOPAlgo_ArgumentAnalyzer();
0037   Standard_EXPORT ~BOPAlgo_ArgumentAnalyzer() override;
0038 
0039   //! sets object shape
0040   Standard_EXPORT void SetShape1(const TopoDS_Shape& TheShape);
0041 
0042   //! sets tool shape
0043   Standard_EXPORT void SetShape2(const TopoDS_Shape& TheShape);
0044 
0045   //! returns object shape;
0046   Standard_EXPORT const TopoDS_Shape& GetShape1() const;
0047 
0048   //! returns tool shape
0049   Standard_EXPORT const TopoDS_Shape& GetShape2() const;
0050 
0051   //! returns ref
0052   Standard_EXPORT BOPAlgo_Operation& OperationType();
0053 
0054   //! returns ref
0055   Standard_EXPORT bool& StopOnFirstFaulty();
0056 
0057   //! Returns (modifiable) mode
0058   //! that means checking types of shapes.
0059   bool& ArgumentTypeMode();
0060 
0061   //! Returns (modifiable) mode that means
0062   //! checking of self-intersection of shapes.
0063   bool& SelfInterMode();
0064 
0065   //! Returns (modifiable) mode that means
0066   //! checking of small edges.
0067   bool& SmallEdgeMode();
0068 
0069   //! Returns (modifiable) mode that means
0070   //! checking of possibility to split or rebuild faces.
0071   bool& RebuildFaceMode();
0072 
0073   //! Returns (modifiable) mode that means
0074   //! checking of tangency between subshapes.
0075   bool& TangentMode();
0076 
0077   //! Returns (modifiable) mode that means
0078   //! checking of problem of merging vertices.
0079   bool& MergeVertexMode();
0080 
0081   //! Returns (modifiable) mode that means
0082   //! checking of problem of merging edges.
0083   bool& MergeEdgeMode();
0084 
0085   //! Returns (modifiable) mode that means
0086   //! checking of problem of continuity of the shape.
0087   bool& ContinuityMode();
0088 
0089   //! Returns (modifiable) mode that means
0090   //! checking of problem of invalid curve on surface.
0091   bool& CurveOnSurfaceMode();
0092 
0093   //! performs analysis
0094   Standard_EXPORT void Perform(
0095     const Message_ProgressRange& theRange = Message_ProgressRange()) override;
0096 
0097   //! result of test
0098   Standard_EXPORT bool HasFaulty() const;
0099 
0100   //! returns a result of test
0101   Standard_EXPORT const NCollection_List<BOPAlgo_CheckResult>& GetCheckResult() const;
0102 
0103 protected:
0104   //! Prepares data;
0105   Standard_EXPORT void Prepare();
0106 
0107   Standard_EXPORT void TestTypes();
0108 
0109   Standard_EXPORT void TestSelfInterferences(const Message_ProgressRange& theRange);
0110 
0111   Standard_EXPORT void TestSmallEdge();
0112 
0113   Standard_EXPORT void TestRebuildFace();
0114 
0115   Standard_EXPORT void TestTangent();
0116 
0117   Standard_EXPORT void TestMergeSubShapes(const TopAbs_ShapeEnum theType);
0118 
0119   Standard_EXPORT void TestMergeVertex();
0120 
0121   Standard_EXPORT void TestMergeEdge();
0122 
0123   Standard_EXPORT void TestContinuity();
0124 
0125   Standard_EXPORT void TestCurveOnSurface();
0126 
0127 private:
0128   TopoDS_Shape                          myShape1;
0129   TopoDS_Shape                          myShape2;
0130   bool                                  myStopOnFirst;
0131   BOPAlgo_Operation                     myOperation;
0132   bool                                  myArgumentTypeMode;
0133   bool                                  mySelfInterMode;
0134   bool                                  mySmallEdgeMode;
0135   bool                                  myRebuildFaceMode;
0136   bool                                  myTangentMode;
0137   bool                                  myMergeVertexMode;
0138   bool                                  myMergeEdgeMode;
0139   bool                                  myContinuityMode;
0140   bool                                  myCurveOnSurfaceMode;
0141   bool                                  myEmpty1;
0142   bool                                  myEmpty2;
0143   NCollection_List<BOPAlgo_CheckResult> myResult;
0144 };
0145 
0146 #include <BOPAlgo_ArgumentAnalyzer.lxx>
0147 
0148 #endif // _BOPAlgo_ArgumentAnalyzer_HeaderFile