mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
779 lines
26 KiB
Plaintext
779 lines
26 KiB
Plaintext
// Created on: 1992-11-24
|
|
// Created by: Laurent BUCHARD
|
|
// Copyright (c) 1992-1999 Matra Datavision
|
|
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
|
//
|
|
// This file is part of Open CASCADE Technology software library.
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify it under
|
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
// by the Free Software Foundation, with special exception defined in the file
|
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
// distribution for complete text of the license and disclaimer of any warranty.
|
|
//
|
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
// commercial license or contractual agreement.
|
|
|
|
#include <IntCurve_IntConicConic.hxx>
|
|
#include <gp_Lin2d.hxx>
|
|
#include <gp_Circ2d.hxx>
|
|
#include <gp_Elips2d.hxx>
|
|
#include <gp_Parab2d.hxx>
|
|
#include <gp_Hypr2d.hxx>
|
|
#include <Precision.hxx>
|
|
|
|
|
|
|
|
IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen () {
|
|
done = Standard_False;
|
|
}
|
|
//-------------------------------------------------------------------------------------
|
|
IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Lin2d& Lin1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol) {
|
|
Perform(Lin1,D1,C2,D2,TolConf,Tol);
|
|
}
|
|
//-------------------------------------------------------------------------------------
|
|
IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Circ2d& Circ1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol) {
|
|
Perform(Circ1,D1,C2,D2,TolConf,Tol);
|
|
}
|
|
//-------------------------------------------------------------------------------------
|
|
IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Parab2d& Parab1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol) {
|
|
Perform(Parab1,D1,C2,D2,TolConf,Tol);
|
|
}
|
|
//-------------------------------------------------------------------------------------
|
|
IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Elips2d& Elips1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol) {
|
|
Perform(Elips1,D1,C2,D2,TolConf,Tol);
|
|
}
|
|
//-------------------------------------------------------------------------------------
|
|
IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Hypr2d& Hyper1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol) {
|
|
Perform(Hyper1,D1,C2,D2,TolConf,Tol);
|
|
}
|
|
//-------------------------------------------------------------------------------------
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
void IntCurve_UserIntConicCurveGen::Perform (const gp_Lin2d& Lin1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol) {
|
|
this->ResetFields();
|
|
Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
|
|
if(NbInterC2 > 1) {
|
|
Standard_Real ParamInf,ParamSup;
|
|
Standard_Real D2FirstParam = D2.FirstParameter();
|
|
Standard_Real D2LastParam = D2.LastParameter();
|
|
Standard_Boolean Ok = Standard_True;
|
|
param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
|
|
param1sup = (D1.HasLastPoint()) ? D1.LastParameter() : Precision::Infinite();
|
|
param2inf = ThePCurveTool::FirstParameter(C2);
|
|
param2sup = ThePCurveTool::LastParameter(C2);
|
|
IntRes2d_Domain DomainC2NumInter;
|
|
|
|
TColStd_Array1OfReal Tab2(1,NbInterC2+1);
|
|
ThePCurveTool::Intervals(C2,Tab2);
|
|
|
|
for(Standard_Integer NumInterC2=1; Ok && (NumInterC2 <= NbInterC2);NumInterC2++) {
|
|
ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
|
|
if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False;
|
|
else {
|
|
if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
|
|
if(ParamSup > D2LastParam) ParamSup = D2LastParam;
|
|
if((ParamSup - ParamInf) > RealEpsilon()) {
|
|
DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
|
|
ParamInf,
|
|
D2.FirstTolerance(),
|
|
ThePCurveTool::Value(C2,ParamSup),
|
|
ParamSup,
|
|
D2.LastTolerance());
|
|
InternalPerform(Lin1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
InternalPerform(Lin1,D1,C2,D2,TolConf,Tol,Standard_False);
|
|
}
|
|
}
|
|
//--------------------------------------------------------------------------------
|
|
void IntCurve_UserIntConicCurveGen::Perform (const gp_Circ2d& Circ1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol) {
|
|
this->ResetFields();
|
|
Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
|
|
if(NbInterC2 > 1) {
|
|
Standard_Real ParamInf,ParamSup;
|
|
Standard_Real D2FirstParam = D2.FirstParameter();
|
|
Standard_Real D2LastParam = D2.LastParameter();
|
|
Standard_Boolean Ok = Standard_True;
|
|
|
|
param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
|
|
param1sup = (D1.HasLastPoint()) ? D1.LastParameter() : Precision::Infinite();
|
|
param2inf = ThePCurveTool::FirstParameter(C2);
|
|
param2sup = ThePCurveTool::LastParameter(C2);
|
|
IntRes2d_Domain DomainC2NumInter;
|
|
|
|
TColStd_Array1OfReal Tab2(1,NbInterC2+1);
|
|
ThePCurveTool::Intervals(C2,Tab2);
|
|
|
|
|
|
for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) {
|
|
ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
|
|
if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False;
|
|
else {
|
|
if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
|
|
if(ParamSup > D2LastParam) ParamSup = D2LastParam;
|
|
if((ParamSup - ParamInf) > RealEpsilon()) {
|
|
DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
|
|
ParamInf,
|
|
D2.FirstTolerance(),
|
|
ThePCurveTool::Value(C2,ParamSup),
|
|
ParamSup,
|
|
D2.LastTolerance());
|
|
InternalPerform(Circ1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
InternalPerform(Circ1,D1,C2,D2,TolConf,Tol,Standard_False);
|
|
}
|
|
}
|
|
//--------------------------------------------------------------------------------
|
|
void IntCurve_UserIntConicCurveGen::Perform (const gp_Parab2d& Parab1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol) {
|
|
this->ResetFields();
|
|
Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
|
|
if(NbInterC2 > 1) {
|
|
Standard_Real ParamInf,ParamSup;
|
|
Standard_Real D2FirstParam = D2.FirstParameter();
|
|
Standard_Real D2LastParam = D2.LastParameter();
|
|
Standard_Boolean Ok = Standard_True;
|
|
param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
|
|
param1sup = (D1.HasLastPoint()) ? D1.LastParameter() : Precision::Infinite();
|
|
param2inf = ThePCurveTool::FirstParameter(C2);
|
|
param2sup = ThePCurveTool::LastParameter(C2);
|
|
IntRes2d_Domain DomainC2NumInter;
|
|
|
|
TColStd_Array1OfReal Tab2(1,NbInterC2+1);
|
|
ThePCurveTool::Intervals(C2,Tab2);
|
|
|
|
for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) {
|
|
ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
|
|
if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False;
|
|
else {
|
|
if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
|
|
if(ParamSup > D2LastParam) ParamSup = D2LastParam;
|
|
if((ParamSup - ParamInf) > RealEpsilon()) {
|
|
DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
|
|
ParamInf,
|
|
D2.FirstTolerance(),
|
|
ThePCurveTool::Value(C2,ParamSup),
|
|
ParamSup,
|
|
D2.LastTolerance());
|
|
InternalPerform(Parab1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
InternalPerform(Parab1,D1,C2,D2,TolConf,Tol,Standard_False);
|
|
}
|
|
}
|
|
//--------------------------------------------------------------------------------
|
|
void IntCurve_UserIntConicCurveGen::Perform (const gp_Elips2d& Elips1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol) {
|
|
this->ResetFields();
|
|
Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
|
|
if(NbInterC2 > 1) {
|
|
Standard_Real ParamInf,ParamSup;
|
|
Standard_Real D2FirstParam = D2.FirstParameter();
|
|
Standard_Real D2LastParam = D2.LastParameter();
|
|
Standard_Boolean Ok = Standard_True;
|
|
param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
|
|
param1sup = (D1.HasLastPoint()) ? D1.LastParameter() : Precision::Infinite();
|
|
param2inf = ThePCurveTool::FirstParameter(C2);
|
|
param2sup = ThePCurveTool::LastParameter(C2);
|
|
IntRes2d_Domain DomainC2NumInter;
|
|
|
|
TColStd_Array1OfReal Tab2(1,NbInterC2+1);
|
|
ThePCurveTool::Intervals(C2,Tab2);
|
|
|
|
for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) {
|
|
ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
|
|
if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False;
|
|
else {
|
|
if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
|
|
if(ParamSup > D2LastParam) ParamSup = D2LastParam;
|
|
if((ParamSup - ParamInf) > RealEpsilon()) {
|
|
DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
|
|
ParamInf,
|
|
D2.FirstTolerance(),
|
|
ThePCurveTool::Value(C2,ParamSup),
|
|
ParamSup,
|
|
D2.LastTolerance());
|
|
InternalPerform(Elips1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
InternalPerform(Elips1,D1,C2,D2,TolConf,Tol,Standard_False);
|
|
}
|
|
}
|
|
//--------------------------------------------------------------------------------
|
|
void IntCurve_UserIntConicCurveGen::Perform (const gp_Hypr2d& Hyper1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol) {
|
|
this->ResetFields();
|
|
Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
|
|
if(NbInterC2 > 1) {
|
|
Standard_Real ParamInf,ParamSup;
|
|
Standard_Real D2FirstParam = D2.FirstParameter();
|
|
Standard_Real D2LastParam = D2.LastParameter();
|
|
Standard_Boolean Ok = Standard_True;
|
|
param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
|
|
param1sup = (D1.HasLastPoint()) ? D1.LastParameter() : Precision::Infinite();
|
|
param2inf = ThePCurveTool::FirstParameter(C2);
|
|
param2sup = ThePCurveTool::LastParameter(C2);
|
|
IntRes2d_Domain DomainC2NumInter;
|
|
|
|
TColStd_Array1OfReal Tab2(1,NbInterC2+1);
|
|
ThePCurveTool::Intervals(C2,Tab2);
|
|
|
|
for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) {
|
|
ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
|
|
if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False;
|
|
else {
|
|
if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
|
|
if(ParamSup > D2LastParam) ParamSup = D2LastParam;
|
|
if((ParamSup - ParamInf) > RealEpsilon()) {
|
|
DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
|
|
ParamInf,
|
|
D2.FirstTolerance(),
|
|
ThePCurveTool::Value(C2,ParamSup),
|
|
ParamSup,
|
|
D2.LastTolerance());
|
|
InternalPerform(Hyper1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
InternalPerform(Hyper1,D1,C2,D2,TolConf,Tol,Standard_False);
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------
|
|
//-- InternalPerform
|
|
//-- Suppose des Courbes Lin...Hypr
|
|
//-- Si Composite == True
|
|
//-- Les Resultats sont Ajoutes
|
|
//-- Sinon
|
|
//-- Les Resultats sont Copies
|
|
//----------------------------------------------------------------------
|
|
void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Lin2d& Lin1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol,
|
|
const Standard_Boolean Composite) {
|
|
|
|
GeomAbs_CurveType typ2 = ThePCurveTool::GetType(C2);
|
|
|
|
switch (typ2) {
|
|
|
|
case GeomAbs_Line:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Lin1,D1,ThePCurveTool::Line(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Circle:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Lin1,D1,ThePCurveTool::Circle(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Ellipse:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Lin1,D1,ThePCurveTool::Ellipse(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Parabola:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Lin1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Hyperbola:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Lin1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
default:
|
|
{
|
|
intconicurv.SetReversedParameters(Standard_False);
|
|
intconicurv.Perform(Lin1,D1,C2,D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconicurv,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconicurv); }
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------
|
|
void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Circ2d& Circ1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol,
|
|
const Standard_Boolean Composite) {
|
|
|
|
GeomAbs_CurveType typ2 = ThePCurveTool::GetType(C2);
|
|
|
|
switch (typ2) {
|
|
|
|
case GeomAbs_Line:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_True);
|
|
intconiconi.Perform(ThePCurveTool::Line(C2),D2,Circ1,D1,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Circle:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Circ1,D1,ThePCurveTool::Circle(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Ellipse:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Circ1,D1,ThePCurveTool::Ellipse(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Parabola:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Circ1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Hyperbola:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Circ1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
default:
|
|
{
|
|
intconicurv.SetReversedParameters(Standard_False);
|
|
intconicurv.Perform(Circ1,D1,C2,D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconicurv,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconicurv); }
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
//----------------------------------------------------------------------
|
|
void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Elips2d& Elips1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol,
|
|
const Standard_Boolean Composite) {
|
|
|
|
GeomAbs_CurveType typ2 = ThePCurveTool::GetType(C2);
|
|
|
|
switch (typ2) {
|
|
|
|
case GeomAbs_Line:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_True);
|
|
intconiconi.Perform(ThePCurveTool::Line(C2),D2,Elips1,D1,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Circle:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_True);
|
|
intconiconi.Perform(ThePCurveTool::Circle(C2),D2,Elips1,D1,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Ellipse:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Elips1,D1,ThePCurveTool::Ellipse(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Parabola:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Elips1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Hyperbola:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Elips1,D1,ThePCurveTool::Hyperbola(C2),D2,
|
|
TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
default:
|
|
{
|
|
intconicurv.SetReversedParameters(Standard_False);
|
|
intconicurv.Perform(Elips1,D1,C2,D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconicurv,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconicurv); }
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------
|
|
void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Parab2d& Parab1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol,
|
|
const Standard_Boolean Composite) {
|
|
|
|
GeomAbs_CurveType typ2 = ThePCurveTool::GetType(C2);
|
|
|
|
switch (typ2) {
|
|
|
|
case GeomAbs_Line:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_True);
|
|
intconiconi.Perform(ThePCurveTool::Line(C2),D2,Parab1,D1,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Circle:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_True);
|
|
intconiconi.Perform(ThePCurveTool::Circle(C2),D2,Parab1,D1,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Ellipse:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_True);
|
|
intconiconi.Perform(ThePCurveTool::Ellipse(C2),D2,Parab1,D1,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Parabola:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Parab1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Hyperbola:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Parab1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
default:
|
|
{
|
|
intconicurv.SetReversedParameters(Standard_False);
|
|
intconicurv.Perform(Parab1,D1,C2,D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconicurv,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconicurv); }
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------
|
|
void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Hypr2d& Hyper1,
|
|
const IntRes2d_Domain& D1,
|
|
const ThePCurve& C2,
|
|
const IntRes2d_Domain& D2,
|
|
const Standard_Real TolConf,
|
|
const Standard_Real Tol,
|
|
const Standard_Boolean Composite) {
|
|
|
|
GeomAbs_CurveType typ2 = ThePCurveTool::GetType(C2);
|
|
|
|
switch (typ2) {
|
|
|
|
case GeomAbs_Line:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_True);
|
|
intconiconi.Perform(ThePCurveTool::Line(C2),D2,Hyper1,D1,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Circle:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_True);
|
|
intconiconi.Perform(ThePCurveTool::Circle(C2),D2,Hyper1,D1,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Ellipse:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_True);
|
|
intconiconi.Perform(ThePCurveTool::Ellipse(C2),D2,Hyper1,D1,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Parabola:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_True);
|
|
intconiconi.Perform(ThePCurveTool::Parabola(C2),D2,Hyper1,D1,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
case GeomAbs_Hyperbola:
|
|
{
|
|
intconiconi.SetReversedParameters(Standard_False);
|
|
intconiconi.Perform(Hyper1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconiconi,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconiconi); }
|
|
}
|
|
break;
|
|
|
|
default:
|
|
{
|
|
intconicurv.SetReversedParameters(Standard_False);
|
|
intconicurv.Perform(Hyper1,D1,
|
|
C2,D2,TolConf,Tol);
|
|
if(Composite) { this->Append(intconicurv,
|
|
param1inf,
|
|
param1sup,
|
|
param2inf,
|
|
param2sup); }
|
|
else { this->SetValues(intconicurv); }
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
//--------------------------------------------------------------------------------
|