//
// 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 version 2.1 as published
+// 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.
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
#include <GeomliteTest.hxx>
#include <DrawTrSurf.hxx>
#include <Draw.hxx>
#include <GeomLib_Tool.hxx>
#include <TopoDS_Shape.hxx>
#include <DBRep.hxx>
+#include <Geom_Curve.hxx>
-//#ifdef WNT
#include <stdio.h>
-#ifdef WNT
-//#define strcasecmp strcmp Already defined
+#ifdef _WIN32
Standard_IMPORT Draw_Viewer dout;
#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
di << "Min Radius of Curvature : " << radius << "\n";
}
else {
- di << "Min Radius of Curvature : infinite" << "\n";
+ di << "Min Radius of Curvature : infinite\n";
}
radius = myProperties.MaxCurvature();
di << "Max Radius of Curvature : " << radius << "\n";
}
else
- di << "Min Radius of Curvature : infinite" << "\n";
+ di << "Min Radius of Curvature : infinite\n";
}
else {
- di << "Curvature not defined." << "\n";
+ di << "Curvature not defined.\n";
}
}
else {
Conv(S, U1, U2, V1, V2, Precision::PConfusion());
NbU = Conv.NbUPatches();
NbV = Conv.NbVPatches();
- di << NbU << " X " << NbV << " patches in the result" << "\n";
+ di << NbU << " X " << NbV << " patches in the result\n";
for (i = 1; i <= NbU; i++) {
for (j = 1; j <= NbV; j++) {
Sprintf(name,"%s_%i_%i",a[1],i,j);
GeomConvert_BSplineSurfaceToBezierSurface Conv(S);
NbU = Conv.NbUPatches();
NbV = Conv.NbVPatches();
- di << NbU << " X " << NbV << " patches in the result" << "\n";
+ di << NbU << " X " << NbV << " patches in the result\n";
for (i = 1; i <= NbU; i++) {
for (j = 1; j <= NbV; j++) {
Sprintf(name,"%s_%i_%i",a[1],i,j);
GeomConvert_BSplineCurveToBezierCurve Conv(C3d, U1, U2,
Precision::PConfusion());
NbArc = Conv.NbArcs();
- di << NbArc << " arcs in the result" << "\n";
+ di << NbArc << " arcs in the result\n";
for (i = 1; i <= NbArc; i++) {
Sprintf(name,"%s_%i",a[1],i);
char *temp = name ;
else {
GeomConvert_BSplineCurveToBezierCurve Conv(C3d);
NbArc = Conv.NbArcs();
- di << NbArc << " arcs in the result" << "\n";
+ di << NbArc << " arcs in the result\n";
for (i = 1; i <= NbArc; i++) {
Sprintf(name,"%s_%i",a[1],i);
char *temp = name ;
Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d, U1, U2,
Precision::PConfusion());
NbArc = Conv.NbArcs();
- di << NbArc << " arcs in the result" << "\n";
+ di << NbArc << " arcs in the result\n";
for (i = 1; i <= NbArc; i++) {
Sprintf(name,"%s_%i",a[1],i);
char *temp = name ;
else {
Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d);
NbArc = Conv.NbArcs();
- di << NbArc << " arcs in the result" << "\n";
+ di << NbArc << " arcs in the result\n";
for (i = 1; i <= NbArc; i++) {
Sprintf(name,"%s_%i",a[1],i);
char *temp = name ;
Standard_Real Tol = Precision::Confusion();
NbU = Draw::Atoi(a[2]);
- if ( (Handle(Geom_Curve)::
- DownCast(DrawTrSurf::Get(a[3]))).IsNull()) {
+ Handle(Geom_Curve) aCurve (Handle(Geom_Curve)::DownCast(DrawTrSurf::Get(a[3])));
+ if (aCurve.IsNull()) {
// Cas Surfacique
NbV = Draw::Atoi(a[3]);
if (n<4+NbU*NbV) {
BZ(ii,jj) =
Handle(Geom_BezierSurface)::DownCast(DrawTrSurf::Get(a[kk]));
if (BZ(ii,jj).IsNull()) {
- di << "the Surface " << kk <<"is not a BezierSurface" << "\n";
+ di << "the Surface " << kk <<"is not a BezierSurface\n";
return 1;
}
kk++;
GeomConvert_CompBezierSurfacesToBSplineSurface Conv(BZ, Tol);
if (! Conv.IsDone()) {
- di << "Convert Not Done" << "\n";
+ di << "Convert Not Done\n";
return 1;
}
for (ii=1, kk=3; ii<=NbU; ii++,kk++) {
BZ = Handle(Geom_BezierCurve)::DownCast(DrawTrSurf::Get(a[kk]));
if (BZ.IsNull()) {
- di << "the curve " << kk <<"is not a BezierCurve" << "\n";
+ di << "the curve " << kk <<"is not a BezierCurve\n";
return 1;
}
TColgp_Array1OfPnt Poles(1, BZ->NbPoles());
if (GBz.IsNull()) {
GBs = DrawTrSurf::GetBSplineSurface(a[1]);
if (GBs.IsNull())
+ {
return 1;
- BSpline = Standard_True;
+ }
+ BSpline = Standard_True;
}
Standard_Real dx = Draw::Atof(a[n-3]);
BSpline = Standard_True;
}
- Standard_Integer Index;
- if ( !strcasecmp(a[0],"remrowpole")) {
- if (BSpline)
- Index = GBs->UDegree();
- else
- Index = GBz->UDegree();
- }
- else if ( !strcasecmp(a[0],"remcolpole")) {
- if (BSpline)
- Index = GBs->VDegree();
- else
- Index = GBz->VDegree();
- }
-
if ( !strcasecmp(a[0],"remrowpole")) {
if ( BSpline) {
- di << " Error : Cannot remove a polerow on a BSplineSurface " << "\n";
+ di << " Error : Cannot remove a polerow on a BSplineSurface \n";
}
else {
GBz->RemovePoleRow(NewIndex);
}
else if ( !strcasecmp(a[0],"remcolpole")) {
if ( BSpline) {
- di << " Error : Cannot remove a polecol on a BSplineSurface " << "\n";
+ di << " Error : Cannot remove a polecol on a BSplineSurface \n";
}
else {
GBz->RemovePoleCol(NewIndex);
if (GBz.IsNull()) {
GBs = DrawTrSurf::GetBSplineSurface(a[1]);
if (GBs.IsNull())
+ {
return 1;
- BSpline = Standard_True;
+ }
+ BSpline = Standard_True;
}
Standard_Integer UIndex = 0;
{
// try to find parameters on a Surface
Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[1]);
- if( S.IsNull() ) { di << "Unknown surface" << "\n"; return 1; }
+ if( S.IsNull() ) { di << "Unknown surface\n"; return 1; }
gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
Standard_Real Tol = Draw::Atof(a[5]), U = 0., V = 0.;
Standard_Boolean res = GeomLib_Tool::Parameters(S,P,Tol,U,V);
Draw::Set(a[6],U);
Draw::Set(a[7],V);
- if( !res ) { di << "Wrong point" << "\n"; return 1; }
+ if( !res ) { di << "Wrong point\n"; return 1; }
}
else if(n == 7)
{
// try to find parameters on a 3d Curve
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[1]);
- if( C.IsNull() ) { di << "Unknown curve" << "\n"; return 1; }
+ if( C.IsNull() ) { di << "Unknown curve\n"; return 1; }
gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
Standard_Real Tol = Draw::Atof(a[5]), U = 0.;
Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
Draw::Set(a[6],U);
- if( !res ) { di << "Wrong point" << "\n"; return 1; }
+ if( !res ) { di << "Wrong point\n"; return 1; }
}
else if(n == 6)
{
// try to find parameters on a 2d Curve
Handle(Geom2d_Curve) C = DrawTrSurf::GetCurve2d(a[1]);
- if( C.IsNull() ) { di << "Unknown curve 2d" << "\n"; return 1; }
+ if( C.IsNull() ) { di << "Unknown curve 2d\n"; return 1; }
gp_Pnt2d P(Draw::Atof(a[2]), Draw::Atof(a[3]));
Standard_Real Tol = Draw::Atof(a[4]), U = 0.;
Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
Draw::Set(a[5],U);
- if( !res ) { di << "Wrong point" << "\n"; return 1; }
+ if( !res ) { di << "Wrong point\n"; return 1; }
}
else
{
- di << "Invalid parameters!" << "\n";
- di << "Usage:" << "\n";
- di << "parameters Surf X Y Z Tol U V" << "\n";
- di << "parameters Curv X Y Z Tol U" << "\n";
- di << "parameters Curv2d X Y Tol U" << "\n";
+ di << "Invalid parameters!\n";
+ di << "Usage:\n";
+ di << "parameters Surf X Y Z Tol U V\n";
+ di << "parameters Curv X Y Z Tol U\n";
+ di << "parameters Curv2d X Y Tol U\n";
return 1;
}