Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:17:26

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_GInter_HeaderFile
0018 #define _Geom2dInt_GInter_HeaderFile
0019 
0020 #include <Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter.hxx>
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 
0024 #include <IntCurve_IntConicConic.hxx>
0025 #include <Geom2dInt_TheIntConicCurveOfGInter.hxx>
0026 #include <Geom2dInt_TheIntPCurvePCurveOfGInter.hxx>
0027 #include <IntRes2d_Intersection.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <NCollection_Array1.hxx>
0030 class Standard_ConstructionError;
0031 class Adaptor2d_Curve2d;
0032 class Geom2dInt_Geom2dCurveTool;
0033 class Geom2dInt_TheProjPCurOfGInter;
0034 class Geom2dInt_TheIntConicCurveOfGInter;
0035 class Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter;
0036 class Geom2dInt_IntConicCurveOfGInter;
0037 class Geom2dInt_TheIntPCurvePCurveOfGInter;
0038 class Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter;
0039 class Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter;
0040 class Geom2dInt_ExactIntersectionPointOfTheIntPCurvePCurveOfGInter;
0041 class IntRes2d_Domain;
0042 
0043 class Geom2dInt_GInter : public IntRes2d_Intersection
0044 {
0045 public:
0046   DEFINE_STANDARD_ALLOC
0047 
0048   //! Empty constructor.
0049   Geom2dInt_GInter();
0050 
0051   //! Self Intersection of a curve
0052   Geom2dInt_GInter(const Adaptor2d_Curve2d& C, const double TolConf, const double Tol);
0053 
0054   //! Self Intersection of a curve with a domain.
0055   Geom2dInt_GInter(const Adaptor2d_Curve2d& C,
0056                    const IntRes2d_Domain&   D,
0057                    const double             TolConf,
0058                    const double             Tol);
0059 
0060   //! Intersection between 2 curves.
0061   Geom2dInt_GInter(const Adaptor2d_Curve2d& C1,
0062                    const Adaptor2d_Curve2d& C2,
0063                    const double             TolConf,
0064                    const double             Tol);
0065 
0066   //! Intersection between 2 curves.
0067   Geom2dInt_GInter(const Adaptor2d_Curve2d& C1,
0068                    const IntRes2d_Domain&   D1,
0069                    const Adaptor2d_Curve2d& C2,
0070                    const double             TolConf,
0071                    const double             Tol);
0072 
0073   //! Intersection between 2 curves.
0074   Geom2dInt_GInter(const Adaptor2d_Curve2d& C1,
0075                    const Adaptor2d_Curve2d& C2,
0076                    const IntRes2d_Domain&   D2,
0077                    const double             TolConf,
0078                    const double             Tol);
0079 
0080   //! Intersection between 2 curves.
0081   Geom2dInt_GInter(const Adaptor2d_Curve2d& C1,
0082                    const IntRes2d_Domain&   D1,
0083                    const Adaptor2d_Curve2d& C2,
0084                    const IntRes2d_Domain&   D2,
0085                    const double             TolConf,
0086                    const double             Tol);
0087 
0088   //! Intersection between 2 curves.
0089   Standard_EXPORT void Perform(const Adaptor2d_Curve2d& C1,
0090                                const IntRes2d_Domain&   D1,
0091                                const Adaptor2d_Curve2d& C2,
0092                                const IntRes2d_Domain&   D2,
0093                                const double             TolConf,
0094                                const double             Tol);
0095 
0096   //! Intersection between 2 curves.
0097   void Perform(const Adaptor2d_Curve2d& C1,
0098                const Adaptor2d_Curve2d& C2,
0099                const double             TolConf,
0100                const double             Tol);
0101 
0102   //! Intersection between 2 curves.
0103   Standard_EXPORT void Perform(const Adaptor2d_Curve2d& C1,
0104                                const IntRes2d_Domain&   D1,
0105                                const double             TolConf,
0106                                const double             Tol);
0107 
0108   //! Intersection between 2 curves.
0109   Standard_EXPORT void Perform(const Adaptor2d_Curve2d& C1, const double TolConf, const double Tol);
0110 
0111   //! Intersection between 2 curves.
0112   void Perform(const Adaptor2d_Curve2d& C1,
0113                const IntRes2d_Domain&   D1,
0114                const Adaptor2d_Curve2d& C2,
0115                const double             TolConf,
0116                const double             Tol);
0117 
0118   //! Intersection between 2 curves.
0119   void Perform(const Adaptor2d_Curve2d& C1,
0120                const Adaptor2d_Curve2d& C2,
0121                const IntRes2d_Domain&   D2,
0122                const double             TolConf,
0123                const double             Tol);
0124 
0125   //! Create a domain from a curve
0126   Standard_EXPORT IntRes2d_Domain ComputeDomain(const Adaptor2d_Curve2d& C1,
0127                                                 const double             TolDomain) const;
0128 
0129   //! Set / get minimum number of points in polygon intersection.
0130   Standard_EXPORT void SetMinNbSamples(const int theMinNbSamples);
0131   Standard_EXPORT int  GetMinNbSamples() const;
0132 
0133 private:
0134   //! Intersection between 2 curves.
0135   Standard_EXPORT void InternalPerform(const Adaptor2d_Curve2d& C1,
0136                                        const IntRes2d_Domain&   D1,
0137                                        const Adaptor2d_Curve2d& C2,
0138                                        const IntRes2d_Domain&   D2,
0139                                        const double             TolConf,
0140                                        const double             Tol,
0141                                        const bool               Composite);
0142 
0143   //! Part of InternalCompositePerform function
0144   Standard_EXPORT void InternalCompositePerform_noRecurs(const int                NbInterC1,
0145                                                          const Adaptor2d_Curve2d& C1,
0146                                                          const int                NumInterC1,
0147                                                          const NCollection_Array1<double>& Tab1,
0148                                                          const IntRes2d_Domain&            D1,
0149                                                          const int                NbInterC2,
0150                                                          const Adaptor2d_Curve2d& C2,
0151                                                          const int                NumInterC2,
0152                                                          const NCollection_Array1<double>& Tab2,
0153                                                          const IntRes2d_Domain&            D2,
0154                                                          const double                      TolConf,
0155                                                          const double                      Tol);
0156 
0157   //! Intersection between 2 curves.
0158   Standard_EXPORT void InternalCompositePerform(const Adaptor2d_Curve2d&          C1,
0159                                                 const IntRes2d_Domain&            D1,
0160                                                 const int                         N1,
0161                                                 const int                         NB1,
0162                                                 const NCollection_Array1<double>& Tab1,
0163                                                 const Adaptor2d_Curve2d&          C2,
0164                                                 const IntRes2d_Domain&            D2,
0165                                                 const int                         N2,
0166                                                 const int                         NB2,
0167                                                 const NCollection_Array1<double>& Tab2,
0168                                                 const double                      TolConf,
0169                                                 const double                      Tol,
0170                                                 const bool                        Composite);
0171 
0172   double                               param1inf;
0173   double                               param1sup;
0174   double                               param2inf;
0175   double                               param2sup;
0176   IntCurve_IntConicConic               intconiconi;
0177   Geom2dInt_TheIntConicCurveOfGInter   intconicurv;
0178   Geom2dInt_TheIntPCurvePCurveOfGInter intcurvcurv;
0179 };
0180 
0181 #define TheCurve Adaptor2d_Curve2d
0182 #define TheCurve_hxx <Adaptor2d_Curve2d.hxx>
0183 #define TheCurveTool Geom2dInt_Geom2dCurveTool
0184 #define TheCurveTool_hxx <Geom2dInt_Geom2dCurveTool.hxx>
0185 #define IntCurve_TheProjPCur Geom2dInt_TheProjPCurOfGInter
0186 #define IntCurve_TheProjPCur_hxx <Geom2dInt_TheProjPCurOfGInter.hxx>
0187 #define IntCurve_TheCurveLocatorOfTheProjPCur Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter
0188 #define IntCurve_TheCurveLocatorOfTheProjPCur_hxx                                                  \
0189   <Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter.hxx>
0190 #define IntCurve_TheLocateExtPCOfTheProjPCur Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter
0191 #define IntCurve_TheLocateExtPCOfTheProjPCur_hxx                                                   \
0192   <Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter.hxx>
0193 #define IntCurve_TheCurveLocatorOfTheProjPCur Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter
0194 #define IntCurve_TheCurveLocatorOfTheProjPCur_hxx                                                  \
0195   <Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter.hxx>
0196 #define IntCurve_TheLocateExtPCOfTheProjPCur Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter
0197 #define IntCurve_TheLocateExtPCOfTheProjPCur_hxx                                                   \
0198   <Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter.hxx>
0199 #define IntCurve_TheIntConicCurve Geom2dInt_TheIntConicCurveOfGInter
0200 #define IntCurve_TheIntConicCurve_hxx <Geom2dInt_TheIntConicCurveOfGInter.hxx>
0201 #define IntCurve_TheIntersectorOfTheIntConicCurve Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter
0202 #define IntCurve_TheIntersectorOfTheIntConicCurve_hxx                                              \
0203   <Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter.hxx>
0204 #define IntCurve_TheIntersectorOfTheIntConicCurve Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter
0205 #define IntCurve_TheIntersectorOfTheIntConicCurve_hxx                                              \
0206   <Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter.hxx>
0207 #define IntCurve_IntConicCurve Geom2dInt_IntConicCurveOfGInter
0208 #define IntCurve_IntConicCurve_hxx <Geom2dInt_IntConicCurveOfGInter.hxx>
0209 #define IntCurve_TheIntPCurvePCurve Geom2dInt_TheIntPCurvePCurveOfGInter
0210 #define IntCurve_TheIntPCurvePCurve_hxx <Geom2dInt_TheIntPCurvePCurveOfGInter.hxx>
0211 #define IntCurve_ThePolygon2dOfTheIntPCurvePCurve Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter
0212 #define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx                                              \
0213   <Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx>
0214 #define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve                                         \
0215   Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter
0216 #define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx                                     \
0217   <Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter.hxx>
0218 #define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve                                        \
0219   Geom2dInt_ExactIntersectionPointOfTheIntPCurvePCurveOfGInter
0220 #define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx                                    \
0221   <Geom2dInt_ExactIntersectionPointOfTheIntPCurvePCurveOfGInter.hxx>
0222 #define IntCurve_ThePolygon2dOfTheIntPCurvePCurve Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter
0223 #define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx                                              \
0224   <Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx>
0225 #define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve                                         \
0226   Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter
0227 #define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx                                     \
0228   <Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter.hxx>
0229 #define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve                                        \
0230   Geom2dInt_ExactIntersectionPointOfTheIntPCurvePCurveOfGInter
0231 #define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx                                    \
0232   <Geom2dInt_ExactIntersectionPointOfTheIntPCurvePCurveOfGInter.hxx>
0233 #define IntCurve_IntCurveCurveGen Geom2dInt_GInter
0234 #define IntCurve_IntCurveCurveGen_hxx <Geom2dInt_GInter.hxx>
0235 
0236 #include <IntCurve_IntCurveCurveGen.lxx>
0237 
0238 #undef TheCurve
0239 #undef TheCurve_hxx
0240 #undef TheCurveTool
0241 #undef TheCurveTool_hxx
0242 #undef IntCurve_TheProjPCur
0243 #undef IntCurve_TheProjPCur_hxx
0244 #undef IntCurve_TheCurveLocatorOfTheProjPCur
0245 #undef IntCurve_TheCurveLocatorOfTheProjPCur_hxx
0246 #undef IntCurve_TheLocateExtPCOfTheProjPCur
0247 #undef IntCurve_TheLocateExtPCOfTheProjPCur_hxx
0248 #undef IntCurve_TheCurveLocatorOfTheProjPCur
0249 #undef IntCurve_TheCurveLocatorOfTheProjPCur_hxx
0250 #undef IntCurve_TheLocateExtPCOfTheProjPCur
0251 #undef IntCurve_TheLocateExtPCOfTheProjPCur_hxx
0252 #undef IntCurve_TheIntConicCurve
0253 #undef IntCurve_TheIntConicCurve_hxx
0254 #undef IntCurve_TheIntersectorOfTheIntConicCurve
0255 #undef IntCurve_TheIntersectorOfTheIntConicCurve_hxx
0256 #undef IntCurve_TheIntersectorOfTheIntConicCurve
0257 #undef IntCurve_TheIntersectorOfTheIntConicCurve_hxx
0258 #undef IntCurve_IntConicCurve
0259 #undef IntCurve_IntConicCurve_hxx
0260 #undef IntCurve_TheIntPCurvePCurve
0261 #undef IntCurve_TheIntPCurvePCurve_hxx
0262 #undef IntCurve_ThePolygon2dOfTheIntPCurvePCurve
0263 #undef IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx
0264 #undef IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve
0265 #undef IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx
0266 #undef IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve
0267 #undef IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx
0268 #undef IntCurve_ThePolygon2dOfTheIntPCurvePCurve
0269 #undef IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx
0270 #undef IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve
0271 #undef IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx
0272 #undef IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve
0273 #undef IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx
0274 #undef IntCurve_IntCurveCurveGen
0275 #undef IntCurve_IntCurveCurveGen_hxx
0276 
0277 #endif // _Geom2dInt_GInter_HeaderFile