View Issue Details

IDProjectCategoryView StatusLast Update
0022879CommunityOCCT:Visualizationpublic2012-03-29 17:26
ReporterszyAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.5.2 
Target Version6.5.3Fixed in Version6.5.3 
Summary0022879: Possible bug in Opengl_togl_begin_layer_mode.cxx
DescriptionPost from the Forum (Massimo Del Fedele) - http://www.opencascade.org/org/forum/thread_22425/.
"The code here :

/*
* On gere le type de font (ASCII !)
*/
if ( strcmp( (char*)FTGLLayerFontName, (char*)font ) != 0 &&
FTGLLayerFontAspect == aspect &&
FTGLLayerFontHeight == height
)
{

makes no sense to me.... it's re-setting font data ONLY if font NAME is different AND font aspect and height are equal... I think it should be like this :

if ( strcmp( (char*)FTGLLayerFontName, (char*)font ) != 0 ||
FTGLLayerFontAspect != aspect ||
FTGLLayerFontHeight != height
)

Anyways, even after pathcing code as whown, font size bug in layer remains... so there must be some other problem.
BTW, the coding style is quite weird... why, for example :

FTGLLayerFontName[0] = '\0';
strcat( (char*)FTGLLayerFontName, (char*)font );

instead of a more simple
strcpy(.....) ??
"

The issue is confirmed as a bug by SAN.
Additional information
and documentation updates
SetTextAttributes method has been fixed in OpenGl_GraphicDriver.
This method now sets font name, type of display text and color of background for subtitle or decal text display for overlayer or underlayer text.
Without this fix, only font name argument has an effect.
There are four different type of display text available:
- Aspect_TODT_NORMAL, display text as usual,
- Aspect_TODT_SUBTITLE, display text on colored background,
- Aspect_TODT_DEKALE, display text with colored outlines,
- Aspect_TODT_BLEND, display text with blended colors.

The color of the font itself can be set with method SetColor in OpenGl_GraphicDriver.

Changes in packages:

OpenGl package:
1) OpenGl_GraphicDriver - method SetTextAttributes now correctly processes the Font, Type, R, G, B parameters.

V3d package:
1) V3d_ColorScale - text attributes changed from Aspect_TODT_SUBTITLE to Aspect_TODT_NORMAL.
2) V3d_LayerMgr - text attributes on beginnig of redraw of the layers in method V3d_LayerMgr::Begin() changed from Aspect_TODT_SUBTITLE to Aspect_TODT_NORMAL.

ViewerTest package:
1) Text attributes testing command "voverlaytext" implemented.
TagsNo tags attached.
Test case numberchl 934 V3

Attached Files

  • V3 (2,953 bytes)

Relationships

related to 0022819 closedbugmaster Open CASCADE Redesign of OpenGl driver 
related to 0022880 closedbugmaster Community Another probable bug in Opengl_togl_begin_layer_mode.cxx 

Activities

abv

2012-02-06 08:17

manager   ~0019399

To be processed after integration of 0022819

apl

2012-02-22 20:00

developer   ~0019751

The following issues has been fixed:
- SetTextAttributes method now affects the type of display text: it is defined on Visual3d_Layer level in accordance with Aspect_TypeOfDisplayText enumeration; this allows to display text in 4 modes: normal, subtitle (with colored background), decal (with colored outlines), blend (mixing colors). The R, G, B values defines the color of the background for subtitle and blend display types.

- The problems with text height and text font are no longer exist in updated OpenGl_GraphicDriver.

- Draw command for overlay text testing purposes "voverlaytext" added

=============================================================================

Dear San,

Could you please review the modification in branch:
http://svn/svn/occt/branches/OCC22879

apl

2012-02-22 20:14

developer   ~0019752

"voverlaytext" testing command added with the following syntax:

voverlaytext TextString X Y [TextHeight] [FontName] [R G B(TextColor)] [DisplayType] [R G B (BackgroundColor)]

TextString - the string with text;
X, Y - where to display the text;
TextHeight - height of the displayed text (default 10.0)
FontName - name of the font to be used (default Courier);
TextColor - Three real values that define the color of the text (default 1.0 1.0 1.0)
DisplayType - display type of the text, might be {normal/subtitle/decal/blend}
BackgroundColor - Three real values that define the color of the subtitle or decal background (default 1.0 1.0 1.0)

The example scenario to test the overlay text parameters:
pload AISV
vinit
# check text height
voverlaytext "Text Height=14" 10.0 10.0 14.0
voverlaytext "Text Height=25" 10.0 40.0 25.0
# check text text font and color
voverlaytext "Arial" 10.0 60.0 18.0 "Arial" 1.0 0.0 0.0
voverlaytext "Times New Roman" 10.0 80.0 20.0 "Times New Roman" 0.0 0.0 1.0
# check display type
voverlaytext "Type1" 10.0 110.0 20.0 "Arial" 1.0 0.0 0.0 subtitle 0.3 0.3 0.3
voverlaytext "Type2" 10.0 130.0 20.0 "Arial" 0.5 0.5 0.3 decal 0.8 0.8 0.8
voverlaytext "Type3" 10.0 150.0 20.0 "Arial" 0.5 0.5 0.3 blend

# check blend:
pload MODELING
box b 10 10 10
vdisplay b
vsetdispmode b 1 ... and move the box under the text to see blended colors.

san

2012-02-22 21:20

developer   ~0019754

The SVN branch reviewed with the following remarks.

OpenGl_GraphicDriver_Layer.cxx
===========================================

Is it really correct to enable blending by the code below without specifying the blend function??? Is blending really needed here at all?

         switch (aDispType)
301 {
302 // blend type
303 case Aspect_TODT_BLEND:
304 {
305 isBlend = glIsEnabled(GL_BLEND);
306 if (!isBlend)
307 glEnable(GL_BLEND);
308
309 glEnable(GL_COLOR_LOGIC_OP);
310 glLogicOp(GL_XOR);
311 }
312 break;

and here:

       if (aDispType == Aspect_TODT_BLEND)
415 {
416 if (!isBlend)
417 glDisable(GL_BLEND);
418
419 glDisable(GL_COLOR_LOGIC_OP);
420 }

apl

2012-02-28 09:50

developer   ~0019786

Dear San,

The redundant code blocks were removed, also the draw command was slightly corrected: color values R G B can be ranged from 0 to 255.

Please review the changes in branch:
http://svn/svn/occt/branches/OCC22879

san

2012-03-07 14:35

developer   ~0019893

The SVN branch reviewed without remarks, ready for testing.

apn

2012-03-14 10:44

administrator   ~0019964

Last edited: 2012-03-14 12:06

Dear BugMaster,
    SVN branch http://svn/svn/occt/branches/OCC22879 hes been moved to GIT CR22879 one.
    Workbench KAS:dev:mkv-22879-occt was created from git branch CR22879
  (and mkv-22879-products from svn trunk) and compiled on Linux platform.
  
    There are not regressions in mkv-22879-products regarding to KAS:dev:products-20120306-opt

    Test case for this fix is chl 934 V3. It's OK.
    
    See results in /QADisk/occttests/results/KAS/dev/mkv-22879-products_13032012/lin
    See reference results in /QADisk/occttests/results/KAS/dev/products-20120306-opt_07032012/lin
    See test cases in /QADisk/occttests/tests/ED

apn

2012-03-14 12:07

administrator  

V3 (2,953 bytes)

bugmaster

2012-03-15 19:08

administrator   ~0019999

Integrated into master

Related Changesets

occt: master 25289ec1

2012-03-13 11:20:21

apl


Committer: bugmaster Details Diff
0022879: Possible bug in Opengl_togl_begin_layer_mode.cxx Affected Issues
0022879
mod - src/Graphic3d/Graphic3d_GraphicDriver.cdl Diff File
mod - src/OpenGl/OpenGl_GraphicDriver.hxx Diff File
mod - src/OpenGl/OpenGl_GraphicDriver_Layer.cxx Diff File
mod - src/OpenGl/OpenGl_Text.cxx Diff File
mod - src/V3d/V3d_ColorScale.cxx Diff File
mod - src/V3d/V3d_LayerMgr.cxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
mod - src/Visual3d/Visual3d_Layer.cdl Diff File

Issue History

Date Modified Username Field Change
2011-12-27 17:18 szy New Issue
2011-12-27 17:18 szy Assigned To => san
2012-02-06 08:16 abv Relationship added related to 0022819
2012-02-06 08:17 abv Note Added: 0019399
2012-02-21 12:10 san Assigned To san => apl
2012-02-21 12:10 san Status new => assigned
2012-02-22 20:00 apl Note Added: 0019751
2012-02-22 20:00 apl Assigned To apl => san
2012-02-22 20:00 apl Status assigned => resolved
2012-02-22 20:14 apl Note Added: 0019752
2012-02-22 20:28 apl Relationship added related to 0022880
2012-02-22 20:44 apl Additional Information Updated
2012-02-22 21:20 san Note Added: 0019754
2012-02-22 21:20 san Assigned To san => apl
2012-02-22 21:20 san Status resolved => assigned
2012-02-28 09:50 apl Note Added: 0019786
2012-02-28 09:50 apl Assigned To apl => san
2012-02-28 09:50 apl Status assigned => resolved
2012-03-07 14:35 san Note Added: 0019893
2012-03-07 14:35 san Assigned To san => bugmaster
2012-03-07 14:35 san Status resolved => reviewed
2012-03-09 12:17 apn Assigned To bugmaster => apn
2012-03-13 15:32 apn Assigned To apn => mkv
2012-03-14 10:44 apn Note Added: 0019964
2012-03-14 12:06 apn Note Edited: 0019964
2012-03-14 12:07 apn File Added: V3
2012-03-14 12:07 apn Test case number => chl 934 V3
2012-03-14 12:07 apn Assigned To mkv => bugmaster
2012-03-14 12:07 apn Status reviewed => tested
2012-03-15 19:08 bugmaster Note Added: 0019999
2012-03-15 19:08 bugmaster Status tested => verified
2012-03-15 19:08 bugmaster Resolution open => fixed
2012-03-15 19:08 bugmaster Assigned To bugmaster => apl
2012-03-29 17:26 bugmaster Changeset attached => occt master 25289ec1