1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0026255: Adaptor3d_OffsetCurve is misleading

1. Rename Adaptor3d_OffsetCurve to Adaptor2d_OffsetCurve and relative classes
2. Remove redundant class Geom2dGcc_CurveToolGeo
This commit is contained in:
azv
2015-11-02 12:03:23 +03:00
committed by bugmaster
parent de6273a31f
commit 5201d3e66c
16 changed files with 197 additions and 485 deletions

View File

@@ -24,8 +24,6 @@ Geom2dGcc_Circ2dTanOnRadGeo.cxx
Geom2dGcc_Circ2dTanOnRadGeo.hxx
Geom2dGcc_CurveTool.cxx
Geom2dGcc_CurveTool.hxx
Geom2dGcc_CurveToolGeo.cxx
Geom2dGcc_CurveToolGeo.hxx
Geom2dGcc_FunctionTanCirCu.cxx
Geom2dGcc_FunctionTanCirCu.hxx
Geom2dGcc_FunctionTanCuCu.cxx

View File

@@ -24,7 +24,7 @@
// Courbes. +
//=========================================================================
#include <Adaptor3d_OffsetCurve.hxx>
#include <Adaptor2d_OffsetCurve.hxx>
#include <ElCLib.hxx>
#include <GccAna_Circ2dBisec.hxx>
#include <GccAna_CircLin2dBisec.hxx>
@@ -39,7 +39,6 @@
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dAdaptor_HCurve.hxx>
#include <Geom2dGcc_Circ2d2TanOnGeo.hxx>
#include <Geom2dGcc_CurveToolGeo.hxx>
#include <Geom2dInt_TheIntConicCurveOfGInter.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Pnt2d.hxx>
@@ -95,11 +94,11 @@ Geom2dGcc_Circ2d2TanOnGeo (const GccEnt_QualifiedCirc& Qualified1 ,
Geom2dInt_TheIntConicCurveOfGInter Intp;
Standard_Integer nbsolution = Bis.NbSolutions();
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv);
Adaptor3d_OffsetCurve Cu2(HCu2,0.);
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(Cu2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(Cu2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(Cu2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(Cu2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve Cu2(HCu2,0.);
firstparam = Max(Cu2.FirstParameter(),thefirst);
lastparam = Min(Cu2.LastParameter(),thelast);
IntRes2d_Domain D2(Cu2.Value(firstparam), firstparam, Tol,
Cu2.Value(lastparam), lastparam, Tol);
Standard_Real Tol1 = Abs(Tolerance);
Standard_Real Tol2 = Tol1;
for (Standard_Integer i = 1 ; i <= nbsolution; i++) {
@@ -323,11 +322,11 @@ parcen3(1,8)
Geom2dInt_TheIntConicCurveOfGInter Intp;
Standard_Integer nbsolution = Bis.NbSolutions();
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv);
Adaptor3d_OffsetCurve C2(HCu2,0.);
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve C2(HCu2,0.);
firstparam = Max(C2.FirstParameter(),thefirst);
lastparam = Min(C2.LastParameter(),thelast);
IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol,
C2.Value(lastparam), lastparam, Tol);
for (Standard_Integer i = 1 ; i <= nbsolution; i++) {
Handle(GccInt_Bisec) Sol = Bis.ThisSolution(i);
GccInt_IType type = Sol->ArcType();
@@ -501,11 +500,11 @@ parcen3(1,8)
Geom2dInt_TheIntConicCurveOfGInter Intp;
Standard_Integer nbsolution = Bis.NbSolutions();
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv);
Adaptor3d_OffsetCurve C2(HCu2,0.);
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve C2(HCu2,0.);
firstparam = Max(C2.FirstParameter(),thefirst);
lastparam = Min(C2.LastParameter(),thelast);
IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol,
C2.Value(lastparam), lastparam, Tol);
IntRes2d_Domain D1;
for (Standard_Integer i = 1 ; i <= nbsolution; i++) {
Intp.Perform(Bis.ThisSolution(i),D1,C2,D2,Tol1,Tol2);
@@ -649,11 +648,11 @@ parcen3(1,8)
Geom2dInt_TheIntConicCurveOfGInter Intp;
Standard_Integer nbsolution = Bis.NbSolutions();
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv);
Adaptor3d_OffsetCurve C2(HCu2,0.);
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve C2(HCu2,0.);
firstparam = Max(C2.FirstParameter(),thefirst);
lastparam = Min(C2.LastParameter(),thelast);
IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol,
C2.Value(lastparam), lastparam, Tol);
for (Standard_Integer i = 1 ; i <= nbsolution; i++) {
Handle(GccInt_Bisec) Sol = Bis.ThisSolution(i);
GccInt_IType type = Sol->ArcType();
@@ -810,11 +809,11 @@ parcen3(1,8)
Standard_Real Tol2 = Tol1;
Geom2dInt_TheIntConicCurveOfGInter Intp;
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv);
Adaptor3d_OffsetCurve C2(HCu2,0.);
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve C2(HCu2,0.);
firstparam = Max(C2.FirstParameter(),thefirst);
lastparam = Min(C2.LastParameter(),thelast);
IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol,
C2.Value(lastparam), lastparam, Tol);
Handle(GccInt_Bisec) Sol = Bis.ThisSolution();
GccInt_IType type = Sol->ArcType();
switch (type) {
@@ -938,11 +937,11 @@ parcen3(1,8)
Standard_Real Tol2 = Tol1;
Geom2dInt_TheIntConicCurveOfGInter Intp;
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(OnCurv);
Adaptor3d_OffsetCurve Cu2(HCu2,0.);
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(Cu2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(Cu2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(Cu2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(Cu2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve Cu2(HCu2,0.);
firstparam = Max(Cu2.FirstParameter(),thefirst);
lastparam = Min(Cu2.LastParameter(),thelast);
IntRes2d_Domain D2(Cu2.Value(firstparam), firstparam, Tol,
Cu2.Value(lastparam), lastparam, Tol);
IntRes2d_Domain D1;
if (Bis.HasSolution()) {
Intp.Perform(Bis.ThisSolution(),D1,Cu2,D2,Tol1,Tol2);

View File

@@ -13,7 +13,7 @@
// commercial license or contractual agreement.
#include <Adaptor3d_OffsetCurve.hxx>
#include <Adaptor2d_OffsetCurve.hxx>
#include <ElCLib.hxx>
#include <GccEnt_BadQualifier.hxx>
#include <GccEnt_QualifiedCirc.hxx>
@@ -21,7 +21,6 @@
#include <Geom2dAdaptor_HCurve.hxx>
#include <Geom2dGcc_Circ2d2TanRadGeo.hxx>
#include <Geom2dGcc_CurveTool.hxx>
#include <Geom2dGcc_CurveToolGeo.hxx>
#include <Geom2dGcc_QCurve.hxx>
#include <Geom2dInt_GInter.hxx>
#include <gp_Ax2d.hxx>
@@ -184,11 +183,11 @@ pararg2(1,aNbSolMAX)
IntRes2d_Domain D1;
for (Standard_Integer jcote2 = 1 ; jcote2 <= nbrcote2 ; jcote2++) {
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(Cu2);
Adaptor3d_OffsetCurve C2(HCu2,cote2(jcote2));
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2));
firstparam = Max(C2.FirstParameter(),thefirst);
lastparam = Min(C2.LastParameter(),thelast);
IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol,
C2.Value(lastparam), lastparam, Tol);
Geom2dInt_TheIntConicCurveOfGInter Intp(Line,D1,C2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
@@ -368,11 +367,11 @@ pararg2(1,aNbSolMAX)
D1.SetEquivalentParameters(0.,2.*M_PI);
for (Standard_Integer jcote2 = 1 ; jcote2 <= nbrcote2 ; jcote2++) {
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(Cu2);
Adaptor3d_OffsetCurve C2(HCu2,cote2(jcote2));
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2));
firstparam = Max(C2.FirstParameter(),thefirst);
lastparam = Min(C2.LastParameter(),thelast);
IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol,
C2.Value(lastparam), lastparam, Tol);
Intp.Perform(Circ,D1,C2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
@@ -500,11 +499,11 @@ pararg2(1,aNbSolMAX)
Geom2dInt_TheIntConicCurveOfGInter Intp;
for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1);
Adaptor3d_OffsetCurve Cu2(HCu1,cote1(jcote1));
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(Cu2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(Cu2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(Cu2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(Cu2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve Cu2(HCu1,cote1(jcote1));
firstparam = Max(Cu2.FirstParameter(),thefirst);
lastparam = Min(Cu2.LastParameter(),thelast);
IntRes2d_Domain D2(Cu2.Value(firstparam), firstparam, Tol,
Cu2.Value(lastparam), lastparam, Tol);
Intp.Perform(Circ,D1,Cu2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
@@ -541,8 +540,8 @@ pararg2(1,aNbSolMAX)
// tangent vector and vector between points in two curves must
// be equal to zero).
//=======================================================================
static void PrecRoot(const Adaptor3d_OffsetCurve& theC1,
const Adaptor3d_OffsetCurve& theC2,
static void PrecRoot(const Adaptor2d_OffsetCurve& theC1,
const Adaptor2d_OffsetCurve& theC2,
const Standard_Real theU0,
const Standard_Real theV0,
Standard_Real& theUfinal,
@@ -597,8 +596,8 @@ where u_{0} and v_{0} are initial values or values computed on previous iteratio
Standard_Real aSQDistPrev = RealFirst();
Geom2dGcc_CurveToolGeo::D2(theC1, aU, aPu, aD1u, aD2u);
Geom2dGcc_CurveToolGeo::D2(theC2, aV, aPv, aD1v, aD2v);
theC1.D2(aU, aPu, aD1u, aD2u);
theC2.D2(aV, aPv, aD1v, aD2v);
const Standard_Real aCrProd = Abs(aD1u.Crossed(aD1v));
if(aCrProd*aCrProd > 1.0e-6*
@@ -690,8 +689,8 @@ where u_{0} and v_{0} are initial values or values computed on previous iteratio
aV += aStepV;
}
Geom2dGcc_CurveToolGeo::D2(theC1, aU, aPu, aD1u, aD2u);
Geom2dGcc_CurveToolGeo::D2(theC2, aV, aPv, aD1v, aD2v);
theC1.D2(aU, aPu, aD1u, aD2u);
theC2.D2(aV, aPv, aD1v, aD2v);
}
while(aNbIter <= aNbIterMax);
}
@@ -739,10 +738,10 @@ pararg2(1,aNbSolMAX)
//========================================================================
Standard_Real Tol = Abs(Tolerance);
Standard_Real thefirst = -100000.;
Standard_Real thelast = 100000.;
Standard_Real firstparam;
Standard_Real lastparam;
#ifdef OCCT_DEBUG
const Standard_Real thefirst = -100000.;
const Standard_Real thelast = 100000.;
#endif
gp_Dir2d dirx(1.,0.);
TColStd_Array1OfReal cote1(1,2);
TColStd_Array1OfReal cote2(1,2);
@@ -833,27 +832,21 @@ pararg2(1,aNbSolMAX)
Geom2dInt_GInter Intp;
for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1);
Adaptor3d_OffsetCurve C1(HCu1,cote1(jcote1));
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C1),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C1),thelast);
Adaptor2d_OffsetCurve C1(HCu1,cote1(jcote1));
#ifdef OCCT_DEBUG
Standard_Real firstparam = Max(C1.FirstParameter(), thefirst);
Standard_Real lastparam = Min(C1.LastParameter(), thelast);
IntRes2d_Domain D2C1(Geom2dGcc_CurveToolGeo::Value(C1,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C1,lastparam),lastparam,Tol);
#else
Geom2dGcc_CurveToolGeo::Value(C1,firstparam);
Geom2dGcc_CurveToolGeo::Value(C1,lastparam);
#endif
for (Standard_Integer jcote2 = 1 ; jcote2 <= nbrcote2 ; jcote2++) {
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(Cu2);
Adaptor3d_OffsetCurve C2(HCu2,cote2(jcote2));
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2));
#ifdef OCCT_DEBUG
firstparam = Max(C2.FirstParameter(), thefirst);
lastparam = Min(C2.LastParameter(),thelast);
IntRes2d_Domain D2C2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
#else
Geom2dGcc_CurveToolGeo::Value(C2,firstparam);
Geom2dGcc_CurveToolGeo::Value(C2,lastparam);
#endif
Intp.Perform(C1,C2,Tol,Tol);
if (Intp.IsDone()) {
@@ -871,10 +864,10 @@ pararg2(1,aNbSolMAX)
Standard_Real aU2 = aU0+Precision::PApproximation();
Standard_Real aV2 = aV0+Precision::PApproximation();
gp_Pnt2d P11 = Geom2dGcc_CurveToolGeo::Value(C1,aU1);
gp_Pnt2d P12 = Geom2dGcc_CurveToolGeo::Value(C2,aV1);
gp_Pnt2d P21 = Geom2dGcc_CurveToolGeo::Value(C1,aU2);
gp_Pnt2d P22 = Geom2dGcc_CurveToolGeo::Value(C2,aV2);
gp_Pnt2d P11 = C1.Value(aU1);
gp_Pnt2d P12 = C2.Value(aV1);
gp_Pnt2d P21 = C1.Value(aU2);
gp_Pnt2d P22 = C2.Value(aV2);
Standard_Real aDist1112 = P11.SquareDistance(P12);
Standard_Real aDist1122 = P11.SquareDistance(P22);
@@ -889,7 +882,7 @@ pararg2(1,aNbSolMAX)
}
NbrSol++;
gp_Pnt2d Center(Geom2dGcc_CurveToolGeo::Value(C1, aU0));
gp_Pnt2d Center(C1.Value(aU0));
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
// =======================================================
qualifier1(NbrSol) = Qualified1.Qualifier();

View File

@@ -21,7 +21,7 @@
// de rayon donne : Radius. +
//========================================================================
#include <Adaptor3d_OffsetCurve.hxx>
#include <Adaptor2d_OffsetCurve.hxx>
#include <ElCLib.hxx>
#include <GccEnt_BadQualifier.hxx>
#include <GccEnt_QualifiedCirc.hxx>
@@ -30,7 +30,6 @@
#include <Geom2dAdaptor_HCurve.hxx>
#include <Geom2dGcc_Circ2dTanOnRadGeo.hxx>
#include <Geom2dGcc_CurveTool.hxx>
#include <Geom2dGcc_CurveToolGeo.hxx>
#include <Geom2dGcc_QCurve.hxx>
#include <Geom2dInt_GInter.hxx>
#include <gp_Circ2d.hxx>
@@ -124,11 +123,11 @@ parcen3(1,8)
Geom2dInt_TheIntConicCurveOfGInter Intp;
for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1);
Adaptor3d_OffsetCurve C2(HCu1,Coef(jcote1));
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve C2(HCu1,Coef(jcote1));
firstparam = Max(C2.FirstParameter(),thefirst);
lastparam = Min(C2.LastParameter(),thelast);
IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol,
C2.Value(lastparam), lastparam, Tol);
Intp.Perform(OnLine,D1,C2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
@@ -237,11 +236,11 @@ parcen3(1,8)
Geom2dInt_TheIntConicCurveOfGInter Intp;
for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1);
Adaptor3d_OffsetCurve C2(HCu1,cote1(jcote1));
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve C2(HCu1,cote1(jcote1));
firstparam = Max(C2.FirstParameter(),thefirst);
lastparam = Min(C2.LastParameter(),thelast);
IntRes2d_Domain D2(C2.Value(firstparam),firstparam,Tol,
C2.Value(lastparam),lastparam,Tol);
Intp.Perform(OnCirc,D1,C2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
@@ -592,17 +591,17 @@ parcen3(1,8)
Geom2dInt_GInter Intp;
for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1);
Adaptor3d_OffsetCurve C1(HCu1,cote1(jcote1));
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C1),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C1),thelast);
IntRes2d_Domain D1(Geom2dGcc_CurveToolGeo::Value(C1,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C1,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve C1(HCu1,cote1(jcote1));
firstparam = Max(C1.FirstParameter(),thefirst);
lastparam = Min(C1.LastParameter(),thelast);
IntRes2d_Domain D1(C1.Value(firstparam), firstparam, Tol,
C1.Value(lastparam), lastparam, Tol);
Handle(Geom2dAdaptor_HCurve) HOnCurv = new Geom2dAdaptor_HCurve(OnCurv);
Adaptor3d_OffsetCurve C2(HOnCurv);
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
Adaptor2d_OffsetCurve C2(HOnCurv);
firstparam = Max(C2.FirstParameter(),thefirst);
lastparam = Min(C2.LastParameter(),thelast);
IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol,
C2.Value(lastparam), lastparam, Tol);
Intp.Perform(C1,D1,C2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {

View File

@@ -1,152 +0,0 @@
// Copyright (c) 1995-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 <Adaptor3d_OffsetCurve.hxx>
#include <Extrema_POnCurv2d.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Ellipse.hxx>
#include <Geom2d_Hyperbola.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_Parabola.hxx>
#include <Geom2dGcc_CurveToolGeo.hxx>
#include <GeomAbs_CurveType.hxx>
#include <gp.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Elips2d.hxx>
#include <gp_Hypr2d.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Parab2d.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <Standard_Failure.hxx>
GeomAbs_CurveType Geom2dGcc_CurveToolGeo::
TheType(const Adaptor3d_OffsetCurve& ) {
return GeomAbs_OtherCurve;
}
gp_Lin2d Geom2dGcc_CurveToolGeo::
Line (const Adaptor3d_OffsetCurve& ) {
cout << "Not implemented" << endl;
return gp_Lin2d();
}
gp_Circ2d Geom2dGcc_CurveToolGeo::
Circle (const Adaptor3d_OffsetCurve& ) {
cout << "Not implemented" << endl;
return gp_Circ2d();
}
gp_Elips2d Geom2dGcc_CurveToolGeo::
Ellipse (const Adaptor3d_OffsetCurve& ) {
cout << "Not implemented" << endl;
return gp_Elips2d();
}
gp_Parab2d Geom2dGcc_CurveToolGeo::
Parabola (const Adaptor3d_OffsetCurve& ) {
cout << "Not implemented" << endl;
return gp_Parab2d();
}
gp_Hypr2d Geom2dGcc_CurveToolGeo::
Hyperbola (const Adaptor3d_OffsetCurve& ) {
cout << "Not implemented" << endl;
return gp_Hypr2d();
}
Standard_Real
Geom2dGcc_CurveToolGeo::EpsX (const Adaptor3d_OffsetCurve& /*C*/,
const Standard_Real Tol) {
return Tol;
}
Standard_Integer
Geom2dGcc_CurveToolGeo::NbSamples (const Adaptor3d_OffsetCurve& C) {
GeomAbs_CurveType typC = C.GetType();
Standard_Integer nbs = 20;
if(typC == GeomAbs_Line)
nbs = 2;
else if(typC == GeomAbs_BezierCurve)
nbs = 3 + C.Bezier()->NbPoles();
else if(typC == GeomAbs_BSplineCurve) {
Handle(Geom2d_BSplineCurve) BSC = C.BSpline();
nbs = BSC->NbKnots();
nbs*= BSC->Degree();
if(nbs < 2) nbs=2;
}
return(nbs);
}
Standard_Real
Geom2dGcc_CurveToolGeo::FirstParameter (const Adaptor3d_OffsetCurve& C) {
return C.FirstParameter();
}
Standard_Real
Geom2dGcc_CurveToolGeo::LastParameter (const Adaptor3d_OffsetCurve& C) {
return C.LastParameter();
}
gp_Pnt2d
Geom2dGcc_CurveToolGeo::Value (const Adaptor3d_OffsetCurve& C,
const Standard_Real U) {
return C.Value(U);
}
void Geom2dGcc_CurveToolGeo::D1(const Adaptor3d_OffsetCurve& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& T) {
C.D1(U,P,T);
}
void Geom2dGcc_CurveToolGeo::D2(const Adaptor3d_OffsetCurve& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& T,
gp_Vec2d& N) {
C.D2(U,P,T,N);
}
Standard_Boolean Geom2dGcc_CurveToolGeo::
IsComposite (const Adaptor3d_OffsetCurve& ) {
return Standard_False;
}
Standard_Integer Geom2dGcc_CurveToolGeo::
GetIntervals (const Adaptor3d_OffsetCurve& ) {
cout << "Not implemented" << endl;
return 0;
}
void Geom2dGcc_CurveToolGeo::
GetInterval (const Adaptor3d_OffsetCurve& ,
const Standard_Integer ,
Standard_Real& ,
Standard_Real& ) {
cout << "Not implemented" << endl;
}
void Geom2dGcc_CurveToolGeo::
SetCurrentInterval ( Adaptor3d_OffsetCurve& ,
const Standard_Integer ) {
cout << "Not implemented" << endl;
}

View File

@@ -1,126 +0,0 @@
// Created on: 1992-06-04
// Created by: Jacques GOUSSARD
// 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.
#ifndef _Geom2dGcc_CurveToolGeo_HeaderFile
#define _Geom2dGcc_CurveToolGeo_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <GeomAbs_CurveType.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Adaptor3d_OffsetCurve;
class gp_Lin2d;
class gp_Circ2d;
class gp_Elips2d;
class gp_Parab2d;
class gp_Hypr2d;
class gp_Pnt2d;
class gp_Vec2d;
class Geom2dGcc_CurveToolGeo
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT static GeomAbs_CurveType TheType (const Adaptor3d_OffsetCurve& C);
//! Returns the Lin2d from gp corresponding to the curve C.
//! This method is called only when TheType returns
//! IntCurve_Lin.
Standard_EXPORT static gp_Lin2d Line (const Adaptor3d_OffsetCurve& C);
//! Returns the Circ2d from gp corresponding to the curve C.
//! This method is called only when TheType returns
//! IntCurve_Cir.
Standard_EXPORT static gp_Circ2d Circle (const Adaptor3d_OffsetCurve& C);
//! Returns the Elips2d from gp corresponding to the curve C.
//! This method is called only when TheType returns
//! IntCurve_Eli.
Standard_EXPORT static gp_Elips2d Ellipse (const Adaptor3d_OffsetCurve& C);
//! Returns the Parab2d from gp corresponding to the curve C.
//! This method is called only when TheType returns
//! IntCurve_Prb.
Standard_EXPORT static gp_Parab2d Parabola (const Adaptor3d_OffsetCurve& C);
//! Returns the Hypr2d from gp corresponding to the curve C.
//! This method is called only when TheType returns
//! IntCurve_Hpr.
Standard_EXPORT static gp_Hypr2d Hyperbola (const Adaptor3d_OffsetCurve& C);
Standard_EXPORT static Standard_Real FirstParameter (const Adaptor3d_OffsetCurve& C);
Standard_EXPORT static Standard_Real LastParameter (const Adaptor3d_OffsetCurve& C);
Standard_EXPORT static Standard_Real EpsX (const Adaptor3d_OffsetCurve& C, const Standard_Real Tol);
Standard_EXPORT static Standard_Integer NbSamples (const Adaptor3d_OffsetCurve& C);
Standard_EXPORT static gp_Pnt2d Value (const Adaptor3d_OffsetCurve& C, const Standard_Real X);
Standard_EXPORT static void D1 (const Adaptor3d_OffsetCurve& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T);
Standard_EXPORT static void D2 (const Adaptor3d_OffsetCurve& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T, gp_Vec2d& N);
Standard_EXPORT static Standard_Boolean IsComposite (const Adaptor3d_OffsetCurve& C);
//! Outputs the number of interval of continuity C1 of
//! the curve
//! used if Type == Composite.
Standard_EXPORT static Standard_Integer GetIntervals (const Adaptor3d_OffsetCurve& C);
//! Outputs the bounds of interval of index <Index>
//! used if Type == Composite.
Standard_EXPORT static void GetInterval (const Adaptor3d_OffsetCurve& C, const Standard_Integer Index, Standard_Real& U1, Standard_Real& U2);
//! Set the current valid interval of index <Index>
//! inside which the computations will be done
//! (used if Type == Composite).
Standard_EXPORT static void SetCurrentInterval (Adaptor3d_OffsetCurve& C, const Standard_Integer Index);
protected:
private:
};
#endif // _Geom2dGcc_CurveToolGeo_HeaderFile