occt-gltf-addon-linux-x64 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/LICENSE_LGPL_21.txt +502 -0
  2. package/OCCT_LGPL_EXCEPTION.txt +10 -0
  3. package/README.md +2 -2
  4. package/index.js +63 -1
  5. package/lib/libTKBO.so.8.0.0 +0 -0
  6. package/lib/libTKBRep.so.8.0.0 +0 -0
  7. package/lib/libTKBin.so.8.0.0 +0 -0
  8. package/lib/libTKBinL.so.8.0.0 +0 -0
  9. package/lib/libTKBinTObj.so.8.0.0 +0 -0
  10. package/lib/libTKBinXCAF.so.8.0.0 +0 -0
  11. package/lib/libTKBool.so.8.0.0 +0 -0
  12. package/lib/libTKCAF.so.8.0.0 +0 -0
  13. package/lib/libTKCDF.so.8.0.0 +0 -0
  14. package/lib/libTKDE.so.8.0.0 +0 -0
  15. package/lib/libTKDECascade.so.8.0.0 +0 -0
  16. package/lib/libTKDEIGES.so.8.0.0 +0 -0
  17. package/lib/libTKDEOBJ.so.8.0.0 +0 -0
  18. package/lib/libTKDEPLY.so.8.0.0 +0 -0
  19. package/lib/libTKDESTEP.so.8.0.0 +0 -0
  20. package/lib/libTKDESTL.so.8.0.0 +0 -0
  21. package/lib/libTKDEVRML.so.8.0.0 +0 -0
  22. package/lib/libTKExpress.so.8.0.0 +0 -0
  23. package/lib/libTKFeat.so.8.0.0 +0 -0
  24. package/lib/libTKFillet.so.8.0.0 +0 -0
  25. package/lib/libTKG2d.so.8.0.0 +0 -0
  26. package/lib/libTKG3d.so.8.0.0 +0 -0
  27. package/lib/libTKGeomAlgo.so.8.0.0 +0 -0
  28. package/lib/libTKGeomBase.so.8.0.0 +0 -0
  29. package/lib/libTKHLR.so.8.0.0 +0 -0
  30. package/lib/libTKHelix.so.8.0.0 +0 -0
  31. package/lib/libTKLCAF.so.8.0.0 +0 -0
  32. package/lib/libTKMath.so.8.0.0 +0 -0
  33. package/lib/libTKMesh.so.8.0.0 +0 -0
  34. package/lib/libTKOffset.so.8.0.0 +0 -0
  35. package/lib/libTKPrim.so.8.0.0 +0 -0
  36. package/lib/libTKRWMesh.so.8.0.0 +0 -0
  37. package/lib/libTKService.so.8.0.0 +0 -0
  38. package/lib/libTKShHealing.so.8.0.0 +0 -0
  39. package/lib/libTKStd.so.8.0.0 +0 -0
  40. package/lib/libTKStdL.so.8.0.0 +0 -0
  41. package/lib/libTKTObj.so.8.0.0 +0 -0
  42. package/lib/libTKTopAlgo.so.8.0.0 +0 -0
  43. package/lib/libTKV3d.so.8.0.0 +0 -0
  44. package/lib/libTKVCAF.so.8.0.0 +0 -0
  45. package/lib/libTKXCAF.so.8.0.0 +0 -0
  46. package/lib/libTKXMesh.so.8.0.0 +0 -0
  47. package/lib/libTKXSBase.so.8.0.0 +0 -0
  48. package/lib/libTKXml.so.8.0.0 +0 -0
  49. package/lib/libTKXmlL.so.8.0.0 +0 -0
  50. package/lib/libTKXmlTObj.so.8.0.0 +0 -0
  51. package/lib/libTKXmlXCAF.so.8.0.0 +0 -0
  52. package/lib/libTKernel.so.8.0.0 +0 -0
  53. package/lib/libdraco.so.1 +0 -0
  54. package/lib/libtbb.so.2 +0 -0
  55. package/lib/libtbbmalloc.so.2 +0 -0
  56. package/lib/libtbbmalloc_proxy.so.2 +0 -0
  57. package/occt_gltf_addon.node +0 -0
  58. package/package.json +6 -2
  59. package/resources/BOPAlgo/BOPAlgo.msg +129 -0
  60. package/resources/BOPAlgo/FILES +1 -0
  61. package/resources/DrawResources/CURVES.tcl +38 -0
  62. package/resources/DrawResources/CheckCommands.tcl +1206 -0
  63. package/resources/DrawResources/DrawDefault +130 -0
  64. package/resources/DrawResources/DrawPlugin +64 -0
  65. package/resources/DrawResources/DrawTK.tcl +623 -0
  66. package/resources/DrawResources/FILES +16 -0
  67. package/resources/DrawResources/Geometry.tcl +96 -0
  68. package/resources/DrawResources/InitEnvironment.tcl +50 -0
  69. package/resources/DrawResources/Move.tcl +85 -0
  70. package/resources/DrawResources/OCC_logo.png +0 -0
  71. package/resources/DrawResources/PROFIL.tcl +726 -0
  72. package/resources/DrawResources/SCAN.tcl +192 -0
  73. package/resources/DrawResources/SURFACES.tcl +35 -0
  74. package/resources/DrawResources/StandardCommands.tcl +451 -0
  75. package/resources/DrawResources/StandardViews.tcl +284 -0
  76. package/resources/DrawResources/TKTopTest.tcl +27 -0
  77. package/resources/DrawResources/TestCommands.tcl +2969 -0
  78. package/resources/DrawResources/Vector.tcl +402 -0
  79. package/resources/DrawResources/dfb_attribns.gif +0 -0
  80. package/resources/DrawResources/dfb_attribute.gif +0 -0
  81. package/resources/DrawResources/dfb_folder.gif +0 -0
  82. package/resources/DrawResources/dftree.tcl +381 -0
  83. package/resources/DrawResources/lamp.ico +0 -0
  84. package/resources/SHMessage/FILES +2 -0
  85. package/resources/SHMessage/SHAPE.fr +267 -0
  86. package/resources/SHMessage/SHAPE.us +267 -0
  87. package/resources/Shaders/Declarations.glsl +276 -0
  88. package/resources/Shaders/DeclarationsImpl.glsl +121 -0
  89. package/resources/Shaders/Display.fs +157 -0
  90. package/resources/Shaders/FILES +27 -0
  91. package/resources/Shaders/LightShadow.glsl +48 -0
  92. package/resources/Shaders/PBRCookTorrance.glsl +20 -0
  93. package/resources/Shaders/PBRDirectionalLight.glsl +20 -0
  94. package/resources/Shaders/PBRDistribution.glsl +9 -0
  95. package/resources/Shaders/PBREnvBaking.fs +226 -0
  96. package/resources/Shaders/PBREnvBaking.vs +55 -0
  97. package/resources/Shaders/PBRFresnel.glsl +36 -0
  98. package/resources/Shaders/PBRGeometry.glsl +13 -0
  99. package/resources/Shaders/PBRIllumination.glsl +28 -0
  100. package/resources/Shaders/PBRPointLight.glsl +27 -0
  101. package/resources/Shaders/PBRSpotLight.glsl +45 -0
  102. package/resources/Shaders/PathtraceBase.fs +993 -0
  103. package/resources/Shaders/PhongDirectionalLight.glsl +29 -0
  104. package/resources/Shaders/PhongPointLight.glsl +36 -0
  105. package/resources/Shaders/PhongShading.fs +191 -0
  106. package/resources/Shaders/PhongShading.vs +43 -0
  107. package/resources/Shaders/PhongSpotLight.glsl +52 -0
  108. package/resources/Shaders/PointLightAttenuation.glsl +35 -0
  109. package/resources/Shaders/RaytraceBase.fs +1236 -0
  110. package/resources/Shaders/RaytraceBase.vs +12 -0
  111. package/resources/Shaders/RaytraceRender.fs +134 -0
  112. package/resources/Shaders/RaytraceSmooth.fs +80 -0
  113. package/resources/Shaders/SkydomBackground.fs +300 -0
  114. package/resources/Shaders/TangentSpaceNormal.glsl +17 -0
  115. package/resources/StdResource/FILES +6 -0
  116. package/resources/StdResource/MigrationSheet.txt +21 -0
  117. package/resources/StdResource/Plugin +52 -0
  118. package/resources/StdResource/Standard +25 -0
  119. package/resources/StdResource/StandardLite +22 -0
  120. package/resources/StdResource/TObj +17 -0
  121. package/resources/StdResource/XCAF +50 -0
  122. package/resources/TObj/FILES +1 -0
  123. package/resources/TObj/TObj.msg +85 -0
  124. package/resources/Textures/1d_elevation.rgb +0 -0
  125. package/resources/Textures/2d_MatraDatavision.rgb +0 -0
  126. package/resources/Textures/2d_alienskin.rgb +0 -0
  127. package/resources/Textures/2d_aluminum.rgb +0 -0
  128. package/resources/Textures/2d_blue_rock.rgb +0 -0
  129. package/resources/Textures/2d_bluewhite_paper.rgb +0 -0
  130. package/resources/Textures/2d_brushed.rgb +0 -0
  131. package/resources/Textures/2d_bubbles.rgb +0 -0
  132. package/resources/Textures/2d_bumps.rgb +0 -0
  133. package/resources/Textures/2d_cast.rgb +0 -0
  134. package/resources/Textures/2d_chess.rgba +0 -0
  135. package/resources/Textures/2d_chipbd.rgb +0 -0
  136. package/resources/Textures/2d_clouds.rgb +0 -0
  137. package/resources/Textures/2d_flesh.rgb +0 -0
  138. package/resources/Textures/2d_floor.rgb +0 -0
  139. package/resources/Textures/2d_galvnisd.rgb +0 -0
  140. package/resources/Textures/2d_grass.rgb +0 -0
  141. package/resources/Textures/2d_knurl.rgb +0 -0
  142. package/resources/Textures/2d_maple.rgb +0 -0
  143. package/resources/Textures/2d_marble.rgb +0 -0
  144. package/resources/Textures/2d_mottled.rgb +0 -0
  145. package/resources/Textures/2d_rain.rgb +0 -0
  146. package/resources/Textures/2d_rock.rgb +0 -0
  147. package/resources/Textures/FILES +31 -0
  148. package/resources/Textures/env_clouds.rgb +0 -0
  149. package/resources/Textures/env_cv.rgb +0 -0
  150. package/resources/Textures/env_lines.rgb +0 -0
  151. package/resources/Textures/env_medit.rgb +0 -0
  152. package/resources/Textures/env_pearl.rgb +0 -0
  153. package/resources/Textures/env_road.rgb +0 -0
  154. package/resources/Textures/env_sky1.rgb +0 -0
  155. package/resources/Textures/env_sky2.rgb +0 -0
  156. package/resources/UnitsAPI/CurrentUnits +74 -0
  157. package/resources/UnitsAPI/FILES +4 -0
  158. package/resources/UnitsAPI/MDTVBaseUnits +70 -0
  159. package/resources/UnitsAPI/MDTVCurrentUnits +74 -0
  160. package/resources/UnitsAPI/Units.dat +481 -0
  161. package/resources/XRResources/FILES +10 -0
  162. package/resources/XRResources/occtvr_actions.json +225 -0
  163. package/resources/XRResources/occtvr_bindings_generic.json +87 -0
  164. package/resources/XRResources/occtvr_bindings_holographic_hmd.json +18 -0
  165. package/resources/XRResources/occtvr_bindings_index_hmd.json +18 -0
  166. package/resources/XRResources/occtvr_bindings_rift.json +18 -0
  167. package/resources/XRResources/occtvr_bindings_touch.json +160 -0
  168. package/resources/XRResources/occtvr_bindings_vive.json +18 -0
  169. package/resources/XRResources/occtvr_bindings_vive_controller.json +139 -0
  170. package/resources/XRResources/occtvr_bindings_vive_cosmos.json +18 -0
  171. package/resources/XRResources/occtvr_bindings_vive_pro.json +18 -0
  172. package/resources/XSMessage/FILES +2 -0
  173. package/resources/XSMessage/XSTEP.fr +1026 -0
  174. package/resources/XSMessage/XSTEP.us +1023 -0
  175. package/resources/XSTEPResource/FILES +2 -0
  176. package/resources/XSTEPResource/IGES +65 -0
  177. package/resources/XSTEPResource/STEP +68 -0
  178. package/resources/XmlOcafResource/FILES +11 -0
  179. package/resources/XmlOcafResource/XmlOcaf.xsd +131 -0
  180. package/resources/XmlOcafResource/XmlOcaf_SmallTypes.xsd +217 -0
  181. package/resources/XmlOcafResource/XmlOcaf_TDF.xsd +33 -0
  182. package/resources/XmlOcafResource/XmlOcaf_TDataStd.xsd +230 -0
  183. package/resources/XmlOcafResource/XmlOcaf_TDataStd_Name.xsd +37 -0
  184. package/resources/XmlOcafResource/XmlOcaf_TDocStd.xsd +37 -0
  185. package/resources/XmlOcafResource/XmlOcaf_TFunction.xsd +38 -0
  186. package/resources/XmlOcafResource/XmlOcaf_TNaming.xsd +128 -0
  187. package/resources/XmlOcafResource/XmlOcaf_TNaming_NamedShape.xsd +97 -0
  188. package/resources/XmlOcafResource/XmlOcaf_TPrsStd.xsd +42 -0
  189. package/resources/XmlOcafResource/XmlXcaf.xsd +109 -0
  190. package/resources/samples/tcl/ANC101.tcl +282 -0
  191. package/resources/samples/tcl/DataExchangeDemo.tcl +85 -0
  192. package/resources/samples/tcl/MBBGehauseRohteil.tcl +268 -0
  193. package/resources/samples/tcl/ModelingDemo.tcl +120 -0
  194. package/resources/samples/tcl/Penrose.tcl +87 -0
  195. package/resources/samples/tcl/Readme.txt +4 -0
  196. package/resources/samples/tcl/VisualizationDemo.tcl +162 -0
  197. package/resources/samples/tcl/bottle.tcl +115 -0
  198. package/resources/samples/tcl/cad.tcl +63 -0
  199. package/resources/samples/tcl/cpu.tcl +327 -0
  200. package/resources/samples/tcl/cutter.tcl +91 -0
  201. package/resources/samples/tcl/dimensions.tcl +83 -0
  202. package/resources/samples/tcl/drill.tcl +147 -0
  203. package/resources/samples/tcl/logo2019.tcl +89 -0
  204. package/resources/samples/tcl/markers.tcl +76 -0
  205. package/resources/samples/tcl/materials.tcl +75 -0
  206. package/resources/samples/tcl/pathtrace_ball.tcl +79 -0
  207. package/resources/samples/tcl/pathtrace_cube.tcl +85 -0
  208. package/resources/samples/tcl/pathtrace_materials.tcl +229 -0
  209. package/resources/samples/tcl/pencil.tcl +64 -0
  210. package/resources/samples/tcl/raytrace.tcl +44 -0
  211. package/resources/samples/tcl/snowflake.tcl +161 -0
  212. package/resources/samples/tcl/spheres.tcl +148 -0
  213. package/resources/samples/tcl/vis_pbr_spheres.tcl +94 -0
  214. package/resources/samples/tcl/xde.tcl +47 -0
@@ -0,0 +1,623 @@
1
+ # Copyright (c) 1999-2014 OPEN CASCADE SAS
2
+ #
3
+ # This file is part of Open CASCADE Technology software library.
4
+ #
5
+ # This library is free software; you can redistribute it and/or modify it under
6
+ # the terms of the GNU Lesser General Public License version 2.1 as published
7
+ # by the Free Software Foundation, with special exception defined in the file
8
+ # OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9
+ # distribution for complete text of the license and disclaimer of any warranty.
10
+ #
11
+ # Alternatively, this file may be used under the terms of Open CASCADE
12
+ # commercial license or contractual agreement.
13
+
14
+ #
15
+ # TK features for Draw
16
+ #
17
+
18
+ # reload bindings
19
+ if { [info exists tk_library] } {
20
+ set version [split [info tclversion] "."]
21
+ set major [lindex ${version} 0]
22
+ set minor [lindex ${version} 1]
23
+ if { (${major} > 8) || (${major} >= 8 && ${minor} >= 4) } {
24
+ #source $tk_library/tk.tcl
25
+ } else {
26
+ source $tk_library/tk.tcl
27
+ }
28
+ }
29
+
30
+ #fills menu "Load" with submenus
31
+ proc fillloadmenu {} {
32
+ set drawplugpath ""
33
+ if {[array names ::env CSF_OCCTResourcePath] != "" && "$::env(CSF_OCCTResourcePath)" != "" && [file exists $::env(CSF_OCCTResourcePath)/DrawResources/DrawPlugin]} {
34
+ set drawplugpath "$::env(CSF_OCCTResourcePath)/DrawResources/DrawPlugin"
35
+ } elseif {[array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/src/DrawResources/DrawPlugin]} {
36
+ set drawplugpath "$::env(CASROOT)/src/DrawResources/DrawPlugin"
37
+ }
38
+
39
+ set chan [open [file nativename $drawplugpath]]
40
+ while {[gets $chan line] >= 0} {
41
+ if {[lindex [split $line ""] 0] != "!"} {
42
+ if {[lindex [split $line ""] 0] == ""} {continue}
43
+ set plugname [lindex [split $line " "] 0]
44
+ addmenu Load "pload $plugname" "pload $plugname"
45
+ }
46
+ }
47
+ close $chan
48
+ }
49
+
50
+ wm geometry . +10+10
51
+ bind . <F1> {vcommands}
52
+
53
+ frame .mbar -relief raised -bd 2
54
+ pack .mbar -side top -fill x
55
+ focus .mbar
56
+
57
+ set theMenus("") ""
58
+ set Draw_MenuIndex 0
59
+
60
+ proc addmenuitem {menu options} {
61
+
62
+ global theMenus Draw_MenuIndex
63
+ if {![info exists theMenus($menu)]} {
64
+ incr Draw_MenuIndex
65
+ set m .mbar.m$Draw_MenuIndex.menu
66
+ menubutton .mbar.m$Draw_MenuIndex -text $menu -menu $m
67
+ pack .mbar.m$Draw_MenuIndex -side left
68
+ menu $m
69
+ set theMenus($menu) $m
70
+ } else {set m $theMenus($menu)}
71
+
72
+ eval $m add $options
73
+ }
74
+
75
+ proc addmenu {menu submenu {command ""}} {
76
+ if {$command == ""} {set command $submenu}
77
+ addmenuitem $menu "command -label {$submenu} -command {$command}"
78
+ }
79
+
80
+ #################################
81
+ # Menus definition
82
+ #################################
83
+
84
+ # the file menu
85
+
86
+ addmenu File "Choose Data Directory" vdatadir
87
+ addmenu File "Load Shape (restore)" vrestore
88
+ addmenu File "Load Script (source)" vsource
89
+ addmenu File Exit exit
90
+
91
+ # the Load menu
92
+ fillloadmenu
93
+
94
+ # the view menu
95
+
96
+ source [file join $dir Move.tcl]
97
+
98
+ addmenuitem Views {checkbutton -label "Extended view commands" \
99
+ -command ShowHideExtCommands -variable ShowExtCommands -onvalue 1 -offvalue 0}
100
+ addmenuitem Views "separator"
101
+ addmenu Views axo {smallview AXON}
102
+ addmenu Views top {smallview +X+Y}
103
+ addmenu Views front {smallview +X+Z}
104
+ addmenu Views left {smallview +Y+Z}
105
+ addmenu Views 2d {smallview -2D-}
106
+ addmenuitem Views "separator"
107
+ addmenu Views mu4
108
+ addmenu Views av2d
109
+ addmenu Views axo
110
+ addmenu Views pers
111
+
112
+ # the display menu
113
+
114
+ addmenu Display fit "fit; repaint"
115
+ addmenu Display 2dfit "2dfit; repaint"
116
+ addmenu Display clear
117
+ addmenu Display 2dclear
118
+
119
+ # the samples menu
120
+ addmenu Samples "View samples" vsample
121
+
122
+ # the help menu
123
+
124
+ addmenu Help "System Info" sysinfo
125
+ addmenu Help Commands vcommands
126
+ addmenu Help About about
127
+ addmenu Help "User Guide" openuserguide
128
+
129
+ #redraw help submenu in the end of menu
130
+ proc redrawhelp {} {
131
+ global theMenus
132
+ set m $theMenus(Help)
133
+ destroy [string trimright $m ".menu"]
134
+ if [info exists theMenus(Help)] {unset theMenus(Help)}
135
+ addmenu Help "System Info" sysinfo
136
+ addmenu Help Commands vcommands
137
+ addmenu Help About about
138
+ addmenu Help "User Guide" openuserguide
139
+ }
140
+
141
+ #################################
142
+ # Modal dialog box
143
+ # add OK, help, cancel buttons
144
+ #################################
145
+
146
+ proc modaldialog {box okproc {helpproc ""} {cancelproc ""}} {
147
+ wm geometry $box +10+60
148
+ button $box.ok -text ok -command "$okproc ; destroy $box"
149
+ pack $box.ok -side left
150
+ button $box.ko -text Cancel -command "$cancelproc ; destroy $box"
151
+ pack $box.ko -side right
152
+ if {$helpproc != ""} {
153
+ button $box.help -text Help -command $helpproc
154
+ pack $box.help -side right
155
+ }
156
+ grab set $box
157
+ }
158
+
159
+
160
+ #################################
161
+ # File menu procedures
162
+ #################################
163
+
164
+ ##############################
165
+ #
166
+ # dialbox command arg1 val1 arg2 val2 ...
167
+ #
168
+ ##############################
169
+
170
+ proc dialbox args {
171
+ set com [lindex $args 0]
172
+
173
+ toplevel .d
174
+ wm title .d $com
175
+
176
+ # com will be the command
177
+ set com "eval $com"
178
+
179
+ # create entries for the arguments
180
+ set n [llength $args]
181
+
182
+ for {set i 1} {$i < $n} {incr i 2} {
183
+
184
+ frame .d.a$i
185
+ label .d.a$i.l -text [lindex $args $i]
186
+ entry .d.a$i.e -relief sunken
187
+ .d.a$i.e insert end [lindex $args [expr $i+1]]
188
+ pack .d.a$i.l -side left
189
+ pack .d.a$i.e -side right
190
+ pack .d.a$i -side top -fill x
191
+
192
+ append com { [} ".d.a$i.e get" {]}
193
+ }
194
+ append com ";repaint"
195
+
196
+ modaldialog .d $com "help [lindex $args 0]"
197
+ }
198
+ proc sdatadir {d} {
199
+ global Draw_DataDir
200
+ set Draw_DataDir $d
201
+ }
202
+
203
+ proc vdatadir {} {
204
+ global Draw_DataDir
205
+ sdatadir [tk_chooseDirectory -title "Data Directory" -initialdir $Draw_DataDir]
206
+ }
207
+
208
+ proc rresto {f} {
209
+ if {[file exists $f]} {
210
+ if {! [file isdirectory $f]} {
211
+ puts "restore $f [file tail $f]"
212
+ uplevel \#0 "restore $f [file tail $f]"
213
+ repaint
214
+ }
215
+ }
216
+ }
217
+
218
+ proc vrestore {} {
219
+ global Draw_DataDir
220
+ rresto [tk_getOpenFile -title "Load Shape (restore)" -filetypes {{{BREP} {.brep}}} -initialdir $Draw_DataDir]
221
+ }
222
+
223
+
224
+ proc ssour {f} {
225
+ global Draw_Source
226
+ if {[file exists $f]} {
227
+ set Draw_Source $f
228
+ if {! [file isdirectory $f]} {
229
+ puts "source $f [file tail $f]"
230
+ uplevel \#0 "source $f"
231
+ }
232
+ }
233
+ }
234
+
235
+ set Draw_Source [pwd]
236
+ proc vsource {} {
237
+ global Draw_Source
238
+ ssour [tk_getOpenFile -title "Load Script (source)" -filetypes {{{All Files} *}} -initialdir Draw_Source]
239
+ }
240
+
241
+ #Creates a "Samples" window
242
+ proc vsamples {} {
243
+ #create list {{category} {title} {filename}}
244
+ set alistofthree ""
245
+
246
+ set samplespath ""
247
+ if { [array names ::env CSF_OCCTSamplesPath] != "" && "$::env(CSF_OCCTSamplesPath)" != "" && [file exists $::env(CSF_OCCTSamplesPath)/tcl/]} {
248
+ set samplespath "$::env(CSF_OCCTSamplesPath)/tcl/"
249
+ } elseif { [array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/samples/tcl/]} {
250
+ set samplespath "$::env(CASROOT)/samples/tcl/"
251
+ }
252
+
253
+ foreach fname [glob -path "${samplespath}" *.tcl] {
254
+
255
+ set chan [open $fname]
256
+ set istitlefound 0
257
+ while {[gets $chan line] >= 0} {
258
+ if {[lindex [split $line " "] 0] == "#Category:"} {
259
+ set acategory [string trim [string trimleft $line "#Category: "]]
260
+ }
261
+ if {[lindex [split $line " "] 0] == "#Title:"} {
262
+ set atitle [string trim [string trimleft $line "#Title: "]]
263
+ lappend alistofthree $acategory $atitle $fname
264
+ incr istitlefound
265
+ break
266
+ }
267
+ }
268
+ close $chan
269
+ if {$istitlefound == 0} {
270
+ lappend alistofthree Other "[lindex [split $fname \\] end]" $fname
271
+ }
272
+ }
273
+ #create window
274
+ toplevel .samples
275
+ wm title .samples "Samples"
276
+ wm geometry .samples +0+0
277
+ wm minsize .samples 800 600
278
+ frame .samples.right
279
+ frame .samples.left
280
+ frame .samples.right.textframe
281
+ frame .samples.right.botframe
282
+ ttk::treeview .samples.left.tree -selectmode browse -yscrollcommand {.samples.left.treescroll set}
283
+ pack .samples.left.tree -fill both -expand 1 -side left
284
+ .samples.left.tree column #0 -minwidth 200
285
+ .samples.left.tree heading #0 -text "Samples"
286
+ pack .samples.right -side right -fill both -expand 1 -padx 10 -pady 10
287
+ pack .samples.left -side left -padx 10 -pady 10 -fill both
288
+ pack .samples.right.textframe -side top -fill both -expand 1
289
+ pack .samples.right.botframe -side bottom -fill both -expand 1
290
+ text .samples.right.textframe.text -yscrollcommand {.samples.right.textframe.scroll set} -xscrollcommand {.samples.right.botframe.scrollx set} -wrap none -width 40 -height 32
291
+ pack .samples.right.textframe.text -fill both -side left -expand 1
292
+ .samples.right.textframe.text delete 0.0 end
293
+ .samples.right.textframe.text configure -state disabled
294
+ set i 1
295
+ foreach {acat title fnam} $alistofthree {
296
+ if [.samples.left.tree exists $acat] {
297
+ .samples.left.tree insert $acat end -id $title -text $title -tags "selected$i"
298
+ .samples.left.tree tag bind selected$i <1> "fillsampletext {$fnam}"
299
+ incr i
300
+ continue
301
+ } else {
302
+ .samples.left.tree insert {} end -id $acat -text $acat
303
+ .samples.left.tree insert $acat end -id $title -text $title -tags "selected$i"
304
+ .samples.left.tree tag bind selected$i <1> "fillsampletext {$fnam}"
305
+ incr i
306
+ }
307
+ }
308
+ scrollbar .samples.right.textframe.scroll -command {.samples.right.textframe.text yview}
309
+ scrollbar .samples.left.treescroll -command {.samples.left.tree yview}
310
+ scrollbar .samples.right.botframe.scrollx -command {.samples.right.textframe.text xview} -orient horizontal
311
+ pack .samples.right.textframe.scroll -side right -fill y
312
+ pack .samples.right.botframe.scrollx -side top -fill x
313
+ pack .samples.left.treescroll -side right -fill y
314
+ button .samples.right.botframe.button -text "Run sample" -state disabled
315
+ pack .samples.right.botframe.button -fill none -pady 10
316
+ }
317
+
318
+ #Fills the textbox in "Samples" window
319
+ proc fillsampletext {fname} {
320
+ .samples.right.botframe.button configure -state normal -command "lower .samples;catch {vclose ALL};catch {vremove -all}; catch {vclear}; source {$fname}"
321
+ .samples.right.textframe.text configure -state normal
322
+ .samples.right.textframe.text delete 0.0 end
323
+ set chan [open "$fname"]
324
+ while {[gets $chan line] >= 0} {
325
+ .samples.right.textframe.text insert end "$line\n"
326
+ }
327
+ close $chan
328
+ .samples.right.textframe.text configure -state disabled
329
+ }
330
+
331
+ #Creates a "Commands help" window
332
+ proc vcommands {} {
333
+ global Draw_Groups Find_Button_Click_Count Entry_Cache
334
+ set Find_Button_Click_Count 0
335
+ set Entry_Cache ""
336
+ toplevel .commands
337
+ focus .commands
338
+ wm minsize .commands 800 600
339
+ wm title .commands "Commands help"
340
+ wm geometry .commands +0+0
341
+ frame .commands.t
342
+ frame .commands.left
343
+ ttk::treeview .commands.left.tree -selectmode browse -yscrollcommand {.commands.left.treescroll set}
344
+ .commands.left.tree column #0 -width 300
345
+ .commands.left.tree heading #0 -text "Help treeview"
346
+ pack .commands.left.tree -expand 1 -fill both -side left
347
+ pack .commands.t -side right -fill both -expand 1 -padx 10 -pady 10
348
+ pack .commands.left -side left -fill both -padx 10 -pady 10
349
+ pack [frame .commands.t.top] -side top -fill x -padx 10 -pady 10
350
+ text .commands.t.text -yscrollcommand {.commands.t.scroll set} -width 40
351
+ .commands.t.text delete 0.0 end
352
+ pack .commands.t.text -fill both -side left -expand 1
353
+ .commands.t.text configure -state disabled
354
+ pack [entry .commands.t.top.e -width 20] -side left
355
+ pack [button .commands.t.top.findcom -text "Find command" -command vhelpsearch] -side left -padx 10
356
+ pack [button .commands.t.top.textfind -text "Find in text" -command "vhelptextsearch; incr Find_Button_Click_Count"] -side left
357
+ set i 1
358
+ set j 100
359
+ set newgroupinx 0
360
+ foreach h [lsort [array names Draw_Groups]] {
361
+ .commands.left.tree insert {} end -id $i -text $h -tags "info$i"
362
+ .commands.left.tree tag bind info$i <1> "vcomhelp {$h}"
363
+ set newgroupinx $j
364
+ foreach f [lsort $Draw_Groups($h)] {
365
+ .commands.left.tree insert $i end -id $j -text $f -tags "selected$j"
366
+ .commands.left.tree tag bind selected$j <1> "vcomhelp {$h} $j $newgroupinx"
367
+ incr j
368
+ }
369
+ incr i
370
+ }
371
+ scrollbar .commands.t.scroll -command {.commands.t.text yview}
372
+ scrollbar .commands.left.treescroll -command {.commands.left.tree yview}
373
+ pack .commands.t.scroll -side right -fill y
374
+ pack .commands.left.treescroll -side right -fill y -expand 1
375
+ #hotkeys
376
+ bind .commands.t.top.e <Return> {vhelpsearch}
377
+ bind .commands <Control-f> {focus .commands.t.top.e}
378
+ bind .commands <Control-F> {focus .commands.t.top.e}
379
+ bind .commands <Escape> {destroy .commands}
380
+ }
381
+
382
+ ############################################################
383
+ # Fills the textbox in "Commands help" window
384
+ # $h -group of commands to display
385
+ # $selindex - index of selected item in the treeview
386
+ # $startindex - index of item int the treeview to start from
387
+ ############################################################
388
+ proc vcomhelp {h {selindex -1} {startindex 0}} {
389
+ global Draw_Helps Draw_Groups
390
+ set highlighted false
391
+ .commands.t.text configure -state normal
392
+ .commands.t.text delete 1.0 end
393
+ foreach f [lsort $Draw_Groups($h)] {
394
+ if {$startindex == $selindex} {
395
+ .commands.t.text insert end "$f : $Draw_Helps($f)\n\n" "highlightline"
396
+ incr startindex
397
+ set highlighted true
398
+ continue
399
+ }
400
+ .commands.t.text insert end "$f : $Draw_Helps($f)\n\n"
401
+ incr startindex
402
+ }
403
+ .commands.t.text tag configure highlightline -background yellow -relief raised
404
+ .commands.t.text configure -state disabled
405
+ if {$highlighted == true} {.commands.t.text see highlightline.last}
406
+ }
407
+
408
+ #Creates a "About" window
409
+ proc about {} {
410
+ toplevel .about
411
+ focus .about
412
+ wm resizable .about 0 0
413
+ wm title .about "About"
414
+ set screenheight [expr {int([winfo screenheight .]*0.5-200)}]
415
+ set screenwidth [expr {int([winfo screenwidth .]*0.5-200)}]
416
+ wm geometry .about 400x200+$screenwidth+$screenheight
417
+
418
+ set logopath ""
419
+ if {[array names ::env CSF_OCCTResourcePath] != "" && "$::env(CSF_OCCTResourcePath)" != "" && [file exists $::env(CSF_OCCTResourcePath)/DrawResources/OCC_logo.png]} {
420
+ set logopath "$::env(CSF_OCCTResourcePath)/DrawResources/OCC_logo.png"
421
+ } elseif {[array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/src/DrawResources/OCC_logo.png]} {
422
+ set logopath "$::env(CASROOT)/src/DrawResources/OCC_logo.png"
423
+ }
424
+
425
+ image create photo occlogo -file $logopath -format png
426
+ frame .about.logo -bg red
427
+ frame .about.links -bg blue
428
+ frame .about.copyright
429
+ pack .about.logo -side top -fill both
430
+ pack .about.links -fill both
431
+ pack .about.copyright -side top -fill both
432
+ label .about.logo.img -image occlogo
433
+ pack .about.logo.img -fill both
434
+ text .about.links.text -bg lightgray -fg blue -height 1 -width 10
435
+ .about.links.text insert end "http://www.opencascade.com/" "link1"
436
+ .about.links.text tag bind link1 <1> "_launchBrowser http://www.opencascade.com/"
437
+ .about.links.text tag bind link1 <Enter> ".about.links.text configure -cursor hand2"
438
+ .about.links.text tag bind link1 <Leave> ".about.links.text configure -cursor arrow"
439
+ .about.links.text tag configure link1 -underline true -justify center
440
+ pack .about.links.text -fill both
441
+ label .about.copyright.text -text "Copyright (c) 1999-2019 OPEN CASCADE SAS"
442
+ button .about.button -text "OK" -command "destroy .about"
443
+ pack .about.button -padx 10 -pady 10
444
+ pack .about.copyright.text
445
+ .about.links.text configure -state disabled
446
+ grab .about
447
+ bind .about <Return> {destroy .about}
448
+ }
449
+
450
+ #Executes files and hyperlinks
451
+ proc launchBrowser url {
452
+ global tcl_platform
453
+
454
+ if {$tcl_platform(platform) eq "windows"} {
455
+ set command [list {*}[auto_execok start] {}]
456
+ } elseif {$tcl_platform(os) eq "Darwin"} {
457
+ set command [list open]
458
+ } else {
459
+ set command [list xdg-open]
460
+ }
461
+ exec {*}$command $url &
462
+ }
463
+
464
+ #Safe execution of files and hyperlinks
465
+ proc _launchBrowser {url} {
466
+ if [catch {launchBrowser $url} err] {
467
+ tk_messageBox -icon error -message "error '$err' with '$command'"
468
+ }
469
+ }
470
+ ################################################################
471
+ # This procedure tries to open an userguide on Draw Harness in pdf format
472
+ # If there is no a such one, then tries to open it in html format
473
+ # Else opens a site with this guide
474
+ ################################################################
475
+ proc openuserguide {} {
476
+ if { [array names ::env CSF_OCCTDocPath] != "" && "$::env(CSF_OCCTDocPath)" != "" && [file exists $::env(CSF_OCCTDocPath)/pdf/user_guides/occt_test_harness.pdf]} {
477
+ _launchBrowser $::env(CSF_OCCTDocPath)/pdf/user_guides/occt_test_harness.pdf
478
+ } elseif { [array names ::env CSF_OCCTDocPath] != "" && "$::env(CSF_OCCTDocPath)" != "" && [file exists $::env(CSF_OCCTDocPath)/overview/html/occt_user_guides__test_harness.html]} {
479
+ _launchBrowser $::env(CSF_OCCTDocPath)/overview/html/occt_user_guides__test_harness.html
480
+ } elseif { [array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf]} {
481
+ _launchBrowser $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf
482
+ } elseif { [array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html]} {
483
+ _launchBrowser $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html
484
+ } else {
485
+ launchBrowser {http://dev.opencascade.org/doc/overview/html/occt_user_guides__test_harness.html}
486
+ }
487
+ }
488
+
489
+ #Search through commands and display the result
490
+ proc vhelpsearch {} {
491
+ global Draw_Groups Entry_Cache
492
+ set searchstring [.commands.t.top.e get]
493
+ set i 1
494
+ set j 100
495
+ set newgroupinx 0
496
+ set isfound 0
497
+ foreach h [lsort [array names Draw_Groups]] {
498
+ set newgroupinx $j
499
+ foreach f [lsort $Draw_Groups($h)] {
500
+ if {$f == $searchstring} {
501
+ incr isfound
502
+ .commands.left.tree see $j
503
+ .commands.left.tree selection set $j
504
+ vcomhelp $h $j $newgroupinx
505
+ break
506
+ }
507
+ incr j
508
+ }
509
+ incr i
510
+ }
511
+ if {$isfound == 0} {
512
+ errorhelp "No help found for '$searchstring'!"
513
+ } else {set Entry_Cache ""}
514
+ }
515
+
516
+ #Displays an error window with $errstring inside
517
+ proc errorhelp {errstring} {
518
+ toplevel .errorhelp
519
+ focus .errorhelp
520
+ wm resizable .errorhelp 0 0
521
+ wm title .errorhelp "Error"
522
+ set screenheight [expr {int([winfo screenheight .]*0.5-200)}]
523
+ set screenwidth [expr {int([winfo screenwidth .]*0.5-200)}]
524
+ wm geometry .errorhelp +$screenwidth+$screenheight
525
+ text .errorhelp.t -width 40 -height 5
526
+ .errorhelp.t insert end $errstring
527
+ button .errorhelp.button -text "OK" -command "destroy .errorhelp"
528
+ pack .errorhelp.t
529
+ .errorhelp.t configure -state disabled
530
+ pack .errorhelp.button -padx 10 -pady 10
531
+ bind .errorhelp <Return> {destroy .errorhelp}
532
+ grab .errorhelp
533
+ }
534
+
535
+ #Search through text of help and display the result
536
+ proc vhelptextsearch {} {
537
+ global Draw_Helps Draw_Groups Find_Button_Click_Count Entry_Cache End_of_Search
538
+ set searchstring [.commands.t.top.e get]
539
+ if {$Entry_Cache != $searchstring} {
540
+ set Find_Button_Click_Count 0
541
+ set End_of_Search 0
542
+ set Entry_Cache $searchstring
543
+ }
544
+ if {$End_of_Search} {
545
+ errorhelp "No more '$searchstring' found!"
546
+ return
547
+ }
548
+ .commands.t.text configure -state normal
549
+ .commands.t.text delete 0.0 end
550
+ set i 0
551
+ set isfound 0
552
+ foreach h [lsort [array names Draw_Groups]] {
553
+ foreach f [lsort $Draw_Groups($h)] {
554
+ if [string match *$searchstring* $Draw_Helps($f)] {
555
+ incr i
556
+ if {$i > $Find_Button_Click_Count+1} {incr isfound; break}
557
+ .commands.t.text insert end "$f : "
558
+ foreach line [list $Draw_Helps($f)] {
559
+ foreach word [split $line " "] {
560
+ if [string match *$searchstring* $word] {
561
+ .commands.t.text insert end "$word" "highlightword"
562
+ .commands.t.text insert end " "
563
+ continue
564
+ }
565
+ .commands.t.text insert end "$word "
566
+ }
567
+ }
568
+ .commands.t.text insert end \n\n
569
+ }
570
+ }
571
+ }
572
+ if {!$isfound} {
573
+ incr End_of_Search
574
+ }
575
+ .commands.t.text tag configure highlightword -background yellow -relief raised
576
+ .commands.t.text see end
577
+ }
578
+
579
+ #Create a "System information" window
580
+ proc sysinfo {} {
581
+ toplevel .info
582
+ wm title .info "System information"
583
+ wm resizable .info 0 0
584
+ pack [frame .info.top] -side top -fill both -padx 5 -pady 10
585
+ pack [frame .info.bot] -side bottom -fill both -padx 5 -pady 10
586
+ pack [frame .info.top.left] -side left -fill both -padx 5 -pady 10
587
+ pack [frame .info.top.mid] -side left -fill both -padx 5 -pady 10
588
+ pack [frame .info.top.right] -side left -fill both -padx 5 -pady 10
589
+ pack [label .info.top.left.label -text "OCCT build configuration "]
590
+ pack [label .info.top.mid.label -text "Memory info"]
591
+ pack [label .info.top.right.label -text "OpenGL info"]
592
+ pack [text .info.top.left.text -width 50 -height 20]
593
+ pack [text .info.top.mid.text -width 50 -height 20]
594
+ pack [text .info.top.right.text -width 50 -height 20]
595
+ pack [button .info.bot.button -text "Update" -command rescaninfo]
596
+ pack [button .info.bot.close -text "Close" -command "destroy .info"] -pady 10
597
+ rescaninfo
598
+ }
599
+
600
+ #Updates information in "System information" window
601
+ proc rescaninfo {} {
602
+ .info.top.left.text configure -state normal
603
+ .info.top.mid.text configure -state normal
604
+ .info.top.right.text configure -state normal
605
+ .info.top.left.text delete 0.0 end
606
+ .info.top.mid.text delete 0.0 end
607
+ .info.top.right.text delete 0.0 end
608
+ .info.top.left.text insert end [dversion]
609
+ .info.top.mid.text insert end [meminfo]
610
+ set glinfo ""
611
+ if [catch {vglinfo} err] {
612
+ if {$err == ""} {
613
+ .info.top.right.text insert end "No active view. Please call vinit."
614
+ } else {
615
+ .info.top.right.text insert end "VISUALIZATION is not loaded. Please call pload VISUALIZATION"
616
+ }
617
+ } else {
618
+ .info.top.right.text insert end [vglinfo]
619
+ }
620
+ .info.top.left.text configure -state disabled
621
+ .info.top.mid.text configure -state disabled
622
+ .info.top.right.text configure -state disabled
623
+ }
@@ -0,0 +1,16 @@
1
+ srcinc:::CURVES.tcl
2
+ srcinc:::dftree.tcl
3
+ srcinc:::DrawDefault
4
+ srcinc:::DrawPlugin
5
+ srcinc:::DrawTK.tcl
6
+ srcinc:::Geometry.tcl
7
+ srcinc:::InitEnvironment.tcl
8
+ srcinc:::lamp.ico
9
+ srcinc:::Move.tcl
10
+ srcinc:::PROFIL.tcl
11
+ srcinc:::SCAN.tcl
12
+ srcinc:::StandardCommands.tcl
13
+ srcinc:::StandardViews.tcl
14
+ srcinc:::SURFACES.tcl
15
+ srcinc:::TestCommands.tcl
16
+ srcinc:::TKTopTest.tcl