Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:03

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_ListOfCheckResult.hxx>
0027 #include <TopAbs_ShapeEnum.hxx>
0028 
0029 
0030 //! check the validity of argument(s) for Boolean Operations
0031 class BOPAlgo_ArgumentAnalyzer  : public BOPAlgo_Algo
0032 {
0033 public:
0034 
0035   DEFINE_STANDARD_ALLOC
0036 
0037   
0038   //! empty constructor
0039   Standard_EXPORT BOPAlgo_ArgumentAnalyzer();
0040 Standard_EXPORT virtual ~BOPAlgo_ArgumentAnalyzer();
0041   
0042   //! sets object shape
0043   Standard_EXPORT void SetShape1 (const TopoDS_Shape& TheShape);
0044   
0045   //! sets tool shape
0046   Standard_EXPORT void SetShape2 (const TopoDS_Shape& TheShape);
0047   
0048   //! returns object shape;
0049   Standard_EXPORT const TopoDS_Shape& GetShape1() const;
0050   
0051   //! returns tool shape
0052   Standard_EXPORT const TopoDS_Shape& GetShape2() const;
0053   
0054   //! returns ref
0055   Standard_EXPORT BOPAlgo_Operation& OperationType();
0056   
0057   //! returns ref
0058   Standard_EXPORT Standard_Boolean& StopOnFirstFaulty();
0059   
0060   //! Returns (modifiable) mode
0061   //! that means checking types of shapes.
0062     Standard_Boolean& ArgumentTypeMode();
0063   
0064   //! Returns (modifiable) mode that means
0065   //! checking of self-intersection of shapes.
0066     Standard_Boolean& SelfInterMode();
0067   
0068   //! Returns (modifiable) mode that means
0069   //! checking of small edges.
0070     Standard_Boolean& SmallEdgeMode();
0071   
0072   //! Returns (modifiable) mode that means
0073   //! checking of possibility to split or rebuild faces.
0074     Standard_Boolean& RebuildFaceMode();
0075   
0076   //! Returns (modifiable) mode that means
0077   //! checking of tangency between subshapes.
0078     Standard_Boolean& TangentMode();
0079   
0080   //! Returns (modifiable) mode that means
0081   //! checking of problem of merging vertices.
0082     Standard_Boolean& MergeVertexMode();
0083   
0084   //! Returns (modifiable) mode that means
0085   //! checking of problem of merging edges.
0086     Standard_Boolean& MergeEdgeMode();
0087   
0088   //! Returns (modifiable) mode that means
0089   //! checking of problem of continuity of the shape.
0090     Standard_Boolean& ContinuityMode();
0091   
0092   //! Returns (modifiable) mode that means
0093   //! checking of problem of invalid curve on surface.
0094     Standard_Boolean& CurveOnSurfaceMode();
0095   
0096   //! performs analysis
0097   Standard_EXPORT void Perform(const Message_ProgressRange& theRange = Message_ProgressRange());
0098   
0099   //! result of test
0100   Standard_EXPORT Standard_Boolean HasFaulty() const;
0101   
0102   //! returns a result of test
0103   Standard_EXPORT const BOPAlgo_ListOfCheckResult& GetCheckResult() const;
0104   
0105 
0106 protected:
0107 
0108   
0109   //! Prepares data;
0110   Standard_EXPORT void Prepare();
0111   
0112   Standard_EXPORT void TestTypes();
0113   
0114   Standard_EXPORT void TestSelfInterferences(const Message_ProgressRange& theRange);
0115   
0116   Standard_EXPORT void TestSmallEdge();
0117   
0118   Standard_EXPORT void TestRebuildFace();
0119   
0120   Standard_EXPORT void TestTangent();
0121   
0122   Standard_EXPORT void TestMergeSubShapes (const TopAbs_ShapeEnum theType);
0123   
0124   Standard_EXPORT void TestMergeVertex();
0125   
0126   Standard_EXPORT void TestMergeEdge();
0127   
0128   Standard_EXPORT void TestContinuity();
0129   
0130   Standard_EXPORT void TestCurveOnSurface();
0131   
0132 
0133 private:
0134 
0135 
0136   TopoDS_Shape myShape1;
0137   TopoDS_Shape myShape2;
0138   Standard_Boolean myStopOnFirst;
0139   BOPAlgo_Operation myOperation;
0140   Standard_Boolean myArgumentTypeMode;
0141   Standard_Boolean mySelfInterMode;
0142   Standard_Boolean mySmallEdgeMode;
0143   Standard_Boolean myRebuildFaceMode;
0144   Standard_Boolean myTangentMode;
0145   Standard_Boolean myMergeVertexMode;
0146   Standard_Boolean myMergeEdgeMode;
0147   Standard_Boolean myContinuityMode;
0148   Standard_Boolean myCurveOnSurfaceMode;
0149   Standard_Boolean myEmpty1;
0150   Standard_Boolean myEmpty2;
0151   BOPAlgo_ListOfCheckResult myResult;
0152 
0153 };
0154 
0155 
0156 #include <BOPAlgo_ArgumentAnalyzer.lxx>
0157 
0158 
0159 #endif // _BOPAlgo_ArgumentAnalyzer_HeaderFile