Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-06-04
0002 // Created by: Jacques GOUSSARD
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 _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile
0018 #define _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TColgp_Array1OfPnt2d.hxx>
0025 #include <TColStd_Array1OfReal.hxx>
0026 #include <TColStd_Array1OfInteger.hxx>
0027 #include <Standard_Boolean.hxx>
0028 #include <Intf_Polygon2d.hxx>
0029 class Standard_OutOfRange;
0030 class Adaptor2d_Curve2d;
0031 class Geom2dInt_Geom2dCurveTool;
0032 class IntRes2d_Domain;
0033 class Bnd_Box2d;
0034 class gp_Pnt2d;
0035 
0036 
0037 
0038 class Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter  : public Intf_Polygon2d
0039 {
0040 public:
0041 
0042   DEFINE_STANDARD_ALLOC
0043 
0044   
0045   //! Compute a polygon on the domain of the curve.
0046   Standard_EXPORT Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter(const Adaptor2d_Curve2d& Curve, const Standard_Integer NbPnt, const IntRes2d_Domain& Domain, const Standard_Real Tol);
0047   
0048   //! The current polygon is modified if most
0049   //! of the  points of the  polygon  are
0050   //! outside  the  box  <OtherBox>.  In this
0051   //! situation, bounds are computed to build
0052   //! a polygon inside or near the OtherBox.
0053   Standard_EXPORT void ComputeWithBox (const Adaptor2d_Curve2d& Curve, const Bnd_Box2d& OtherBox);
0054   
0055     virtual Standard_Real DeflectionOverEstimation() const Standard_OVERRIDE;
0056   
0057     void SetDeflectionOverEstimation (const Standard_Real x);
0058   
0059     void Closed (const Standard_Boolean clos);
0060   
0061   //! Returns True if the polyline is closed.
0062     virtual Standard_Boolean Closed () const Standard_OVERRIDE { return ClosedPolygon; }
0063   
0064   //! Give the number of Segments in the polyline.
0065     virtual Standard_Integer NbSegments() const Standard_OVERRIDE;
0066   
0067   //! Returns the points of the segment <Index> in the Polygon.
0068   Standard_EXPORT virtual void Segment (const Standard_Integer theIndex, gp_Pnt2d& theBegin, gp_Pnt2d& theEnd) const Standard_OVERRIDE;
0069   
0070   //! Returns the parameter (On the curve)
0071   //! of the first point of the Polygon
0072     Standard_Real InfParameter() const;
0073   
0074   //! Returns the parameter (On the curve)
0075   //! of the last point of the Polygon
0076     Standard_Real SupParameter() const;
0077   
0078   Standard_EXPORT Standard_Boolean AutoIntersectionIsPossible() const;
0079   
0080   //! Give an approximation of the parameter on the curve
0081   //! according to the discretization of the Curve.
0082   Standard_EXPORT Standard_Real ApproxParamOnCurve (const Standard_Integer Index, const Standard_Real ParamOnLine) const;
0083   
0084     Standard_Integer CalculRegion (const Standard_Real x, const Standard_Real y, const Standard_Real x1, const Standard_Real x2, const Standard_Real y1, const Standard_Real y2) const;
0085   
0086   Standard_EXPORT void Dump() const;
0087 
0088 
0089 
0090 
0091 protected:
0092 
0093 
0094 
0095 
0096 
0097 private:
0098 
0099 
0100 
0101   Standard_Real TheDeflection;
0102   Standard_Integer NbPntIn;
0103   Standard_Integer TheMaxNbPoints;
0104   TColgp_Array1OfPnt2d ThePnts;
0105   TColStd_Array1OfReal TheParams;
0106   TColStd_Array1OfInteger TheIndex;
0107   Standard_Boolean ClosedPolygon;
0108   Standard_Real Binf;
0109   Standard_Real Bsup;
0110 
0111 
0112 };
0113 
0114 #define TheCurve Adaptor2d_Curve2d
0115 #define TheCurve_hxx <Adaptor2d_Curve2d.hxx>
0116 #define TheCurveTool Geom2dInt_Geom2dCurveTool
0117 #define TheCurveTool_hxx <Geom2dInt_Geom2dCurveTool.hxx>
0118 #define IntCurve_Polygon2dGen Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter
0119 #define IntCurve_Polygon2dGen_hxx <Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx>
0120 
0121 #include <IntCurve_Polygon2dGen.lxx>
0122 
0123 #undef TheCurve
0124 #undef TheCurve_hxx
0125 #undef TheCurveTool
0126 #undef TheCurveTool_hxx
0127 #undef IntCurve_Polygon2dGen
0128 #undef IntCurve_Polygon2dGen_hxx
0129 
0130 
0131 
0132 
0133 #endif // _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile