3 # It shows the various marker types supported by OCCT.
5 #Category: Visualization
6 #Title: Markers in 3d viewer
8 pload MODELING VISUALIZATION
10 # reflects Aspect_TypeOfMarker enumeration
11 set aMarkerTypeNames {
25 Aspect_TOM_USERDEFINED
29 set aCustom1 [locate_data_file images/marker_box1.png]
30 set aCustom2 [locate_data_file images/marker_box2.png]
31 set aCustom3 [locate_data_file images/marker_kr.png]
32 set aCustom4 [locate_data_file images/marker_dot.png]
35 catch { set aFontFile [locate_data_file DejaVuSans.ttf] }
36 set aLabelFont "Arial"
37 if { "$aFontFile" != "" } {
38 vfont add "$aFontFile" SansFont
39 set aLabelFont "SansFont"
45 vinit name=View1 l=32 t=32 w=512 h=512
47 puts "Draw box in advance which should fit all our markers"
50 vdisplay -noupdate -dispmode 0 b
54 puts "Draw markers of different type and size"
55 for { set aMarkerType 0 } { $aMarkerType <= 13 } { incr aMarkerType } {
56 set aRow [expr $aMarkerType - 7]
58 set aName [lindex $aMarkerTypeNames $aMarkerType]
59 vdrawtext "$aName" "$aName" -pos 0 [expr $aRow + 0.5] 0 -color 7FFFFF -halign center -valign center -angle 000 -zoom 0 -height 12 -aspect bold -font $aLabelFont -noupdate
60 vdisplay -top -noupdate "$aName"
61 if { $aMarkerType == 13 } {
62 vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom1
63 set aCol [expr $aCol - 1]
64 vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom2
65 set aCol [expr $aCol - 1]
66 vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom3
67 set aCol [expr $aCol - 1]
68 vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom4
70 for { set aMarkerScale 1.0 } { $aMarkerScale <= 7 } { set aMarkerScale [expr $aMarkerScale + 0.5] } {
71 vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 MarkerType=$aMarkerType Scale=$aMarkerScale PointsOnSide=1
72 set aCol [expr $aCol - 1]
76 puts "All markers have been displayed"