Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:59:48

0001 // Created on: 1993-06-17
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _TopOpeBRepBuild_WireEdgeClassifier_HeaderFile
0018 #define _TopOpeBRepBuild_WireEdgeClassifier_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Boolean.hxx>
0025 #include <gp_Pnt2d.hxx>
0026 #include <BRepClass_Edge.hxx>
0027 #include <BRepClass_FacePassiveClassifier.hxx>
0028 #include <TopoDS_Shape.hxx>
0029 #include <TopOpeBRepBuild_CompositeClassifier.hxx>
0030 #include <TopAbs_State.hxx>
0031 class TopOpeBRepBuild_BlockBuilder;
0032 class TopOpeBRepBuild_Loop;
0033 
0034 //! Classify edges and wires.
0035 //! shapes are Wires, Element are Edge.
0036 class TopOpeBRepBuild_WireEdgeClassifier : public TopOpeBRepBuild_CompositeClassifier
0037 {
0038 public:
0039   DEFINE_STANDARD_ALLOC
0040 
0041   //! Creates a classifier on edge <F>.
0042   //! Used to compare edges and wires on the edge <F>.
0043   Standard_EXPORT TopOpeBRepBuild_WireEdgeClassifier(const TopoDS_Shape&                 F,
0044                                                      const TopOpeBRepBuild_BlockBuilder& BB);
0045 
0046   Standard_EXPORT TopAbs_State Compare(const occ::handle<TopOpeBRepBuild_Loop>& L1,
0047                                        const occ::handle<TopOpeBRepBuild_Loop>& L2) override;
0048 
0049   Standard_EXPORT TopoDS_Shape LoopToShape(const occ::handle<TopOpeBRepBuild_Loop>& L);
0050 
0051   //! classify wire <B1> with wire <B2>
0052   Standard_EXPORT TopAbs_State CompareShapes(const TopoDS_Shape& B1,
0053                                              const TopoDS_Shape& B2) override;
0054 
0055   //! classify edge <E> with wire <B>
0056   Standard_EXPORT TopAbs_State CompareElementToShape(const TopoDS_Shape& E,
0057                                                      const TopoDS_Shape& B) override;
0058 
0059   //! prepare classification involving wire <B>
0060   //! calls ResetElement on first edge of <B>
0061   Standard_EXPORT void ResetShape(const TopoDS_Shape& B) override;
0062 
0063   //! prepare classification involving edge <E>
0064   //! define 2D point (later used in Compare()) on first vertex of edge <E>.
0065   Standard_EXPORT void ResetElement(const TopoDS_Shape& E) override;
0066 
0067   //! Add the edge <E> in the set of edges used in 2D point
0068   //! classification.
0069   Standard_EXPORT bool CompareElement(const TopoDS_Shape& E) override;
0070 
0071   //! Returns state of classification of 2D point, defined by
0072   //! ResetElement, with the current set of edges, defined by Compare.
0073   Standard_EXPORT TopAbs_State State() override;
0074 
0075 private:
0076   bool                            myFirstCompare;
0077   gp_Pnt2d                        myPoint2d;
0078   BRepClass_Edge                  myBCEdge;
0079   BRepClass_FacePassiveClassifier myFPC;
0080   TopoDS_Shape                    myShape;
0081 };
0082 
0083 #endif // _TopOpeBRepBuild_WireEdgeClassifier_HeaderFile