diff --git a/src/Aspect/Aspect_TypeOfDisplayText.hxx b/src/Aspect/Aspect_TypeOfDisplayText.hxx index ee9a2bea0a..a7caefd9df 100644 --- a/src/Aspect/Aspect_TypeOfDisplayText.hxx +++ b/src/Aspect/Aspect_TypeOfDisplayText.hxx @@ -17,19 +17,14 @@ #define _Aspect_TypeOfDisplayText_HeaderFile //! 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 { -Aspect_TODT_NORMAL, -Aspect_TODT_SUBTITLE, -Aspect_TODT_DEKALE, -Aspect_TODT_BLEND, -Aspect_TODT_DIMENSION + Aspect_TODT_NORMAL, //!< default display, text only + Aspect_TODT_SUBTITLE, //!< there is a subtitle under the text + Aspect_TODT_DEKALE, //!< the text is displayed with a 3D style + Aspect_TODT_BLEND, //!< the text is displayed in XOR + 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 diff --git a/src/OpenGl/OpenGl_Text.cxx b/src/OpenGl/OpenGl_Text.cxx index 5bfd924b9b..eb09e0a657 100644 --- a/src/OpenGl/OpenGl_Text.cxx +++ b/src/OpenGl/OpenGl_Text.cxx @@ -919,6 +919,13 @@ void OpenGl_Text::render (const Handle(OpenGl_Context)& theCtx, drawText (theCtx, theTextAspect); 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_NORMAL: { diff --git a/src/ViewerTest/ViewerTest_ObjectCommands.cxx b/src/ViewerTest/ViewerTest_ObjectCommands.cxx index db7fe998b9..490bcd8fe2 100644 --- a/src/ViewerTest/ViewerTest_ObjectCommands.cxx +++ b/src/ViewerTest/ViewerTest_ObjectCommands.cxx @@ -2554,6 +2554,8 @@ static int VDrawText (Draw_Interpretor& theDI, aDisplayType = Aspect_TODT_DIMENSION; else if (aType == "normal") aDisplayType = Aspect_TODT_NORMAL; + else if (aType == "shadow") + aDisplayType = Aspect_TODT_SHADOW; else { 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 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: [-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: [-noupdate]" "\n\t\t: [-plane NormX NormY NormZ DirX DirY DirZ]" diff --git a/tests/3rdparty/fonts/A7 b/tests/3rdparty/fonts/A7 index 75d74bc8de..32931b66c8 100644 --- a/tests/3rdparty/fonts/A7 +++ b/tests/3rdparty/fonts/A7 @@ -6,28 +6,30 @@ puts "" 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 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 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 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 +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 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 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 box b 1 2 3 -vsetdispmode 1 -vdisplay b -vfit - -vfps +vdisplay -dispMode 1 b +vselprops localSelHighlight -dispMode 1 -material SILVER -color WHITE +vselmode b FACE 1 +vselect 250 250 vglinfo -checkview -screenshot -3d -path ${imagedir}/${test_image}.png +vdump ${imagedir}/${casename}.png