return 0;
}
-
-
-//=======================================================================
-//function : DT_SupportModification
-//purpose : Changes the supports of a Shell
-// The given surface wil support all the faces of the new shell.
-// with the PCurves of the old ones.
-//
-//=======================================================================
-/*static Standard_Integer DT_SupportModification (Draw_Interpretor& di,
- Standard_Integer n, const char** a)
-
-{
- // a[1]= result
- // a[2]= input Shell
- // a[3]= new Surface
- // a[4]= 2d3d Scale Factor
-
- if (n !=5) {
- di << "bad number of arguments" <<"\n";
- return 1;
- }
-
- TopoDS_Shape inputShape= DBRep::Get(a[2]);
- TopoDS_Shell inputShell = TopoDS::Shell(inputShape);
- if (inputShell.IsNull()) {
- di << a[2] << " is not a shell" << "\n";
- return 1;
- }
-
- Handle(Geom_Surface) theSurf = DrawTrSurf::GetSurface(a[3]);
- if ( theSurf.IsNull()) {
- di << a[3] << " is not a surface" << "\n";
- return 1;
- }
-
- ShapeUpgrade_DataMapOfShapeSurface theMap;
- // Associates thesurf to each face of inputShell.
- TopExp_Explorer ExpSh;
- for (ExpSh.Init(inputShell,TopAbs_FACE); ExpSh.More(); ExpSh.Next()){
- TopoDS_Face theFace= TopoDS::Face(ExpSh.Current());
- theMap.Bind(theFace,theSurf);
- }
-
- Standard_Real the2d3dFactor=Draw::Atof(a[4]);
- ShapeUpgrade_SupportModification theTool(inputShell,theMap,the2d3dFactor);
-
- TopoDS_Shell res = theTool.Shell();
- DBRep::Set(a[1],res);
-
- return 0;
-}*/
-
-//=======================================================================
-//function : DT_Debug
-//purpose : activation of the debug mode
-//
-//=======================================================================
-/*
-static Standard_Integer DT_Debug (Draw_Interpretor& di,
- Standard_Integer n, const char** a)
-
-{
- // a[1]= 0/1
-
- if (n !=2) {
- di << "bad number of arguments" <<"\n";
- return 1;
- }
-
- if (Draw::Atoi(a[1])==1) {
- di << "Activation of debug messages"<<"\n";
- ShapeUpgrade::SetDebug(Standard_True);
- }
- else {
- di << "Desactivation of debug messages"<<"\n";
- ShapeUpgrade::SetDebug(Standard_False);
- }
- return 0;
-}
-*/
-
-/*static Standard_Integer shellsolid
- (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
-{
- if (argc < 4) {
- di<<"Donner option + nom de SHAPE + nom de RESULTAT"<<"\n";
- di<<"Options : a all (sewing sur tous les shells\n"
- << " c check (sewing sur shells avec bad edges\n"
- <<" b bad edges\n f free edges"<<"\n";
- return 1 ;
- }
- Standard_CString arg1 = argv[1];
- Standard_CString arg2 = argv[2];
- Standard_CString arg3 = argv[3];
-
- TopoDS_Shape Shape = DBRep::Get(arg2);
- if (Shape.IsNull()) { di<<"Shape unknown : "<<arg2<<"\n"; return 1 ; }
-
- ShapeAnalysis_Shell STS;
- char opt = arg1[0];
- if (opt == 'a') STS.LoadShells (Shape);
- else if (opt == 'f') STS.CheckOrientedShells (Shape,Standard_True);
- else if (opt == 'b' || opt == 'c') STS.CheckOrientedShells (Shape,Standard_False);
-
- else if (opt == 'o') {
-
-// Test WireOrder
- Handle(ShapeExtend_WireData) Frees = new ShapeExtend_WireData;//:sw Frees.SetPrecision (BRepBuilderAPI::Precision());
- Standard_Integer nbe = 0;
- for (TopExp_Explorer edges(Shape,TopAbs_EDGE); edges.More(); edges.Next()) {
- Frees->Add (TopoDS::Edge(edges.Current())); nbe ++;
- }
- ShapeAnalysis_WireOrder WO (Standard_True,BRepBuilderAPI::Precision());
- ShapeAnalysis_Wire saw;
- saw.Load ( Frees );
- saw.SetPrecision ( BRepBuilderAPI::Precision() );
- saw.CheckOrder ( WO );
-
- Standard_Integer stat = WO.Status();
- di<<"Wire Order Status = "<<stat<<" on "<<nbe<<" Edges"<<"\n";
- nbe = WO.NbEdges();
- for (Standard_Integer ie = 1; ie <= nbe; ie ++) {
- Standard_Integer io = WO.Ordered (ie);
- gp_XYZ st3d,en3d;
- WO.XYZ (io,st3d,en3d);
- di<<ie<<": Edge."<<io<<" Start:"<<st3d.X()<<" "<<st3d.Y()<<" "<<st3d.Z()
- <<" End:"<<en3d.X()<<" "<<en3d.Y()<<" "<<en3d.Z()<<"\n";
- }
-// Chainage ?
- Standard_Real gap = BRepBuilderAPI::Precision();
- WO.SetChains (gap);
- Standard_Integer n1,n2,ic, nc = WO.NbChains();
- for (ic = 1; ic <= nc; ic ++) {
- WO.Chain(ic,n1,n2);
- di<<"Chain."<<ic<<" From "<<n1<<" To "<<n2<<"\n";
- }
- }
-
- else { di<<"Option non reconnue : "<<arg1<<"\n"; return 1; }
-
- TopoDS_Shape res;
- if (opt == 'a' || opt == 'c') {
- ShapeUpgrade_ShellSewing sew;
- res = sew.ApplySewing (Shape);
- if (res.IsEqual(Shape)) {
- res.Nullify();
- di<<"ShellSolid : no sewing done"<<"\n";
- }
- } else if (opt == 'b') {
- if (STS.HasBadEdges()) res = STS.BadEdges();
- else di<<"ShellSolid : no bad edge"<<"\n";
- } else if (opt == 'f') {
- if (STS.HasFreeEdges()) res = STS.FreeEdges();
- else di<<"ShellSolid : no free edge"<<"\n";
- if (STS.HasConnectedEdges()) di<<"ShellSolid : connected edges"<<"\n";
- else di<<"ShellSolid : NO connected edges"<<"\n";
- }
-
- if (!res.IsNull()) DBRep::Set (arg3,res);
-
- return 0; // Done
-}*/
//---------------gka
//=======================================================================
//function : offset2dcurve