mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0027731: Visualization, OpenGl_AspectMarker - handle fractional marker Scale when sharing resources
OpenGl_AspectMarker::Resources::SpriteKeys() now encodes decimal number of marker scale into resource key, since built-in markers are defined with 0.5 scale step.
This commit is contained in:
parent
6887652ac6
commit
d509e5a43f
@ -31,7 +31,8 @@ set aCustom2 [locate_data_file images/marker_box2.png]
|
|||||||
set aCustom3 [locate_data_file images/marker_kr.png]
|
set aCustom3 [locate_data_file images/marker_kr.png]
|
||||||
set aCustom4 [locate_data_file images/marker_dot.png]
|
set aCustom4 [locate_data_file images/marker_dot.png]
|
||||||
|
|
||||||
set aFontFile [locate_data_file DejaVuSans.ttf]
|
set aFontFile ""
|
||||||
|
catch { set aFontFile [locate_data_file DejaVuSans.ttf] }
|
||||||
set aLabelFont "Arial"
|
set aLabelFont "Arial"
|
||||||
if { "$aFontFile" != "" } {
|
if { "$aFontFile" != "" } {
|
||||||
vfont add "$aFontFile" SansFont
|
vfont add "$aFontFile" SansFont
|
||||||
@ -55,7 +56,8 @@ for { set aMarkerType 0 } { $aMarkerType <= 13 } { incr aMarkerType } {
|
|||||||
set aRow [expr $aMarkerType - 7]
|
set aRow [expr $aMarkerType - 7]
|
||||||
set aCol 5
|
set aCol 5
|
||||||
set aName [lindex $aMarkerTypeNames $aMarkerType]
|
set aName [lindex $aMarkerTypeNames $aMarkerType]
|
||||||
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
|
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 -noupdate
|
||||||
|
vdisplay -top -noupdate "$aName"
|
||||||
if { $aMarkerType == 13 } {
|
if { $aMarkerType == 13 } {
|
||||||
vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom1
|
vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom1
|
||||||
set aCol [expr $aCol - 1]
|
set aCol [expr $aCol - 1]
|
||||||
|
@ -1950,8 +1950,8 @@ void OpenGl_AspectMarker::Resources::SpriteKeys (const Handle(Graphic3d_MarkerIm
|
|||||||
}
|
}
|
||||||
else if (theType != Aspect_TOM_POINT)
|
else if (theType != Aspect_TOM_POINT)
|
||||||
{
|
{
|
||||||
// predefined markers
|
// predefined markers are defined with 0.5 step
|
||||||
const Standard_Integer aScale = Standard_Integer(theScale + 0.5f);
|
const Standard_Integer aScale = Standard_Integer(theScale * 10.0f + 0.5f);
|
||||||
theKey = TCollection_AsciiString ("OpenGl_AspectMarker") + theType + "_" + aScale;
|
theKey = TCollection_AsciiString ("OpenGl_AspectMarker") + theType + "_" + aScale;
|
||||||
theKeyA = theKey + "A";
|
theKeyA = theKey + "A";
|
||||||
if (theType == Aspect_TOM_BALL)
|
if (theType == Aspect_TOM_BALL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user