mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0029350: Visualization, OpenGl_Text - add Aspect_TODT_SHADOW text style
Within new style Aspect_TODT_SHADOW, a tiny shadow is drawn at right-bottom corner with one pixel shift, producing a slightly nicer visual look than Aspect_TODT_DEKALE.
This commit is contained in:
parent
64c6d8df50
commit
3cbd0a8e87
@ -17,19 +17,14 @@
|
|||||||
#define _Aspect_TypeOfDisplayText_HeaderFile
|
#define _Aspect_TypeOfDisplayText_HeaderFile
|
||||||
|
|
||||||
//! Define the display type of the text.
|
//! Define the display type of the text.
|
||||||
//!
|
|
||||||
//! TODT_NORMAL Default display. Text only.
|
|
||||||
//! TODT_SUBTITLE There is a subtitle under the text.
|
|
||||||
//! TODT_DEKALE The text is displayed with a 3D style.
|
|
||||||
//! TODT_BLEND The text is displayed in XOR.
|
|
||||||
//! TODT_DIMENSION Dimension line under text will be invisible.
|
|
||||||
enum Aspect_TypeOfDisplayText
|
enum Aspect_TypeOfDisplayText
|
||||||
{
|
{
|
||||||
Aspect_TODT_NORMAL,
|
Aspect_TODT_NORMAL, //!< default display, text only
|
||||||
Aspect_TODT_SUBTITLE,
|
Aspect_TODT_SUBTITLE, //!< there is a subtitle under the text
|
||||||
Aspect_TODT_DEKALE,
|
Aspect_TODT_DEKALE, //!< the text is displayed with a 3D style
|
||||||
Aspect_TODT_BLEND,
|
Aspect_TODT_BLEND, //!< the text is displayed in XOR
|
||||||
Aspect_TODT_DIMENSION
|
Aspect_TODT_DIMENSION, //!< dimension line under text will be invisible
|
||||||
|
Aspect_TODT_SHADOW //!< the text will have a shadow at the right-bottom corner
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _Aspect_TypeOfDisplayText_HeaderFile
|
#endif // _Aspect_TypeOfDisplayText_HeaderFile
|
||||||
|
@ -919,6 +919,13 @@ void OpenGl_Text::render (const Handle(OpenGl_Context)& theCtx,
|
|||||||
drawText (theCtx, theTextAspect);
|
drawText (theCtx, theTextAspect);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Aspect_TODT_SHADOW:
|
||||||
|
{
|
||||||
|
theCtx->SetColor4fv (theColorSubs);
|
||||||
|
setupMatrix (theCtx, theTextAspect, OpenGl_Vec3 (+1.0f, -1.0f, 0.00001f));
|
||||||
|
drawText (theCtx, theTextAspect);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Aspect_TODT_DIMENSION:
|
case Aspect_TODT_DIMENSION:
|
||||||
case Aspect_TODT_NORMAL:
|
case Aspect_TODT_NORMAL:
|
||||||
{
|
{
|
||||||
|
@ -2554,6 +2554,8 @@ static int VDrawText (Draw_Interpretor& theDI,
|
|||||||
aDisplayType = Aspect_TODT_DIMENSION;
|
aDisplayType = Aspect_TODT_DIMENSION;
|
||||||
else if (aType == "normal")
|
else if (aType == "normal")
|
||||||
aDisplayType = Aspect_TODT_NORMAL;
|
aDisplayType = Aspect_TODT_NORMAL;
|
||||||
|
else if (aType == "shadow")
|
||||||
|
aDisplayType = Aspect_TODT_SHADOW;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "Error: wrong display type '" << aType << "'.\n";
|
std::cout << "Error: wrong display type '" << aType << "'.\n";
|
||||||
@ -6584,7 +6586,7 @@ void ViewerTest::ObjectCommands(Draw_Interpretor& theCommands)
|
|||||||
"\n\t\t X and Y define the coordinate origin in 2d space relative to the view window"
|
"\n\t\t X and Y define the coordinate origin in 2d space relative to the view window"
|
||||||
"\n\t\t Example: X=0 Y=0 is center, X=1 Y=1 is upper right corner etc..."
|
"\n\t\t Example: X=0 Y=0 is center, X=1 Y=1 is upper right corner etc..."
|
||||||
"\n\t\t Z coordinate defines the gap from border of view window (except center position)."
|
"\n\t\t Z coordinate defines the gap from border of view window (except center position)."
|
||||||
"\n\t\t: [-disptype {blend|decal|subtitle|dimension|normal}=normal}"
|
"\n\t\t: [-disptype {blend|decal|shadow|subtitle|dimension|normal}=normal}"
|
||||||
"\n\t\t: [-subcolor {R G B|name}=white]"
|
"\n\t\t: [-subcolor {R G B|name}=white]"
|
||||||
"\n\t\t: [-noupdate]"
|
"\n\t\t: [-noupdate]"
|
||||||
"\n\t\t: [-plane NormX NormY NormZ DirX DirY DirZ]"
|
"\n\t\t: [-plane NormX NormY NormZ DirX DirY DirZ]"
|
||||||
|
38
tests/3rdparty/fonts/A7
vendored
38
tests/3rdparty/fonts/A7
vendored
@ -6,28 +6,30 @@ puts ""
|
|||||||
|
|
||||||
vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
||||||
|
|
||||||
vdrawtext t1 "Overlay Test Blend" -2d -perspos -1 1 -pos 100 -50 0 -height 16 -font SansFont -color 1 1 0 -disptype blend -subcolor 0 0 1
|
set aParams "-height 16 -font SansFont -2d -persPos -1 1 -subColor BLUE1"
|
||||||
|
|
||||||
vdrawtext t2 "Overlay Test Decal" -2d -perspos -1 1 -pos 100 -100 0 -height 16 -font SansFont -color 1 1 0 -disptype decal -subcolor 0 0 1
|
vclear
|
||||||
|
vviewparams -scale 254.5 -proj 0.89 -0.37 0.26 -up -0.21 0.16 0.96 -at 0.69 1.05 1.46
|
||||||
|
|
||||||
vdrawtext t3 "Overlay Test Subtitle" -2d -perspos -1 1 -pos 100 -150 0 -height 16 -font SansFont -color 1 1 0 -disptype subtitle -subcolor 0 0 1
|
vdrawtext td "Overlay Test Decal" {*}$aParams -pos 20 -100 0 -color WHITE -dispType decal
|
||||||
|
vdrawtext ts "Overlay Test Shadow" {*}$aParams -pos 20 -150 0 -color WHITE -dispType shadow
|
||||||
|
vdrawtext tx "Overlay Test XOR" {*}$aParams -pos 20 -200 0 -color YELLOW -dispType blend
|
||||||
|
vdrawtext tt "Overlay Test Subtitle" {*}$aParams -pos 20 -250 0 -color WHITE -dispType subtitle
|
||||||
|
vdrawtext tw "Overlay Test Normal" {*}$aParams -pos 20 -300 0 -color WHITE -dispType normal
|
||||||
|
vdrawtext tb "Overlay Test Normal" {*}$aParams -pos 20 -350 0 -color GRAY33 -dispType normal
|
||||||
|
|
||||||
vdrawtext t4 "Overlay Test Normal" -2d -perspos -1 1 -pos 100 -200 0 -height 16 -font SansFont -color 0 1 1 -disptype normal -subcolor 0 0 1
|
vdrawtext td2 " Overlay Test Decal \n Second line" {*}$aParams -pos 200 -100 0 -color WHITE -dispType decal
|
||||||
|
vdrawtext ts2 " Overlay Test Shadow \n Second line" {*}$aParams -pos 200 -150 0 -color WHITE -dispType shadow
|
||||||
vdrawtext t5 " Overlay Test Normal \n Second line" -2d -perspos -1 1 -pos 100 -250 0 -height 16 -font SansFont -color 0 1 1 -disptype normal -subcolor 0 0 1
|
vdrawtext tx2 " Overlay Test XOR \n Second line" {*}$aParams -pos 200 -200 0 -color YELLOW -dispType blend
|
||||||
|
vdrawtext tt2 " Overlay Test Subtitle\n Second line" {*}$aParams -pos 200 -250 0 -color WHITE -dispType subtitle
|
||||||
vdrawtext t6 " Overlay Test Subtitle\n Second line" -2d -perspos -1 1 -pos 100 -300 0 -height 16 -font SansFont -color 1 1 0 -disptype subtitle -subcolor 0 0 1
|
vdrawtext tw2 " Overlay Test Normal \n Second line" {*}$aParams -pos 200 -300 0 -color WHITE -dispType normal
|
||||||
|
vdrawtext tb2 " Overlay Test Normal \n Second line" {*}$aParams -pos 200 -350 0 -color GRAY33 -dispType normal
|
||||||
vdrawtext t7 " Overlay Test Decal \n Second line" -2d -perspos -1 1 -pos 100 -350 0 -height 16 -font SansFont -color 1 1 0 -disptype decal -subcolor 0 0 1
|
|
||||||
|
|
||||||
vdrawtext t8 " Overlay Test Blend \n Second line" -2d -perspos -1 1 -pos 100 -400 0 -height 16 -font SansFont -color 1 1 0 -disptype blend -subcolor 0 0 1
|
|
||||||
|
|
||||||
box b 1 2 3
|
box b 1 2 3
|
||||||
vsetdispmode 1
|
vdisplay -dispMode 1 b
|
||||||
vdisplay b
|
vselprops localSelHighlight -dispMode 1 -material SILVER -color WHITE
|
||||||
vfit
|
vselmode b FACE 1
|
||||||
|
vselect 250 250
|
||||||
vfps
|
|
||||||
|
|
||||||
vglinfo
|
vglinfo
|
||||||
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|
vdump ${imagedir}/${casename}.png
|
||||||
|
Loading…
x
Reference in New Issue
Block a user