Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:24

0001 // Created on: 1994-10-13
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1994-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 _TopOpeBRep_FaceEdgeIntersector_HeaderFile
0018 #define _TopOpeBRep_FaceEdgeIntersector_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopoDS_Face.hxx>
0024 #include <TopoDS_Edge.hxx>
0025 #include <GeomAdaptor_Curve.hxx>
0026 #include <IntCurveSurface_SequenceOfPnt.hxx>
0027 #include <TColStd_SequenceOfInteger.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <TopExp_Explorer.hxx>
0030 #include <TopoDS_Shape.hxx>
0031 #include <TopoDS_Vertex.hxx>
0032 #include <TopAbs_State.hxx>
0033 #include <TopAbs_Orientation.hxx>
0034 #include <TopAbs_ShapeEnum.hxx>
0035 class gp_Pnt;
0036 class gp_Pnt2d;
0037 class TopOpeBRepDS_Transition;
0038 
0039 
0040 //! Describes the intersection of a face and an edge.
0041 class TopOpeBRep_FaceEdgeIntersector 
0042 {
0043 public:
0044 
0045   DEFINE_STANDARD_ALLOC
0046 
0047   
0048   Standard_EXPORT TopOpeBRep_FaceEdgeIntersector();
0049   
0050   Standard_EXPORT void Perform (const TopoDS_Shape& F, const TopoDS_Shape& E);
0051   
0052   Standard_EXPORT Standard_Boolean IsEmpty();
0053   
0054   //! returns intersected face or edge according to
0055   //! value of <Index> = 1 or 2
0056   Standard_EXPORT const TopoDS_Shape& Shape (const Standard_Integer Index) const;
0057   
0058 
0059   //! Force the tolerance values used by the next Perform(S1,S2) call.
0060   Standard_EXPORT void ForceTolerance (const Standard_Real tol);
0061   
0062 
0063   //! Return the tolerance value used in the last Perform() call
0064   //! If ForceTolerance() has been called, return the given value.
0065   //! If not, return value extracted from shapes.
0066   Standard_EXPORT Standard_Real Tolerance() const;
0067   
0068   Standard_EXPORT Standard_Integer NbPoints() const;
0069   
0070   Standard_EXPORT void InitPoint();
0071   
0072   Standard_EXPORT Standard_Boolean MorePoint() const;
0073   
0074   Standard_EXPORT void NextPoint();
0075   
0076   //! return the 3D point of the current intersection point.
0077   Standard_EXPORT gp_Pnt Value() const;
0078   
0079   //! parametre de Value() sur l'arete
0080   Standard_EXPORT Standard_Real Parameter() const;
0081   
0082   //! parametre de Value() sur la face
0083   Standard_EXPORT void UVPoint (gp_Pnt2d& P) const;
0084   
0085   //! IN ou ON / a la face. Les points OUT ne sont pas retournes.
0086   Standard_EXPORT TopAbs_State State() const;
0087   
0088 
0089   //! Index = 1 transition par rapport a la face, en cheminant sur l'arete
0090   Standard_EXPORT TopOpeBRepDS_Transition Transition (const Standard_Integer Index, const TopAbs_Orientation FaceOrientation) const;
0091   
0092   Standard_EXPORT Standard_Boolean IsVertex (const TopoDS_Shape& S, const gp_Pnt& P, const Standard_Real Tol, TopoDS_Vertex& V);
0093   
0094   Standard_EXPORT Standard_Boolean IsVertex (const Standard_Integer I, TopoDS_Vertex& V);
0095   
0096   //! trace only
0097   Standard_EXPORT Standard_Integer Index() const;
0098 
0099 
0100 
0101 
0102 protected:
0103 
0104 
0105 
0106 
0107 
0108 private:
0109 
0110   
0111   Standard_EXPORT void ResetIntersection();
0112   
0113   //! extract tolerance values from shapes <S1>,<S2>,
0114   //! in order to perform intersection between <S1> and <S2>
0115   //! with tolerance values "fitting" the shape tolerances.
0116   //! (called by Perform() by default, when ForceTolerances() has not
0117   //! been called)
0118   Standard_EXPORT void ShapeTolerances (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
0119   
0120   //! returns the max tolerance of sub-shapes of type <T>
0121   //! found in shape <S>. If no such sub-shape found, return
0122   //! Precision::Intersection()
0123   //! (called by ShapeTolerances())
0124   Standard_EXPORT Standard_Real ToleranceMax (const TopoDS_Shape& S, const TopAbs_ShapeEnum T) const;
0125 
0126 
0127   TopoDS_Face myFace;
0128   TopoDS_Edge myEdge;
0129   Standard_Real myTol;
0130   Standard_Boolean myForceTolerance;
0131   GeomAdaptor_Curve myCurve;
0132   Standard_Boolean myIntersectionDone;
0133   IntCurveSurface_SequenceOfPnt mySequenceOfPnt;
0134   TColStd_SequenceOfInteger mySequenceOfState;
0135   Standard_Integer myPointIndex;
0136   Standard_Integer myNbPoints;
0137   TopExp_Explorer myVertexExplorer;
0138   TopoDS_Shape myNullShape;
0139   TopoDS_Vertex myNullVertex;
0140 
0141 
0142 };
0143 
0144 
0145 
0146 
0147 
0148 
0149 
0150 #endif // _TopOpeBRep_FaceEdgeIntersector_HeaderFile