DataExchangeDemo.tcl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Copyright (c) 1999-2014 OPEN CASCADE SAS
  2. #
  3. #Category: Demos
  4. #Title: Import and export
  5. #
  6. # This file is part of Open CASCADE Technology software library.
  7. #
  8. # This library is free software; you can redistribute it and / or modify it
  9. # under the terms of the GNU Lesser General Public version 2.1 as published
  10. # by the Free Software Foundation, with special exception defined in the file
  11. # OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
  12. # distribution for complete text of the license and disclaimer of any warranty.
  13. #
  14. # Alternatively, this file may be used under the terms of Open CASCADE
  15. # commercial license or contractual agreement.
  16. # Command to log a message to both command-line and dialog window
  17. proc sage { a} {
  18. if { ![winfo exists .h ] } {
  19. toplevel .h -bg azure3
  20. wm title .h "INFO TEST HARNESS"
  21. wm geometry .h +320+20
  22. }
  23. if { [winfo exists .h.m ] } {
  24. set astring [.h.m cget -text]
  25. set newstring "${astring} \n $a"
  26. .h.m configure -text $newstring
  27. puts $a
  28. } else {
  29. message .h.m -justify left -bg azure2 -width 13c -relief ridge -bd 4 -text $a
  30. puts $a
  31. }
  32. pack .h.m
  33. update
  34. }
  35. pload DATAEXCHANGE
  36. smallview
  37. if { [winfo exists .h ] } {
  38. destroy .h
  39. }
  40. set ddir .
  41. if { [info exists env(CSF_OCCTDataPath)] } {
  42. set ddir [file join $env(CSF_OCCTDataPath) occ]
  43. } elseif { [info exists env(CASROOT)] } {
  44. set ddir [file join $env(CASROOT) data occ]
  45. }
  46. set tdir .
  47. if { [info exist env(TEMP)] } {
  48. set tdir $env(TEMP)
  49. }
  50. sage " First, we retrieve a BREP File "
  51. sage " restore $ddir/wing.brep wing"
  52. sage " "
  53. datadir .
  54. restore $ddir/wing.brep wing
  55. disp wing
  56. fit
  57. sage "Generate the IGES File of this BREP"
  58. sage " brepiges wing $tdir/wing.igs"
  59. sage " "
  60. brepiges wing $tdir/wing.igs
  61. wait 3
  62. sage "we delete all DRAW data"
  63. sage ""
  64. dall
  65. fit
  66. wait 3
  67. sage "Restore this IGES File we have created "
  68. sage " igesbrep $tdir/wing.igs new *"
  69. sage ""
  70. igesbrep $tdir/wing.igs new *
  71. disp new
  72. fit
  73. puts "End IGES Elementary Test "
  74. sage " "
  75. file delete $tdir/wing.igs