DiscussionsIssue archiveOCCT:Visualization

Archived issue #0025475

Visualization, TKOpenGl - draw background using primitive arrays

Open CASCADEOCCT:Visualizationclosed38 public notes

Search issues

Description

Current implementation of OpenGl_View::DrawBackground() uses deprecated functionality and should be re-written using OpenGl_PrimitiveArray.

Steps to reproduce

Test case name: /bugs/vis/bug25475

Public activity

38 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: aba
Date: Fri Nov 21 18:46:01 2014 +0300

    0025475: Visualization, TKOpenGl - draw background using primitive arrays
02Commenter 2
Dear kgv,

please review the git branch CR25475.
03Author
+      OpenGl_PrimitiveArray* aTriangleArray = new OpenGl_PrimitiveArray (NULL, Graphic3d_TOPA_TRIANGLES,
+                                                                         anIndices, anAttribs, NULL);

please make array as field of OpenGl_View, and eliminate graphic3d_buffer re-creations - it can be re-used.
04Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Sun Nov 23 15:08:00 2014 +0300

    avoid memory leak

05Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
06Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: aba
Date: Mon Nov 24 08:44:17 2014 +0300

    0025475: Visualization, TKOpenGl - draw background using primitive arrays
07Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
08Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue Dec 9 18:55:17 2014 +0400

    OpenGl_View::DrawBackground() - create GLushort index buffer

09Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: aba
Date: Thu Dec 11 09:03:48 2014 +0300

    0025475: Visualization, TKOpenGl - draw background using primitive arrays
10Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: aba
Date: Wed Jan 14 16:50:55 2015 +0300

    Moved background arrays to separate classes

11Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
12Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: aba
Date: Fri Jan 16 19:50:22 2015 +0300

    create one background array class for texture and gradient

13Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
14Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
15Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
16Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
17Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: aba
Date: Wed Jan 28 15:24:38 2015 +0300

    0025475: Visualization, TKOpenGl - draw background using primitive arrays:
    - moved background arrays to separate class for texture and gradient arrays
18Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
19Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: aba
Date: Thu Jan 29 11:00:25 2015 +0300

    Remarks

20Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
21Commenter 21
Dear kgv,

please review the Git branch CR25475_3.
22Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Jan 30 17:15:40 2015 +0300

    cosmetics

23Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Jan 30 17:16:24 2015 +0300

    correct test case

24Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: aba
Date: Fri Jan 30 17:20:12 2015 +0300

    0025475: Visualization, TKOpenGl - draw background using primitive arrays
    
    Move background arrays to separate class OpenGl_BackgroundArray
    for texture and gradient arrays.
25Author
Please test patch in branch CR25475_4.
26Commenter 26
Dear Commenter 1,
Branch CR25475_4 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 24 (18 on master)
Windows: 0 (0 on master)

There are new additional compilation warnings on Linux platform:
http://jenkins-test-03.nnov.opencascade.com:8080/user/mnt/my-views/view/A_mnt_warnings/portlet/dashboard_portlet_17008/job/mnt-CR25475_4-master_build_occt_linux/1/warnings17Result/package.-133837126/
OpenGl_BackgroundArray.cxx:26, GNU C Compiler 4 (gcc), Priority: Normal
when initialized here
OpenGl_View.cxx:53, GNU C Compiler 4 (gcc), Priority: Normal
when initialized here

http://jenkins-test-03.nnov.opencascade.com:8080/user/mnt/my-views/view/A_mnt_warnings/portlet/dashboard_portlet_17008/job/mnt-CR25475_4-master_build_occt_linux/1/warnings17Result/package.-671474530/
OpenGl_BackgroundArray.hxx:101, GNU C Compiler 4 (gcc), Priority: Normal
‘Graphic3d_TypeOfBackground OpenGl_BackgroundArray::myType’

OpenGl_BackgroundArray.hxx:104, GNU C Compiler 4 (gcc), Priority: Normal
‘OpenGl_BackgroundArray::myFillMethod’ will be initialized after

OpenGl_View.hxx:290, GNU C Compiler 4 (gcc), Priority: Normal
‘OpenGl_AspectFace* OpenGl_View::myTextureParams’

OpenGl_View.hxx:292, GNU C Compiler 4 (gcc), Priority: Normal
‘OpenGl_View::myBgTextureArray’ will be initialized after

products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
http://occt-tests/CR25475-4-master-occt/Debian60-64/bugs/vis/bug25475.html
http://occt-tests/CR25475-4-master-occt/Windows-32-VC10/bugs/vis/bug25475.html
bugs vis(004) bug25475: OK

Testing on Linux:
occt component :
Total MEMORY difference: 369887944 / 370076844
Total CPU difference: 53390.50999999995 / 49863.81000000002
products component :
Total MEMORY difference: 110931024 / 110877292
Total CPU difference: 16204.519999999991 / 15924.139999999974

Testing on Windows:
occt component :
Total MEMORY difference: 275859392 / 276284192
Total CPU difference: 35454.09375 / 36894.109375
products component :
Total MEMORY difference: 72352720 / 71401072
Total CPU difference: 10443.25 / 11731.96875

There are no differences in images found by testdiff.
27Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: aba
Date: Tue Feb 3 13:44:40 2015 +0300

    Eliminated warnings on Linux

28Commenter 28
Warnings on Linux were eliminated.

Dear mkv,

please test CR25475_4.
29Author
Dear mkv, please just check warnings (compilation) - no need to perform regression testing anew.
30Commenter 30
Dear Commenter 1,
Branch CR25475_4 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 18 (18 on master)
Windows: 0 (0 on master)

products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)
31Commenter 3
Hello, I've tried these changes (Branch CR25475_4) with OpenGL ES on Android. It's don't work with usage:
myView->SetBgGradientColors (myTopBackgroundColor, myBottomBackgroundColor,
                Aspect_GFM_VER, Standard_False);

I've debugged OpenGl_BackgroundArray class and found that myIndices is empty. Adding initializing code solve my problem. Review changes again please.
32Author
>> I've debugged OpenGl_BackgroundArray class and found that myIndices is empty
It is empty for a purpose - the vertices in this primitive array are sorted in natural order and do not require dedicated indices buffer.
33Commenter 3
You're right. But I don't see vertical gradient on Android. Moreover, sometimes when use gradient background I've seen:
VBO creation for Primitive Array has failed for xx indices. Out of memory?
in log when showing AIS objects.
34Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]
35Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]
36Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]
37Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]
38Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]

Related records