1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0026298: Visualization, OpenGl_Text - make font resolution configurable.

Add THE_DEFAULT_RESOLUTION static const parameter to Graphic3d_RenderingParams.
Add resolution to Graphic3d_RenderingParams.
Drop redundant variables from OpenGl_Workspace.
Add a new parameter to Graphic3d_GraphicDriver::TextSize method (and to OpenGl_GraphicDriver).
Add a new parameter to OpenGl_Text::Render() and to OpenGl_Text::render() methods.
OpenGl_Text::FontKey() considers a resolution (PPI) now.
Add a new argument '-resolution' (sets a pixel density) in the 'VRenderParams' draw-command.
This commit is contained in:
isk
2015-09-29 12:17:58 +03:00
committed by bugmaster
parent 5b0f2540d7
commit 4b1c8733e8
12 changed files with 115 additions and 44 deletions

View File

@@ -8444,6 +8444,25 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
return 1;
}
}
else if (aFlag == "-resolution")
{
if (++anArgIter >= theArgNb)
{
std::cerr << "Error: wrong syntax at argument '" << anArg << "'\n";
return 1;
}
TCollection_AsciiString aResolution (theArgVec[anArgIter]);
if (aResolution.IsIntegerValue())
{
aView->ChangeRenderingParams().Resolution = static_cast<unsigned int> (Draw::Atoi (aResolution.ToCString()));
}
else
{
std::cout << "Error: wrong syntax at argument'" << anArg << "'.\n";
return 1;
}
}
else
{
std::cout << "Error: wrong syntax, unknown flag '" << anArg << "'\n";
@@ -9164,6 +9183,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
"\n '-env on|off' Enables/disables environment map background"
"\n '-shadingModel model' Controls shading model from enumeration"
"\n color, flat, gouraud, phong"
"\n '-resolution value' Sets a new pixels density (PPI), defines scaling factor for parameters like text size"
"\n Unlike vcaps, these parameters dramatically change visual properties."
"\n Command is intended to control presentation quality depending on"
"\n hardware capabilities and performance.",