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]
34 set aFontFile [locate_data_file DejaVuSans.ttf]
35 set aLabelFont "Arial"
36 if { "$aFontFile" != "" } {
37 vfont add "$aFontFile" SansFont
38 set aLabelFont "SansFont"
44 vinit name=View1 l=32 t=32 w=512 h=512
46 puts "Draw box in advance which should fit all our markers"
49 vdisplay -noupdate -dispmode 0 b
53 puts "Draw markers of different type and size"
54 for { set aMarkerType 0 } { $aMarkerType <= 13 } { incr aMarkerType } {
55 set aRow [expr $aMarkerType - 7]
57 set aName [lindex $aMarkerTypeNames $aMarkerType]
58 vdrawtext "$aName" "$aName" -pos 0 [expr $aRow + 0.5] 0 -color 0.5 1.0 1.0 -halign center -valign center -angle 000 -zoom 0 -height 12 -aspect bold -font $aLabelFont
59 if { $aMarkerType == 13 } {
60 vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom1
61 set aCol [expr $aCol - 1]
62 vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom2
63 set aCol [expr $aCol - 1]
64 vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom3
65 set aCol [expr $aCol - 1]
66 vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom4
68 for { set aMarkerScale 1.0 } { $aMarkerScale <= 7 } { set aMarkerScale [expr $aMarkerScale + 0.5] } {
69 vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 MarkerType=$aMarkerType Scale=$aMarkerScale PointsOnSide=1
70 set aCol [expr $aCol - 1]
74 puts "All markers have been displayed"