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_EdgesIntersector_HeaderFile
0018 #define _TopOpeBRep_EdgesIntersector_HeaderFile
0019 
0020 #include <BRepAdaptor_Surface.hxx>
0021 #include <GeomAbs_SurfaceType.hxx>
0022 #include <Geom2dAdaptor_Curve.hxx>
0023 #include <Geom2dInt_GInter.hxx>
0024 #include <IntRes2d_Domain.hxx>
0025 #include <IntRes2d_SequenceOfIntersectionPoint.hxx>
0026 #include <IntRes2d_SequenceOfIntersectionSegment.hxx>
0027 #include <TopAbs_Orientation.hxx>
0028 #include <TopoDS_Face.hxx>
0029 #include <TopOpeBRep_SequenceOfPoint2d.hxx>
0030 #include <TopOpeBRep_P2Dstatus.hxx>
0031 #include <TopOpeBRepDS_Config.hxx>
0032 
0033 class Bnd_Box;
0034 class BRepAdaptor_Surface;
0035 class TCollection_AsciiString;
0036 class TopOpeBRep_Point2d;
0037 class IntRes2d_IntersectionSegment;
0038 class IntRes2d_IntersectionPoint;
0039 class TopOpeBRepDS_Transition;
0040 class gp_Pnt;
0041 
0042 //! Describes the intersection of two edges on the same surface
0043 class TopOpeBRep_EdgesIntersector 
0044 {
0045 public:
0046 
0047   DEFINE_STANDARD_ALLOC
0048 
0049   
0050   Standard_EXPORT TopOpeBRep_EdgesIntersector();
0051   
0052   Standard_EXPORT virtual ~TopOpeBRep_EdgesIntersector();
0053   
0054   Standard_EXPORT void SetFaces (const TopoDS_Shape& F1, const TopoDS_Shape& F2);
0055   
0056   Standard_EXPORT void SetFaces (const TopoDS_Shape& F1, const TopoDS_Shape& F2, const Bnd_Box& B1, const Bnd_Box& B2);
0057   
0058   Standard_EXPORT void ForceTolerances (const Standard_Real Tol1, const Standard_Real Tol2);
0059   
0060   Standard_EXPORT void Dimension (const Standard_Integer D);
0061   
0062   //! set working space dimension D = 1 for E &|| W, 2 for E in F
0063   Standard_EXPORT Standard_Integer Dimension() const;
0064   
0065   Standard_EXPORT void Perform (const TopoDS_Shape& E1, const TopoDS_Shape& E2, const Standard_Boolean ReduceSegments = Standard_True);
0066   
0067   Standard_EXPORT Standard_Boolean IsEmpty();
0068   
0069   //! true if at least one intersection segment.
0070   Standard_EXPORT Standard_Boolean HasSegment() const;
0071   
0072   //! = mySameDomain.
0073   Standard_EXPORT Standard_Boolean SameDomain() const;
0074   
0075   Standard_EXPORT const TopoDS_Shape& Edge (const Standard_Integer Index) const;
0076   
0077   Standard_EXPORT const Geom2dAdaptor_Curve& Curve (const Standard_Integer Index) const;
0078   
0079   Standard_EXPORT const TopoDS_Shape& Face (const Standard_Integer Index) const;
0080   
0081   Standard_EXPORT const BRepAdaptor_Surface& Surface (const Standard_Integer Index) const;
0082   
0083   Standard_EXPORT Standard_Boolean SurfacesSameOriented() const;
0084   
0085   Standard_EXPORT Standard_Boolean FacesSameOriented() const;
0086   
0087   Standard_EXPORT Standard_Real ToleranceMax() const;
0088   
0089   Standard_EXPORT void Tolerances (Standard_Real& tol1, Standard_Real& tol2) const;
0090   
0091   Standard_EXPORT Standard_Integer NbPoints() const;
0092   
0093   Standard_EXPORT Standard_Integer NbSegments() const;
0094   
0095   Standard_EXPORT void Dump (const TCollection_AsciiString& str, const Standard_Integer ie1 = 0, const Standard_Integer ie2 = 0);
0096   
0097   Standard_EXPORT void InitPoint (const Standard_Boolean selectkeep = Standard_True);
0098   
0099   Standard_EXPORT Standard_Boolean MorePoint() const;
0100   
0101   Standard_EXPORT void NextPoint();
0102   
0103   Standard_EXPORT const TopOpeBRep_SequenceOfPoint2d& Points() const;
0104   
0105   Standard_EXPORT const TopOpeBRep_Point2d& Point() const;
0106   
0107   Standard_EXPORT const TopOpeBRep_Point2d& Point (const Standard_Integer I) const;
0108   
0109   Standard_EXPORT virtual Standard_Boolean ReduceSegment (TopOpeBRep_Point2d& P1, TopOpeBRep_Point2d& P2, TopOpeBRep_Point2d& Pn) const;
0110   
0111   Standard_EXPORT TopOpeBRep_P2Dstatus Status1() const;
0112 
0113 
0114 
0115 
0116 protected:
0117 
0118 
0119 
0120 
0121 
0122 private:
0123 
0124   
0125   Standard_EXPORT void Find();
0126   
0127   //! process if current edges can be considered as SameDomain
0128   Standard_EXPORT Standard_Boolean ComputeSameDomain();
0129   
0130   //! set field mySameDomain to B and return B value
0131   Standard_EXPORT Standard_Boolean SetSameDomain (const Standard_Boolean B);
0132   
0133   Standard_EXPORT void MakePoints2d();
0134   
0135   Standard_EXPORT void ReduceSegments();
0136   
0137   Standard_EXPORT const IntRes2d_IntersectionSegment& Segment1() const;
0138   
0139   Standard_EXPORT Standard_Boolean IsOpposite1() const;
0140   
0141   Standard_EXPORT void InitPoint1();
0142   
0143   Standard_EXPORT Standard_Boolean MorePoint1() const;
0144   
0145   Standard_EXPORT void NextPoint1();
0146   
0147   Standard_EXPORT const IntRes2d_IntersectionPoint& Point1() const;
0148   
0149   Standard_EXPORT TopOpeBRepDS_Transition Transition1 (const Standard_Integer Index, const TopAbs_Orientation EO) const;
0150   
0151   Standard_EXPORT Standard_Real Parameter1 (const Standard_Integer Index) const;
0152   
0153   Standard_EXPORT Standard_Boolean IsVertex1 (const Standard_Integer Index);
0154   
0155   Standard_EXPORT const TopoDS_Shape& Vertex1 (const Standard_Integer Index);
0156   
0157   Standard_EXPORT gp_Pnt Value1() const;
0158   
0159   Standard_EXPORT Standard_Boolean IsPointOfSegment1() const;
0160   
0161   Standard_EXPORT Standard_Integer Index1() const;
0162   
0163   //! geometric configuration of E1,E2 at current intersection point :
0164   //! UNSHGEOMETRY if the edges do not share geometry.
0165   //! SAMEORIENTED if the edges share geometry and are same oriented.
0166   //! DIFFORIENTED if the edges share geometry and are not same oriented.
0167   Standard_EXPORT TopOpeBRepDS_Config EdgesConfig1() const;
0168 
0169 
0170   TopoDS_Face myFace1;
0171   TopoDS_Face myFace2;
0172   Handle(BRepAdaptor_Surface) mySurface1;
0173   Handle(BRepAdaptor_Surface) mySurface2;
0174   GeomAbs_SurfaceType mySurfaceType1;
0175   GeomAbs_SurfaceType mySurfaceType2;
0176   Standard_Boolean mySurfacesSameOriented;
0177   Standard_Boolean myFacesSameOriented;
0178   IntRes2d_Domain myDomain1;
0179   IntRes2d_Domain myDomain2;
0180   TopoDS_Edge myEdge1;
0181   TopoDS_Edge myEdge2;
0182   Geom2dAdaptor_Curve myCurve1;
0183   Geom2dAdaptor_Curve myCurve2;
0184   Standard_Real myTol1;
0185   Standard_Real myTol2;
0186   Standard_Boolean myTolForced;
0187   Geom2dInt_GInter myIntersector;
0188   IntRes2d_SequenceOfIntersectionPoint mylpnt;
0189   IntRes2d_SequenceOfIntersectionSegment mylseg;
0190   Standard_Integer myNbPoints;
0191   Standard_Integer myNbSegments;
0192   Standard_Integer myTrueNbPoints;
0193   Standard_Integer myPointIndex;
0194   Standard_Integer myIsVertexPointIndex;
0195   Standard_Integer myIsVertexIndex;
0196   Standard_Boolean myIsVertexValue;
0197   TopoDS_Vertex myIsVertexVertex;
0198   Standard_Integer myDimension;
0199   Standard_Boolean myHasSegment;
0200   Standard_Boolean mySameDomain;
0201   Standard_Boolean myf1surf1F_sameoriented;
0202   Standard_Boolean myf2surf1F_sameoriented;
0203   TopOpeBRep_SequenceOfPoint2d mysp2d;
0204   Standard_Integer myip2d;
0205   Standard_Integer mynp2d;
0206   Standard_Boolean myselectkeep;
0207 
0208 
0209 };
0210 
0211 
0212 
0213 
0214 
0215 
0216 
0217 #endif // _TopOpeBRep_EdgesIntersector_HeaderFile