Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/IntCurve_IntConicCurveGen.lxx is written in an unsupported language. File is not indexed.

0001 // Created on: 1992-06-03
0002 // Created by: Laurent BUCHARD
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 #include IntCurve_TheIntersector_hxx
0018 
0019 #include <IntRes2d_Domain.hxx>
0020 
0021 #include <gp_Lin2d.hxx>
0022 #include <gp_Circ2d.hxx>
0023 #include <gp_Elips2d.hxx>
0024 #include <gp_Hypr2d.hxx>
0025 #include <gp_Parab2d.hxx>
0026 
0027 #include <IntCurve_IConicTool.hxx>
0028 
0029 //--------------------------------------------------------------------------------
0030 inline IntCurve_IntConicCurveGen::IntCurve_IntConicCurveGen() {}
0031 
0032 //--------------------------------------------------------------------------------
0033 inline IntCurve_IntConicCurveGen::IntCurve_IntConicCurveGen(const gp_Lin2d&        L,
0034                                                             const IntRes2d_Domain& D1,
0035                                                             const ThePCurve&       PCurve,
0036                                                             const IntRes2d_Domain& D2,
0037                                                             const double           TolConf,
0038                                                             const double           Tol)
0039 {
0040 
0041   Perform(IntCurve_IConicTool(L), D1, PCurve, D2, TolConf, Tol);
0042 }
0043 
0044 inline void IntCurve_IntConicCurveGen::Perform(const gp_Lin2d&        L,
0045                                                const IntRes2d_Domain& D1,
0046                                                const ThePCurve&       PCurve,
0047                                                const IntRes2d_Domain& D2,
0048                                                const double           TolConf,
0049                                                const double           Tol)
0050 {
0051 
0052   Perform(IntCurve_IConicTool(L), D1, PCurve, D2, TolConf, Tol);
0053 }
0054 
0055 //--------------------------------------------------------------------------------
0056 inline void IntCurve_IntConicCurveGen::Perform(const gp_Circ2d&       C,
0057                                                const IntRes2d_Domain& D1,
0058                                                const ThePCurve&       PCurve,
0059                                                const IntRes2d_Domain& D2,
0060                                                const double           TolConf,
0061                                                const double           Tol)
0062 {
0063   if (!D1.IsClosed())
0064   {
0065     IntRes2d_Domain D(D1);
0066     D.SetEquivalentParameters(D1.FirstParameter(), D1.FirstParameter() + M_PI + M_PI);
0067     Perform(IntCurve_IConicTool(C), D, PCurve, D2, TolConf, Tol);
0068     //-- throw Standard_ConstructionError("Domaine incorrect");
0069   }
0070   else
0071   {
0072     Perform(IntCurve_IConicTool(C), D1, PCurve, D2, TolConf, Tol);
0073   }
0074 }
0075 
0076 //--------------------------------------------------------------------------------
0077 inline void IntCurve_IntConicCurveGen::Perform(const gp_Elips2d&      E,
0078                                                const IntRes2d_Domain& D1,
0079                                                const ThePCurve&       PCurve,
0080                                                const IntRes2d_Domain& D2,
0081                                                const double           TolConf,
0082                                                const double           Tol)
0083 {
0084   if (!D1.IsClosed())
0085   {
0086     IntRes2d_Domain D(D1);
0087     D.SetEquivalentParameters(D1.FirstParameter(), D1.FirstParameter() + M_PI + M_PI);
0088     Perform(IntCurve_IConicTool(E), D, PCurve, D2, TolConf, Tol);
0089   }
0090   else
0091   {
0092     Perform(IntCurve_IConicTool(E), D1, PCurve, D2, TolConf, Tol);
0093   }
0094 }
0095 
0096 //--------------------------------------------------------------------------------
0097 inline void IntCurve_IntConicCurveGen::Perform(const gp_Parab2d&      Prb,
0098                                                const IntRes2d_Domain& D1,
0099                                                const ThePCurve&       PCurve,
0100                                                const IntRes2d_Domain& D2,
0101                                                const double           TolConf,
0102                                                const double           Tol)
0103 {
0104   Perform(IntCurve_IConicTool(Prb), D1, PCurve, D2, TolConf, Tol);
0105 }
0106 
0107 //--------------------------------------------------------------------------------
0108 inline void IntCurve_IntConicCurveGen::Perform(const gp_Hypr2d&       H,
0109                                                const IntRes2d_Domain& D1,
0110                                                const ThePCurve&       PCurve,
0111                                                const IntRes2d_Domain& D2,
0112                                                const double           TolConf,
0113                                                const double           Tol)
0114 {
0115   Perform(IntCurve_IConicTool(H), D1, PCurve, D2, TolConf, Tol);
0116 }
0117 
0118 //--------------------------------------------------------------------------------
0119 inline void IntCurve_IntConicCurveGen::Perform(const IntCurve_IConicTool& ICurve,
0120                                                const IntRes2d_Domain&     D1,
0121                                                const ThePCurve&           PCurve,
0122                                                const IntRes2d_Domain&     D2,
0123                                                const double               TolConf,
0124                                                const double               Tol)
0125 {
0126   IntCurve_TheIntersector myintersection;
0127   myintersection.SetReversedParameters(ReversedParameters());
0128   myintersection.Perform(ICurve, D1, PCurve, D2, TolConf, Tol);
0129   this->SetValues(myintersection);
0130 }
0131 
0132 //================================================================================