mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026922: Huge performance issue writing data to the output stream
Test case for issue CR26922 Correction of literal (char to string)
This commit is contained in:
@@ -44,29 +44,29 @@ static int dejadraw = 0;
|
||||
static Standard_Integer LocSet (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
di << argv[0] << "LocSet a [b [c]]: set location for shape \"a\":" << "\n";
|
||||
di << "- to Null if one argument is given" << "\n";
|
||||
di << "- to location of shape b if two arguments are given" << "\n";
|
||||
di << "- to difference of locations of shapes b and c if three arguments are given" << "\n";
|
||||
di << argv[0] << "LocSet a [b [c]]: set location for shape \"a\":\n";
|
||||
di << "- to Null if one argument is given\n";
|
||||
di << "- to location of shape b if two arguments are given\n";
|
||||
di << "- to difference of locations of shapes b and c if three arguments are given\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape a = DBRep::Get ( argv[1] );
|
||||
if ( a.IsNull() ) {
|
||||
di << "No shape named \"" << argv[1] << "\" found" << "\n";
|
||||
di << "No shape named \"" << argv[1] << "\" found\n";
|
||||
return 1;
|
||||
}
|
||||
TopLoc_Location L;
|
||||
if ( argc >2 ) {
|
||||
TopoDS_Shape b = DBRep::Get ( argv[2] );
|
||||
if ( b.IsNull() ) {
|
||||
di << "No shape named \"" << argv[2] << "\" found" << "\n";
|
||||
di << "No shape named \"" << argv[2] << "\" found\n";
|
||||
return 1;
|
||||
}
|
||||
if ( argc >3 ) {
|
||||
TopoDS_Shape c = DBRep::Get ( argv[3] );
|
||||
if ( c.IsNull() ) {
|
||||
di << "No shape named \"" << argv[3] << "\" found" << "\n";
|
||||
di << "No shape named \"" << argv[3] << "\" found\n";
|
||||
return 1;
|
||||
}
|
||||
L = b.Location().Multiplied ( c.Location().Inverted() );
|
||||
@@ -87,19 +87,19 @@ static Standard_Integer LocSet (Draw_Interpretor& di, Standard_Integer argc, con
|
||||
static Standard_Integer LocDump (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
di << argv[0] << "LocDump a: dump location of shape \"a\"" << "\n";
|
||||
di << argv[0] << "LocDump a: dump location of shape \"a\"\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape a = DBRep::Get ( argv[1] );
|
||||
if ( a.IsNull() ) {
|
||||
di << "No shape named \"" << argv[1] << "\" found" << "\n";
|
||||
di << "No shape named \"" << argv[1] << "\" found\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopLoc_Location L = a.Location();
|
||||
di << "Location of shape " << argv[1] << ":" << "\n";
|
||||
di << "Results in:" << "\n";
|
||||
di << "Location of shape " << argv[1] << ":\n";
|
||||
di << "Results in:\n";
|
||||
gp_Trsf T = L.Transformation();
|
||||
TopLoc_Location l ( T );
|
||||
Standard_SStream aSStream;
|
||||
|
@@ -69,7 +69,7 @@ static Standard_Integer tolerance
|
||||
<< "myshape [mode] valmin : sub-shapes over valmin\n"
|
||||
<<"myshape [mode] valmin valmax : between valmin and valmax\n"
|
||||
<<"myshape [mode] 0 valmax : below valmax\n"
|
||||
<<" more : all shapes(D) v vertices e edges f faces c combined(faces)"<<"\n";
|
||||
<<" more : all shapes(D) v vertices e edges f faces c combined(faces)\n";
|
||||
return (argc < 2 ? 0 : 1 /* Error */); }
|
||||
Standard_CString arg1 = argv[1];
|
||||
TopoDS_Shape Shape = DBRep::Get(arg1);
|
||||
@@ -132,11 +132,11 @@ static Standard_Integer tolerance
|
||||
static Standard_Integer projface
|
||||
(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 4) { di<<"Give FACE name and X Y [Z]"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 4) { di<<"Give FACE name and X Y [Z]\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
TopoDS_Shape Shape = DBRep::Get(arg1);
|
||||
if (Shape.IsNull()) { di<<"Shape unknown : "<<arg1<<"\n"; return 1 /* Error */; }
|
||||
if (Shape.ShapeType() != TopAbs_FACE) { di<<"Not a face"<<"\n"; return 1 /* Error */; }
|
||||
if (Shape.ShapeType() != TopAbs_FACE) { di<<"Not a face\n"; return 1 /* Error */; }
|
||||
TopoDS_Face F = TopoDS::Face (Shape);
|
||||
Handle(Geom_Surface) thesurf = BRep_Tool::Surface (F); // pas locface
|
||||
// On y va
|
||||
@@ -158,7 +158,7 @@ static Standard_Integer projface
|
||||
|
||||
GeomAPI_ProjectPointOnSurf proj(P3D, thesurf, uf-du, ul+du, vf-dv, vl+dv);
|
||||
Standard_Integer sol, nPSurf = proj.NbPoints();
|
||||
di<<" Found "<<nPSurf<<" Points"<<"\n";
|
||||
di<<" Found "<<nPSurf<<" Points\n";
|
||||
for (sol = 1; sol <= nPSurf; sol ++) {
|
||||
di<<"n0 "<<sol<<" Distance "<<proj.Distance(sol);
|
||||
proj.Parameters(sol, U,V);
|
||||
@@ -188,7 +188,7 @@ static Standard_Integer projcurve
|
||||
(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
// admet une EDGE ou une CURVE
|
||||
if (argc < 5) { di<<"Give : EDGE X Y Z or CURVE3D X Y Z or CURVE3D first last X Y Z"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 5) { di<<"Give : EDGE X Y Z or CURVE3D X Y Z or CURVE3D first last X Y Z\n"; return 1 /* Error */; }
|
||||
const char * arg1 = argv[1];
|
||||
Standard_Integer i0 = 0;
|
||||
TopoDS_Shape Shape = DBRep::Get(arg1);
|
||||
@@ -200,13 +200,13 @@ static Standard_Integer projcurve
|
||||
C = BRep_Tool::Curve (E,cf,cl);
|
||||
di<<"Edge "<<arg1<<" Params from "<<cf<<" to "<<cl<<"\n";
|
||||
} else {
|
||||
di<<"SHAPE "<<arg1<<" Not an EDGE"<<"\n"; return 1 /* Error */;
|
||||
di<<"SHAPE "<<arg1<<" Not an EDGE\n"; return 1 /* Error */;
|
||||
}
|
||||
} else {
|
||||
const char* a1 = arg1;
|
||||
C = DrawTrSurf::GetCurve (a1);
|
||||
if (C.IsNull())
|
||||
{ di<<arg1<<" neither EDGE nor CURVE 3D"<<"\n"; return 1 /* Error */; }
|
||||
{ di<<arg1<<" neither EDGE nor CURVE 3D\n"; return 1 /* Error */; }
|
||||
cf = C->FirstParameter(); cl = C->LastParameter();
|
||||
if (argc >= 7) { cf = Draw::Atof (argv[2]); cl = Draw::Atof (argv[3]); i0 = 2; }
|
||||
di<<"Curve 3D "<<arg1<<" Params from "<<cf<<" to "<<cl<<"\n";
|
||||
@@ -224,18 +224,18 @@ static Standard_Integer projcurve
|
||||
|
||||
dist = ShapeAnalysis_Curve().Project (C,P3D,BRepBuilderAPI::Precision(),res,param, cf,cl);
|
||||
res.Coord(X,Y,Z);
|
||||
di<<"Result : "<<X<<" "<<Y<<" "<<Z<<"\n"<<"Param = "<<param<<" Gap = "<<dist<<"\n";
|
||||
di<<"Result : "<<X<<" "<<Y<<" "<<Z<<"\nParam = "<<param<<" Gap = "<<dist<<"\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Standard_Integer anaface
|
||||
(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 2) { di<<"donner un nom de face"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 2) { di<<"donner un nom de face\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
TopoDS_Shape Shape = DBRep::Get(arg1);
|
||||
if (Shape.IsNull()) { di<<arg1<<" inconnu"<<"\n"; return 1 /* Error */; }
|
||||
// if (Shape.ShapeType() != TopAbs_FACE) { di<<"Pas une FACE"<<"\n"; return 1 /* Error */; }
|
||||
if (Shape.IsNull()) { di<<arg1<<" inconnu\n"; return 1 /* Error */; }
|
||||
// if (Shape.ShapeType() != TopAbs_FACE) { di<<"Pas une FACE\n"; return 1 /* Error */; }
|
||||
|
||||
// On regarde les wires, sont-ils bien fermes
|
||||
Standard_Integer nbw = 0, nbe = 0;
|
||||
@@ -252,7 +252,7 @@ static Standard_Integer anaface
|
||||
}
|
||||
di<<"\n";
|
||||
}
|
||||
else { di<<"Analyse Wires, Ignore Faces"<<"\n"; }
|
||||
else { di<<"Analyse Wires, Ignore Faces\n"; }
|
||||
Standard_Boolean iasurf = !surface.IsNull();
|
||||
//:sw if (!Face.IsNull()) STW.SetFace (Face);
|
||||
//:sw else STW.SetPrecision (BRepBuilderAPI::Precision());
|
||||
@@ -260,8 +260,8 @@ static Standard_Integer anaface
|
||||
for (TopExp_Explorer exp(Shape,TopAbs_WIRE); exp.More(); exp.Next()) {
|
||||
TopoDS_Wire Wire = TopoDS::Wire (exp.Current()); nbw ++; nbe = 0;
|
||||
di<<"WIRE "<<nbw;
|
||||
if (Wire.Orientation() == TopAbs_FORWARD) di<<" (FWD)"<<"\n";
|
||||
else di<<" (REV)"<<"\n";
|
||||
if (Wire.Orientation() == TopAbs_FORWARD) di<<" (FWD)\n";
|
||||
else di<<" (REV)\n";
|
||||
gp_Pnt fin,debut;
|
||||
gp_Pnt2d finuv,debuv; gp_XY baseuv;
|
||||
TopoDS_Vertex fv,lv;
|
||||
@@ -271,7 +271,7 @@ static Standard_Integer anaface
|
||||
Standard_Real u1= 0.,u2= 0.,v1= 0.,v2= 0.,umin= 0.,umax= 0.,vmin= 0.,vmax= 0., totcross= 0.;
|
||||
|
||||
//:sw STW.ClearWire(); STW.Load (Wire);
|
||||
// if (STW.Reorder()) di<<"Wire reordered to explore"<<"\n";
|
||||
// if (STW.Reorder()) di<<"Wire reordered to explore\n";
|
||||
// for (TopExp_Explorer exe(Wire.Oriented(TopAbs_FORWARD),TopAbs_EDGE); exe.More(); exe.Next()) {
|
||||
// TopoDS_Edge Edge = TopoDS::Edge (exe.Current()); nbe ++;
|
||||
//:sw for (nbe = 1; nbe <= STW.NbEdges(); nbe ++) {
|
||||
@@ -283,14 +283,14 @@ static Standard_Integer anaface
|
||||
di<<"Wire "<<nbw<<", Edge "<<nbe;
|
||||
if (Edge.Orientation() == TopAbs_FORWARD) di<<" (FWD";
|
||||
else di<<" (REV";
|
||||
di<<" , Tol= "<<BRep_Tool::Tolerance (Edge)<<" )"<<"\n";
|
||||
di<<" , Tol= "<<BRep_Tool::Tolerance (Edge)<<" )\n";
|
||||
Standard_Real f3d,l3d,f2d,l2d;
|
||||
Handle(Geom_Curve) curve3d = BRep_Tool::Curve (Edge,f3d,l3d);
|
||||
Handle(Geom2d_Curve) curve2d;
|
||||
if (iasurf) curve2d = BRep_Tool::CurveOnSurface(Edge,Face,f2d,l2d);
|
||||
Standard_Boolean ia2d = !curve2d.IsNull(); iaw2d |= ia2d;
|
||||
if (!ia2d) di<<"-- No PCurve"<<"\n";
|
||||
if (curve3d.IsNull()) di<<"-- no Curve 3d"<<"\n";
|
||||
if (!ia2d) di<<"-- No PCurve\n";
|
||||
if (curve3d.IsNull()) di<<"-- no Curve 3d\n";
|
||||
|
||||
// On va tacher de calculer les positions et les comparer
|
||||
gp_Pnt2d fuv,luv;
|
||||
@@ -357,32 +357,32 @@ static Standard_Integer anaface
|
||||
Standard_Real difu = umax - umin, difv = vmax - vmin;
|
||||
GProp_GProps G;
|
||||
BRepGProp::SurfaceProperties(Face,G);
|
||||
if (G.Mass() > 0) di<<"GProps:Mass Out"<<"\n";
|
||||
else di<<"GProps:Mass In"<<"\n";
|
||||
if (G.Mass() > 0) di<<"GProps:Mass Out\n";
|
||||
else di<<"GProps:Mass In\n";
|
||||
/// return (G.Mass() > 0);
|
||||
BRepTopAdaptor_FClass2d fcl (Face,BRep_Tool::Tolerance(Face));
|
||||
if (fcl.PerformInfinitePoint () == TopAbs_OUT) di<<"Classifier Infinite : Out"<<"\n";
|
||||
else di<<"Classifier Infinite : In"<<"\n";
|
||||
if (fcl.PerformInfinitePoint () == TopAbs_OUT) di<<"Classifier Infinite : Out\n";
|
||||
else di<<"Classifier Infinite : In\n";
|
||||
gp_Pnt2d pcl;
|
||||
pcl.SetCoord(umin-difu,vmin-difv);
|
||||
if (fcl.Perform (pcl) == TopAbs_OUT) di<<"Classifier UMin-VMin : Out"<<"\n";
|
||||
if (fcl.Perform (pcl) == TopAbs_OUT) di<<"Classifier UMin-VMin : Out\n";
|
||||
pcl.SetCoord(umin-difu,vmax+difv);
|
||||
if (fcl.Perform (pcl) == TopAbs_OUT) di<<"Classifier UMin-VMax : Out"<<"\n";
|
||||
if (fcl.Perform (pcl) == TopAbs_OUT) di<<"Classifier UMin-VMax : Out\n";
|
||||
pcl.SetCoord(umax+difu,vmin-difv);
|
||||
if (fcl.Perform (pcl) == TopAbs_OUT) di<<"Classifier UMax-VMin : Out"<<"\n";
|
||||
if (fcl.Perform (pcl) == TopAbs_OUT) di<<"Classifier UMax-VMin : Out\n";
|
||||
pcl.SetCoord(umax+difu,vmax+difv);
|
||||
if (fcl.Perform (pcl) == TopAbs_OUT) di<<"Classifier UMax-VMax : Out"<<"\n";
|
||||
if (fcl.Perform (pcl) == TopAbs_OUT) di<<"Classifier UMax-VMax : Out\n";
|
||||
}
|
||||
}
|
||||
if (ShapeAnalysis::IsOuterBound (Face)) di<<"ShapeAnalysis: Outer Bound"<<"\n";
|
||||
else di<<"ShapeAnalysis: Not Outer Bound"<<"\n";
|
||||
di<<" Total "<<nbw<<" Wire(s)"<<"\n";
|
||||
if (ShapeAnalysis::IsOuterBound (Face)) di<<"ShapeAnalysis: Outer Bound\n";
|
||||
else di<<"ShapeAnalysis: Not Outer Bound\n";
|
||||
di<<" Total "<<nbw<<" Wire(s)\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Standard_Integer XSHAPE_statshape(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 2) { di<<"ShapeName; + options : prefix for particular cases : what to get"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 2) { di<<"ShapeName; + options : prefix for particular cases : what to get\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
Standard_CString arg2 = NULL;
|
||||
Standard_CString arg3 = NULL;
|
||||
@@ -404,61 +404,61 @@ static Standard_Integer XSHAPE_statshape(Draw_Interpretor& di, Standard_Integer
|
||||
}
|
||||
analyzer.Perform(Shape);
|
||||
|
||||
di<<"Count Item\n----- ----"<<"\n";
|
||||
di<<"Count Item\n----- ----\n";
|
||||
nb = analyzer.NbEdges();
|
||||
if(nb>0) di<<nb<<" "<<" EDGE (Oriented)"<<"\n";
|
||||
if(nb>0) di<<nb<<" EDGE (Oriented)\n";
|
||||
nb = analyzer.NbSharedEdges();
|
||||
if(nb>0) di<<nb<<" "<<" EDGE (Shared)"<<"\n";
|
||||
if(nb>0) di<<nb<<" EDGE (Shared)\n";
|
||||
nb = analyzer.NbFreeEdges();
|
||||
if(nb>0) di<<nb<<" "<<" EDGE (Free)"<<"\n";
|
||||
if(nb>0) di<<nb<<" EDGE (Free)\n";
|
||||
nb = analyzer.NbFaces();
|
||||
if(nb>0) di<<nb<<" "<<" FACE"<<"\n";
|
||||
if(nb>0) di<<nb<<" FACE\n";
|
||||
nb = analyzer.NbFreeFaces();
|
||||
if(nb>0) di<<nb<<" "<<" FACE (Free)"<<"\n";
|
||||
if(nb>0) di<<nb<<" FACE (Free)\n";
|
||||
nb = analyzer.NbFreeWires();
|
||||
if(nb>0) di<<nb<<" "<<" WIRE (Free)"<<"\n";
|
||||
if(nb>0) di<<nb<<" WIRE (Free)\n";
|
||||
nb = analyzer.NbShells();
|
||||
if(nb>0) di<<nb<<" "<<" SHELL"<<"\n";
|
||||
if(nb>0) di<<nb<<" SHELL\n";
|
||||
nb = analyzer.NbSolids();
|
||||
if(nb>0) di<<nb<<" "<<" SOLID"<<"\n";
|
||||
if(nb>0) di<<nb<<" SOLID\n";
|
||||
nb = analyzer.NbVertices();
|
||||
if(nb>0) di<<nb<<" "<<" VERTEX (Oriented)"<<"\n";
|
||||
if(nb>0) di<<nb<<" VERTEX (Oriented)\n";
|
||||
nb = analyzer.NbSharedVertices();
|
||||
if(nb>0) di<<nb<<" "<<" VERTEX (Shared)"<<"\n";
|
||||
if(nb>0) di<<nb<<" VERTEX (Shared)\n";
|
||||
nb = analyzer.NbWires();
|
||||
if(nb>0) di<<nb<<" "<<" WIRE"<<"\n";
|
||||
if(nb>0) di<<nb<<" WIRE\n";
|
||||
nb = analyzer.NbFaceWithSevWires();
|
||||
if(nb>0) di<<nb<<" "<<"Face with more than one wire"<<"\n";
|
||||
if(nb>0) di<<nb<<" Face with more than one wire\n";
|
||||
nb = analyzer.NbNoPCurve();
|
||||
if(nb>0) di<<nb<<" "<<"No pcurve"<<"\n";
|
||||
if(nb>0) di<<nb<<" No pcurve\n";
|
||||
nb = analyzer.NbSolidsWithVoids();
|
||||
if(nb>0) di<<nb<<" "<<"SOLID with voids"<<"\n";
|
||||
if(nb>0) di<<nb<<" SOLID with voids\n";
|
||||
nb = analyzer.NbWireWitnSeam();
|
||||
if(nb>0) di<<nb<<" "<<"Wire(s) with one seam edge"<<"\n";
|
||||
if(nb>0) di<<nb<<" Wire(s) with one seam edge\n";
|
||||
nb = analyzer.NbWireWithSevSeams();
|
||||
if(nb>0) di<<nb<<" "<<"Wire(s) with several seam edges"<<"\n";
|
||||
if(nb>0) di<<nb<<" Wire(s) with several seam edges\n";
|
||||
nb = analyzer.NbBigSplines();
|
||||
if(nb>0) di<<nb<<" "<<"bigspl : BSpline > 8192 poles"<<"\n";
|
||||
if(nb>0) di<<nb<<" bigspl : BSpline > 8192 poles\n";
|
||||
nb = analyzer.NbBezierSurf();
|
||||
if(nb>0) di<<nb<<" "<<"bezsur : BezierSurface"<<"\n";
|
||||
if(nb>0) di<<nb<<" bezsur : BezierSurface\n";
|
||||
nb = analyzer.NbBSplibeSurf();
|
||||
if(nb>0) di<<nb<<" "<<"bspsur : BSplineSurface"<<"\n";
|
||||
if(nb>0) di<<nb<<" bspsur : BSplineSurface\n";
|
||||
nb = analyzer.NbC0Curves();
|
||||
if(nb>0) di<<nb<<" "<<"c0curv : Curve Only C0"<<"\n";
|
||||
if(nb>0) di<<nb<<" c0curv : Curve Only C0\n";
|
||||
nb = analyzer.NbC0Surfaces();
|
||||
if(nb>0) di<<nb<<" "<<"c0surf : Surface Only C0"<<"\n";
|
||||
if(nb>0) di<<nb<<" c0surf : Surface Only C0\n";
|
||||
nb = analyzer.NbIndirectSurf();
|
||||
if(nb>0) di<<nb<<" "<<"indsur : Indirect Surface"<<"\n";
|
||||
if(nb>0) di<<nb<<" indsur : Indirect Surface\n";
|
||||
nb = analyzer.NbOffsetCurves();
|
||||
if(nb>0) di<<nb<<" "<<"ofcur : Offset Curve(s)"<<"\n";
|
||||
if(nb>0) di<<nb<<" ofcur : Offset Curve(s)\n";
|
||||
nb = analyzer.NbOffsetSurf();
|
||||
if(nb>0) di<<nb<<" "<<"ofsur : Offset Surface"<<"\n";
|
||||
if(nb>0) di<<nb<<" ofsur : Offset Surface\n";
|
||||
nb = analyzer.NbTrimmedCurve2d();
|
||||
if(nb>0) di<<nb<<" "<<"trc2d : Trimmed Curve2d"<<"\n";
|
||||
if(nb>0) di<<nb<<" trc2d : Trimmed Curve2d\n";
|
||||
nb = analyzer.NbTrimmedCurve3d();
|
||||
if(nb>0) di<<nb<<" "<<"trc3d : Trimmed Curve3d"<<"\n";
|
||||
if(nb>0) di<<nb<<" trc3d : Trimmed Curve3d\n";
|
||||
nb = analyzer.NbTrimSurf();
|
||||
if(nb>0) di<<nb<<" "<<"trimsu : RectangularTrimmedSurface"<<"\n";
|
||||
if(nb>0) di<<nb<<" trimsu : RectangularTrimmedSurface\n";
|
||||
|
||||
if(arg3 ==NULL) return 0;
|
||||
|
||||
@@ -519,12 +519,12 @@ static Standard_Integer XSHAPE_comptoledge
|
||||
"Deviation is computed by nbpoints sample points (default is 371).\n"
|
||||
"Gives the max, min and average value on all edges in the shape\n"
|
||||
"If prefix is defined, edges with maximal real tolerance and\n"
|
||||
"relation (and corresponding faces) will be saved with such names\n" << "\n";
|
||||
"relation (and corresponding faces) will be saved with such names\n\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
TopoDS_Shape shape = DBRep::Get(argv[1]);
|
||||
if (shape.IsNull()) { di << "Shape name \"" << argv[1] << "\" is invalid" << "\n"; return 1; }
|
||||
if (shape.IsNull()) { di << "Shape name \"" << argv[1] << "\" is invalid\n"; return 1; }
|
||||
Standard_Integer nbpnts = 371;
|
||||
Standard_CString prefix = 0;
|
||||
if ( argc >2 ) {
|
||||
@@ -558,7 +558,7 @@ static Standard_Integer XSHAPE_comptoledge
|
||||
}
|
||||
num++;
|
||||
}
|
||||
if ( ! num ) { di << "No edges found in the shape" << "\n"; return 1; }
|
||||
if ( ! num ) { di << "No edges found in the shape\n"; return 1; }
|
||||
|
||||
di << "Edges tolerance computed by " << nbpnts << " points: \n"
|
||||
"MAX=" << max << " AVG=" << ave/num << " MIN=" << min << "\n";
|
||||
@@ -626,11 +626,11 @@ static Standard_Integer freebounds (Draw_Interpretor& di,
|
||||
TopoDS_Shape wires = F.GetClosedWires();
|
||||
Sprintf (name, "%s_c", a[1]);
|
||||
DBRep::Set (name, wires);
|
||||
di << name << " - closed wires" << "\n";
|
||||
di << name << " - closed wires\n";
|
||||
wires = F.GetOpenWires();
|
||||
Sprintf (name, "%s_o", a[1]);
|
||||
DBRep::Set (name, wires);
|
||||
di << name << " - open wires" << "\n";
|
||||
di << name << " - open wires\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -664,7 +664,7 @@ static Standard_Integer FreeBoundsProps(Draw_Interpretor& di,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
if ( (n < 2)||(n > 5) ) {
|
||||
di<<"Usage : freeprops shapename [tolerance [splitclosed [splitopen]]]"<<"\n";
|
||||
di<<"Usage : freeprops shapename [tolerance [splitclosed [splitopen]]]\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -690,10 +690,10 @@ static Standard_Integer FreeBoundsProps(Draw_Interpretor& di,
|
||||
|
||||
Standard_Integer nb = analyzer.NbClosedFreeBounds();
|
||||
di<<"\n";
|
||||
di<<" \t"<<"Area mm2"<<"\t"<<"Length mm"<<"\t"<<"Ratio L/W"<<"\t"<<"Width mm"<<"\t"<<"Nb noth"<<"\n";
|
||||
di<<" \tArea mm2\tLength mm\tRatio L/W\tWidth mm\tNb noth\n";
|
||||
B.MakeCompound(closed);
|
||||
if (nb) {
|
||||
di<<"Closed bounds properties"<<"\n";
|
||||
di<<"Closed bounds properties\n";
|
||||
for (Standard_Integer i=1; i <= nb; i++) {
|
||||
Handle(ShapeAnalysis_FreeBoundData) fbd = analyzer.ClosedFreeBound(i);
|
||||
PrintProps(i, fbd, di);
|
||||
@@ -704,7 +704,7 @@ static Standard_Integer FreeBoundsProps(Draw_Interpretor& di,
|
||||
nb = analyzer.NbOpenFreeBounds();
|
||||
B.MakeCompound(open);
|
||||
if (nb) {
|
||||
di<<"Open bounds properties"<<"\n";
|
||||
di<<"Open bounds properties\n";
|
||||
for (Standard_Integer i=1; i <= nb; i++) {
|
||||
Handle(ShapeAnalysis_FreeBoundData) fbd = analyzer.OpenFreeBound(i);
|
||||
PrintProps(i, fbd, di);
|
||||
@@ -717,7 +717,7 @@ static Standard_Integer FreeBoundsProps(Draw_Interpretor& di,
|
||||
di << name << " - closed wires, ";
|
||||
DBRep::Set(name, closed);
|
||||
Sprintf (name, "%s_o",a[1]);
|
||||
di << name << " - closed wires " << "\n";
|
||||
di << name << " - closed wires \n";
|
||||
DBRep::Set(name, open);
|
||||
return 0;
|
||||
}
|
||||
@@ -748,11 +748,11 @@ static Standard_Integer closefreebounds (Draw_Interpretor& di,
|
||||
TopoDS_Shape wires = F.GetClosedWires();
|
||||
Sprintf (name, "%s_c", a[1]);
|
||||
DBRep::Set (name, wires);
|
||||
di << name << " - closed wires" << "\n";
|
||||
di << name << " - closed wires\n";
|
||||
wires = F.GetOpenWires();
|
||||
Sprintf (name, "%s_o", a[1]);
|
||||
DBRep::Set (name, wires);
|
||||
di << name << " - open wires" << "\n";
|
||||
di << name << " - open wires\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -824,11 +824,11 @@ static Standard_Integer getareacontour (Draw_Interpretor& di,
|
||||
if (n < 2) return 1;
|
||||
TopoDS_Shape shape = DBRep::Get(a[1]);
|
||||
if (shape.IsNull()) {
|
||||
di<<"Shape is not defined"<<"\n";
|
||||
di<<"Shape is not defined\n";
|
||||
return 1;
|
||||
}
|
||||
if(shape.ShapeType() != TopAbs_WIRE) {
|
||||
di<<"invalid type of argument"<<"\n";
|
||||
di<<"invalid type of argument\n";
|
||||
return 1;
|
||||
}
|
||||
//Handle(ShapeExtend_WireData) asewd = new ShapeExtend_WireData(TopoDS::Wire(shape));
|
||||
@@ -843,7 +843,7 @@ static Standard_Integer checkselfintersection
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
di<<"Call please \"checkselfintersection wire [face]\""<<"\n";
|
||||
di<<"Call please \"checkselfintersection wire [face]\"\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -852,7 +852,7 @@ static Standard_Integer checkselfintersection
|
||||
TopoDS_Shape wire = DBRep::Get(arg1);
|
||||
if (wire.IsNull() || wire.ShapeType() != TopAbs_WIRE)
|
||||
{
|
||||
di<<"A null shape or not a wire is used."<<"\n";
|
||||
di<<"A null shape or not a wire is used.\n";
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@ static Standard_Integer checkselfintersection
|
||||
face = DBRep::Get(arg2);
|
||||
if (face.IsNull() || face.ShapeType() != TopAbs_FACE)
|
||||
{
|
||||
di<<"A null shape or not a face is used."<<"\n";
|
||||
di<<"A null shape or not a face is used.\n";
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
@@ -877,7 +877,7 @@ static Standard_Integer checkselfintersection
|
||||
face = mkFace.Face();
|
||||
else
|
||||
{
|
||||
di<<"Can't make a face for the wire. Provide please a face for analysis."<<"\n";
|
||||
di<<"Can't make a face for the wire. Provide please a face for analysis.\n";
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
@@ -886,9 +886,9 @@ static Standard_Integer checkselfintersection
|
||||
Standard_Boolean result = analyser.CheckSelfIntersection();
|
||||
|
||||
if (result == Standard_True)
|
||||
di<<"A self-intersecting wire."<<"\n";
|
||||
di<<"A self-intersecting wire.\n";
|
||||
else
|
||||
di<<"Not self-intersecting wire."<<"\n";
|
||||
di<<"Not self-intersecting wire.\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -896,7 +896,7 @@ static Standard_Integer checkedge(Draw_Interpretor& di, Standard_Integer argc, c
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
di<<"Call please \"checkedge edge [face]\""<<"\n";
|
||||
di<<"Call please \"checkedge edge [face]\"\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -905,7 +905,7 @@ static Standard_Integer checkedge(Draw_Interpretor& di, Standard_Integer argc, c
|
||||
TopoDS_Shape edge = DBRep::Get(arg1);
|
||||
if (edge.IsNull() || edge.ShapeType() != TopAbs_EDGE)
|
||||
{
|
||||
di<<"A null shape or not an edge is used."<<"\n";
|
||||
di<<"A null shape or not an edge is used.\n";
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -917,7 +917,7 @@ static Standard_Integer checkedge(Draw_Interpretor& di, Standard_Integer argc, c
|
||||
face = DBRep::Get(arg2);
|
||||
if (face.IsNull() || face.ShapeType() != TopAbs_FACE)
|
||||
{
|
||||
di<<"A null shape or not a face is used."<<"\n";
|
||||
di<<"A null shape or not a face is used.\n";
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
@@ -70,15 +70,15 @@ static Standard_Integer ContToInteger( const GeomAbs_Shape Cont)
|
||||
|
||||
static Standard_Integer directfaces(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 3) { di<<"Donner un nom de SHAPE + un nom de RESULTAT"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 3) { di<<"Donner un nom de SHAPE + un nom de RESULTAT\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
Standard_CString arg2 = argv[2];
|
||||
TopoDS_Shape Shape = DBRep::Get(arg2);
|
||||
if (Shape.IsNull()) { di<<"Shape unknown : "<<arg2<<"\n"; return 1 /* Error */; }
|
||||
|
||||
TopoDS_Shape result = ShapeCustom::DirectFaces (Shape);
|
||||
if (result.IsNull()) { di<<"NO RESULT"<<"\n"; return 1; }
|
||||
else if (result == Shape) { di<<"No modif"<<"\n"; return 0; }
|
||||
if (result.IsNull()) { di<<"NO RESULT\n"; return 1; }
|
||||
else if (result == Shape) { di<<"No modif\n"; return 0; }
|
||||
di<<"DirectFaces -> Result : "<<arg1<<"\n";
|
||||
DBRep::Set (arg1,result);
|
||||
return 0; // Done
|
||||
@@ -271,7 +271,7 @@ static void expsurf(const Handle(Geom_Surface)& aSurface, TColStd_Array2OfIntege
|
||||
static Standard_Integer expshape(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc <4) {
|
||||
di << "Incorrect number of arguments. Must be 3" << "\n";
|
||||
di << "Incorrect number of arguments. Must be 3\n";
|
||||
return 1 /* Error */;
|
||||
}
|
||||
Standard_CString arg2 = argv[1];
|
||||
@@ -290,7 +290,7 @@ static Standard_Integer expshape(Draw_Interpretor& di, Standard_Integer argc, co
|
||||
else if (strcmp(argv[k],"G1") == 0) aCont3 = GeomAbs_C0;
|
||||
else if (strcmp(argv[k],"G2") == 0) aCont3 = GeomAbs_C1;
|
||||
else {
|
||||
di<< "Invalid argument Cont3e" << "\n"; return 1; }
|
||||
di<< "Invalid argument Cont3e\n"; return 1; }
|
||||
|
||||
|
||||
}
|
||||
@@ -339,7 +339,7 @@ static Standard_Integer expshape(Draw_Interpretor& di, Standard_Integer argc, co
|
||||
//if(NbSurf.Value(2,1) !=0)
|
||||
di<< "Number of Bezier surfaces with degree more then "<< Degree << " - " <<NbSurf.Value(2,1)<<"\n";
|
||||
//if(NbSurf.Value(2,3) !=0)
|
||||
di<< "Number of Rational Bezier surfaces " << " - " <<NbSurf.Value(2,3)<<"\n";
|
||||
di<< "Number of Rational Bezier surfaces - " <<NbSurf.Value(2,3)<<"\n";
|
||||
//if(NbSurf.Value(2,4) !=0)
|
||||
di<< "Number of Bezier surfaces with continuity less than specified - " << NbSurf.Value(2,4)<<"\n";
|
||||
|
||||
@@ -359,7 +359,7 @@ static Standard_Integer expshape(Draw_Interpretor& di, Standard_Integer argc, co
|
||||
//if(NbCurv.Value(2,1) !=0)
|
||||
di<< "Number of Bezier curves with degree more then - "<< Degree << " - " <<NbCurv.Value(2,1)<<"\n";
|
||||
//if(NbCurv.Value(2,3) !=0)
|
||||
di<< "Number of Rational Bezier curves " << " - " <<NbCurv.Value(2,3)<<"\n";
|
||||
di<< "Number of Rational Bezier curves - " <<NbCurv.Value(2,3)<<"\n";
|
||||
//if(NbCurv.Value(2,4) !=0)
|
||||
di<< "Number of Bezier curves with less continuity - " << NbCurv.Value(2,4)<<"\n";
|
||||
|
||||
@@ -375,9 +375,9 @@ static Standard_Integer expshape(Draw_Interpretor& di, Standard_Integer argc, co
|
||||
// if(NbCurv2d.Value(1,4) !=0)
|
||||
di<< "Number of BSpline pcurves with less continuity - " << NbCurv2d.Value(1,4)<<"\n";
|
||||
//if(NbCurv2d.Value(2,1) !=0)
|
||||
di<< "Number of Bezier pcurves with degree more then "<< Degree <<" - " <<" - " <<NbCurv2d.Value(2,1)<<"\n";
|
||||
di<< "Number of Bezier pcurves with degree more then "<< Degree <<" - - " <<NbCurv2d.Value(2,1)<<"\n";
|
||||
//if(NbCurv2d.Value(2,3) !=0)
|
||||
di<< "Number of Rational Bezier pcurves " << " - " <<NbCurv2d.Value(2,3)<<"\n";
|
||||
di<< "Number of Rational Bezier pcurves - " <<NbCurv2d.Value(2,3)<<"\n";
|
||||
//if(NbCurv2d.Value(2,4) !=0)
|
||||
di<< "Number of Bezier pcurves with less continuity - " << NbCurv2d.Value(2,4)<<"\n";
|
||||
|
||||
@@ -389,7 +389,7 @@ static Standard_Integer expshape(Draw_Interpretor& di, Standard_Integer argc, co
|
||||
static Standard_Integer scaleshape(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc !=4) {
|
||||
di << "Incorrect number of arguments. Must be 4" << "\n";
|
||||
di << "Incorrect number of arguments. Must be 4\n";
|
||||
return 1 /* Error */;
|
||||
}
|
||||
Standard_CString arg2 = argv[2];
|
||||
@@ -397,15 +397,15 @@ static Standard_Integer scaleshape(Draw_Interpretor& di, Standard_Integer argc,
|
||||
if (Shape.IsNull()) { di << "Shape unknown: " << arg2 << "\n"; return 1 /* Error */; }
|
||||
|
||||
TopoDS_Shape result = ShapeCustom::ScaleShape (Shape, Draw::Atof(argv[3]));
|
||||
if (result.IsNull()) { di << "NO RESULT" << "\n"; return 1; }
|
||||
else if (result == Shape) { di << "NO MODIFICATIONS" << "\n"; return 0; }
|
||||
if (result.IsNull()) { di << "NO RESULT\n"; return 1; }
|
||||
else if (result == Shape) { di << "NO MODIFICATIONS\n"; return 0; }
|
||||
DBRep::Set (argv[1],result);
|
||||
return 0;
|
||||
}
|
||||
static Standard_Integer BSplRes(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 11) {
|
||||
di << "Incorrect number of arguments. Must be 10" << "\n";
|
||||
di << "Incorrect number of arguments. Must be 10\n";
|
||||
return 1 /* Error */;
|
||||
}
|
||||
Standard_CString arg2 = argv[2];
|
||||
@@ -420,7 +420,7 @@ static Standard_Integer BSplRes(Draw_Interpretor& di, Standard_Integer argc, con
|
||||
else if (strcmp(argv[7],"G1") == 0) aCont3 = GeomAbs_C0;
|
||||
else if (strcmp(argv[7],"G2") == 0) aCont3 = GeomAbs_C1;
|
||||
else {
|
||||
di<< "Invalid argument Cont3e" << "\n"; return 1; }
|
||||
di<< "Invalid argument Cont3e\n"; return 1; }
|
||||
GeomAbs_Shape aCont2;
|
||||
if(strcmp(argv[8],"C0") == 0) aCont2 = GeomAbs_C0;
|
||||
else if (strcmp(argv[8],"C1") == 0) aCont2 = GeomAbs_C1;
|
||||
@@ -430,13 +430,13 @@ static Standard_Integer BSplRes(Draw_Interpretor& di, Standard_Integer argc, con
|
||||
else if (strcmp(argv[8],"G1") == 0) aCont2 = GeomAbs_C0;
|
||||
else if (strcmp(argv[8],"G2") == 0) aCont2 = GeomAbs_C1;
|
||||
else {
|
||||
di<< "Invalid argument Cont3e" << "\n"; return 1; }
|
||||
di<< "Invalid argument Cont3e\n"; return 1; }
|
||||
|
||||
Handle(ShapeCustom_RestrictionParameters) aParameters = new ShapeCustom_RestrictionParameters;
|
||||
TopoDS_Shape result = ShapeCustom::BSplineRestriction (Shape, Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atoi(argv[5]),Draw::Atoi(argv[6]),aCont3,aCont2,(Standard_Boolean) Draw::Atoi(argv[9]),(Standard_Boolean) Draw::Atoi(argv[10]),aParameters);
|
||||
if (result.IsNull()) { di << "NO RESULT" << "\n"; return 1; }
|
||||
if (result.IsNull()) { di << "NO RESULT\n"; return 1; }
|
||||
else if (result == Shape) {
|
||||
di << "NO MODIFICATIONS" << "\n";
|
||||
di << "NO MODIFICATIONS\n";
|
||||
DBRep::Set (argv[1],result); return 0;
|
||||
}
|
||||
ShapeFix::SameParameter(result,Standard_False);
|
||||
@@ -447,7 +447,7 @@ static Standard_Integer BSplRes(Draw_Interpretor& di, Standard_Integer argc, con
|
||||
|
||||
static Standard_Integer convtorevol(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 3) { di<<"Convert surfaces to revolution: convtorevol result shape"<<"\n"; return 1; }
|
||||
if (argc < 3) { di<<"Convert surfaces to revolution: convtorevol result shape\n"; return 1; }
|
||||
|
||||
Standard_CString arg1 = argv[1];
|
||||
Standard_CString arg2 = argv[2];
|
||||
@@ -455,8 +455,8 @@ static Standard_Integer convtorevol(Draw_Interpretor& di, Standard_Integer argc,
|
||||
if (Shape.IsNull()) { di<<"Shape unknown : "<<arg2<<"\n"; return 1; }
|
||||
|
||||
TopoDS_Shape result = ShapeCustom::ConvertToRevolution (Shape);
|
||||
if (result.IsNull()) { di<<"NO RESULT"<<"\n"; return 1; }
|
||||
else if (result == Shape) { di<<"No modif"<<"\n"; return 0; }
|
||||
if (result.IsNull()) { di<<"NO RESULT\n"; return 1; }
|
||||
else if (result == Shape) { di<<"No modif\n"; return 0; }
|
||||
di<<"ConvertToRevolution -> Result : "<<arg1<<"\n";
|
||||
DBRep::Set (arg1,result);
|
||||
return 0; // Done
|
||||
|
@@ -26,10 +26,10 @@ static Standard_Integer sortcompound (Draw_Interpretor& di, Standard_Integer arg
|
||||
{
|
||||
Standard_CString arg1 = argv[1];
|
||||
if (argc < 2) {
|
||||
di<<"Give shape name. As is, just displays shape type"<<"\n";
|
||||
di<<" or add result_name type [mode]"<<"\n";
|
||||
di<<" Type : v (vertex) e (edge) w (wire) f (face) s (shell) so (solid)"<<"\n";
|
||||
di<<" Mode : n (normal, by default) e (explore) c (compound) x (explore+comp)"<<"\n";
|
||||
di<<"Give shape name. As is, just displays shape type\n";
|
||||
di<<" or add result_name type [mode]\n";
|
||||
di<<" Type : v (vertex) e (edge) w (wire) f (face) s (shell) so (solid)\n";
|
||||
di<<" Mode : n (normal, by default) e (explore) c (compound) x (explore+comp)\n";
|
||||
return 0;
|
||||
}
|
||||
TopoDS_Shape Shape = DBRep::Get(arg1);
|
||||
@@ -41,9 +41,9 @@ static Standard_Integer sortcompound (Draw_Interpretor& di, Standard_Integer arg
|
||||
TopAbs_ShapeEnum ts = sbx.ShapeType(Shape,i);
|
||||
//cout<<" Type "<<(i ? " (via Compound) : " : "(True) : ");
|
||||
if (i == 0) {
|
||||
di<<" Type "<<"(True) : ";
|
||||
di<<" Type (True) : ";
|
||||
} else {
|
||||
di<<" Type "<<" (via Compound) : ";
|
||||
di<<" Type (via Compound) : ";
|
||||
}
|
||||
switch (ts) {
|
||||
case TopAbs_SHAPE : di<<"SHAPE (empty)"; break;
|
||||
@@ -83,7 +83,7 @@ static Standard_Integer sortcompound (Draw_Interpretor& di, Standard_Integer arg
|
||||
}
|
||||
ShapeExtend_Explorer sbx;
|
||||
Shape = sbx.SortedCompound (Shape,tse,modexp,modcom);
|
||||
if ( Shape.IsNull()) { di<<"Empty result"<<"\n"; return 0; }
|
||||
if ( Shape.IsNull()) { di<<"Empty result\n"; return 0; }
|
||||
DBRep::Set(argv[2],Shape);
|
||||
}
|
||||
return 0; // Done
|
||||
|
@@ -79,11 +79,11 @@ static Standard_Integer edgesameparam (Draw_Interpretor& di, Standard_Integer ar
|
||||
// const Standard_CString arg1 = argv[1];
|
||||
const Standard_CString arg2 (argc > 2 ? argv[2] : NULL);
|
||||
// **** Edge:SameParameter ****
|
||||
if (argc < 2) { di<<"shapename , option f to force, else only Edges not-SameParameter are computed"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 2) { di<<"shapename , option f to force, else only Edges not-SameParameter are computed\n"; return 1 /* Error */; }
|
||||
TopoDS_Shape Shape = DBRep::Get(argv[1]);
|
||||
|
||||
if (!ShapeFix::SameParameter(Shape, (argc > 2 && arg2[0] == 'f') , BRepBuilderAPI::Precision()) )
|
||||
di<<"Some edges were not processed"<<"\n";
|
||||
di<<"Some edges were not processed\n";
|
||||
di<<"\n";
|
||||
return 0; // Done
|
||||
}
|
||||
@@ -96,11 +96,11 @@ static Standard_Integer edgesameparam (Draw_Interpretor& di, Standard_Integer ar
|
||||
static Standard_Integer settolerance (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 3) {
|
||||
di<< "myshape val : forces tolerances at <val>"<<"\n"
|
||||
<< "myshape < max : sets maximum tolerance to <max>"<<"\n"
|
||||
<< "myshape > min : sets minimum tolerance to <min>"<<"\n"
|
||||
<< "myshape min max : bounds tolerances between <min> and <max>"<<"\n"
|
||||
<<"myshape mode=v-e-f other args : idem but only on vertex-edge-face"<<"\n";
|
||||
di<< "myshape val : forces tolerances at <val>\n"
|
||||
<< "myshape < max : sets maximum tolerance to <max>\n"
|
||||
<< "myshape > min : sets minimum tolerance to <min>\n"
|
||||
<< "myshape min max : bounds tolerances between <min> and <max>\n"
|
||||
<<"myshape mode=v-e-f other args : idem but only on vertex-edge-face\n";
|
||||
return (argc < 2 ? 0 : 1 /* Error */);
|
||||
}
|
||||
Standard_CString arg1 = argv[1];
|
||||
@@ -140,15 +140,15 @@ static Standard_Integer settolerance (Draw_Interpretor& di, Standard_Integer arg
|
||||
static Standard_Integer stwire (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 2) { // help
|
||||
di<<"Donner nom shape depart + nom shape resultat + option"<<"\n";
|
||||
di<<"Donner nom shape depart + nom shape resultat + option\n";
|
||||
di<<"Options de chargement : x add connected (sinon add simple)\n"
|
||||
<< "Options de traitement : l fix little/BRepBuilderAPI\n"
|
||||
<<"Options de sortie : aucune make simple\n"
|
||||
<<" m MakeAPI r avec reorder v vertex\n"
|
||||
<<"Autres (se cumulent) : q quid(stats)"<<"\n";
|
||||
<<"Autres (se cumulent) : q quid(stats)\n";
|
||||
return 0;
|
||||
}
|
||||
if (argc < 4) { di<<"stwire tout court pour help"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 4) { di<<"stwire tout court pour help\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
Standard_CString arg2 = argv[2];
|
||||
|
||||
@@ -170,7 +170,7 @@ static Standard_Integer stwire (Draw_Interpretor& di, Standard_Integer argc, con
|
||||
}
|
||||
}
|
||||
TopoDS_Shape Shape = DBRep::Get(arg1);
|
||||
if (Shape.IsNull()) { di<<arg1<<" inconnu"<<"\n"; return 1 /* Error */; }
|
||||
if (Shape.IsNull()) { di<<arg1<<" inconnu\n"; return 1 /* Error */; }
|
||||
|
||||
// On y va
|
||||
Handle(ShapeExtend_WireData) sbwd = new ShapeExtend_WireData;
|
||||
@@ -188,7 +188,7 @@ static Standard_Integer stwire (Draw_Interpretor& di, Standard_Integer argc, con
|
||||
}
|
||||
if (awire.IsNull()) {
|
||||
di<<"Neither FACE nor WIRE : "<<arg1<<"\n";
|
||||
di<<"Considering as list of edges ..."<<"\n";
|
||||
di<<"Considering as list of edges ...\n";
|
||||
awire = Shape;
|
||||
// return 1 /* Error */;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ static Standard_Integer stwire (Draw_Interpretor& di, Standard_Integer argc, con
|
||||
else di<<" FWD";
|
||||
di<<" ordered to "<<iord<<" Gap="<<WO.Gap(i)<<"\n";
|
||||
}
|
||||
di<<"Reorder not yet done"<<"\n";
|
||||
di<<"Reorder not yet done\n";
|
||||
sfw->FixReorder (WO);
|
||||
// Mais on n execute pas
|
||||
}
|
||||
@@ -282,13 +282,13 @@ static Standard_Integer stwire (Draw_Interpretor& di, Standard_Integer argc, con
|
||||
Standard_Integer stat = sawv.Data (i,pos,upre,ufol);
|
||||
di<<i<<" : ";
|
||||
switch (stat) {
|
||||
case 0 : di<<"Same Vertex"<<"\n"; break;
|
||||
case 1 : di<<"Same Coords with recorded precisions (but not Same Vertex)"<<"\n"; break;
|
||||
case 2 : di<<"Close (with preci="<< saw->Precision()<<")"<<"\n"; break;
|
||||
case 0 : di<<"Same Vertex\n"; break;
|
||||
case 1 : di<<"Same Coords with recorded precisions (but not Same Vertex)\n"; break;
|
||||
case 2 : di<<"Close (with preci="<< saw->Precision()<<")\n"; break;
|
||||
case 3 : di<<"End of "<<i<<" OK, Start of "<<(i == nb ? 1 : i+1)<<" at U="<<ufol; break;
|
||||
case 4 : di<<"End of "<<i<<" at U="<<upre<<", Start of "<<(i == nb ? 1 : i+1)<<" OK"; break;
|
||||
case 5 : di<<"Intersection, End of "<<i<<" at U="<<upre<<", Start of "<<(i == nb ? 1 : i+1)<<" at U="<<ufol; break;
|
||||
default : di<<"Disjoined"<<"\n";
|
||||
default : di<<"Disjoined\n";
|
||||
}
|
||||
if (stat >= 3 && stat <= 5) di<<"\n - Position : "<<pos.X()<<" "<<pos.Y()<<" "<<pos.Z()<<"\n";
|
||||
}
|
||||
@@ -318,13 +318,13 @@ static Standard_Integer stwire (Draw_Interpretor& di, Standard_Integer argc, con
|
||||
}
|
||||
result = CW.Wire (num);
|
||||
}
|
||||
else di << "Cannot apply Correct_Wire: face not defined" << "\n";
|
||||
else di << "Cannot apply Correct_Wire: face not defined\n";
|
||||
}
|
||||
*/
|
||||
else if (om) result = sbwd->WireAPIMake();
|
||||
else result = sbwd->Wire();
|
||||
if (result.IsNull()) {
|
||||
di<<"Pas de resultat, desole"<<"\n";
|
||||
di<<"Pas de resultat, desole\n";
|
||||
return 1; // Fail
|
||||
}
|
||||
DBRep::Set (arg2,result);
|
||||
@@ -338,7 +338,7 @@ static Standard_Integer stwire (Draw_Interpretor& di, Standard_Integer argc, con
|
||||
|
||||
static Standard_Integer reface (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 3) { di<<"Donner un nom de SHAPE (SHELL ou FACE) + un nom de RESULTAT"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 3) { di<<"Donner un nom de SHAPE (SHELL ou FACE) + un nom de RESULTAT\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
Standard_CString arg2 = argv[2];
|
||||
TopoDS_Shape Shape = DBRep::Get(arg1);
|
||||
@@ -391,7 +391,7 @@ static Standard_Integer reface (Draw_Interpretor& di, Standard_Integer argc, con
|
||||
DBRep::Set (arg2,resh.Apply (Shape,TopAbs_FACE,2));
|
||||
return 0; // Done
|
||||
}
|
||||
else di<<"ShapeFix_Face n a rien trouve a redire"<<"\n";
|
||||
else di<<"ShapeFix_Face n a rien trouve a redire\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -465,20 +465,20 @@ static Standard_Integer fixshape (Draw_Interpretor& di, Standard_Integer argc, c
|
||||
|
||||
if ( par <2 ) {
|
||||
di << "Use: " << argv[0] << " result shape [tolerance [max_tolerance]] [switches]\n"
|
||||
"[-maxtaila <degrees>] [-maxtailw <width>]" << "\n";
|
||||
di << "Switches allow to tune parameters of ShapeFix" << "\n";
|
||||
di << "The following syntax is used: <symbol><parameter>" << "\n";
|
||||
di << "- symbol may be - to set parameter off, + to set on or * to set default" << "\n";
|
||||
di << "- parameters are identified by letters:" << "\n";
|
||||
di << " l - FixLackingMode" << "\n";
|
||||
di << " o - FixOrientationMode" << "\n";
|
||||
di << " h - FixShiftedMode" << "\n";
|
||||
di << " m - FixMissingSeamMode" << "\n";
|
||||
di << " d - FixDegeneratedMode" << "\n";
|
||||
di << " s - FixSmallMode" << "\n";
|
||||
di << " i - FixSelfIntersectionMode" << "\n";
|
||||
di << " n - FixNotchedEdgesMode" << "\n";
|
||||
di << "For enhanced message output, use switch '+?'" << "\n";
|
||||
"[-maxtaila <degrees>] [-maxtailw <width>]\n";
|
||||
di << "Switches allow to tune parameters of ShapeFix\n";
|
||||
di << "The following syntax is used: <symbol><parameter>\n";
|
||||
di << "- symbol may be - to set parameter off, + to set on or * to set default\n";
|
||||
di << "- parameters are identified by letters:\n";
|
||||
di << " l - FixLackingMode\n";
|
||||
di << " o - FixOrientationMode\n";
|
||||
di << " h - FixShiftedMode\n";
|
||||
di << " m - FixMissingSeamMode\n";
|
||||
di << " d - FixDegeneratedMode\n";
|
||||
di << " s - FixSmallMode\n";
|
||||
di << " i - FixSelfIntersectionMode\n";
|
||||
di << " n - FixNotchedEdgesMode\n";
|
||||
di << "For enhanced message output, use switch '+?'\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ Standard_Integer fixgaps(Draw_Interpretor& di, Standard_Integer n, const char**
|
||||
|
||||
TopoDS_Shape S = DBRep::Get(a[2]);
|
||||
if (S.IsNull()) {
|
||||
di << " Shape is null" << "\n";
|
||||
di << " Shape is null\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -555,7 +555,7 @@ Standard_Integer fixgaps(Draw_Interpretor& di, Standard_Integer n, const char**
|
||||
SFWF->SetPrecision(prec);
|
||||
if ( SFWF->FixWireGaps() ) {
|
||||
DBRep::Set(a[1],SFWF->Shape());
|
||||
di<<" Wireframe gaps fixed on shape"<<"\n";
|
||||
di<<" Wireframe gaps fixed on shape\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -572,7 +572,7 @@ Standard_Integer fixsmall(Draw_Interpretor& di, Standard_Integer n, const char**
|
||||
|
||||
TopoDS_Shape S = DBRep::Get(a[2]);
|
||||
if (S.IsNull()) {
|
||||
di << " Shape is null" << "\n";
|
||||
di << " Shape is null\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -582,7 +582,7 @@ Standard_Integer fixsmall(Draw_Interpretor& di, Standard_Integer n, const char**
|
||||
|
||||
if (SFWF.FixSmallEdges()) {
|
||||
DBRep::Set(a[1],SFWF.Shape());
|
||||
di<<" Small edges fixed on shape"<<"\n";
|
||||
di<<" Small edges fixed on shape\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -596,7 +596,7 @@ Standard_Integer fixsmall(Draw_Interpretor& di, Standard_Integer n, const char**
|
||||
static Standard_Integer fixsmalledges(Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||
{
|
||||
if( n < 3) {
|
||||
di<<"Invalid number of arguments"<<"\n";
|
||||
di<<"Invalid number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Shape Sh = DBRep::Get(a[2]);
|
||||
@@ -641,19 +641,19 @@ static Standard_Integer fixsmalledges(Draw_Interpretor& di, Standard_Integer n,
|
||||
static Standard_Integer checkoverlapedges(Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||
{
|
||||
if( n < 3) {
|
||||
di<<"Invalid number of arguments"<<"\n";
|
||||
di<<"Invalid number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Shape Sh1 = DBRep::Get(a[1]);
|
||||
TopoDS_Shape Sh2 = DBRep::Get(a[2]);
|
||||
if(Sh1.IsNull() || Sh2.IsNull()) {
|
||||
di<<"Invalid arguments"<<"\n";
|
||||
di<<"Invalid arguments\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Edge e1 = TopoDS::Edge(Sh1);
|
||||
TopoDS_Edge e2 = TopoDS::Edge(Sh2);
|
||||
if(e1.IsNull() || e2.IsNull()) {
|
||||
di<<"Invalid type of arguments"<<"\n";
|
||||
di<<"Invalid type of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -680,14 +680,14 @@ static Standard_Integer checkoverlapedges(Draw_Interpretor& di, Standard_Integer
|
||||
ShapeAnalysis_Edge sae;
|
||||
if(sae.CheckOverlapping(e1,e2,aTol,aDistDomain)) {
|
||||
if(aDistDomain ==0.0)
|
||||
di<<"Edges is overlaping comletly"<<"\n";
|
||||
di<<"Edges is overlaping comletly\n";
|
||||
else {
|
||||
di<<"Edges is overlaped"<<"\n";
|
||||
di<<"Edges is overlaped\n";
|
||||
di<<"with tolerance = "<<aTol<<"\n";
|
||||
di<<"on segment length = "<<aDistDomain<<"\n";
|
||||
}
|
||||
}
|
||||
else di<<"Edges is not overlaped"<<"\n";
|
||||
else di<<"Edges is not overlaped\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -699,14 +699,14 @@ static Standard_Integer checkoverlapedges(Draw_Interpretor& di, Standard_Integer
|
||||
static Standard_Integer checkfclass2d(Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||
{
|
||||
if( n < 4) {
|
||||
di<<"Invalid number of arguments"<<"\n";
|
||||
di<<"Invalid number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Shape Sh1 = DBRep::Get(a[1]);
|
||||
Standard_Real ucoord = Draw::Atof(a[2]);
|
||||
Standard_Real vcoord = Draw::Atof(a[3]);
|
||||
if(Sh1.IsNull() || Sh1.ShapeType()!= TopAbs_FACE) {
|
||||
di<<"Invalid arguments"<<"\n";
|
||||
di<<"Invalid arguments\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Face aFace = TopoDS::Face(Sh1);
|
||||
@@ -714,25 +714,25 @@ static Standard_Integer checkfclass2d(Draw_Interpretor& di, Standard_Integer n,
|
||||
BRepTopAdaptor_FClass2d f2d(aFace,Precision::Confusion());
|
||||
TopAbs_State stat = f2d.Perform(p2d);
|
||||
if(stat == TopAbs_OUT)
|
||||
di<<"Point is OUT"<<"\n";
|
||||
di<<"Point is OUT\n";
|
||||
else if(stat == TopAbs_IN)
|
||||
di<<"Point is IN"<<"\n";
|
||||
di<<"Point is IN\n";
|
||||
else if(stat == TopAbs_ON)
|
||||
di<<"Point is ON"<<"\n";
|
||||
di<<"Point is ON\n";
|
||||
else
|
||||
di<<"Point is UNKNOWN"<<"\n";
|
||||
di<<"Point is UNKNOWN\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Standard_Integer connectedges(Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||
{
|
||||
if( n < 3) {
|
||||
di<<"Invalid number of arguments. Should be : result shape [toler shared]"<<"\n";
|
||||
di<<"Invalid number of arguments. Should be : result shape [toler shared]\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Shape aSh1 = DBRep::Get(a[2]);
|
||||
if(aSh1.IsNull()) {
|
||||
di<<"Shape is null"<<"\n";
|
||||
di<<"Shape is null\n";
|
||||
return 1;
|
||||
}
|
||||
Standard_Real aTol = Precision::Confusion();
|
||||
@@ -760,7 +760,7 @@ static Standard_Integer connectedges(Draw_Interpretor& di, Standard_Integer n, c
|
||||
for( ; i <= aSeqWires->Length() ; i++)
|
||||
{
|
||||
TopoDS_Shape aW = aSeqWires->Value(i);
|
||||
di<<"Wire - "<<i<<" : "<<"\n";
|
||||
di<<"Wire - "<<i<<" : \n";
|
||||
|
||||
TopExp_Explorer aExp1(aW, TopAbs_EDGE);
|
||||
for( ; aExp1.More(); aExp1.Next())
|
||||
|
@@ -31,7 +31,7 @@
|
||||
static Standard_Integer ApplySequence(Draw_Interpretor& di,
|
||||
Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 4) { di<<"Specify result, shape, resource name and prefix (optional)"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 4) { di<<"Specify result, shape, resource name and prefix (optional)\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
Standard_CString arg2 = argv[2];
|
||||
Standard_CString arg3 = argv[3];
|
||||
@@ -47,10 +47,10 @@ static Standard_Integer ApplySequence(Draw_Interpretor& di,
|
||||
TopoDS_Shape result = context->Result();
|
||||
// seq.PrintPreparationResult ();
|
||||
if ( result.IsNull() ) {
|
||||
di << "No result" << "\n";
|
||||
di << "No result\n";
|
||||
}
|
||||
else if ( result == Shape ) {
|
||||
di << "Shape not modified" << "\n";
|
||||
di << "Shape not modified\n";
|
||||
}
|
||||
DBRep::Set (arg1,result);
|
||||
return 0;
|
||||
|
@@ -29,7 +29,7 @@
|
||||
//=======================================================================
|
||||
static Standard_Integer ApplySequence(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 4) { di<<"Specify result, shape, resource name and prefix (optional)"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 4) { di<<"Specify result, shape, resource name and prefix (optional)\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
Standard_CString arg2 = argv[2];
|
||||
Standard_CString arg3 = argv[3];
|
||||
|
@@ -57,10 +57,10 @@
|
||||
static Standard_Integer XSHAPE_edge
|
||||
(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 2) { di<<"donner un nom de shape"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 2) { di<<"donner un nom de shape\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
TopoDS_Shape Shape = DBRep::Get(arg1);
|
||||
if (Shape.IsNull()) { di<<arg1<<" inconnu"<<"\n"; return 1 /* Error */; }
|
||||
if (Shape.IsNull()) { di<<arg1<<" inconnu\n"; return 1 /* Error */; }
|
||||
Standard_Integer nbe = 0, nbf = 0; Standard_Real f3d,l3d;
|
||||
|
||||
for (TopExp_Explorer exp(Shape,TopAbs_EDGE); exp.More(); exp.Next()) {
|
||||
@@ -84,11 +84,11 @@ static Standard_Integer XSHAPE_explorewire
|
||||
(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
char nomsh[30];
|
||||
if (argc < 2) { di<<"donner un nom de wire"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 2) { di<<"donner un nom de wire\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
TopoDS_Shape Shape = DBRep::Get(arg1);
|
||||
if (Shape.IsNull()) { di<<arg1<<" inconnu"<<"\n"; return 1 /* Error */; }
|
||||
if (Shape.ShapeType() != TopAbs_WIRE) { di<<"Pas un WIRE"<<"\n"; return 1 /* Error */; }
|
||||
if (Shape.IsNull()) { di<<arg1<<" inconnu\n"; return 1 /* Error */; }
|
||||
if (Shape.ShapeType() != TopAbs_WIRE) { di<<"Pas un WIRE\n"; return 1 /* Error */; }
|
||||
TopoDS_Wire W = TopoDS::Wire (Shape);
|
||||
TopoDS_Face F;
|
||||
if (argc > 2) {
|
||||
@@ -106,11 +106,11 @@ static Standard_Integer XSHAPE_explorewire
|
||||
}
|
||||
int* nbs = new int[nbe+1]; for (i = 0; i <= nbe; i ++) nbs[i] = 0;
|
||||
|
||||
di<<"TopoDS_Iterator(EDGE) donne "<<nbe<<" Edges dont "<<num<<" distinctes"<<"\n";
|
||||
di<<"TopoDS_Iterator(EDGE) donne "<<nbe<<" Edges dont "<<num<<" distinctes\n";
|
||||
nbe = num;
|
||||
nbw = 0;
|
||||
for (TopExp_Explorer exe(W.Oriented(TopAbs_FORWARD),TopAbs_EDGE); exe.More(); exe.Next()) nbw ++;
|
||||
di<<"TopExp_Explorer(EDGE) donne "<<nbw<<" Edges"<<"\n";
|
||||
di<<"TopExp_Explorer(EDGE) donne "<<nbw<<" Edges\n";
|
||||
nbw = 0;
|
||||
BRepTools_WireExplorer bwe;
|
||||
if (F.IsNull()) bwe.Init(W);
|
||||
@@ -121,16 +121,16 @@ static Standard_Integer XSHAPE_explorewire
|
||||
num = map.FindIndex(E);
|
||||
nbs[num] ++;
|
||||
}
|
||||
di<<"BRepTools_WireExplorer donne "<<nbw<<" Edges"<<"\n";
|
||||
di<<"Par rapport a la map, edges sautees par WE en NOWE_num, passees > 1 fois en MULTWE_num"<<"\n";
|
||||
if (nbs[0] > 0) di<<"NB : Edge n0 0 comptee "<<nbs[0]<<" fois"<<"\n";
|
||||
di<<"BRepTools_WireExplorer donne "<<nbw<<" Edges\n";
|
||||
di<<"Par rapport a la map, edges sautees par WE en NOWE_num, passees > 1 fois en MULTWE_num\n";
|
||||
if (nbs[0] > 0) di<<"NB : Edge n0 0 comptee "<<nbs[0]<<" fois\n";
|
||||
for (i = 1; i <= nbe; i ++) {
|
||||
if (nbs[i] < 1) {
|
||||
di<<"Edge n0 "<<i<<" pas vue par WE"<<"\n";
|
||||
di<<"Edge n0 "<<i<<" pas vue par WE\n";
|
||||
Sprintf (nomsh,"NOWE_%d",i);
|
||||
DBRep::Set (nomsh,map.FindKey(i));
|
||||
} else if (nbs[i] > 1) {
|
||||
di<<"Edge n0 "<<i<<" vue par WE : "<<nbs[i]<<" fois"<<"\n";
|
||||
di<<"Edge n0 "<<i<<" vue par WE : "<<nbs[i]<<" fois\n";
|
||||
Sprintf (nomsh,"MULT_%d",i);
|
||||
DBRep::Set (nomsh,map.FindKey(i));
|
||||
}
|
||||
@@ -144,20 +144,20 @@ static Standard_Integer XSHAPE_explorewire
|
||||
static Standard_Integer XSHAPE_ssolid
|
||||
(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 3) { di<<"Give new solid name + shell name"<<"\n"; return 1 /* Error */; }
|
||||
if (argc < 3) { di<<"Give new solid name + shell name\n"; return 1 /* Error */; }
|
||||
Standard_CString arg1 = argv[1];
|
||||
TopoDS_Shape Shape = DBRep::Get(arg1);
|
||||
if (Shape.IsNull()) { di<<"Shape unknown : "<<arg1<<"\n"; return 1 /* Error */; }
|
||||
TopAbs_ShapeEnum shen = Shape.ShapeType();
|
||||
if (shen == TopAbs_SOLID) {
|
||||
di<<" Already a Solide ! nothing done"<<"\n";
|
||||
di<<" Already a Solide ! nothing done\n";
|
||||
return 0;
|
||||
}
|
||||
if (shen != TopAbs_SHELL) {
|
||||
di<<" Not a Shell"<<"\n"; return 1 /* Error */;
|
||||
di<<" Not a Shell\n"; return 1 /* Error */;
|
||||
}
|
||||
if (!Shape.Free ()) {
|
||||
di<<"Shape non Free -> Freeing"<<"\n";
|
||||
di<<"Shape non Free -> Freeing\n";
|
||||
Shape.Free(Standard_True);
|
||||
}
|
||||
TopoDS_Shell sh = TopoDS::Shell (Shape);
|
||||
@@ -171,7 +171,7 @@ static Standard_Integer XSHAPE_ssolid
|
||||
if (bsc3d.State() == TopAbs_IN) {
|
||||
// Ensuite, inverser C-A-D REPRENDRE LES SHELLS
|
||||
// (l inversion du solide n est pas bien prise en compte)
|
||||
di<<"NB : Shell to be reversed"<<"\n";
|
||||
di<<"NB : Shell to be reversed\n";
|
||||
TopoDS_Solid soli2;
|
||||
B.MakeSolid (soli2); // on recommence
|
||||
sh.Reverse();
|
||||
@@ -190,7 +190,7 @@ static Standard_Integer XSHAPE_edgeregul
|
||||
Standard_Real tolang = Precision::Angular(); // = Interface_Static::RVal("XSTEP.encoderegularity.angle");
|
||||
// if (argc < 3) di<<"Current value for regularity angle : "<<tolang<<"\n";
|
||||
if (argc < 3) {
|
||||
di<<"Donner nom de shape.\n + option : angle en radian, sinon la valeur courante est prise"<<"\n";
|
||||
di<<"Donner nom de shape.\n + option : angle en radian, sinon la valeur courante est prise\n";
|
||||
return 0;
|
||||
}
|
||||
Standard_CString arg1 = argv[1];
|
||||
@@ -233,10 +233,10 @@ static Standard_Integer samerange (Draw_Interpretor& di, Standard_Integer argc,
|
||||
DrawTrSurf::Set(argv[1],NewC2d);
|
||||
}
|
||||
else {
|
||||
di << "Apply BRepLib::SameRange() to shape or GeomLib::SameRange() to pcurve:" << "\n";
|
||||
di << "> samerange shape" << "\n";
|
||||
di << "or" << "\n";
|
||||
di << "> samerange newcurve curve2d first last newfirst newlast" << "\n";
|
||||
di << "Apply BRepLib::SameRange() to shape or GeomLib::SameRange() to pcurve:\n";
|
||||
di << "> samerange shape\n";
|
||||
di << "or\n";
|
||||
di << "> samerange newcurve curve2d first last newfirst newlast\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -93,14 +93,14 @@ static Standard_Integer DT_ShapeDivide (Draw_Interpretor& di,
|
||||
// a[n-1]= Tolerance
|
||||
|
||||
if (n<3) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// try to read a shape:
|
||||
TopoDS_Shape inputShape=DBRep::Get(a[2]);
|
||||
if (inputShape.IsNull()) {
|
||||
di << "Unknown shape"<< "\n";
|
||||
di << "Unknown shape\n";
|
||||
return 1;
|
||||
}
|
||||
// a[2] is a shape. managing:
|
||||
@@ -120,23 +120,23 @@ static Standard_Integer DT_ShapeDivide (Draw_Interpretor& di,
|
||||
tool.Perform();
|
||||
TopoDS_Shape res = tool.Result();
|
||||
|
||||
if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8\n";
|
||||
|
||||
// fixes
|
||||
|
||||
@@ -150,23 +150,23 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n<5) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// try to read a shape:
|
||||
TopoDS_Shape inputShape=DBRep::Get(a[2]);
|
||||
if (inputShape.IsNull()) {
|
||||
di << "Unknown shape"<< "\n";
|
||||
di << "Unknown shape\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Standard_Integer c2d = Draw::Atoi(a[3]);
|
||||
Standard_Integer c3d = Draw::Atoi(a[4]);
|
||||
TopoDS_Shape revsh = ShapeCustom::ConvertToRevolution (inputShape);
|
||||
if (revsh.IsNull()) { di<<"NO RESULT"<<"\n"; return 1; }
|
||||
else if (revsh == inputShape) { di<<"No modif"<<"\n";}
|
||||
else di<<"ConvertToRevolution -> Result : "<<"\n";
|
||||
if (revsh.IsNull()) { di<<"NO RESULT\n"; return 1; }
|
||||
else if (revsh == inputShape) { di<<"No modif\n";}
|
||||
else di<<"ConvertToRevolution -> Result : \n";
|
||||
|
||||
ShapeUpgrade_ShapeConvertToBezier tool(revsh);
|
||||
tool.SetSurfaceConversion(Standard_True);
|
||||
@@ -184,23 +184,23 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
|
||||
tool.Perform();
|
||||
TopoDS_Shape res = tool.Result();
|
||||
|
||||
if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8\n";
|
||||
|
||||
// fixes
|
||||
|
||||
@@ -218,7 +218,7 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
|
||||
|
||||
TopoDS_Face inputFace = TopoDS::Face(inputShape);
|
||||
if (inputFace.IsNull()) {
|
||||
di << a[2] << " is not a face" << "\n";
|
||||
di << a[2] << " is not a face\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -238,21 +238,21 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
|
||||
ShapeUpgrade_Error theError=theTool.Error();
|
||||
di << "Not done: error=";
|
||||
if (theError==ShapeUpgrade_Done)
|
||||
di << "Done"<<"\n";
|
||||
di << "Done\n";
|
||||
else if (theError==ShapeUpgrade_NotDone)
|
||||
di << "NotDone"<<"\n";
|
||||
di << "NotDone\n";
|
||||
else if (theError==ShapeUpgrade_EmptyShell)
|
||||
di << "EmptyShell"<<"\n";
|
||||
di << "EmptyShell\n";
|
||||
else if (theError==ShapeUpgrade_InvalidCriterion)
|
||||
di << "InvalidCriterion"<<"\n";
|
||||
di << "InvalidCriterion\n";
|
||||
else if (theError==ShapeUpgrade_InvalidGridSurface)
|
||||
di << "InvalidGridSurface"<<"\n";
|
||||
di << "InvalidGridSurface\n";
|
||||
else if (theError==ShapeUpgrade_DegeneratedEdge)
|
||||
di << "DegeneratedEdge"<<"\n";
|
||||
di << "DegeneratedEdge\n";
|
||||
else if (theError==ShapeUpgrade_NoSurface)
|
||||
di << "NoSurface"<<"\n";
|
||||
di << "NoSurface\n";
|
||||
else if (theError==ShapeUpgrade_NoTolerance)
|
||||
di << "NoTolerance"<<"\n";
|
||||
di << "NoTolerance\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Shell res = theTool.Shell();
|
||||
@@ -281,7 +281,7 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
|
||||
if (n>=5) {
|
||||
TopoDS_Shape inputBoundary=DBRep::Get(a[3]);
|
||||
if (inputBoundary.IsNull()) {
|
||||
di << "Invalid Boundary" << "\n";
|
||||
di << "Invalid Boundary\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Wire WireBoundary = TopoDS::Wire(inputBoundary);
|
||||
@@ -289,7 +289,7 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
|
||||
// DT_ShapeDivide result Surface Wire Surf Tol
|
||||
Handle(Geom_Surface) WireSupport = DrawTrSurf::GetSurface(a[4]);
|
||||
if (WireSupport.IsNull()) {
|
||||
di << "Invalid Surface supporting the Wire" << "\n";
|
||||
di << "Invalid Surface supporting the Wire\n";
|
||||
return 1;
|
||||
}
|
||||
theTool.SetBoundary(WireBoundary, WireSupport);
|
||||
@@ -307,14 +307,14 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
|
||||
// DT_ShapeDivide result NbU NbV {Surf_u_v...} Face Tol
|
||||
// DT_ShapeDivide result NbU NbV {Surf_u_v...} Wire Surf Tol
|
||||
if (n<6) {
|
||||
di << "bad number of arguments for grid input" <<"\n";
|
||||
di << "bad number of arguments for grid input\n";
|
||||
return 1;
|
||||
}
|
||||
// number of surf:
|
||||
Standard_Integer NbU=Draw::Atoi(a[2]);
|
||||
Standard_Integer NbV=Draw::Atoi(a[3]);
|
||||
if (n < 4+NbU*NbV+1) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
|
||||
if (n>=6+NbU*NbV) {
|
||||
TopoDS_Shape inputBoundary=DBRep::Get(a[4+NbU*NbV]);
|
||||
if (inputBoundary.IsNull()) {
|
||||
di << "Invalid Boundary" << "\n";
|
||||
di << "Invalid Boundary\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Wire WireBoundary = TopoDS::Wire(inputBoundary);
|
||||
@@ -341,7 +341,7 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
|
||||
// DT_ShapeDivide result Surface Wire Surf Tol
|
||||
Handle(Geom_Surface) WireSupport = DrawTrSurf::GetSurface(a[4+NbU*NbV+1]);
|
||||
if (WireSupport.IsNull()) {
|
||||
di << "Invalid Surface supporting the Wire" << "\n";
|
||||
di << "Invalid Surface supporting the Wire\n";
|
||||
return 1;
|
||||
}
|
||||
theTool.SetBoundary(WireBoundary, WireSupport);
|
||||
@@ -359,21 +359,21 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
|
||||
ShapeUpgrade_Error theError=theTool.Error();
|
||||
di << "Not done: error=";
|
||||
if (theError==ShapeUpgrade_Done)
|
||||
di << "Done"<<"\n";
|
||||
di << "Done\n";
|
||||
else if (theError==ShapeUpgrade_NotDone)
|
||||
di << "NotDone"<<"\n";
|
||||
di << "NotDone\n";
|
||||
else if (theError==ShapeUpgrade_EmptyShell)
|
||||
di << "EmptyShell"<<"\n";
|
||||
di << "EmptyShell\n";
|
||||
else if (theError==ShapeUpgrade_InvalidCriterion)
|
||||
di << "InvalidCriterion"<<"\n";
|
||||
di << "InvalidCriterion\n";
|
||||
else if (theError==ShapeUpgrade_InvalidGridSurface)
|
||||
di << "InvalidGridSurface"<<"\n";
|
||||
di << "InvalidGridSurface\n";
|
||||
else if (theError==ShapeUpgrade_DegeneratedEdge)
|
||||
di << "DegeneratedEdge"<<"\n";
|
||||
di << "DegeneratedEdge\n";
|
||||
else if (theError==ShapeUpgrade_NoSurface)
|
||||
di << "NoSurface"<<"\n";
|
||||
di << "NoSurface\n";
|
||||
else if (theError==ShapeUpgrade_NoTolerance)
|
||||
di << "NoTolerance"<<"\n";
|
||||
di << "NoTolerance\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -388,14 +388,14 @@ static Standard_Integer DT_ShapeConvert (Draw_Interpretor& di,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n<5) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// try to read a shape:
|
||||
TopoDS_Shape inputShape=DBRep::Get(a[2]);
|
||||
if (inputShape.IsNull()) {
|
||||
di << "Unknown shape"<< "\n";
|
||||
di << "Unknown shape\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -411,23 +411,23 @@ static Standard_Integer DT_ShapeConvert (Draw_Interpretor& di,
|
||||
tool.Perform();
|
||||
TopoDS_Shape res = tool.Result();
|
||||
|
||||
if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8\n";
|
||||
|
||||
// fixes
|
||||
|
||||
@@ -440,13 +440,13 @@ static Standard_Integer DT_SplitAngle(Draw_Interpretor& di,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n<3) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape inputShape=DBRep::Get(a[2]);
|
||||
if (inputShape.IsNull()) {
|
||||
di << "Unknown shape"<< "\n";
|
||||
di << "Unknown shape\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -460,23 +460,23 @@ static Standard_Integer DT_SplitAngle(Draw_Interpretor& di,
|
||||
tool.Perform();
|
||||
TopoDS_Shape res = tool.Result();
|
||||
|
||||
if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n";
|
||||
if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7\n";
|
||||
if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7\n";
|
||||
if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8\n";
|
||||
|
||||
// fixes
|
||||
|
||||
@@ -502,7 +502,7 @@ static Standard_Integer DT_PlaneDividedFace (Draw_Interpretor& di,
|
||||
// a[3]= Tolerance
|
||||
|
||||
if (n !=4) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ static Standard_Integer DT_PlaneDividedFace (Draw_Interpretor& di,
|
||||
TopoDS_Shape inputShape=DBRep::Get(a[2]);
|
||||
TopoDS_Face inputFace = TopoDS::Face(inputShape);
|
||||
if (inputFace.IsNull()) {
|
||||
di << a[2] << " is not a face" << "\n";
|
||||
di << a[2] << " is not a face\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ static Standard_Integer DT_PlaneDividedFace (Draw_Interpretor& di,
|
||||
//theTool.SetTolerance(Tol);
|
||||
theTool.Build();
|
||||
if (!theTool.IsDone()) {
|
||||
di << "Not done" << "\n";
|
||||
di << "Not done\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -555,7 +555,7 @@ static Standard_Integer DT_PlaneGridShell (Draw_Interpretor& di,
|
||||
Standard_Integer NbU=Draw::Atoi(a[2]);
|
||||
Standard_Integer NbV=Draw::Atoi(a[3]);
|
||||
if (n != 4+NbU+NbV+1) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -595,21 +595,21 @@ static Standard_Integer DT_PlaneFaceCommon (Draw_Interpretor& di,
|
||||
// a[3]= input Shell
|
||||
|
||||
if (n !=4) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape inputShape= DBRep::Get(a[2]);
|
||||
TopoDS_Face inputFace = TopoDS::Face(inputShape);
|
||||
if (inputFace.IsNull()) {
|
||||
di << a[2] << " is not a face" << "\n";
|
||||
di << a[2] << " is not a face\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
inputShape = DBRep::Get(a[3]);
|
||||
TopoDS_Shell inputShell = TopoDS::Shell(inputShape);
|
||||
if (inputShell.IsNull()) {
|
||||
di << a[3] << " is not a shell" << "\n";
|
||||
di << a[3] << " is not a shell\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -636,7 +636,7 @@ static Standard_Integer DT_SplitCurve (Draw_Interpretor& di,
|
||||
// a[2]= Tolerance
|
||||
|
||||
if (n < 3) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -681,7 +681,7 @@ static Standard_Integer DT_SplitCurve2d (Draw_Interpretor& di,
|
||||
// a[2]= Tolerance
|
||||
|
||||
if (n < 3) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -724,18 +724,18 @@ static Standard_Integer DT_SplitWire (Draw_Interpretor& di,
|
||||
{
|
||||
|
||||
if (n <3) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Face source = TopoDS::Face(DBRep::Get(a[2]));
|
||||
if(source.IsNull()) {
|
||||
di <<"Shape is not face"<<"\n";
|
||||
di <<"Shape is not face\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Iterator wi(source);
|
||||
if(!wi.More()) {
|
||||
di <<"Shape is face without wire"<<"\n";
|
||||
di <<"Shape is face without wire\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -758,13 +758,13 @@ static Standard_Integer DT_SplitFace (Draw_Interpretor& di,
|
||||
{
|
||||
|
||||
if (n <3) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Face source = TopoDS::Face(DBRep::Get(a[2]));
|
||||
if(source.IsNull()) {
|
||||
di <<"Shape is not face"<<"\n";
|
||||
di <<"Shape is not face\n";
|
||||
return 1;
|
||||
}
|
||||
Handle(ShapeUpgrade_ShapeDivideContinuity) tool = new ShapeUpgrade_FaceDivideContinuity;
|
||||
@@ -779,23 +779,23 @@ static Standard_Integer DT_SplitFace (Draw_Interpretor& di,
|
||||
TopoDS_Shape result = tool->Result();
|
||||
|
||||
|
||||
if ( tool->Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n";
|
||||
if ( tool->Status ( ShapeExtend_OK ) ) di << "Status: OK\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7\n";
|
||||
if ( tool->Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7\n";
|
||||
if ( tool->Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8\n";
|
||||
|
||||
// fixes
|
||||
|
||||
@@ -821,7 +821,7 @@ static Standard_Integer DT_SplitSurface (Draw_Interpretor& di,
|
||||
// a[4+nbU*nbV]= Tolerance
|
||||
|
||||
if (n <4) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -835,7 +835,7 @@ static Standard_Integer DT_SplitSurface (Draw_Interpretor& di,
|
||||
/*
|
||||
if ( GS.IsNull()) {
|
||||
// Case of composite grid surface
|
||||
di << "composite surf" << "\n";
|
||||
di << "composite surf\n";
|
||||
Standard_Integer nbU=Draw::Atoi(a[2]);
|
||||
Standard_Integer nbV=Draw::Atoi(a[3]);
|
||||
if (nbU==0 || nbV==0) return 1;
|
||||
@@ -847,14 +847,14 @@ static Standard_Integer DT_SplitSurface (Draw_Interpretor& di,
|
||||
theGrid->SetValue(iu,iv,GS);
|
||||
}
|
||||
}
|
||||
di << "appel a SplitSurface::Init" << "\n";
|
||||
di << "appel a SplitSurface::Init\n";
|
||||
theTool->Init(theGrid);
|
||||
}
|
||||
else {*/
|
||||
// Case of single surface
|
||||
di << "single surf" << "\n";
|
||||
di << "single surf\n";
|
||||
|
||||
di << "appel a SplitSurface::Init" << "\n";
|
||||
di << "appel a SplitSurface::Init\n";
|
||||
theTool->Init(GS);
|
||||
if(Split ==1) {
|
||||
Handle(TColStd_HSequenceOfReal) spval = new TColStd_HSequenceOfReal;
|
||||
@@ -863,10 +863,10 @@ static Standard_Integer DT_SplitSurface (Draw_Interpretor& di,
|
||||
theTool->SetVSplitValues(spval);
|
||||
}
|
||||
|
||||
di << "appel a SplitSurface::Build" << "\n";
|
||||
di << "appel a SplitSurface::Build\n";
|
||||
theTool->Build(Standard_True);
|
||||
|
||||
di << "appel a SplitSurface::GlobalU/VKnots" << "\n";
|
||||
di << "appel a SplitSurface::GlobalU/VKnots\n";
|
||||
Handle(ShapeExtend_CompositeSurface) Grid = theTool->ResSurfaces();
|
||||
Handle(TColStd_HArray1OfReal) GlobalU=Grid->UJointValues();
|
||||
Handle(TColStd_HArray1OfReal) GlobalV=Grid->VJointValues();
|
||||
@@ -881,10 +881,10 @@ static Standard_Integer DT_SplitSurface (Draw_Interpretor& di,
|
||||
di <<" "<< GlobalV->Value(iv);
|
||||
di <<"\n";
|
||||
|
||||
di << "appel a Surfaces" << "\n";
|
||||
di << "appel a Surfaces\n";
|
||||
Handle(TColGeom_HArray2OfSurface) theSurfaces= Grid->Patches();
|
||||
|
||||
di << "transfert resultat" << "\n";
|
||||
di << "transfert resultat\n";
|
||||
Standard_Integer NbRow=theSurfaces->ColLength();
|
||||
Standard_Integer NbCol=theSurfaces->RowLength();
|
||||
for (Standard_Integer irow=1; irow<=NbRow; irow++) {
|
||||
@@ -909,7 +909,7 @@ static Standard_Integer offset2dcurve
|
||||
(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 4) {
|
||||
di<<"result + curve + offset"<<"\n";
|
||||
di<<"result + curve + offset\n";
|
||||
|
||||
return 1 /* Error */;
|
||||
}
|
||||
@@ -932,7 +932,7 @@ static Standard_Integer offsetcurve
|
||||
(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 5) {
|
||||
di<<"result + curve + offset + Dir"<<"\n";
|
||||
di<<"result + curve + offset + Dir\n";
|
||||
|
||||
return 1 /* Error */;
|
||||
}
|
||||
@@ -957,14 +957,14 @@ static Standard_Integer splitface
|
||||
(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 5) {
|
||||
di << "Split face: splitface result face [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]" << "\n";
|
||||
di << "Split face: splitface result face [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape aLocalShape = DBRep::Get(argv[2]) ;
|
||||
TopoDS_Face face = TopoDS::Face ( aLocalShape );
|
||||
if ( face.IsNull() ) {
|
||||
di << argv[2] << " is not Face" << "\n";
|
||||
di << argv[2] << " is not Face\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1006,21 +1006,21 @@ static Standard_Integer splitface
|
||||
Standard_Real val = Draw::Atof ( argv[i] );
|
||||
TColStd_SequenceOfReal &vals = ( byV ? vval : uval );
|
||||
if ( vals.Length() >0 && val - vals.Last() < Precision::PConfusion() ) {
|
||||
di << "Values should be sorted in increasing order; skipped" << "\n";
|
||||
di << "Values should be sorted in increasing order; skipped\n";
|
||||
continue;
|
||||
}
|
||||
if ( ( byV && ( val < Vf+Precision::PConfusion() ||
|
||||
val > Vl-Precision::PConfusion() ) ) ||
|
||||
(!byV && ( val < Uf+Precision::PConfusion() ||
|
||||
val > Ul-Precision::PConfusion() ) ) ) {
|
||||
di << "Values should be inside range of surface; skipped" << "\n";
|
||||
di << "Values should be inside range of surface; skipped\n";
|
||||
continue;
|
||||
}
|
||||
vals.Append ( val );
|
||||
}
|
||||
}
|
||||
if ( uval.Length() <1 && vval.Length() <1 ) {
|
||||
di << "No splitting defined" << "\n";
|
||||
di << "No splitting defined\n";
|
||||
return 1;
|
||||
}
|
||||
if ( uval.Length() >0 ) {
|
||||
@@ -1065,7 +1065,7 @@ static Standard_Integer splitface
|
||||
}
|
||||
|
||||
Handle(ShapeExtend_CompositeSurface) Grid = new ShapeExtend_CompositeSurface;
|
||||
if ( ! Grid->Init ( AS ) ) di << "Grid badly connected!" << "\n";
|
||||
if ( ! Grid->Init ( AS ) ) di << "Grid badly connected!\n";
|
||||
|
||||
ShapeFix_ComposeShell SUCS;
|
||||
TopLoc_Location l;
|
||||
@@ -1074,23 +1074,23 @@ static Standard_Integer splitface
|
||||
SUCS.SetContext( RS );
|
||||
SUCS.Perform ();
|
||||
|
||||
if ( SUCS.Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n";
|
||||
if ( SUCS.Status ( ShapeExtend_OK ) ) di << "Status: OK\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7\n";
|
||||
if ( SUCS.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7\n";
|
||||
if ( SUCS.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8\n";
|
||||
|
||||
TopoDS_Shape sh = SUCS.Result();
|
||||
ShapeFix::SameParameter ( sh, Standard_False );
|
||||
@@ -1115,7 +1115,7 @@ static Standard_Integer converttobspline
|
||||
|
||||
TopoDS_Shape inputShape=DBRep::Get(argv[2]);
|
||||
if (inputShape.IsNull()) {
|
||||
di << "Unknown shape"<< "\n";
|
||||
di << "Unknown shape\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Shape revsh = ShapeCustom::ConvertToRevolution (inputShape);
|
||||
@@ -1135,13 +1135,13 @@ static Standard_Integer splitclosed (Draw_Interpretor& di,
|
||||
const char** argv)
|
||||
{
|
||||
if (argc<3) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape inputShape=DBRep::Get(argv[2]);
|
||||
if (inputShape.IsNull()) {
|
||||
di << "Unknown shape"<< "\n";
|
||||
di << "Unknown shape\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1159,13 +1159,13 @@ static Standard_Integer splitarea (Draw_Interpretor& di,
|
||||
const char** argv)
|
||||
{
|
||||
if (argc<4) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape inputShape=DBRep::Get(argv[2]);
|
||||
if (inputShape.IsNull()) {
|
||||
di << "Unknown shape"<< "\n";
|
||||
di << "Unknown shape\n";
|
||||
return 1;
|
||||
}
|
||||
Standard_Real aMaxArea = Draw::Atof(argv[3]);
|
||||
@@ -1190,13 +1190,13 @@ static Standard_Integer removeinternalwires (Draw_Interpretor& di,
|
||||
const char** argv)
|
||||
{
|
||||
if (argc<4) {
|
||||
di << "bad number of arguments" <<"\n";
|
||||
di << "bad number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
Standard_Real aMinArea = Draw::Atof(argv[2]);
|
||||
TopoDS_Shape inputShape=DBRep::Get(argv[3]);
|
||||
if (inputShape.IsNull()) {
|
||||
di << "Unknown shape"<< "\n";
|
||||
di << "Unknown shape\n";
|
||||
return 1;
|
||||
}
|
||||
Handle(ShapeUpgrade_RemoveInternalWires) aTool;
|
||||
@@ -1204,7 +1204,7 @@ static Standard_Integer removeinternalwires (Draw_Interpretor& di,
|
||||
if(inputShape.ShapeType() < TopAbs_WIRE)
|
||||
aTool = new ShapeUpgrade_RemoveInternalWires(inputShape);
|
||||
else {
|
||||
di<<"Invalid type of first shape: should be FACE,SHELL,SOLID or COMPOUND"<<"\n";
|
||||
di<<"Invalid type of first shape: should be FACE,SHELL,SOLID or COMPOUND\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1233,17 +1233,17 @@ static Standard_Integer removeinternalwires (Draw_Interpretor& di,
|
||||
else
|
||||
aTool->Perform();
|
||||
if(aTool->Status(ShapeExtend_FAIL1))
|
||||
di<<"Initial shape has invalid type"<<"\n";
|
||||
di<<"Initial shape has invalid type\n";
|
||||
else if(aTool->Status(ShapeExtend_FAIL2))
|
||||
di<<"Specified sub-shape is not belonged to whole shape"<<"\n";
|
||||
di<<"Specified sub-shape is not belonged to whole shape\n";
|
||||
if(aTool->Status(ShapeExtend_DONE1)) {
|
||||
const TopTools_SequenceOfShape& aRemovedWires =aTool->RemovedWires();
|
||||
di<<aRemovedWires.Length()<<" internal wires were removed"<<"\n";
|
||||
di<<aRemovedWires.Length()<<" internal wires were removed\n";
|
||||
|
||||
}
|
||||
if(aTool->Status(ShapeExtend_DONE2)) {
|
||||
const TopTools_SequenceOfShape& aRemovedFaces =aTool->RemovedFaces();
|
||||
di<<aRemovedFaces.Length()<<" small faces were removed"<<"\n";
|
||||
di<<aRemovedFaces.Length()<<" small faces were removed\n";
|
||||
|
||||
}
|
||||
TopoDS_Shape res = aTool->GetResult();
|
||||
@@ -1258,7 +1258,7 @@ static Standard_Integer removeloc (Draw_Interpretor& di,
|
||||
const char** argv)
|
||||
{
|
||||
if (argc<3) {
|
||||
di << "bad number of arguments. Should be: removeloc res shape" <<"\n";
|
||||
di << "bad number of arguments. Should be: removeloc res shape\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1352,7 +1352,7 @@ static Standard_Integer copytranslate(Draw_Interpretor& di,
|
||||
const char** argv)
|
||||
{
|
||||
if (argc<6) {
|
||||
di << "bad number of arguments. Should be: removeloc res shape dx dyy dz" <<"\n";
|
||||
di << "bad number of arguments. Should be: removeloc res shape dx dyy dz\n";
|
||||
return 1;
|
||||
}
|
||||
TopoDS_Shape aShape = DBRep::Get(argv[2]);
|
||||
|
Reference in New Issue
Block a user