1 // Created on: 1992-09-28 2 // Created by: Didier PIFFAULT 3 // Copyright (c) 1992-1999 Matra Datavision 4 // Copyright (c) 1999-2014 OPEN CASCADE SAS 5 // 6 // This file is part of Open CASCADE Technology software library. 7 // 8 // This library is free software; you can redistribute it and/or modify it under 9 // the terms of the GNU Lesser General Public License version 2.1 as published 10 // by the Free Software Foundation, with special exception defined in the file 11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 12 // distribution for complete text of the license and disclaimer of any warranty. 13 // 14 // Alternatively, this file may be used under the terms of Open CASCADE 15 // commercial license or contractual agreement. 16 17 #ifndef _Intf_InterferencePolygon2d_HeaderFile 18 #define _Intf_InterferencePolygon2d_HeaderFile 19 20 #include <Standard.hxx> 21 #include <Standard_DefineAlloc.hxx> 22 #include <Standard_Handle.hxx> 23 24 #include <Standard_Boolean.hxx> 25 #include <Standard_Integer.hxx> 26 #include <Intf_Interference.hxx> 27 class Intf_Polygon2d; 28 class gp_Pnt2d; 29 30 31 //! Computes the interference between two polygons or 32 //! the self intersection of a polygon in two 33 //! dimensions. 34 class Intf_InterferencePolygon2d : public Intf_Interference 35 { 36 public: 37 38 DEFINE_STANDARD_ALLOC 39 40 41 //! Constructs an empty interference of Polygon. 42 Standard_EXPORT Intf_InterferencePolygon2d(); 43 44 //! Constructs and computes an interference between two Polygons. 45 Standard_EXPORT Intf_InterferencePolygon2d(const Intf_Polygon2d& Obje1, const Intf_Polygon2d& Obje2); 46 47 //! Constructs and computes the auto interference of a Polygon. 48 Standard_EXPORT Intf_InterferencePolygon2d(const Intf_Polygon2d& Obje); 49 50 //! Computes an interference between two Polygons. 51 Standard_EXPORT void Perform (const Intf_Polygon2d& Obje1, const Intf_Polygon2d& Obje2); 52 53 //! Computes the self interference of a Polygon. 54 Standard_EXPORT void Perform (const Intf_Polygon2d& Obje); 55 56 //! Gives the geometrical 2d point of the intersection 57 //! point at address <Index> in the interference. 58 Standard_EXPORT gp_Pnt2d Pnt2dValue (const Standard_Integer Index) const; 59 60 61 62 63 protected: 64 65 66 67 68 69 private: 70 71 72 Standard_EXPORT void Interference (const Intf_Polygon2d& Obje1, const Intf_Polygon2d& Obje2); 73 74 Standard_EXPORT void Interference (const Intf_Polygon2d& Obje); 75 76 Standard_EXPORT void Clean(); 77 78 //! Computes the intersection between two segments 79 //! <BegO><EndO> et <BegT><EndT>. 80 Standard_EXPORT void Intersect (const Standard_Integer iO, const Standard_Integer iT, const gp_Pnt2d& BegO, const gp_Pnt2d& EndO, const gp_Pnt2d& BegT, const gp_Pnt2d& EndT); 81 82 83 Standard_Boolean oClos; 84 Standard_Boolean tClos; 85 Standard_Integer nbso; 86 87 88 }; 89 90 91 92 93 94 95 96 #endif // _Intf_InterferencePolygon2d_HeaderFile 97