]> OCCT Git - occt-copy.git/commitdiff
0024757: DRAW: Move commands fixshape, tolerance, and similar to MODELING
authordbv <dbv@opencascade.com>
Thu, 3 Apr 2014 12:22:15 +0000 (16:22 +0400)
committerapn <apn@opencascade.com>
Fri, 4 Apr 2014 08:57:25 +0000 (12:57 +0400)
Package SWDRAW has been moved to TKTopTest toolkit. Class SWDRAW_ToVRML has been moved to XSDRAWSTLVRML_ToVRML
Removed unused classes:
SWDRAW_ShapeBuild
SWDRAW_ShapeConstruct
XSDRAW_Shape
Removed NSPApply command
Test script update
Removed xtrace command

26 files changed:
src/IFSelect/IFSelect_Functions.cxx
src/SWDRAW/SWDRAW.cdl
src/SWDRAW/SWDRAW.cxx
src/SWDRAW/SWDRAW_ShapeBuild.cdl [deleted file]
src/SWDRAW/SWDRAW_ShapeBuild.cxx [deleted file]
src/SWDRAW/SWDRAW_ShapeConstruct.cdl [deleted file]
src/SWDRAW/SWDRAW_ShapeConstruct.cxx [deleted file]
src/SWDRAW/SWDRAW_ToVRML.cdl [deleted file]
src/SWDRAW/SWDRAW_ToVRML.cxx [deleted file]
src/TKTopTest/EXTERNLIB
src/TKTopTest/PACKAGES
src/TKXSDRAW/EXTERNLIB
src/TKXSDRAW/PACKAGES
src/TestTopOpe/TestTopOpe.cxx
src/XDEDRAW/XDEDRAW.cxx
src/XDEDRAW/XDEDRAW_Common.cxx
src/XSDRAW/XSDRAW.cdl
src/XSDRAW/XSDRAW.cxx
src/XSDRAW/XSDRAW_Shape.cdl [deleted file]
src/XSDRAW/XSDRAW_Shape.cxx [deleted file]
src/XSDRAWSTLVRML/XSDRAWSTLVRML.cdl
src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx
src/XSDRAWSTLVRML/XSDRAWSTLVRML_ToVRML.cdl [new file with mode: 0644]
src/XSDRAWSTLVRML/XSDRAWSTLVRML_ToVRML.cxx [new file with mode: 0644]
tests/heal/begin
tests/heal/elementary_to_revolution/end

index f2945861ef6afa2ab1f3e6088a12703b23aea5c6..1f698cb7fa371e5c326de9b2a09c7bd1f15a26c6 100644 (file)
@@ -136,29 +136,6 @@ static IFSelect_ReturnStatus fun1
   return IFSelect_RetDone;
 }
 
-static IFSelect_ReturnStatus fun2
-  (const Handle(IFSelect_SessionPilot)& pilot)
-{
-//        ****    Trace File        ****
-  Standard_Integer argc = pilot->NbWords();
-
-  Handle(Message_Messenger) sout = Message::DefaultMessenger();
-  const Standard_CString arg1 = pilot->Arg(1);
-  if (argc < 2) {
-//    sout<<" Trace : Level="<<Message_PrinterOStream::Default()->GetTraceLevel();
-  } else if (arg1[1] == '\0' && arg1[0] == '.') {
-    sout<<" Trace -> Standard Output"<<endl;
-//    Message_PrinterOStream::SetDefault();
-  } else if (arg1[1] == '\0' && (arg1[0] >= '0' && arg1[0] <= '9')) {
-    sout<<" Trace Level : "<<arg1<<endl;
-//    Message_PrinterOStream::Default()->SetTraceLevel((Message_TraceLevel)atoi(arg1));
-  } else {
-    sout<<" Trace -> Append File : "<<arg1<<endl;
-//    Message_PrinterOStream::SetDefault (Message_PrinterOStream::Default()->GetTraceLevel(),arg1,Standard_True);
-  }
-  return IFSelect_RetVoid;
-}
-
 static IFSelect_ReturnStatus fun3
   (const Handle(IFSelect_SessionPilot)& pilot)
 {
@@ -2485,7 +2462,6 @@ static int initactor = 0;
   IFSelect_Act::SetGroup("DE: General");
   IFSelect_Act::AddFunc("xstatus","Lists XSTEP Status : Version, System Name ...",funstatus);
   IFSelect_Act::AddFunc("handler","Toggle status catch Handler Error of the session",fun1);
-  IFSelect_Act::AddFunc("xtrace",". -> stdout or file:string or level:integer  -> File/Level Trace XSTEP",fun2);
   IFSelect_Act::AddFunc("xload","file:string  : Read File -> Load Model",fun3);
 // IFSelect_Act::AddFunc("load","file:string  : Read File -> Load Model",fun3);
   IFSelect_Act::AddFunc("xread","file:string  : Read File -> Load Model",fun3);
index c9dac5addb8911802628c4b5a6e725c9bd33cf47..4f0ed6b418caaf321b54f740cbf7401e3ec8fd20 100644 (file)
@@ -33,12 +33,6 @@ is
     class ShapeAnalysis;
        ---Purpose: Contains commands to activate package ShapeAnalysis
 
-    class ShapeBuild;
-       ---Purpose: Contains commands to activate package ShapeBuild
-
-    class ShapeConstruct;
-       ---Purpose: Contains commands to activate package ShapeConstruct
-
     class ShapeCustom;
        ---Purpose: Contains commands to activate package ShapeCustom
 
@@ -56,11 +50,6 @@ is
     
     class ShapeProcessAPI;
        ---Purpose: Contains commands to activate package ShapeProcessAPI
-       
-    class ToVRML;
-       ---Purpose: A utility which writes a Shape to VRML format
-       ---Remark : It can be placed elsewhere, while it depends on
-       --          only BRepMesh i.e. TOPOLOGY
 
     Init (theCommands: in out Interpretor from Draw);
        ---Purpose: Loads commands defined in SWDRAW
index 0f2a9d791c57ebfb4c24c4da86e09f4abda666e5..ea9b7be54b7588e54cd68b2a174c6d74a8c8cb0d 100644 (file)
@@ -18,8 +18,6 @@
 
 #include <SWDRAW_ShapeTool.hxx>
 #include <SWDRAW_ShapeAnalysis.hxx>
-#include <SWDRAW_ShapeBuild.hxx>
-#include <SWDRAW_ShapeConstruct.hxx>
 #include <SWDRAW_ShapeCustom.hxx>
 #include <SWDRAW_ShapeExtend.hxx>
 #include <SWDRAW_ShapeFix.hxx>
@@ -27,9 +25,6 @@
 #include <SWDRAW_ShapeProcess.hxx>
 #include <SWDRAW_ShapeProcessAPI.hxx>
 
-//  tovrml
-#include <TopoDS_Shape.hxx>
-#include <SWDRAW_ToVRML.hxx>
 //#72 rln 09.03.99 Packaging of SWDRAW
 
 #include <ShapeProcess_OperLibrary.hxx>
@@ -48,21 +43,6 @@ static int dejadraw = 0;
 
 //#72 rln 09.03.99 Packaging of SWDRAW
 
-//=======================================================================
-//function : tovrml
-//purpose  : 
-//=======================================================================
-
-static Standard_Integer tovrml(Draw_Interpretor& /*di*/, Standard_Integer n, const char** a)
-{
-  if (n < 3) return 1;
-  SWDRAW_ToVRML avrml;
-  TopoDS_Shape sh = DBRep::Get (a[1]);
-  const char* filename = a[2];
-  if (!avrml.Write (sh,filename)) return 1;
-  return 0;
-}
-
 //=======================================================================
 //function : LocSet
 //purpose  : 
@@ -138,42 +118,6 @@ static Standard_Integer LocDump (Draw_Interpretor& di, Standard_Integer argc, co
   return 0; 
 }
 
-//=======================================================================
-//function : NSPApply
-//purpose  : CKY , 12 JUL 2001
-//=======================================================================
-
-static Standard_Integer NSPApply (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
-{
-  if ( argc < 6) {
-    di<<"NSPApply result(new shape) shape(initial shape) rscfile sequence tol [maxtol, default=1]"<<"\n";
-    return 1;
-  }
-  TopoDS_Shape shape = DBRep::Get ( argv[2] );
-  if (shape.IsNull()) {
-    di << "No shape named \"" << argv[1] << "\" found" << "\n";
-    return 1;
-  }
-  TopoDS_Shape newshape;
-  Standard_Real tol = Draw::Atof(argv[5]);
-  Standard_Real maxtol = 1.;
-  if (argc > 6) maxtol = Draw::Atof(argv[6]);
-
-  XSAlgo::AlgoContainer()->PrepareForTransfer();
-  Handle(Standard_Transient) info;  // reserved for special uses
-  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator (di, 1);
-  newshape = XSAlgo::AlgoContainer()->ProcessShape
-    ( shape, tol, maxtol, argv[3] , argv[4] , info, aProgress);
-//    WHAT IS MISSING HERE IS MERGING with starting transfer map
-
-  if (newshape.IsNull()) {
-    di<<"No result produced"<<"\n";
-  }
-  else
-    DBRep::Set ( argv[1], newshape );
-  return 0;
-}
-
 //=======================================================================
 //function : Init
 //purpose  : 
@@ -192,8 +136,6 @@ void  SWDRAW::Init (Draw_Interpretor& theCommands)
 
   SWDRAW_ShapeTool::InitCommands (theCommands);
   SWDRAW_ShapeAnalysis::InitCommands (theCommands);
-  SWDRAW_ShapeBuild::InitCommands (theCommands);
-  SWDRAW_ShapeConstruct::InitCommands (theCommands);
   SWDRAW_ShapeCustom::InitCommands (theCommands);
   SWDRAW_ShapeExtend::InitCommands (theCommands);
   SWDRAW_ShapeFix::InitCommands (theCommands);
@@ -205,15 +147,9 @@ void  SWDRAW::Init (Draw_Interpretor& theCommands)
   theCommands.Add("LocSet", "a [b [c]]: set loc b->a; use no args to get help",__FILE__,LocSet,"essai");
   theCommands.Add("LocDump", "a: dump location of a",__FILE__,LocDump,"essai");
 
-  //tovrml
-  theCommands.Add("tovrml", "shape filename",__FILE__, tovrml, "essai");
-
   // register operators for ShapeProcessing
   ShapeProcess_OperLibrary::Init();
 
-  // new shape processing
-  theCommands.Add ("NSPApply","NSPApply result shape rscfilename sequence tol [maxtol, default=1]",
-                   __FILE__,NSPApply,"essai");
 }
 
 //=======================================================================
diff --git a/src/SWDRAW/SWDRAW_ShapeBuild.cdl b/src/SWDRAW/SWDRAW_ShapeBuild.cdl
deleted file mode 100644 (file)
index 2fcf7b1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
--- Created on: 1999-03-09
--- Created by: data exchange team
--- Copyright (c) 1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class ShapeBuild from SWDRAW 
-
-       ---Purpose: Contains commands to activate package ShapeBuild
-       --          List of DRAW commands and corresponding functionalities:
-
-uses
-    Interpretor from Draw
-
-is
-
-    InitCommands (myclass; theCommands: in out Interpretor from Draw);
-       ---Purpose: Loads commands defined in ShapeBuild
-
-end ShapeBuild;
diff --git a/src/SWDRAW/SWDRAW_ShapeBuild.cxx b/src/SWDRAW/SWDRAW_ShapeBuild.cxx
deleted file mode 100644 (file)
index 648fc64..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Created on: 1999-03-09
-// Created by: data exchange team
-// Copyright (c) 1999-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <SWDRAW_ShapeBuild.ixx>
-
-//=======================================================================
-//function : InitCommands
-//purpose  : 
-//=======================================================================
-
-void SWDRAW_ShapeBuild::InitCommands(Draw_Interpretor& ) 
-{
-}
diff --git a/src/SWDRAW/SWDRAW_ShapeConstruct.cdl b/src/SWDRAW/SWDRAW_ShapeConstruct.cdl
deleted file mode 100644 (file)
index f4cee7b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
--- Created on: 1999-03-09
--- Created by: data exchange team
--- Copyright (c) 1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class ShapeConstruct from SWDRAW 
-
-       ---Purpose: Contains commands to activate package ShapeConstruct
-       --          List of DRAW commands and corresponding functionalities:
-
-uses
-
-    Interpretor from Draw
-
-is
-
-    InitCommands (myclass; theCommands: in out Interpretor from Draw);
-       ---Purpose: Loads commands defined in ShapeConstruct
-
-end ShapeConstruct;
diff --git a/src/SWDRAW/SWDRAW_ShapeConstruct.cxx b/src/SWDRAW/SWDRAW_ShapeConstruct.cxx
deleted file mode 100644 (file)
index 486a622..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Created on: 1999-03-09
-// Created by: data exchange team
-// Copyright (c) 1999-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <SWDRAW_ShapeConstruct.ixx>
-
-void SWDRAW_ShapeConstruct::InitCommands(Draw_Interpretor& /*theCommands*/) 
-{
-}
diff --git a/src/SWDRAW/SWDRAW_ToVRML.cdl b/src/SWDRAW/SWDRAW_ToVRML.cdl
deleted file mode 100644 (file)
index 4452bd3..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
--- Created on: 1998-08-03
--- Created by: Christian CAILLET
--- Copyright (c) 1998-1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class ToVRML  from SWDRAW
-
-    ---Purpose : Writes a Shape to a File in VRML Format
-
-uses CString, OStream, AsciiString from TCollection, Shape from TopoDS
-
-is
-
-    Create returns ToVRML;
-
-    EmissiveColorRed   (me : in out) returns Real;
-    ---C++ : return &
-    EmissiveColorGreen (me : in out) returns Real;
-    ---C++ : return &
-    EmissiveColorBlue  (me : in out) returns Real;
-    ---C++ : return &
-    DiffuseColorRed    (me : in out) returns Real;
-    ---C++ : return &
-    DiffuseColorGreen  (me : in out) returns Real;
-    ---C++ : return &
-    DiffuseColorBlue   (me : in out) returns Real;
-    ---C++ : return &
-    Transparency       (me : in out) returns Real;
-    ---C++ : return &
-    AmbientIntensity   (me : in out) returns Real;
-    ---C++ : return &
-    SpecularColorRed   (me : in out) returns Real;
-    ---C++ : return &
-    SpecularColorGreen (me : in out) returns Real;
-    ---C++ : return &
-    SpecularColorBlue  (me : in out) returns Real;
-    ---C++ : return &
-    Shininess          (me : in out) returns Real;
-    ---C++ : return &
-    Texture            (me : in out) returns AsciiString;
-    ---C++ : return &
-    CreaseAngle        (me : in out) returns Real;
-    ---C++ : return &
-    Deflection         (me : in out) returns Real;
-    ---C++ : return &
-
-
-    Write (me; shape : Shape from TopoDS; filename : CString) returns Boolean;
-    ---Purpose : conversion of a Shape into VRML format for 3d visualisation
-
-fields
-
-  myEmissiveColorRed   : Real;  -- def 0.3
-  myEmissiveColorGreen : Real;  -- def 0.3
-  myEmissiveColorBlue  : Real;  -- def 0.3
-  myDiffuseColorRed    : Real;  -- def 0.3
-  myDiffuseColorGreen  : Real;  -- def 0.3
-  myDiffuseColorBlue   : Real;  -- def 0.5
-  myTransparency       : Real;  -- def 0.0
-  myAmbientIntensity   : Real;  -- def 0.3
-  mySpecularColorRed   : Real;  -- def 0.7
-  mySpecularColorGreen : Real;  -- def 0.7
-  mySpecularColorBlue  : Real;  -- def 0.8
-  myShininess          : Real;  -- def 0.1
-  myTexture            : AsciiString;  -- def " [] "
-  myCreaseAngle        : Real;  -- def 1.57
-  myDeflection         : Real;  -- def 0.005
-
-end ToVRML;
diff --git a/src/SWDRAW/SWDRAW_ToVRML.cxx b/src/SWDRAW/SWDRAW_ToVRML.cxx
deleted file mode 100644 (file)
index 2611e1b..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <SWDRAW_ToVRML.ixx>
-
-#include <Standard_Stream.hxx>
-#include <BRepMesh_FastDiscret.hxx>
-#include <BRepMesh_Triangle.hxx>
-#include <BRepMesh_Edge.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-
-#include <gp_Pnt.hxx> //ied_modif_for_compil_Nov-20-1998
-
-SWDRAW_ToVRML::SWDRAW_ToVRML  ()
-{
-  myEmissiveColorRed   = 0.3;
-  myEmissiveColorGreen = 0.3;
-  myEmissiveColorBlue  = 0.3;
-  myDiffuseColorRed    = 0.3;
-  myDiffuseColorGreen  = 0.3;
-  myDiffuseColorBlue   = 0.5;
-  myTransparency       = 0.0;
-  myAmbientIntensity   = 0.3;
-  mySpecularColorRed   = 0.7;
-  mySpecularColorGreen = 0.7;
-  mySpecularColorBlue  = 0.8;
-  myShininess   = 0.1;
-  myTexture     = " [] " ;
-  myCreaseAngle = 1.57;
-  myDeflection  = 0.005;
-}
-
-Standard_Real&  SWDRAW_ToVRML::EmissiveColorRed  ()  {  return myEmissiveColorRed  ;  }
-Standard_Real&  SWDRAW_ToVRML::EmissiveColorGreen()  {  return myEmissiveColorGreen;  }
-Standard_Real&  SWDRAW_ToVRML::EmissiveColorBlue ()  {  return myEmissiveColorBlue ;  }
-Standard_Real&  SWDRAW_ToVRML::DiffuseColorRed   ()  {  return myDiffuseColorRed   ;  }
-Standard_Real&  SWDRAW_ToVRML::DiffuseColorGreen ()  {  return myDiffuseColorGreen ;  }
-Standard_Real&  SWDRAW_ToVRML::DiffuseColorBlue  ()  {  return myDiffuseColorBlue  ;  }
-Standard_Real&  SWDRAW_ToVRML::Transparency      ()  {  return myTransparency      ;  }
-Standard_Real&  SWDRAW_ToVRML::AmbientIntensity  ()  {  return myAmbientIntensity  ;  }
-Standard_Real&  SWDRAW_ToVRML::SpecularColorRed  ()  {  return mySpecularColorRed  ;  }
-Standard_Real&  SWDRAW_ToVRML::SpecularColorGreen()  {  return mySpecularColorGreen;  }
-Standard_Real&  SWDRAW_ToVRML::SpecularColorBlue ()  {  return mySpecularColorBlue ;  }
-Standard_Real&  SWDRAW_ToVRML::Shininess  ()         {  return myShininess  ;  }
-TCollection_AsciiString&  SWDRAW_ToVRML::Texture ()  {  return myTexture    ;  }
-Standard_Real&  SWDRAW_ToVRML::CreaseAngle()         {  return myCreaseAngle;  }
-Standard_Real&  SWDRAW_ToVRML::Deflection ()         {  return myDeflection ;  }
-
-//=======================================================================
-// function : ToVRML::Write
-// purpose  : conversion of a Shape into VRML format for 3d visualisation
-//=======================================================================
-
-Standard_Boolean  SWDRAW_ToVRML::Write
-  (const TopoDS_Shape& aShape, const Standard_CString filename) const
-{
-  filebuf thefile;
-  ostream TheFileOut(&thefile);
-
-  if (thefile.open(filename,ios::out))
-    {
-
-      // Creates facets from the shape
-//     Create (defle     : Real    from Standard;
-//             shape     : Shape   from TopoDS;
-//             angl      : Real    from Standard= 0.17;
-//             withShare : Boolean from Standard=Standard_True;
-//             inshape   : Boolean from Standard=Standard_False;
-//             relative  : Boolean from Standard=Standard_False;
-//             shapetrigu: Boolean from Standard=Standard_False)
-//         returns mutable Discret from BRepMesh;
-      Bnd_Box B;
-      BRepBndLib::Add(aShape, B);
-
-      Handle(BRepMesh_FastDiscret)     TheDiscret = 
-       new BRepMesh_FastDiscret(myDeflection,
-                            aShape,
-                             B,
-                            0.17,
-                            Standard_True,
-                            Standard_False,
-                            Standard_True,
-                            Standard_True);
-
-      Standard_Integer i,j;
-
-      // header of the VRML file
-      TheFileOut << "#VRML V2.0 utf8" << endl;
-      TheFileOut << "Group {" << endl;
-      TheFileOut << " children [ " << endl;
-      TheFileOut << " NavigationInfo {" << endl;
-      TheFileOut << "       type \"EXAMINE\" " << endl;
-      TheFileOut << " }," << endl;
-      TheFileOut << "Shape {" << endl;
-
-      TheFileOut << "   appearance Appearance {" << endl;
-      TheFileOut << "     texture ImageTexture {" << endl;
-      TheFileOut << "         url " << myTexture.ToCString() << endl;
-      TheFileOut << "         }" << endl;
-      TheFileOut << "     material Material { " << endl;
-      TheFileOut << "  diffuseColor " << myDiffuseColorRed << " " << myDiffuseColorGreen << " " << myDiffuseColorBlue << " " << endl;
-      TheFileOut << " emissiveColor " << myEmissiveColorRed << " "
-       << myEmissiveColorGreen << " " << myEmissiveColorBlue << " " << endl;
-      TheFileOut << " transparency " << myTransparency << endl;
-      TheFileOut << " ambientIntensity " << myAmbientIntensity << " " << endl;
-      TheFileOut << " specularColor " << mySpecularColorRed << " " << mySpecularColorGreen << " " << mySpecularColorBlue << " " << endl;
-      TheFileOut << " shininess " <<myShininess << " " << endl;
-      TheFileOut << "         }" << endl;
-      TheFileOut << "     }" << endl;
-
-      TheFileOut << "   geometry IndexedFaceSet {" << endl;
-      TheFileOut << "     coord Coordinate {" << endl;
-      TheFileOut << "       point [" << endl;
-      
-      // puts the coordinates of all the vertices using the order
-      // given during the discretisation
-      for (i=1;i<=TheDiscret->NbVertices();i++)
-       {
-         gp_Pnt TheVertex=TheDiscret->Pnt(i);
-         TheFileOut << "          " 
-           <<  TheVertex.Coord().X() << " " 
-             << TheVertex.Coord().Y() <<  " " 
-               << TheVertex.Coord().Z() << "," << endl;
-       }
-      TheFileOut << "       ]" << endl;
-      TheFileOut << "     }" << endl;
-      
-      TheFileOut << "     coordIndex [" << endl;
-      
-      // retrieves all the triangles in order to draw the facets
-      for (j=1; j <= TheDiscret->NbTriangles(); j++)
-       {
-         BRepMesh_Triangle TheTri=TheDiscret->Triangle(j);
-         Standard_Integer e1,e2,e3,i1,i2,i3;
-         Standard_Boolean b1,b2,b3;
-         
-         TheTri.Edges(e1,e2,e3,b1,b2,b3);
-         
-         if (b1)
-           {
-             i1 = TheDiscret->Edge(e1).FirstNode()-1;
-             i2 = TheDiscret->Edge(e1).LastNode()-1;
-           }
-         else
-           {
-             i2 = TheDiscret->Edge(e1).FirstNode()-1;
-             i1 = TheDiscret->Edge(e1).LastNode()-1;
-           }
-
-         if (b2)
-           {
-             i3 = TheDiscret->Edge(e2).LastNode()-1;
-           }
-         else
-           {
-             i3 = TheDiscret->Edge(e2).FirstNode()-1;
-           }
-         
-         TheFileOut << "          " << i1  << ", " << i2 << ", "  << i3  << ", -1, " << endl;
-       }
-      
-      TheFileOut << "          ]" << endl;
-      TheFileOut << "     solid FALSE" << endl;      // it is not a closed solid
-      TheFileOut << " creaseAngle " << myCreaseAngle << " " << endl; // for smooth shading
-      TheFileOut << "     }" << endl;
-      TheFileOut << "   }" << endl;
-         TheFileOut << " ]" << endl;
-         TheFileOut << "} " << endl;
-      
-    }
-  else return Standard_False;  // failure when opening file
-
-  thefile.close();
-
-  return Standard_True;
-}
-
index 18ed2658ea1851911d027e2c359c433b3183d279..7edc95ffb4306545a342ef773b5856e0eee60c59 100644 (file)
@@ -17,3 +17,4 @@ TKPrim
 TKBool
 TKOffset
 TKFeat
+TKShHealing
index fde67a022b90b25dee5a8106cbc07208e76bceab..e69da695766541d614df68e18b90ce68b9857f5f 100755 (executable)
@@ -8,3 +8,4 @@ MeshTest
 GeomliteTest
 DrawFairCurve
 BOPTest
+SWDRAW
index 9292c4614848b4a8be5745dd0e6f4b08b0cf57f3..e3cbb2f49b81e74d4f9911022e145f0da56e98e7 100755 (executable)
@@ -11,7 +11,6 @@ TKViewerTest
 TKG2d
 TKSTEPBase
 TKTopAlgo
-TKShHealing
 TKGeomBase
 TKGeomAlgo
 TKMesh
index 21d032bd0faeba106edf059be831a06166c81c8b..da48d7c48ca7f6c4c734487af0f288a1bb9926a2 100755 (executable)
@@ -1,4 +1,3 @@
-SWDRAW
 XSDRAW
 XSDRAWIGES
 XSDRAWSTEP
index 8c476fda2e22cfe97a4af18600bbe5fa568b55ae..25c525a92c6fc69b4f452820aee39d0ab75cdc12 100644 (file)
@@ -24,6 +24,7 @@
 #include <Draw_Interpretor.hxx>
 #include <Draw_PluginMacro.hxx>
 #include <BOPTest.hxx>
+#include <SWDRAW.hxx>
 #ifdef WNT
 #pragma warning(4:4190)
 #endif
@@ -117,6 +118,8 @@ void TestTopOpe::Factory(Draw_Interpretor& theDI)
 
   BOPTest::Factory(theDI);
 
+  SWDRAW::Init (theDI);
+
 #ifdef DEB
       cout << "Draw Plugin : All topological operations kernel commands are loaded" << endl;
 #endif
index cbb17d02cb7c5b90472b173d50140a7964b53a66..5061cdf2cc2c45ac019dde49211e2623ccd840ff 100644 (file)
@@ -80,7 +80,6 @@
 #include <XDEDRAW_Common.hxx>
 #include <XSDRAWIGES.hxx>
 #include <XSDRAWSTEP.hxx>
-#include <SWDRAW.hxx>
 #include <XSDRAW.hxx>
 #include <XCAFPrs.hxx>
 #include <ViewerTest.hxx>
@@ -1162,7 +1161,6 @@ void XDEDRAW::Factory(Draw_Interpretor& theDI)
 
   XSDRAWSTEP::InitCommands(theDI);
 
-  SWDRAW::Init(theDI);
   XSDRAW::LoadDraw(theDI);
 
   XDEDRAW::Init(theDI);
index 9389c3d14e2453b93c51a0c39071e880315b7c25..c9747b51a8992122e68da972612efa82bc1dd1bc 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <Draw.hxx>
 #include <Draw_Interpretor.hxx>
-#include <SWDRAW.hxx>
 #include <XSDRAW.hxx>
 #include <XDEDRAW.hxx>
 #include <XSDRAWIGES.hxx>
index 8cab8b8054b4ecc91a64343cce1a2e56d458e0ca..0414a7ff26a4332e6e3a91632797a7b5414fb34a 100644 (file)
@@ -36,14 +36,6 @@ is
     --           
     --           Loaded by LoadDraw
 
-    class Shape;
-    ---Purpose : Gathers commands which only apply to shapes/geometry, and are
-    --           not concerned by XSTEP features for files
-    --           This set of functions just enriches the standard DRAW set,
-    --           with either useful but lacking basic functions, or complements
-    --           used in transfer operations, or specific control functions
-    --           Loaded by LoadDraw
-
     class Vars;
     ---Purpose : Takes variables to/from the DRAW session
 
index 9fe113341b1cb1be5771fb1e59bcb2df036ccfe8..08ef887ef536f84fa466345c6f5db7ccfd47b8a4 100644 (file)
@@ -17,7 +17,6 @@
 #include <TColStd_HSequenceOfAsciiString.hxx>
 #include <IFSelect_Functions.hxx>
 #include <IFSelect_SessionPilot.hxx>
-#include <SWDRAW.hxx>
 //#include <XSDRAW_Shape.hxx>
 #include <XSDRAW_Vars.hxx>
 #include <XSControl_Functions.hxx>
@@ -95,9 +94,7 @@ static Standard_Integer XSTEPDRAWRUN (Draw_Interpretor& , Standard_Integer argc,
 void XSDRAW::LoadDraw (Draw_Interpretor& theCommands)
 {
   if (dejald) return;  dejald = 1;
-//  XSDRAW_Shape::InitCommands (theCommands);
-//  Pour tout faire d un coup : BRepTest & cie, SWDRAW & cie :
-  SWDRAW::Init (theCommands);
+//  Pour tout faire d un coup : BRepTest & cie:
   LoadSession();
 
   //skl: we make remove commands "x" and "exit" in order to this commands are
diff --git a/src/XSDRAW/XSDRAW_Shape.cdl b/src/XSDRAW/XSDRAW_Shape.cdl
deleted file mode 100644 (file)
index 37e2780..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
--- Created on: 1997-04-22
--- Created by: Christian CAILLET
--- Copyright (c) 1997-1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class Shape  from XSDRAW
-
-    ---Purpose : Defines functions to control shapes (in way useful for XSTEP),
-    --           additional features which should be basic, or call tools which
-    --           are bound with transfer needs.           
-    --           But these functions work on shapes, geometry, nothing else
-    --           (no file, no model, no entity)
-
-uses CString, Interpretor from Draw
-
-is
-
-    InitCommands (myclass; theCommands : in out Interpretor from Draw);
-    ---Purpose : Defines and loads all basic functions for XSDRAW on Shapes
-
-end Shape;
diff --git a/src/XSDRAW/XSDRAW_Shape.cxx b/src/XSDRAW/XSDRAW_Shape.cxx
deleted file mode 100644 (file)
index 7c8b7c7..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <XSDRAW_Shape.ixx>
-#include <SWDRAW_ShapeTool.hxx>
-
-//unused variable 
-//static int initactor = 0;
-
-void XSDRAW_Shape::InitCommands (Draw_Interpretor& theCommands)
-{
-  SWDRAW_ShapeTool::InitCommands (theCommands);
-}
index f11aea875a052b65004bbe97d9a658767802c121..68989ba584165144a82babcb9ca63b84bfc95756 100644 (file)
@@ -17,7 +17,7 @@ package XSDRAWSTLVRML
 
        ---Purpose:
 
-uses Draw, MeshVS, StlMesh, TColStd, TCollection, Standard
+uses Draw, MeshVS, StlMesh, TColStd, TCollection, Standard, TopoDS
 
 is
 
@@ -31,6 +31,9 @@ is
     class CoordsMap instantiates DataMap from TCollection
             ( Integer from Standard, DataMapOfIntegerReal from TColStd, MapIntegerHasher from TColStd );
 
+    class ToVRML;
+    ---Purpose: A utility which writes a Shape to VRML format
+
     InitCommands (theCommands : in out Interpretor from Draw);
     ---Purpose : Inits commands for writing to STL and VRML formats
 
index bbd14045177b8e83ee784ce237eb3faeb1ce5066..1ed67803b151f525c16d7313e1c93562c08d5e95 100644 (file)
@@ -26,7 +26,6 @@
 #include <Quantity_HArray1OfColor.hxx>
 #include <StlAPI_Writer.hxx>
 #include <Draw_PluginMacro.hxx>
-#include <SWDRAW.hxx>
 #include <XSDRAW.hxx>
 #include <XSDRAWSTEP.hxx>
 #include <XSDRAWIGES.hxx>
@@ -71,6 +70,8 @@
 #include <TColStd_Array1OfReal.hxx>
 #include <Bnd_Box.hxx>
 
+#include <XSDRAWSTLVRML_ToVRML.hxx>
+
 // avoid warnings on 'extern "C"' functions returning C++ classes
 #ifdef WNT
 #pragma warning(4:4190)
@@ -979,6 +980,21 @@ static Standard_Integer mesh_edge_width( Draw_Interpretor& di,
   return 0;
 }
 
+//=======================================================================
+//function : tovrml
+//purpose  : 
+//=======================================================================
+
+static Standard_Integer tovrml(Draw_Interpretor& /*di*/, Standard_Integer n, const char** a)
+{
+  if (n < 3) return 1;
+  XSDRAWSTLVRML_ToVRML avrml;
+  TopoDS_Shape sh = DBRep::Get (a[1]);
+  const char* filename = a[2];
+  if (!avrml.Write (sh,filename)) return 1;
+  return 0;
+}
+
 //-----------------------------------------------------------------------------
 
 void  XSDRAWSTLVRML::InitCommands (Draw_Interpretor& theCommands)
@@ -987,6 +1003,7 @@ void  XSDRAWSTLVRML::InitCommands (Draw_Interpretor& theCommands)
   //XSDRAW::LoadDraw(theCommands);
 
   theCommands.Add ("writevrml", "shape file",__FILE__,writevrml,g);
+  theCommands.Add ("tovrml",    "shape file",__FILE__, tovrml, g);
   theCommands.Add ("writestl",  "shape file [ascii/binary (0/1) : 1 by default] [InParallel (0/1) : 0 by default]",__FILE__,writestl,g);
   theCommands.Add ("readstl",   "shape file",__FILE__,readstl,g);
   theCommands.Add ("loadvrml" , "shape file",__FILE__,loadvrml,g);
@@ -1019,7 +1036,6 @@ void XSDRAWSTLVRML::Factory(Draw_Interpretor& theDI)
   XSDRAWIGES::InitFromBRep(theDI);
   XSDRAWSTEP::InitCommands(theDI);
   XSDRAWSTLVRML::InitCommands(theDI);
-  SWDRAW::Init(theDI);
   XSDRAW::LoadDraw(theDI);
 #ifdef DEB
   theDI << "Draw Plugin : All TKXSDRAW commands are loaded" << "\n";
diff --git a/src/XSDRAWSTLVRML/XSDRAWSTLVRML_ToVRML.cdl b/src/XSDRAWSTLVRML/XSDRAWSTLVRML_ToVRML.cdl
new file mode 100644 (file)
index 0000000..3ff4a98
--- /dev/null
@@ -0,0 +1,80 @@
+-- Created on: 1998-08-03
+-- Created by: Christian CAILLET
+-- Copyright (c) 1998-1999 Matra Datavision
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
+--
+-- This file is part of Open CASCADE Technology software library.
+--
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
+--
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
+
+class ToVRML  from XSDRAWSTLVRML
+
+    ---Purpose : Writes a Shape to a File in VRML Format
+
+uses CString, OStream, AsciiString from TCollection, Shape from TopoDS
+
+is
+
+    Create returns ToVRML;
+
+    EmissiveColorRed   (me : in out) returns Real;
+    ---C++ : return &
+    EmissiveColorGreen (me : in out) returns Real;
+    ---C++ : return &
+    EmissiveColorBlue  (me : in out) returns Real;
+    ---C++ : return &
+    DiffuseColorRed    (me : in out) returns Real;
+    ---C++ : return &
+    DiffuseColorGreen  (me : in out) returns Real;
+    ---C++ : return &
+    DiffuseColorBlue   (me : in out) returns Real;
+    ---C++ : return &
+    Transparency       (me : in out) returns Real;
+    ---C++ : return &
+    AmbientIntensity   (me : in out) returns Real;
+    ---C++ : return &
+    SpecularColorRed   (me : in out) returns Real;
+    ---C++ : return &
+    SpecularColorGreen (me : in out) returns Real;
+    ---C++ : return &
+    SpecularColorBlue  (me : in out) returns Real;
+    ---C++ : return &
+    Shininess          (me : in out) returns Real;
+    ---C++ : return &
+    Texture            (me : in out) returns AsciiString;
+    ---C++ : return &
+    CreaseAngle        (me : in out) returns Real;
+    ---C++ : return &
+    Deflection         (me : in out) returns Real;
+    ---C++ : return &
+
+
+    Write (me; shape : Shape from TopoDS; filename : CString) returns Boolean;
+    ---Purpose : conversion of a Shape into VRML format for 3d visualisation
+
+fields
+
+  myEmissiveColorRed   : Real;  -- def 0.3
+  myEmissiveColorGreen : Real;  -- def 0.3
+  myEmissiveColorBlue  : Real;  -- def 0.3
+  myDiffuseColorRed    : Real;  -- def 0.3
+  myDiffuseColorGreen  : Real;  -- def 0.3
+  myDiffuseColorBlue   : Real;  -- def 0.5
+  myTransparency       : Real;  -- def 0.0
+  myAmbientIntensity   : Real;  -- def 0.3
+  mySpecularColorRed   : Real;  -- def 0.7
+  mySpecularColorGreen : Real;  -- def 0.7
+  mySpecularColorBlue  : Real;  -- def 0.8
+  myShininess          : Real;  -- def 0.1
+  myTexture            : AsciiString;  -- def " [] "
+  myCreaseAngle        : Real;  -- def 1.57
+  myDeflection         : Real;  -- def 0.005
+
+end ToVRML;
diff --git a/src/XSDRAWSTLVRML/XSDRAWSTLVRML_ToVRML.cxx b/src/XSDRAWSTLVRML/XSDRAWSTLVRML_ToVRML.cxx
new file mode 100644 (file)
index 0000000..b93d578
--- /dev/null
@@ -0,0 +1,188 @@
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <XSDRAWSTLVRML_ToVRML.ixx>
+
+#include <Standard_Stream.hxx>
+#include <BRepMesh_FastDiscret.hxx>
+#include <BRepMesh_Triangle.hxx>
+#include <BRepMesh_Edge.hxx>
+#include <Bnd_Box.hxx>
+#include <BRepBndLib.hxx>
+
+#include <gp_Pnt.hxx> //ied_modif_for_compil_Nov-20-1998
+
+XSDRAWSTLVRML_ToVRML::XSDRAWSTLVRML_ToVRML  ()
+{
+  myEmissiveColorRed   = 0.3;
+  myEmissiveColorGreen = 0.3;
+  myEmissiveColorBlue  = 0.3;
+  myDiffuseColorRed    = 0.3;
+  myDiffuseColorGreen  = 0.3;
+  myDiffuseColorBlue   = 0.5;
+  myTransparency       = 0.0;
+  myAmbientIntensity   = 0.3;
+  mySpecularColorRed   = 0.7;
+  mySpecularColorGreen = 0.7;
+  mySpecularColorBlue  = 0.8;
+  myShininess   = 0.1;
+  myTexture     = " [] " ;
+  myCreaseAngle = 1.57;
+  myDeflection  = 0.005;
+}
+
+Standard_Real&  XSDRAWSTLVRML_ToVRML::EmissiveColorRed  ()  {  return myEmissiveColorRed  ;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::EmissiveColorGreen()  {  return myEmissiveColorGreen;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::EmissiveColorBlue ()  {  return myEmissiveColorBlue ;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::DiffuseColorRed   ()  {  return myDiffuseColorRed   ;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::DiffuseColorGreen ()  {  return myDiffuseColorGreen ;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::DiffuseColorBlue  ()  {  return myDiffuseColorBlue  ;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::Transparency      ()  {  return myTransparency      ;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::AmbientIntensity  ()  {  return myAmbientIntensity  ;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::SpecularColorRed  ()  {  return mySpecularColorRed  ;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::SpecularColorGreen()  {  return mySpecularColorGreen;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::SpecularColorBlue ()  {  return mySpecularColorBlue ;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::Shininess  ()         {  return myShininess  ;  }
+TCollection_AsciiString&  XSDRAWSTLVRML_ToVRML::Texture ()  {  return myTexture    ;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::CreaseAngle()         {  return myCreaseAngle;  }
+Standard_Real&  XSDRAWSTLVRML_ToVRML::Deflection ()         {  return myDeflection ;  }
+
+//=======================================================================
+// function : ToVRML::Write
+// purpose  : conversion of a Shape into VRML format for 3d visualisation
+//=======================================================================
+
+Standard_Boolean  XSDRAWSTLVRML_ToVRML::Write
+  (const TopoDS_Shape& aShape, const Standard_CString filename) const
+{
+  filebuf thefile;
+  ostream TheFileOut(&thefile);
+
+  if (thefile.open(filename,ios::out))
+    {
+
+      // Creates facets from the shape
+//     Create (defle     : Real    from Standard;
+//             shape     : Shape   from TopoDS;
+//             angl      : Real    from Standard= 0.17;
+//             withShare : Boolean from Standard=Standard_True;
+//             inshape   : Boolean from Standard=Standard_False;
+//             relative  : Boolean from Standard=Standard_False;
+//             shapetrigu: Boolean from Standard=Standard_False)
+//         returns mutable Discret from BRepMesh;
+      Bnd_Box B;
+      BRepBndLib::Add(aShape, B);
+
+      Handle(BRepMesh_FastDiscret)     TheDiscret = 
+       new BRepMesh_FastDiscret(myDeflection,
+                            aShape,
+                             B,
+                            0.17,
+                            Standard_True,
+                            Standard_False,
+                            Standard_True,
+                            Standard_True);
+
+      Standard_Integer i,j;
+
+      // header of the VRML file
+      TheFileOut << "#VRML V2.0 utf8" << endl;
+      TheFileOut << "Group {" << endl;
+      TheFileOut << " children [ " << endl;
+      TheFileOut << " NavigationInfo {" << endl;
+      TheFileOut << "       type \"EXAMINE\" " << endl;
+      TheFileOut << " }," << endl;
+      TheFileOut << "Shape {" << endl;
+
+      TheFileOut << "   appearance Appearance {" << endl;
+      TheFileOut << "     texture ImageTexture {" << endl;
+      TheFileOut << "         url " << myTexture.ToCString() << endl;
+      TheFileOut << "         }" << endl;
+      TheFileOut << "     material Material { " << endl;
+      TheFileOut << "  diffuseColor " << myDiffuseColorRed << " " << myDiffuseColorGreen << " " << myDiffuseColorBlue << " " << endl;
+      TheFileOut << " emissiveColor " << myEmissiveColorRed << " "
+       << myEmissiveColorGreen << " " << myEmissiveColorBlue << " " << endl;
+      TheFileOut << " transparency " << myTransparency << endl;
+      TheFileOut << " ambientIntensity " << myAmbientIntensity << " " << endl;
+      TheFileOut << " specularColor " << mySpecularColorRed << " " << mySpecularColorGreen << " " << mySpecularColorBlue << " " << endl;
+      TheFileOut << " shininess " <<myShininess << " " << endl;
+      TheFileOut << "         }" << endl;
+      TheFileOut << "     }" << endl;
+
+      TheFileOut << "   geometry IndexedFaceSet {" << endl;
+      TheFileOut << "     coord Coordinate {" << endl;
+      TheFileOut << "       point [" << endl;
+      
+      // puts the coordinates of all the vertices using the order
+      // given during the discretisation
+      for (i=1;i<=TheDiscret->NbVertices();i++)
+       {
+         gp_Pnt TheVertex=TheDiscret->Pnt(i);
+         TheFileOut << "          " 
+           <<  TheVertex.Coord().X() << " " 
+             << TheVertex.Coord().Y() <<  " " 
+               << TheVertex.Coord().Z() << "," << endl;
+       }
+      TheFileOut << "       ]" << endl;
+      TheFileOut << "     }" << endl;
+      
+      TheFileOut << "     coordIndex [" << endl;
+      
+      // retrieves all the triangles in order to draw the facets
+      for (j=1; j <= TheDiscret->NbTriangles(); j++)
+       {
+         BRepMesh_Triangle TheTri=TheDiscret->Triangle(j);
+         Standard_Integer e1,e2,e3,i1,i2,i3;
+         Standard_Boolean b1,b2,b3;
+         
+         TheTri.Edges(e1,e2,e3,b1,b2,b3);
+         
+         if (b1)
+           {
+             i1 = TheDiscret->Edge(e1).FirstNode()-1;
+             i2 = TheDiscret->Edge(e1).LastNode()-1;
+           }
+         else
+           {
+             i2 = TheDiscret->Edge(e1).FirstNode()-1;
+             i1 = TheDiscret->Edge(e1).LastNode()-1;
+           }
+
+         if (b2)
+           {
+             i3 = TheDiscret->Edge(e2).LastNode()-1;
+           }
+         else
+           {
+             i3 = TheDiscret->Edge(e2).FirstNode()-1;
+           }
+         
+         TheFileOut << "          " << i1  << ", " << i2 << ", "  << i3  << ", -1, " << endl;
+       }
+      
+      TheFileOut << "          ]" << endl;
+      TheFileOut << "     solid FALSE" << endl;      // it is not a closed solid
+      TheFileOut << " creaseAngle " << myCreaseAngle << " " << endl; // for smooth shading
+      TheFileOut << "     }" << endl;
+      TheFileOut << "   }" << endl;
+         TheFileOut << " ]" << endl;
+         TheFileOut << "} " << endl;
+      
+    }
+  else return Standard_False;  // failure when opening file
+
+  thefile.close();
+
+  return Standard_True;
+}
+
index 3d7d8e1ce3220a6de8160da51095b8a837bea197..41d89bdaf6ce073a7a3feb4063b9e3c0d5ecfda6 100755 (executable)
@@ -1,9 +1,5 @@
-if { [array get Draw_Groups "TOPOLOGY Check commands"] == "" } {
-    pload TOPTEST
-}
-if { [array get Draw_Groups "Shape Healing"] == "" } {
-    pload XSDRAW
-}
+pload TOPTEST
+
 # To prevent loops limit to 5 minutes
 cpulimit 300
 
index 7f98a27f4c382de9e5c68b2a5c8177d3ab892efd..95df05b4368f274a3f4296541c725461d7da49c9 100644 (file)
@@ -1,6 +1,5 @@
 set env(CSF_dataDefaults) [file dirname [info script]]/../data
 puts $env(CSF_dataDefaults)
-xtrace 3
 DT_ApplySeq result a data data1
 set b [explode a f]
 set b1 [explode result f]