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

0024708: Convertation of the generic classes to the non-generic. Part 2

Generic classes from "AppParCurves" package:
    "AppDef_SmoothCriterion", "AppDef_LinearCriteria" and "AppDef_Variational" moved to the corresponding non-generic classes "AppDef_SmoothCriterion", "AppDef_LinearCriteria" and "AppDef_Variational" to "AppDef" package. Also several "*.cxx" files of "AppDef_Variational" class merged to one ".cxx".
Generic class from "IntImp" package:
    "IntImp_ZerCOnSSParFunc" moved to the corresponding non-generic class "IntPatch_CSFunction" to "IntPatch" package.
Next unused generic classes were removed:

- IntCurveSurface_SurfaceTool
- Intf_InterferencePolygon3d
And some other minor changes.
This commit is contained in:
dln
2014-03-05 18:22:43 +04:00
committed by abv
parent 84c71f29e4
commit f62de37212
37 changed files with 3482 additions and 4806 deletions

View File

@@ -58,7 +58,6 @@
#include <TColStd_HArray1OfBoolean.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_TheVariational.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <AppParCurves_ConstraintCouple.hxx>
#include <GC_MakeSegment.hxx>
@@ -73,7 +72,7 @@ Standard_IMPORT Draw_Color DrawTrSurf_CurveColor(const Draw_Color);
static Standard_Integer solutions(Draw_Interpretor& di,
Geom2dGcc_Circ2d2TanRad& ct3, const char* name)
Geom2dGcc_Circ2d2TanRad& ct3, const char* name)
{
char solname[200];
@@ -97,7 +96,7 @@ static Standard_Integer solutions(Draw_Interpretor& di,
}
static Standard_Integer solutions(Draw_Interpretor& di,
Geom2dGcc_Circ2d3Tan& ct3, const char* name)
Geom2dGcc_Circ2d3Tan& ct3, const char* name)
{
char solname[200];
@@ -136,7 +135,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
Standard_Boolean ip1 = DrawTrSurf::GetPoint2d(a[2],P1);
Standard_Boolean ip2 = DrawTrSurf::GetPoint2d(a[3],P2);
Standard_Boolean ip3 = DrawTrSurf::GetPoint2d(a[4],P3);
Standard_Real tol = Precision::Confusion();
if (n > 5) tol = Draw::Atof(a[5]);
@@ -146,84 +145,84 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
if (!C2.IsNull()) {
// C-C-...
if (!C3.IsNull()) {
// C-C-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
Geom2dGcc::Unqualified(C3),
tol,0,0,0);
return solutions(di,ct3,a[1]);
// C-C-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
Geom2dGcc::Unqualified(C3),
tol,0,0,0);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// C-C-P
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P3),
tol,0,0);
return solutions(di,ct3,a[1]);
// C-C-P
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P3),
tol,0,0);
return solutions(di,ct3,a[1]);
}
else {
// C-C-R
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
// C-C-R
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
}
else if (ip2) {
// C-P-..
if (!C3.IsNull()) {
// C-P-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P2),
tol,0,0);
return solutions(di,ct3,a[1]);
// C-P-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P2),
tol,0,0);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// C-P-P
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
new Geom2d_CartesianPoint(P2),
new Geom2d_CartesianPoint(P3),
tol,0);
return solutions(di,ct3,a[1]);
// C-P-P
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
new Geom2d_CartesianPoint(P2),
new Geom2d_CartesianPoint(P3),
tol,0);
return solutions(di,ct3,a[1]);
}
else {
// C-P-R
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
new Geom2d_CartesianPoint(P2),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
// C-P-R
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
new Geom2d_CartesianPoint(P2),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
}
else {
// C-R-..
if (!C3.IsNull()) {
// C-R-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C3),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
// C-R-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C3),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// C-R-P
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
// C-R-P
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
else {
// C-R-R
di << "Curve, radius, radius ???"<<"\n";
return 1;
// C-R-R
di << "Curve, radius, radius ???"<<"\n";
return 1;
}
}
}
@@ -233,84 +232,84 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
if (!C2.IsNull()) {
// P-C-...
if (!C3.IsNull()) {
// P-C-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C2),
Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P1),
tol,0,0);
return solutions(di,ct3,a[1]);
// P-C-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C2),
Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P1),
tol,0,0);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// P-C-P
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P3),
tol,0);
return solutions(di,ct3,a[1]);
// P-C-P
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P3),
tol,0);
return solutions(di,ct3,a[1]);
}
else {
// P-C-R
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P1),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
// P-C-R
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P1),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
}
else if (ip2) {
// P-P-..
if (!C3.IsNull()) {
// P-P-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P2),
tol,0);
return solutions(di,ct3,a[1]);
// P-P-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P2),
tol,0);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// P-P-P
Geom2dGcc_Circ2d3Tan ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P2),
new Geom2d_CartesianPoint(P3),
tol);
return solutions(di,ct3,a[1]);
// P-P-P
Geom2dGcc_Circ2d3Tan ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P2),
new Geom2d_CartesianPoint(P3),
tol);
return solutions(di,ct3,a[1]);
}
else {
// P-P-R
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P2),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
// P-P-R
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P2),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
}
else {
// P-R-..
if (!C3.IsNull()) {
// P-R-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P1),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
// P-R-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P1),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// P-R-P
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
// P-R-P
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
else {
// P-R-R
di << "Point, radius, radius ???"<<"\n";
return 1;
// P-R-R
di << "Point, radius, radius ???"<<"\n";
return 1;
}
}
}
@@ -320,21 +319,21 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
if (!C2.IsNull()) {
// R-C-...
if (!C3.IsNull()) {
// R-C-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
Geom2dGcc::Unqualified(C3),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
// R-C-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
Geom2dGcc::Unqualified(C3),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// R-C-P
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
// R-C-P
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
else {
@@ -348,19 +347,19 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
if (!C3.IsNull()) {
// R-P-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P2),
Draw::Atof(a[2]),
tol);
new Geom2d_CartesianPoint(P2),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
else if (ip3)
{
// R-P-P
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P2),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[2]),
tol);
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
else {
@@ -405,17 +404,17 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
}
Standard_Real ang = Draw::Atof(a[4]) * (M_PI / 180.0);
Geom2dGcc_Lin2dTanObl ct3(Geom2dGcc::Unqualified(C1),
L->Lin2d(),
Precision::Angular(),
(C1->FirstParameter()+C1->LastParameter())/2.,
ang);
L->Lin2d(),
Precision::Angular(),
(C1->FirstParameter()+C1->LastParameter())/2.,
ang);
if (ct3.IsDone()) {
for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
Handle(Geom2d_Line) LS = new Geom2d_Line(ct3.ThisSolution(i));
Sprintf(solname,"%s_%d",a[1],i);
char* temp = solname; // pour portage WNT
DrawTrSurf::Set(temp,LS);
di << solname << " ";
Handle(Geom2d_Line) LS = new Geom2d_Line(ct3.ThisSolution(i));
Sprintf(solname,"%s_%d",a[1],i);
char* temp = solname; // pour portage WNT
DrawTrSurf::Set(temp,LS);
di << solname << " ";
}
}
else
@@ -423,17 +422,17 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
}
else {
Geom2dGcc_Lin2d2Tan ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
Precision::Angular(),
(C1->FirstParameter()+C1->LastParameter())/2.,
(C2->FirstParameter()+C2->LastParameter())/2.);
Geom2dGcc::Unqualified(C2),
Precision::Angular(),
(C1->FirstParameter()+C1->LastParameter())/2.,
(C2->FirstParameter()+C2->LastParameter())/2.);
if (ct3.IsDone()) {
for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
Handle(Geom2d_Line) LS = new Geom2d_Line(ct3.ThisSolution(i));
Sprintf(solname,"%s_%d",a[1],i);
char* temp = solname; // pour portage WNT
DrawTrSurf::Set(temp,LS);
di << solname << " ";
Handle(Geom2d_Line) LS = new Geom2d_Line(ct3.ThisSolution(i));
Sprintf(solname,"%s_%d",a[1],i);
char* temp = solname; // pour portage WNT
DrawTrSurf::Set(temp,LS);
di << solname << " ";
}
}
else
@@ -463,7 +462,7 @@ static Standard_Integer interpol (Draw_Interpretor& di,Standard_Integer n, const
gp_Pnt P;
gp_Pnt2d P2d;
Standard_Boolean newcurve;
if (dout.Is3D(id)) {
Handle(Draw_Marker3D) mark;
Handle(TColgp_HArray1OfPnt) Points = new TColgp_HArray1OfPnt(1, 1);
@@ -476,50 +475,50 @@ static Standard_Integer interpol (Draw_Interpretor& di,Standard_Integer n, const
dout.Flush();
Handle(Geom_BSplineCurve) C;
i = 1;
while (b != 3) {
dout.Select(id,XX,YY,b, Standard_False);
P.SetCoord((Standard_Real)XX/zoom,(Standard_Real)YY/zoom, 0.0);
ThePoints->SetValue(i+1, P);
newcurve = Standard_False;
if (!(ThePoints->Value(i)).IsEqual(ThePoints->Value(i+1), 1.e-06)) {
if (b == 1) {
i++;
mark = new Draw_Marker3D(ThePoints->Value(i), Draw_X, Draw_vert);
dout << mark;
dout.Flush();
Points =
new TColgp_HArray1OfPnt(ThePoints->Lower(),ThePoints->Upper());
Points->ChangeArray1() = ThePoints->Array1();
newcurve = Standard_True;
}
GeomAPI_Interpolate anInterpolator(ThePoints,
Standard_False,
1.0e-5);
anInterpolator.Perform() ;
if (anInterpolator.IsDone()) {
C = anInterpolator.Curve() ;
Handle(DrawTrSurf_BSplineCurve)
DC = new DrawTrSurf_BSplineCurve(C);
DC->ClearPoles();
DC->ClearKnots();
Draw::Set(a[1], DC);
dout.RepaintView(id);
}
if (newcurve) {
ThePoints = new TColgp_HArray1OfPnt(1, i+1);
for (j = 1; j <= i; j++) ThePoints->SetValue(j, Points->Value(j));
}
}
dout.Select(id,XX,YY,b, Standard_False);
P.SetCoord((Standard_Real)XX/zoom,(Standard_Real)YY/zoom, 0.0);
ThePoints->SetValue(i+1, P);
newcurve = Standard_False;
if (!(ThePoints->Value(i)).IsEqual(ThePoints->Value(i+1), 1.e-06)) {
if (b == 1) {
i++;
mark = new Draw_Marker3D(ThePoints->Value(i), Draw_X, Draw_vert);
dout << mark;
dout.Flush();
Points =
new TColgp_HArray1OfPnt(ThePoints->Lower(),ThePoints->Upper());
Points->ChangeArray1() = ThePoints->Array1();
newcurve = Standard_True;
}
GeomAPI_Interpolate anInterpolator(ThePoints,
Standard_False,
1.0e-5);
anInterpolator.Perform() ;
if (anInterpolator.IsDone()) {
C = anInterpolator.Curve() ;
Handle(DrawTrSurf_BSplineCurve)
DC = new DrawTrSurf_BSplineCurve(C);
DC->ClearPoles();
DC->ClearKnots();
Draw::Set(a[1], DC);
dout.RepaintView(id);
}
if (newcurve) {
ThePoints = new TColgp_HArray1OfPnt(1, i+1);
for (j = 1; j <= i; j++) ThePoints->SetValue(j, Points->Value(j));
}
}
}
GeomAPI_Interpolate anInterpolator(ThePoints,
Standard_False,
1.0e-5);
Standard_False,
1.0e-5);
anInterpolator.Perform() ;
if (anInterpolator.IsDone()) {
C = anInterpolator.Curve() ;
DrawTrSurf::Set(a[1], C);
dout.RepaintView(id);
C = anInterpolator.Curve() ;
DrawTrSurf::Set(a[1], C);
dout.RepaintView(id);
}
}
else {
@@ -534,53 +533,53 @@ static Standard_Integer interpol (Draw_Interpretor& di,Standard_Integer n, const
dout.Flush();
Handle(Geom2d_BSplineCurve) C;
i = 1;
while (b != 3) {
dout.Select(id,XX,YY,b, Standard_False);
P2d.SetCoord((Standard_Real)XX/zoom,(Standard_Real)YY/zoom);
ThePoints->SetValue(i+1, P2d);
newcurve = Standard_False;
if (!(ThePoints->Value(i)).IsEqual(ThePoints->Value(i+1), 1.e-06)) {
if (b == 1) {
i++;
mark = new Draw_Marker2D(P2d, Draw_X, Draw_vert);
dout << mark;
dout.Flush();
Points =
new TColgp_HArray1OfPnt2d(ThePoints->Lower(),ThePoints->Upper());
Points->ChangeArray1() = ThePoints->Array1();
newcurve = Standard_True;
}
dout.Select(id,XX,YY,b, Standard_False);
P2d.SetCoord((Standard_Real)XX/zoom,(Standard_Real)YY/zoom);
ThePoints->SetValue(i+1, P2d);
newcurve = Standard_False;
if (!(ThePoints->Value(i)).IsEqual(ThePoints->Value(i+1), 1.e-06)) {
if (b == 1) {
i++;
mark = new Draw_Marker2D(P2d, Draw_X, Draw_vert);
dout << mark;
dout.Flush();
Points =
new TColgp_HArray1OfPnt2d(ThePoints->Lower(),ThePoints->Upper());
Points->ChangeArray1() = ThePoints->Array1();
newcurve = Standard_True;
}
Geom2dAPI_Interpolate a2dInterpolator(ThePoints,
Standard_False,
1.0e-5) ;
Standard_False,
1.0e-5) ;
a2dInterpolator.Perform() ;
if (a2dInterpolator.IsDone()) {
C = a2dInterpolator.Curve() ;
Handle(DrawTrSurf_BSplineCurve2d)
DC = new DrawTrSurf_BSplineCurve2d(C);
DC->ClearPoles();
DC->ClearKnots();
Draw::Set(a[1], DC);
dout.RepaintView(id);
}
C = a2dInterpolator.Curve() ;
if (newcurve) {
ThePoints = new TColgp_HArray1OfPnt2d(1, i+1);
for (j = 1; j <= i; j++) ThePoints->SetValue(j, Points->Value(j));
}
}
Handle(DrawTrSurf_BSplineCurve2d)
DC = new DrawTrSurf_BSplineCurve2d(C);
DC->ClearPoles();
DC->ClearKnots();
Draw::Set(a[1], DC);
dout.RepaintView(id);
}
if (newcurve) {
ThePoints = new TColgp_HArray1OfPnt2d(1, i+1);
for (j = 1; j <= i; j++) ThePoints->SetValue(j, Points->Value(j));
}
}
}
Geom2dAPI_Interpolate a2dInterpolator(Points,
Standard_False,
1.0e-5) ;
Standard_False,
1.0e-5) ;
a2dInterpolator.Perform() ;
if (a2dInterpolator.IsDone()) {
C = a2dInterpolator.Curve() ;
DrawTrSurf::Set(a[1], C);
dout.RepaintView(id);
C = a2dInterpolator.Curve() ;
DrawTrSurf::Set(a[1], C);
dout.RepaintView(id);
}
}
@@ -598,35 +597,35 @@ static Standard_Integer interpol (Draw_Interpretor& di,Standard_Integer n, const
iFile >> dimen;
if (!strcmp(dimen,"3d")) {
Handle_TColgp_HArray1OfPnt Point =
new TColgp_HArray1OfPnt(1, nbp);
new TColgp_HArray1OfPnt(1, nbp);
for (i = 1; i <= nbp; i++) {
iFile >> x >> y >> z;
Point->SetValue(i, gp_Pnt(x, y, z));
iFile >> x >> y >> z;
Point->SetValue(i, gp_Pnt(x, y, z));
}
GeomAPI_Interpolate anInterpolator(Point,
Standard_False,
1.0e-5) ;
Standard_False,
1.0e-5) ;
anInterpolator.Perform() ;
if (anInterpolator.IsDone()) {
Handle(Geom_BSplineCurve) C =
anInterpolator.Curve();
DrawTrSurf::Set(a[1], C);
Handle(Geom_BSplineCurve) C =
anInterpolator.Curve();
DrawTrSurf::Set(a[1], C);
}
}
else if (!strcmp(dimen,"2d")) {
Handle(TColgp_HArray1OfPnt2d) PointPtr =
new TColgp_HArray1OfPnt2d(1, nbp);
new TColgp_HArray1OfPnt2d(1, nbp);
for (i = 1; i <= nbp; i++) {
iFile >> x >> y;
PointPtr->SetValue(i, gp_Pnt2d(x, y));
iFile >> x >> y;
PointPtr->SetValue(i, gp_Pnt2d(x, y));
}
Geom2dAPI_Interpolate a2dInterpolator(PointPtr,
Standard_False,
1.0e-5);
Standard_False,
1.0e-5);
a2dInterpolator.Perform() ;
if (a2dInterpolator.IsDone()) {
Handle(Geom2d_BSplineCurve) C = a2dInterpolator.Curve() ;
DrawTrSurf::Set(a[1], C);
Handle(Geom2d_BSplineCurve) C = a2dInterpolator.Curve() ;
DrawTrSurf::Set(a[1], C);
}
}
}
@@ -634,8 +633,8 @@ static Standard_Integer interpol (Draw_Interpretor& di,Standard_Integer n, const
}
static Standard_Integer tanginterpol (Draw_Interpretor& di,
Standard_Integer n,
const char** a)
Standard_Integer n,
const char** a)
{
@@ -645,23 +644,23 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
Standard_Integer
ii,
jj,
// num_knots,
// degree,
// num_knots,
// degree,
num_tangents,
num_read,
num_start,
num_parameters ;
Standard_Real
// delta,
tolerance;
// parameter ;
Standard_Boolean periodic_flag = Standard_False ;
gp_Pnt a_point ;
gp_Vec a_vector ;
tolerance = 1.0e-5 ;
Standard_Real
// delta,
tolerance;
// parameter ;
Standard_Boolean periodic_flag = Standard_False ;
gp_Pnt a_point ;
gp_Vec a_vector ;
tolerance = 1.0e-5 ;
@@ -686,7 +685,7 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
}
Handle_TColgp_HArray1OfPnt PointsArrayPtr=
new TColgp_HArray1OfPnt(1,num_parameters) ;
num_tangents = ((n - num_read) / 3) - num_parameters ;
num_tangents = Max (0,num_tangents) ;
num_tangents = Min (num_parameters, num_tangents) ;
@@ -702,15 +701,15 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
ii += 1 ;
}
GeomAPI_Interpolate anInterpolator(PointsArrayPtr,
periodic_flag,
tolerance) ;
periodic_flag,
tolerance) ;
if (num_tangents > 0) {
TColgp_Array1OfVec TangentsArray(1,num_parameters) ;
Handle_TColStd_HArray1OfBoolean
TangentFlagsPtr =
new TColStd_HArray1OfBoolean(1,num_parameters) ;
new TColStd_HArray1OfBoolean(1,num_parameters) ;
for (ii = 1 ; ii <= num_tangents ; ii++) {
TangentFlagsPtr->SetValue(ii,Standard_True) ;
}
@@ -720,16 +719,16 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
ii = 1 ;
while (ii <= num_tangents) {
for (jj = 1 ; jj <= 3 ; jj++) {
a_vector.SetCoord(jj,Draw::Atof(a[num_read])) ;
num_read += 1 ;
a_vector.SetCoord(jj,Draw::Atof(a[num_read])) ;
num_read += 1 ;
}
TangentsArray.SetValue(ii,a_vector) ;
ii += 1 ;
}
anInterpolator.Load(TangentsArray,
TangentFlagsPtr) ;
TangentFlagsPtr) ;
}
anInterpolator.Perform() ;
if (anInterpolator.IsDone()) {
@@ -737,7 +736,7 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
anInterpolator.Curve() ;
DrawTrSurf::Set(a[1],
NewCurvePtr) ;
NewCurvePtr) ;
di << a[2] << " " ;
}
@@ -752,32 +751,32 @@ static Standard_Integer gcarc (Draw_Interpretor& di,Standard_Integer n, const ch
gp_Pnt P1,P2,P3,P4;
if (!strcmp(a[2], "seg")) {
if (DrawTrSurf::GetPoint(a[3], P1)) {
if (DrawTrSurf::GetPoint(a[4], P2)) {
Handle(Geom_Curve) theline = GC_MakeSegment(P1,P2).Value();
DrawTrSurf::Set(a[1], theline);
return 1;
}
if (DrawTrSurf::GetPoint(a[4], P2)) {
Handle(Geom_Curve) theline = GC_MakeSegment(P1,P2).Value();
DrawTrSurf::Set(a[1], theline);
return 1;
}
}
}
else if (!strcmp(a[2], "cir")) {
if (DrawTrSurf::GetPoint(a[3], P1)) {
if (DrawTrSurf::GetPoint(a[4], P2)) {
if (DrawTrSurf::GetPoint(a[5], P3)) {
// if (DrawTrSurf::GetPoint(a[6], P4)) {
if (n>6) {
DrawTrSurf::GetPoint(a[6], P4);
gp_Vec V1 = gp_Vec(P2,P3);
Handle(Geom_Curve)thearc = GC_MakeArcOfCircle(P1,V1,P4).Value();
DrawTrSurf::Set(a[1], thearc);
return 1;
}
else {
Handle(Geom_Curve)thearc = GC_MakeArcOfCircle(P1,P2,P3).Value();
DrawTrSurf::Set(a[1], thearc);
return 1;
}
}
}
if (DrawTrSurf::GetPoint(a[4], P2)) {
if (DrawTrSurf::GetPoint(a[5], P3)) {
// if (DrawTrSurf::GetPoint(a[6], P4)) {
if (n>6) {
DrawTrSurf::GetPoint(a[6], P4);
gp_Vec V1 = gp_Vec(P2,P3);
Handle(Geom_Curve)thearc = GC_MakeArcOfCircle(P1,V1,P4).Value();
DrawTrSurf::Set(a[1], thearc);
return 1;
}
else {
Handle(Geom_Curve)thearc = GC_MakeArcOfCircle(P1,P2,P3).Value();
DrawTrSurf::Set(a[1], thearc);
return 1;
}
}
}
}
}
}
@@ -805,28 +804,28 @@ void GeometryTest::ConstraintCommands(Draw_Interpretor& theCommands)
// constrained constructs
g = "GEOMETRY Constraints";
theCommands.Add("cirtang",
"cirtang cname curve/point/radius curve/point/radius curve/point/radius",
__FILE__,
cirtang,g);
theCommands.Add("cirtang",
"cirtang cname curve/point/radius curve/point/radius curve/point/radius",
__FILE__,
cirtang,g);
theCommands.Add("lintan",
"lintan lname curve1 curve2 [angle]",
__FILE__,
lintang,g);
theCommands.Add("lintan",
"lintan lname curve1 curve2 [angle]",
__FILE__,
lintang,g);
theCommands.Add("interpol",
"interpol cname [fic]",
__FILE__,
interpol, g);
theCommands.Add("tanginterpol",
"tanginterpol curve [p] num_points points [tangents] modifier p = periodic",
__FILE__,
tanginterpol,g);
theCommands.Add("interpol",
"interpol cname [fic]",
__FILE__,
interpol, g);
theCommands.Add("tanginterpol",
"tanginterpol curve [p] num_points points [tangents] modifier p = periodic",
__FILE__,
tanginterpol,g);
theCommands.Add("gcarc",
"gcarc name seg/cir p1 p2 p3 p4",
__FILE__,
gcarc,g);
theCommands.Add("gcarc",
"gcarc name seg/cir p1 p2 p3 p4",
__FILE__,
gcarc,g);
}