Back to home page

EIC code displayed by LXR

 
 

    


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

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