Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-11-19
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1992-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 _BRepClass_FaceExplorer_HeaderFile
0018 #define _BRepClass_FaceExplorer_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0023 
0024 #include <TopAbs_Orientation.hxx>
0025 #include <TopoDS_Face.hxx>
0026 #include <TopExp_Explorer.hxx>
0027 #include <Standard_Integer.hxx>
0028 class gp_Pnt2d;
0029 class gp_Lin2d;
0030 class BRepClass_Edge;
0031 
0032 
0033 //! Provide an   exploration of a  BRep Face   for the
0034 //! classification. Return UV edges.
0035 class BRepClass_FaceExplorer 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   
0042   Standard_EXPORT BRepClass_FaceExplorer(const TopoDS_Face& F);
0043 
0044   //! Checks the point and change its coords if it is located too far
0045   //! from the bounding box of the face. New Coordinates of the point 
0046   //! will be on the line between the point and the center of the 
0047   //! bounding box. Returns True if point was not changed.
0048   Standard_EXPORT Standard_Boolean CheckPoint (gp_Pnt2d& thePoint);
0049   
0050   //! Should  return  True  if the  point  is  outside a
0051   //! bounding volume of the face.
0052   Standard_EXPORT Standard_Boolean Reject (const gp_Pnt2d& P) const;
0053   
0054   //! Returns  in <L>, <Par>  a segment having at least
0055   //! one  intersection  with  the   face  boundary  to
0056   //! compute  intersections.
0057   Standard_EXPORT Standard_Boolean Segment (const gp_Pnt2d& P, gp_Lin2d& L, Standard_Real& Par);
0058   
0059   //! Returns  in <L>, <Par>  a segment having at least
0060   //! one  intersection  with  the   face  boundary  to
0061   //! compute  intersections. Each call gives another segment.
0062   Standard_EXPORT Standard_Boolean OtherSegment (const gp_Pnt2d& P, gp_Lin2d& L, Standard_Real& Par);
0063   
0064   //! Starts an exploration of the wires.
0065   Standard_EXPORT void InitWires();
0066   
0067   //! Returns True if there is  a current wire.
0068     Standard_Boolean MoreWires() const;
0069   
0070   //! Sets the explorer  to the  next  wire.
0071     void NextWire();
0072   
0073   //! Returns True  if the wire  bounding volume does not
0074   //! intersect the segment.
0075   Standard_EXPORT Standard_Boolean RejectWire (const gp_Lin2d& L, const Standard_Real Par) const;
0076   
0077   //! Starts an exploration of the  edges of the current
0078   //! wire.
0079   Standard_EXPORT void InitEdges();
0080   
0081   //! Returns True if there is a current edge.
0082     Standard_Boolean MoreEdges() const;
0083   
0084   //! Sets the explorer  to the  next  edge.
0085     void NextEdge();
0086   
0087   //! Returns True  if the edge  bounding volume does not
0088   //! intersect the segment.
0089   Standard_EXPORT Standard_Boolean RejectEdge (const gp_Lin2d& L, const Standard_Real Par) const;
0090   
0091   //! Current edge in current wire and its orientation.
0092   Standard_EXPORT void CurrentEdge (BRepClass_Edge& E, TopAbs_Orientation& Or) const;
0093 
0094   //! Returns the maximum tolerance
0095   Standard_Real MaxTolerance() const
0096   {
0097     return myMaxTolerance;
0098   }
0099 
0100   //! Sets the maximum tolerance at 
0101   //! which to start checking in the intersector
0102   void SetMaxTolerance(const Standard_Real theValue)
0103   {
0104     myMaxTolerance = theValue;
0105   }
0106 
0107   //! Returns true if we are using boxes
0108   //! in the intersector
0109   Standard_Boolean UseBndBox() const
0110   {
0111     return myUseBndBox;
0112   }
0113 
0114   //! Sets the status of whether we are
0115   //! using boxes or not
0116   void SetUseBndBox(const Standard_Boolean theValue)
0117   {
0118     myUseBndBox = theValue;
0119   }
0120 
0121 
0122 
0123 
0124 protected:
0125 
0126   //! Computes UV bounds of a face
0127   Standard_EXPORT void ComputeFaceBounds();
0128 
0129 
0130 private:
0131 
0132 
0133 
0134   TopoDS_Face myFace;
0135   TopExp_Explorer myWExplorer;
0136   TopExp_Explorer myEExplorer;
0137   Standard_Integer myCurEdgeInd;
0138   Standard_Real myCurEdgePar;
0139   Standard_Real myMaxTolerance;
0140   Standard_Boolean myUseBndBox;
0141   TopTools_IndexedDataMapOfShapeListOfShape myMapVE;
0142 
0143   Standard_Real myUMin;
0144   Standard_Real myUMax;
0145   Standard_Real myVMin;
0146   Standard_Real myVMax;
0147 };
0148 
0149 
0150 #include <BRepClass_FaceExplorer.lxx>
0151 
0152 
0153 
0154 
0155 
0156 #endif // _BRepClass_FaceExplorer_HeaderFile