Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/IntCurve_UserIntConicCurveGen.gxx is written in an unsupported language. File is not indexed.

0001 // Created on: 1992-11-24
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_IntConicConic.hxx>
0018 #include <gp_Lin2d.hxx>
0019 #include <gp_Circ2d.hxx>
0020 #include <gp_Elips2d.hxx>
0021 #include <gp_Parab2d.hxx>
0022 #include <gp_Hypr2d.hxx>
0023 #include <Precision.hxx>        
0024 
0025 
0026 
0027 IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen () {
0028   done = Standard_False;
0029 }
0030 //-------------------------------------------------------------------------------------
0031 IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Lin2d& Lin1,
0032                                                               const IntRes2d_Domain& D1,
0033                                                               const ThePCurve& C2,
0034                                                               const IntRes2d_Domain& D2,
0035                                                               const Standard_Real TolConf,
0036                                                               const Standard_Real Tol) {
0037   Perform(Lin1,D1,C2,D2,TolConf,Tol);
0038 }
0039 //-------------------------------------------------------------------------------------
0040 IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Circ2d& Circ1,
0041                                                               const IntRes2d_Domain& D1,
0042                                                               const ThePCurve& C2,
0043                                                               const IntRes2d_Domain& D2,
0044                                                               const Standard_Real TolConf,
0045                                                               const Standard_Real Tol) {
0046   Perform(Circ1,D1,C2,D2,TolConf,Tol);
0047 }
0048 //-------------------------------------------------------------------------------------
0049 IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Parab2d& Parab1,
0050                                                               const IntRes2d_Domain& D1,
0051                                                               const ThePCurve& C2,
0052                                                               const IntRes2d_Domain& D2,
0053                                                               const Standard_Real TolConf,
0054                                                               const Standard_Real Tol) {
0055   Perform(Parab1,D1,C2,D2,TolConf,Tol);
0056 }
0057 //-------------------------------------------------------------------------------------
0058 IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Elips2d& Elips1,
0059                                                               const IntRes2d_Domain& D1,
0060                                                               const ThePCurve& C2,
0061                                                               const IntRes2d_Domain& D2,
0062                                                               const Standard_Real TolConf,
0063                                                               const Standard_Real Tol) {
0064   Perform(Elips1,D1,C2,D2,TolConf,Tol);
0065 }
0066 //-------------------------------------------------------------------------------------
0067 IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Hypr2d& Hyper1,
0068                                                               const IntRes2d_Domain& D1,
0069                                                               const ThePCurve& C2,
0070                                                               const IntRes2d_Domain& D2,
0071                                                               const Standard_Real TolConf,
0072                                                               const Standard_Real Tol) {
0073   Perform(Hyper1,D1,C2,D2,TolConf,Tol);
0074 }
0075 //-------------------------------------------------------------------------------------  
0076 
0077 
0078 //----------------------------------------------------------------------
0079 void IntCurve_UserIntConicCurveGen::Perform (const gp_Lin2d& Lin1,
0080                                              const IntRes2d_Domain& D1,
0081                                              const ThePCurve& C2,
0082                                              const IntRes2d_Domain& D2,
0083                                              const Standard_Real TolConf,
0084                                              const Standard_Real Tol) {
0085   this->ResetFields();
0086   Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
0087   if(NbInterC2 > 1) { 
0088     Standard_Real ParamInf,ParamSup;
0089     Standard_Real D2FirstParam = D2.FirstParameter();
0090     Standard_Real D2LastParam  = D2.LastParameter();
0091     Standard_Boolean Ok = Standard_True;
0092     param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
0093     param1sup = (D1.HasLastPoint()) ?  D1.LastParameter()  : Precision::Infinite();
0094     param2inf = ThePCurveTool::FirstParameter(C2);
0095     param2sup = ThePCurveTool::LastParameter(C2);
0096     IntRes2d_Domain DomainC2NumInter;
0097 
0098     TColStd_Array1OfReal Tab2(1,NbInterC2+1);
0099     ThePCurveTool::Intervals(C2,Tab2);    
0100 
0101     for(Standard_Integer NumInterC2=1; Ok && (NumInterC2 <= NbInterC2);NumInterC2++) { 
0102       ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
0103       if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False; 
0104       else { 
0105         if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
0106         if(ParamSup > D2LastParam)  ParamSup = D2LastParam; 
0107         if((ParamSup - ParamInf) > RealEpsilon()) { 
0108           DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
0109                                      ParamInf,
0110                                      D2.FirstTolerance(),
0111                                      ThePCurveTool::Value(C2,ParamSup),
0112                                      ParamSup,
0113                                      D2.LastTolerance());
0114           InternalPerform(Lin1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
0115         }
0116       }
0117     }
0118   }
0119   else { 
0120     InternalPerform(Lin1,D1,C2,D2,TolConf,Tol,Standard_False);
0121   }
0122 }
0123 //--------------------------------------------------------------------------------
0124 void IntCurve_UserIntConicCurveGen::Perform (const gp_Circ2d& Circ1,
0125                                              const IntRes2d_Domain& D1,
0126                                              const ThePCurve& C2,
0127                                              const IntRes2d_Domain& D2,
0128                                              const Standard_Real TolConf,
0129                                              const Standard_Real Tol) {
0130   this->ResetFields();
0131   Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
0132   if(NbInterC2 > 1) {
0133     Standard_Real ParamInf,ParamSup;
0134     Standard_Real D2FirstParam = D2.FirstParameter();
0135     Standard_Real D2LastParam  = D2.LastParameter();
0136     Standard_Boolean Ok = Standard_True;
0137     
0138     param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
0139     param1sup = (D1.HasLastPoint()) ?  D1.LastParameter()  : Precision::Infinite();
0140     param2inf = ThePCurveTool::FirstParameter(C2);
0141     param2sup = ThePCurveTool::LastParameter(C2);
0142     IntRes2d_Domain DomainC2NumInter;
0143     
0144     TColStd_Array1OfReal Tab2(1,NbInterC2+1);
0145     ThePCurveTool::Intervals(C2,Tab2);    
0146     
0147     
0148     for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) { 
0149       ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
0150       if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False; 
0151       else { 
0152         if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
0153         if(ParamSup > D2LastParam)  ParamSup = D2LastParam; 
0154         if((ParamSup - ParamInf) > RealEpsilon()) { 
0155           DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
0156                                      ParamInf,
0157                                      D2.FirstTolerance(),
0158                                      ThePCurveTool::Value(C2,ParamSup),
0159                                      ParamSup,
0160                                      D2.LastTolerance());
0161           InternalPerform(Circ1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
0162         }
0163       }
0164     }
0165   }
0166   else { 
0167     InternalPerform(Circ1,D1,C2,D2,TolConf,Tol,Standard_False);
0168   }
0169 }
0170 //--------------------------------------------------------------------------------
0171 void IntCurve_UserIntConicCurveGen::Perform (const gp_Parab2d& Parab1,
0172                                              const IntRes2d_Domain& D1,
0173                                              const ThePCurve& C2,
0174                                              const IntRes2d_Domain& D2,
0175                                              const Standard_Real TolConf,
0176                                              const Standard_Real Tol) {
0177   this->ResetFields();
0178   Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);  
0179   if(NbInterC2 > 1) {
0180     Standard_Real ParamInf,ParamSup;
0181     Standard_Real D2FirstParam = D2.FirstParameter();
0182     Standard_Real D2LastParam  = D2.LastParameter();
0183     Standard_Boolean Ok = Standard_True;
0184     param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
0185     param1sup = (D1.HasLastPoint()) ?  D1.LastParameter()  : Precision::Infinite();
0186     param2inf = ThePCurveTool::FirstParameter(C2);
0187     param2sup = ThePCurveTool::LastParameter(C2);
0188     IntRes2d_Domain DomainC2NumInter;
0189 
0190     TColStd_Array1OfReal Tab2(1,NbInterC2+1);
0191     ThePCurveTool::Intervals(C2,Tab2);    
0192  
0193     for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) { 
0194       ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
0195       if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False; 
0196       else { 
0197         if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
0198         if(ParamSup > D2LastParam)  ParamSup = D2LastParam; 
0199         if((ParamSup - ParamInf) > RealEpsilon()) { 
0200           DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
0201                                      ParamInf,
0202                                      D2.FirstTolerance(),
0203                                      ThePCurveTool::Value(C2,ParamSup),
0204                                      ParamSup,
0205                                      D2.LastTolerance());
0206           InternalPerform(Parab1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
0207         }
0208       }
0209     }
0210   }
0211   else { 
0212     InternalPerform(Parab1,D1,C2,D2,TolConf,Tol,Standard_False);
0213   }
0214 }
0215 //--------------------------------------------------------------------------------
0216 void IntCurve_UserIntConicCurveGen::Perform (const gp_Elips2d& Elips1,
0217                                              const IntRes2d_Domain& D1,
0218                                              const ThePCurve& C2,
0219                                              const IntRes2d_Domain& D2,
0220                                              const Standard_Real TolConf,
0221                                              const Standard_Real Tol) {
0222   this->ResetFields();
0223   Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);  
0224   if(NbInterC2 > 1) {
0225     Standard_Real ParamInf,ParamSup;
0226     Standard_Real D2FirstParam = D2.FirstParameter();
0227     Standard_Real D2LastParam  = D2.LastParameter();
0228     Standard_Boolean Ok = Standard_True;
0229     param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
0230     param1sup = (D1.HasLastPoint()) ?  D1.LastParameter()  : Precision::Infinite();
0231     param2inf = ThePCurveTool::FirstParameter(C2);
0232     param2sup = ThePCurveTool::LastParameter(C2);
0233     IntRes2d_Domain DomainC2NumInter;
0234 
0235     TColStd_Array1OfReal Tab2(1,NbInterC2+1);
0236     ThePCurveTool::Intervals(C2,Tab2);    
0237 
0238     for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) { 
0239       ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
0240       if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False; 
0241       else { 
0242         if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
0243         if(ParamSup > D2LastParam)  ParamSup = D2LastParam; 
0244         if((ParamSup - ParamInf) > RealEpsilon()) { 
0245           DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
0246                                      ParamInf,
0247                                      D2.FirstTolerance(),
0248                                      ThePCurveTool::Value(C2,ParamSup),
0249                                      ParamSup,
0250                                      D2.LastTolerance());
0251           InternalPerform(Elips1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
0252         }
0253       }
0254     }
0255   }
0256   else { 
0257     InternalPerform(Elips1,D1,C2,D2,TolConf,Tol,Standard_False);
0258   }
0259 }
0260 //--------------------------------------------------------------------------------
0261 void IntCurve_UserIntConicCurveGen::Perform (const gp_Hypr2d& Hyper1,
0262                                              const IntRes2d_Domain& D1,
0263                                              const ThePCurve& C2,
0264                                              const IntRes2d_Domain& D2,
0265                                              const Standard_Real TolConf,
0266                                              const Standard_Real Tol) {
0267   this->ResetFields();
0268   Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);  
0269   if(NbInterC2 > 1) {
0270     Standard_Real ParamInf,ParamSup;
0271     Standard_Real D2FirstParam = D2.FirstParameter();
0272     Standard_Real D2LastParam  = D2.LastParameter();
0273     Standard_Boolean Ok = Standard_True;
0274     param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
0275     param1sup = (D1.HasLastPoint()) ?  D1.LastParameter()  : Precision::Infinite();
0276     param2inf = ThePCurveTool::FirstParameter(C2);
0277     param2sup = ThePCurveTool::LastParameter(C2);
0278     IntRes2d_Domain DomainC2NumInter;
0279     
0280     TColStd_Array1OfReal Tab2(1,NbInterC2+1);
0281     ThePCurveTool::Intervals(C2,Tab2);    
0282 
0283     for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) { 
0284       ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
0285       if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False; 
0286       else { 
0287         if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
0288         if(ParamSup > D2LastParam)  ParamSup = D2LastParam; 
0289         if((ParamSup - ParamInf) > RealEpsilon()) { 
0290           DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
0291                                      ParamInf,
0292                                      D2.FirstTolerance(),
0293                                      ThePCurveTool::Value(C2,ParamSup),
0294                                      ParamSup,
0295                                      D2.LastTolerance());
0296           InternalPerform(Hyper1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
0297         }
0298       }
0299     }
0300   }
0301   else { 
0302     InternalPerform(Hyper1,D1,C2,D2,TolConf,Tol,Standard_False);
0303   }
0304 }
0305 
0306 //----------------------------------------------------------------------
0307 //-- InternalPerform 
0308 //-- Suppose des Courbes Lin...Hypr
0309 //-- Si Composite == True 
0310 //--     Les Resultats sont Ajoutes 
0311 //-- Sinon
0312 //--     Les Resultats sont Copies
0313 //----------------------------------------------------------------------
0314 void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Lin2d& Lin1,
0315                                                      const IntRes2d_Domain& D1,
0316                                                      const ThePCurve& C2,
0317                                                      const IntRes2d_Domain& D2,
0318                                                      const Standard_Real TolConf,
0319                                                      const Standard_Real Tol,
0320                                                      const Standard_Boolean Composite) {
0321 
0322   GeomAbs_CurveType typ2 = ThePCurveTool::GetType(C2);
0323   
0324   switch (typ2) {
0325     
0326   case GeomAbs_Line:
0327     {
0328       intconiconi.SetReversedParameters(Standard_False);
0329       intconiconi.Perform(Lin1,D1,ThePCurveTool::Line(C2),D2,TolConf,Tol);
0330       if(Composite)    { this->Append(intconiconi,
0331                                       param1inf,
0332                                       param1sup,
0333                                       param2inf,
0334                                       param2sup);  }
0335       else             { this->SetValues(intconiconi); }
0336     }
0337     break;
0338     
0339   case GeomAbs_Circle:
0340     {
0341       intconiconi.SetReversedParameters(Standard_False);
0342       intconiconi.Perform(Lin1,D1,ThePCurveTool::Circle(C2),D2,TolConf,Tol);
0343       if(Composite)    { this->Append(intconiconi,
0344                                       param1inf,
0345                                       param1sup,
0346                                       param2inf,
0347                                       param2sup);  }
0348       else             { this->SetValues(intconiconi); }
0349     }
0350     break;
0351     
0352   case GeomAbs_Ellipse:
0353     {
0354       intconiconi.SetReversedParameters(Standard_False);
0355       intconiconi.Perform(Lin1,D1,ThePCurveTool::Ellipse(C2),D2,TolConf,Tol);
0356       if(Composite)    { this->Append(intconiconi,
0357                                       param1inf,
0358                                       param1sup,
0359                                       param2inf,
0360                                       param2sup);  }
0361       else             { this->SetValues(intconiconi); }
0362     }
0363     break;
0364     
0365   case GeomAbs_Parabola:
0366     {
0367       intconiconi.SetReversedParameters(Standard_False);
0368       intconiconi.Perform(Lin1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
0369       if(Composite)    { this->Append(intconiconi,
0370                                       param1inf,
0371                                       param1sup,
0372                                       param2inf,
0373                                       param2sup);  }
0374       else             { this->SetValues(intconiconi); }
0375     }
0376     break;
0377     
0378   case GeomAbs_Hyperbola:
0379     {
0380       intconiconi.SetReversedParameters(Standard_False);
0381       intconiconi.Perform(Lin1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
0382       if(Composite)    { this->Append(intconiconi,
0383                                       param1inf,
0384                                       param1sup,
0385                                       param2inf,
0386                                       param2sup);  }
0387       else             { this->SetValues(intconiconi); }
0388     }
0389     break;
0390     
0391   default: 
0392     {
0393       intconicurv.SetReversedParameters(Standard_False);
0394       intconicurv.Perform(Lin1,D1,C2,D2,TolConf,Tol);
0395       if(Composite)    { this->Append(intconicurv,
0396                                       param1inf,
0397                                       param1sup,
0398                                       param2inf,
0399                                       param2sup);  }
0400       else             { this->SetValues(intconicurv); }
0401     }
0402     break;
0403   }
0404 }
0405   
0406 //----------------------------------------------------------------------
0407 void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Circ2d& Circ1,
0408                                                      const IntRes2d_Domain& D1,
0409                                                      const ThePCurve& C2,
0410                                                      const IntRes2d_Domain& D2,
0411                                                      const Standard_Real TolConf,
0412                                                      const Standard_Real Tol,
0413                                                      const Standard_Boolean Composite) { 
0414 
0415   GeomAbs_CurveType typ2 = ThePCurveTool::GetType(C2);
0416   
0417   switch (typ2) {
0418     
0419   case GeomAbs_Line:
0420     {
0421       intconiconi.SetReversedParameters(Standard_True);
0422       intconiconi.Perform(ThePCurveTool::Line(C2),D2,Circ1,D1,TolConf,Tol);
0423       if(Composite)    { this->Append(intconiconi,
0424                                       param1inf,
0425                                       param1sup,
0426                                       param2inf,
0427                                       param2sup);  }
0428       else             { this->SetValues(intconiconi); }
0429     }
0430     break;
0431     
0432   case GeomAbs_Circle:
0433     {
0434       intconiconi.SetReversedParameters(Standard_False);
0435       intconiconi.Perform(Circ1,D1,ThePCurveTool::Circle(C2),D2,TolConf,Tol);
0436       if(Composite)    { this->Append(intconiconi,
0437                                       param1inf,
0438                                       param1sup,
0439                                       param2inf,
0440                                       param2sup);  }
0441       else             { this->SetValues(intconiconi); }
0442     }
0443     break;
0444     
0445   case GeomAbs_Ellipse:
0446     {
0447       intconiconi.SetReversedParameters(Standard_False);
0448       intconiconi.Perform(Circ1,D1,ThePCurveTool::Ellipse(C2),D2,TolConf,Tol);
0449       if(Composite)    { this->Append(intconiconi,
0450                                       param1inf,
0451                                       param1sup,
0452                                       param2inf,
0453                                       param2sup);  }
0454       else             { this->SetValues(intconiconi); }
0455     }
0456     break;
0457     
0458   case GeomAbs_Parabola:
0459     {
0460       intconiconi.SetReversedParameters(Standard_False);
0461       intconiconi.Perform(Circ1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
0462       if(Composite)    { this->Append(intconiconi,
0463                                       param1inf,
0464                                       param1sup,
0465                                       param2inf,
0466                                       param2sup);  }
0467       else             { this->SetValues(intconiconi); }
0468     }
0469     break;
0470     
0471   case GeomAbs_Hyperbola:
0472     {
0473       intconiconi.SetReversedParameters(Standard_False);
0474       intconiconi.Perform(Circ1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
0475       if(Composite)    { this->Append(intconiconi,
0476                                       param1inf,
0477                                       param1sup,
0478                                       param2inf,
0479                                       param2sup);  }
0480       else             { this->SetValues(intconiconi); }
0481     }
0482     break;
0483     
0484   default:
0485     {
0486       intconicurv.SetReversedParameters(Standard_False);
0487       intconicurv.Perform(Circ1,D1,C2,D2,TolConf,Tol);
0488       if(Composite)    { this->Append(intconicurv,
0489                                       param1inf,
0490                                       param1sup,
0491                                       param2inf,
0492                                       param2sup);  }
0493       else             { this->SetValues(intconicurv); }
0494     }
0495     break;  
0496   }
0497 }
0498 //----------------------------------------------------------------------
0499 void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Elips2d& Elips1,
0500                                                      const IntRes2d_Domain& D1,
0501                                                      const ThePCurve& C2,
0502                                                      const IntRes2d_Domain& D2,
0503                                                      const Standard_Real TolConf,
0504                                                      const Standard_Real Tol,
0505                                                      const Standard_Boolean Composite) { 
0506   
0507   GeomAbs_CurveType typ2 = ThePCurveTool::GetType(C2);
0508     
0509   switch (typ2) {
0510     
0511   case GeomAbs_Line:
0512     {
0513       intconiconi.SetReversedParameters(Standard_True);
0514       intconiconi.Perform(ThePCurveTool::Line(C2),D2,Elips1,D1,TolConf,Tol);
0515       if(Composite)    { this->Append(intconiconi,
0516                                       param1inf,
0517                                       param1sup,
0518                                       param2inf,
0519                                       param2sup);  }
0520       else             { this->SetValues(intconiconi); }
0521     }
0522     break;
0523     
0524   case GeomAbs_Circle:
0525     {
0526       intconiconi.SetReversedParameters(Standard_True);
0527       intconiconi.Perform(ThePCurveTool::Circle(C2),D2,Elips1,D1,TolConf,Tol);
0528       if(Composite)    { this->Append(intconiconi,
0529                                       param1inf,
0530                                       param1sup,
0531                                       param2inf,
0532                                       param2sup);  }
0533       else             { this->SetValues(intconiconi); }
0534     }
0535     break;
0536     
0537   case GeomAbs_Ellipse:
0538     {
0539       intconiconi.SetReversedParameters(Standard_False);
0540       intconiconi.Perform(Elips1,D1,ThePCurveTool::Ellipse(C2),D2,TolConf,Tol);
0541       if(Composite)    { this->Append(intconiconi,
0542                                       param1inf,
0543                                       param1sup,
0544                                       param2inf,
0545                                       param2sup);  }
0546       else             { this->SetValues(intconiconi); }
0547     }
0548     break;
0549     
0550   case GeomAbs_Parabola:
0551     {
0552       intconiconi.SetReversedParameters(Standard_False);
0553       intconiconi.Perform(Elips1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
0554       if(Composite)    { this->Append(intconiconi,
0555                                       param1inf,
0556                                       param1sup,
0557                                       param2inf,
0558                                       param2sup);  }
0559       else             { this->SetValues(intconiconi); }
0560     }
0561     break;
0562     
0563   case GeomAbs_Hyperbola:
0564     {
0565       intconiconi.SetReversedParameters(Standard_False);
0566       intconiconi.Perform(Elips1,D1,ThePCurveTool::Hyperbola(C2),D2,
0567                           TolConf,Tol);
0568       if(Composite)    { this->Append(intconiconi,
0569                                       param1inf,
0570                                       param1sup,
0571                                       param2inf,
0572                                       param2sup);  }
0573       else             { this->SetValues(intconiconi); }
0574     }
0575     break;
0576     
0577   default:
0578     {
0579       intconicurv.SetReversedParameters(Standard_False);
0580       intconicurv.Perform(Elips1,D1,C2,D2,TolConf,Tol);
0581       if(Composite)    { this->Append(intconicurv,
0582                                       param1inf,
0583                                       param1sup,
0584                                       param2inf,
0585                                       param2sup);  }
0586       else             { this->SetValues(intconicurv); }
0587     }
0588     break;
0589   }
0590 }
0591 
0592 //----------------------------------------------------------------------
0593 void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Parab2d& Parab1,
0594                                                      const IntRes2d_Domain& D1,
0595                                                      const ThePCurve& C2,
0596                                                      const IntRes2d_Domain& D2,
0597                                                      const Standard_Real TolConf,
0598                                                      const Standard_Real Tol,
0599                                                      const Standard_Boolean Composite) { 
0600 
0601   GeomAbs_CurveType typ2 = ThePCurveTool::GetType(C2);
0602   
0603   switch (typ2) {
0604     
0605   case GeomAbs_Line:
0606     {
0607       intconiconi.SetReversedParameters(Standard_True);
0608       intconiconi.Perform(ThePCurveTool::Line(C2),D2,Parab1,D1,TolConf,Tol);
0609       if(Composite)    { this->Append(intconiconi,
0610                                       param1inf,
0611                                       param1sup,
0612                                       param2inf,
0613                                       param2sup);  }
0614       else             { this->SetValues(intconiconi); }
0615     }
0616     break;
0617     
0618   case GeomAbs_Circle:
0619     {
0620       intconiconi.SetReversedParameters(Standard_True);
0621       intconiconi.Perform(ThePCurveTool::Circle(C2),D2,Parab1,D1,TolConf,Tol);
0622       if(Composite)    { this->Append(intconiconi,
0623                                       param1inf,
0624                                       param1sup,
0625                                       param2inf,
0626                                       param2sup);  }
0627       else             { this->SetValues(intconiconi); }
0628     }
0629     break;
0630     
0631   case GeomAbs_Ellipse:
0632     {
0633       intconiconi.SetReversedParameters(Standard_True);
0634       intconiconi.Perform(ThePCurveTool::Ellipse(C2),D2,Parab1,D1,TolConf,Tol);
0635       if(Composite)    { this->Append(intconiconi,
0636                                       param1inf,
0637                                       param1sup,
0638                                       param2inf,
0639                                       param2sup);  }
0640       else             { this->SetValues(intconiconi); }
0641     }
0642     break;
0643     
0644   case GeomAbs_Parabola:
0645     {
0646       intconiconi.SetReversedParameters(Standard_False);
0647       intconiconi.Perform(Parab1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
0648       if(Composite)    { this->Append(intconiconi,
0649                                       param1inf,
0650                                       param1sup,
0651                                       param2inf,
0652                                       param2sup);  }
0653       else             { this->SetValues(intconiconi); }
0654     }
0655     break;
0656     
0657   case GeomAbs_Hyperbola:
0658     {
0659       intconiconi.SetReversedParameters(Standard_False);
0660       intconiconi.Perform(Parab1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
0661       if(Composite)    { this->Append(intconiconi,
0662                                       param1inf,
0663                                       param1sup,
0664                                       param2inf,
0665                                       param2sup);  }
0666       else             { this->SetValues(intconiconi); }
0667     }
0668     break;
0669     
0670   default:
0671     {
0672       intconicurv.SetReversedParameters(Standard_False);
0673       intconicurv.Perform(Parab1,D1,C2,D2,TolConf,Tol);
0674       if(Composite)    { this->Append(intconicurv,
0675                                       param1inf,
0676                                       param1sup,
0677                                       param2inf,
0678                                       param2sup);  }
0679       else             { this->SetValues(intconicurv); }
0680     }
0681     break;
0682   }
0683 }
0684   
0685 //----------------------------------------------------------------------
0686 void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Hypr2d& Hyper1,
0687                                                      const IntRes2d_Domain& D1,
0688                                                      const ThePCurve& C2,
0689                                                      const IntRes2d_Domain& D2,
0690                                                      const Standard_Real TolConf,
0691                                                      const Standard_Real Tol,
0692                                                      const Standard_Boolean Composite) { 
0693 
0694   GeomAbs_CurveType typ2 = ThePCurveTool::GetType(C2);
0695   
0696   switch (typ2) {
0697     
0698   case GeomAbs_Line:
0699     {
0700       intconiconi.SetReversedParameters(Standard_True);
0701       intconiconi.Perform(ThePCurveTool::Line(C2),D2,Hyper1,D1,TolConf,Tol);
0702       if(Composite)    { this->Append(intconiconi,
0703                                       param1inf,
0704                                       param1sup,
0705                                       param2inf,
0706                                       param2sup);  }
0707       else             { this->SetValues(intconiconi); }
0708     }
0709     break;
0710     
0711   case GeomAbs_Circle:
0712     {
0713       intconiconi.SetReversedParameters(Standard_True);
0714       intconiconi.Perform(ThePCurveTool::Circle(C2),D2,Hyper1,D1,TolConf,Tol);
0715       if(Composite)    { this->Append(intconiconi,
0716                                       param1inf,
0717                                       param1sup,
0718                                       param2inf,
0719                                       param2sup);  }
0720       else             { this->SetValues(intconiconi); }
0721     }
0722     break;
0723     
0724   case GeomAbs_Ellipse:
0725     {
0726       intconiconi.SetReversedParameters(Standard_True);
0727       intconiconi.Perform(ThePCurveTool::Ellipse(C2),D2,Hyper1,D1,TolConf,Tol);
0728       if(Composite)    { this->Append(intconiconi,
0729                                       param1inf,
0730                                       param1sup,
0731                                       param2inf,
0732                                       param2sup);  }
0733       else             { this->SetValues(intconiconi); }
0734     }
0735     break;
0736     
0737   case GeomAbs_Parabola:
0738     {
0739       intconiconi.SetReversedParameters(Standard_True);
0740       intconiconi.Perform(ThePCurveTool::Parabola(C2),D2,Hyper1,D1,TolConf,Tol);
0741       if(Composite)    { this->Append(intconiconi,
0742                                       param1inf,
0743                                       param1sup,
0744                                       param2inf,
0745                                       param2sup);  }
0746       else             { this->SetValues(intconiconi); }
0747     }
0748     break;
0749     
0750   case GeomAbs_Hyperbola:
0751     {
0752       intconiconi.SetReversedParameters(Standard_False);
0753       intconiconi.Perform(Hyper1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
0754       if(Composite)    { this->Append(intconiconi,
0755                                       param1inf,
0756                                       param1sup,
0757                                       param2inf,
0758                                       param2sup);  }
0759       else             { this->SetValues(intconiconi); }
0760     }
0761     break;
0762     
0763   default:
0764     {
0765       intconicurv.SetReversedParameters(Standard_False);
0766       intconicurv.Perform(Hyper1,D1,
0767                           C2,D2,TolConf,Tol);
0768       if(Composite)    { this->Append(intconicurv,
0769                                       param1inf,
0770                                       param1sup,
0771                                       param2inf,
0772                                       param2sup);  }
0773       else             { this->SetValues(intconicurv); }
0774     }
0775     break;
0776   }
0777 }
0778 //--------------------------------------------------------------------------------