MantisBT - Open CASCADE
View Issue Details
0029570Open CASCADE[OCCT] OCCT:Visualizationpublic2018-03-13 08:122019-03-14 16:21
kgv 
apn 
normalintegration request 
verifiedfixed 
 
[OCCT] 7.4.0* 
Not needed
0029570: Visualization, Graphic3d_Aspect - merge Graphic3d_Group aspects
Historically, OCCT declares dedicated aspects per rendered primitive type:
- Graphic3d_AspectFillArea3d / OpenGl_AspectFace for rendering Triangles/Quads.
- Graphic3d_AspectLine3d / OpenGl_AspectLine for rendering Lines.
- Graphic3d_AspectMarker3d / OpenGl_AspectMarker for rendering Points/Markers.
- Graphic3d_AspectText3d / OpenGl_AspectText for rendering text labels.

As consequence, OpenGl_Group stores 4 aspects at once (myAspectLine, myAspectFace, myAspectMarker, myAspectText) and OpenGl_Workspace provides 4 sets of methods for managing aspects of different kind.

In reality, such differentiation leads to redundancy of information and ambiguity, because final GLSL programs are based not on primitive type, but rather on combination of attributes (the only special case is a program for Point/Marker implying gl_PointCoord/gl_PointSize in its syntax).

E.g., lighting can be enabled for Lines and Points when vertex attributes include normals, however material and shading properties are defined only within Graphic3d_AspectFillArea3d, while Line width within Graphic3d_AspectLine3d and Point size within Graphic3d_AspectMarker3d - hence, explosive combination of parameters is cherry-picked from various aspects.

At the same time, all aspects define own Color property, as well as GLSL Program, making final definition ambiguous, when combination of aspects is in effect. And all 4 aspects should be applied somehow at once before rendering, to avoid unexpected behavior - e.g. active GLSL Program should be clearly specified, and properties like Alpha test and Blending (which currently buried within Graphic3d_AspectFillArea3d) affect ALL rendered primitives regardless of their type.

Therefore, it is proposed to merge all 4 aspects into single one combining all properties, so that only 1 aspect can be active at the same moment within OpenGl_Context/OpenGl_Workspace/OpenGl_Group/Graphic3d_Group.

Graphic3d_Group::SetGroupPrimitivesAspect() will disallow setting 4 aspects at once - only 1 aspect will be associated with Group, while multiple aspects can be specified sequentially through Graphic3d_Group::SetPrimitivesAspect().

Differentiated classes per primitive type can be preserved for compatibility (and clarity) as sub-classes of new consolidated base class.
No tags attached.
related to 0030124verified apn Open CASCADE Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic 
parent of 0030566closed bugmaster Community Visualization - Prs3d_PointAspect never take affect on Android. 
related to 0030571verified apn Open CASCADE Visualization, TKOpenGl - mapped texture is ignored while drawing points 
Issue History
2018-03-13 08:12kgvNew Issue
2018-03-13 08:12kgvAssigned To => kgv
2018-03-13 08:14kgvDescription Updatedbug_revision_view_page.php?rev_id=18714#r18714
2018-03-13 15:08kgvRelationship addedrelated to 0027977
2019-03-03 21:41gitNote Added: 0082566
2019-03-03 23:58gitNote Added: 0082567
2019-03-03 23:58gitNote Added: 0082568
2019-03-04 01:39gitNote Added: 0082570
2019-03-04 08:12gitNote Added: 0082571
2019-03-04 12:35gitNote Added: 0082576
2019-03-04 12:55gitNote Added: 0082578
2019-03-04 14:07gitNote Added: 0082581
2019-03-04 14:58gitNote Added: 0082586
2019-03-04 15:28gitNote Added: 0082591
2019-03-04 18:10kgvNote Added: 0082595
2019-03-04 18:10kgvAssigned Tokgv => san
2019-03-04 18:10kgvStatusnew => resolved
2019-03-04 21:03gitNote Added: 0082598
2019-03-05 22:42gitNote Added: 0082705
2019-03-05 23:08gitNote Added: 0082707
2019-03-06 06:49gitNote Added: 0082709
2019-03-06 07:03gitNote Added: 0082710
2019-03-06 07:44gitNote Added: 0082712
2019-03-06 08:09gitNote Added: 0082714
2019-03-06 08:13gitNote Added: 0082715
2019-03-06 09:59gitNote Added: 0082719
2019-03-06 10:07kgvNote Edited: 0082595bug_revision_view_page.php?bugnote_id=82595#r20793
2019-03-06 10:08kgvNote Edited: 0082595bug_revision_view_page.php?bugnote_id=82595#r20794
2019-03-06 10:08kgvNote Edited: 0082595bug_revision_view_page.php?bugnote_id=82595#r20795
2019-03-06 14:27sanNote Added: 0082732
2019-03-06 14:27sanAssigned Tosan => bugmaster
2019-03-06 14:27sanStatusresolved => reviewed
2019-03-06 16:19apnTest case number => Not needed
2019-03-06 16:19apnNote Added: 0082742
2019-03-06 16:19apnStatusreviewed => tested
2019-03-07 18:06gitNote Added: 0082780
2019-03-08 13:39kgvRelationship addedrelated to 0030124
2019-03-10 18:17apnChangeset attached => occt master bf5f0ca2
2019-03-10 18:17apnAssigned Tobugmaster => apn
2019-03-10 18:17apnStatustested => verified
2019-03-10 18:17apnResolutionopen => fixed
2019-03-11 14:01gitNote Added: 0082817
2019-03-11 14:02gitNote Added: 0082825
2019-03-11 14:02gitNote Added: 0082828
2019-03-13 11:02kgvRelationship addedparent of 0030566
2019-03-14 16:21kgvRelationship addedrelated to 0030571

Notes
(0082566)
git   
2019-03-03 21:41   
Branch CR29570 has been created by kgv.

SHA-1: 8ae17650ced1d4a6cd8d327b22d61aa648b07a57


Detailed log of new commits:

Author: kgv
Date: Sun Mar 3 21:07:55 2019 +0300

    0029570: Visualization, Graphic3d_Aspect - merge Graphic3d_Group aspects
(0082567)
git   
2019-03-03 23:58   
Branch CR29570 has been deleted by kgv.

SHA-1: 8ae17650ced1d4a6cd8d327b22d61aa648b07a57
(0082568)
git   
2019-03-03 23:58   
Branch CR29570 has been created by kgv.

SHA-1: a0c7f42d87f8d1afa6f4929fe2d1e9d493e1bc7a


Detailed log of new commits:

Author: kgv
Date: Sun Mar 3 21:07:55 2019 +0300

    0029570: Visualization, Graphic3d_Aspect - merge Graphic3d_Group aspects
    
    Graphic3d_AspectFillArea3d, Graphic3d_AspectLine3d and Graphic3d_AspectMarker3d
    have been merged into new class Graphic3d_Aspects.
    The old classes are preserved as dummy sub-classes of Graphic3d_Aspects.
    
    Methods IsGroupPrimitivesAspectSet(), GroupPrimitivesAspect(), FillAreaAspect(),
    LineAspect() and MarkerAspect() have been removed from Graphic3d_Group.
    Instead, a new method Graphic3d_Group::ReplaceAspects() has been introduced
    for replacing existing group aspects.
    
    AIS_Shape now uses new method AIS_InteractiveObject::replaceAspects()
    for updating computed groups with new aspects without presentation recomputation
    in places where SynchronizeAspects() is not applicable.
    
    OpenGl_AspectFace, OpenGl_AspectLine and OpenGl_AspectMarker have been merged into new class OpenGl_Aspects.
(0082570)
git   
2019-03-04 01:39   
Branch CR29570 has been updated forcibly by kgv.

SHA-1: 6adb986337063a5b0550734c981518e496696afb
(0082571)
git   
2019-03-04 08:12   
Branch CR29570 has been updated forcibly by kgv.

SHA-1: 1e6bf871e093edb13db5fc16b9a66afafe901598
(0082576)
git   
2019-03-04 12:35   
Branch CR29570_1 has been created by kgv.

SHA-1: 0f5ffbd655d291cf5a5b63c1f6e706821a4f50e4


Detailed log of new commits:

Author: kgv
Date: Sun Mar 3 21:07:55 2019 +0300

    0029570: Visualization, Graphic3d_Aspect - merge Graphic3d_Group aspects
    
    Graphic3d_AspectFillArea3d, Graphic3d_AspectLine3d and Graphic3d_AspectMarker3d
    have been merged into new class Graphic3d_Aspects.
    The old classes are preserved as dummy sub-classes of Graphic3d_Aspects.
    
    Methods IsGroupPrimitivesAspectSet(), GroupPrimitivesAspect(), FillAreaAspect(),
    LineAspect() and MarkerAspect() have been removed from Graphic3d_Group.
    Instead, a new method Graphic3d_Group::ReplaceAspects() has been introduced
    for replacing existing group aspects.
    
    AIS_Shape now uses new method AIS_InteractiveObject::replaceAspects()
    for updating computed groups with new aspects without presentation recomputation
    in places where SynchronizeAspects() is not applicable.
    
    OpenGl_AspectFace, OpenGl_AspectLine and OpenGl_AspectMarker have been merged into new class OpenGl_Aspects.
    
    ViewerTest::parseColor() - fix uninitialized alpha component.
(0082578)
git   
2019-03-04 12:55   
Branch CR29570_1 has been updated forcibly by kgv.

SHA-1: 6d65158c4ca128a4b73db5f625fd9ed1a0ce26f1
(0082581)
git   
2019-03-04 14:07   
Branch CR29570_1 has been updated forcibly by kgv.

SHA-1: 4762f2d4462562c675cc91e810f73e36cd03749c
(0082586)
git   
2019-03-04 14:58   
Branch CR29570_1 has been updated forcibly by kgv.

SHA-1: 561b8ad69b0689b099e30727319c7f206265aaa1
(0082591)
git   
2019-03-04 15:28   
Branch CR29570_1 has been updated forcibly by kgv.

SHA-1: 036c08640589ea83759bcc384643ca0bef667a4c
(0082595)
kgv   
2019-03-04 18:10   
(edited on: 2019-03-06 10:08)
Patch is ready for review.

Suspicions changes on screenshots are due to:
- v3d/glsl/interior1,interior2
  Shrunk presentation when using glPolygonMode() is now simulated
  by mesh edges with background color for more consistent result
  to GLSL program (although it is still broken, anyway).
- bugs/vis/bug26959
  Changing line width does not require recomputing entire presentation,
  so that screenshot with line width 3 corresponds to original presentation
  with line width 1.
  Why recomputing presentation fixes unconnected edges
  is a subject for dedicated issue.
- bugs/vis/bug27958
  This is a bugfix, test case explicitly sets arrow color to BLUE
  [vtrihedron t1 -arrowColor 0.0 0.0 1.0].

(0082598)
git   
2019-03-04 21:03   
Branch CR29570_1 has been updated forcibly by kgv.

SHA-1: 47d95227b6951907cd61b8e8a6b9e0cdb307e3d2
(0082705)
git   
2019-03-05 22:42   
Branch CR29570_2 has been created by kgv.

SHA-1: 193ffb8f9584255779bcc6ebf8bdaa7ae3486cbb


Detailed log of new commits:

Author: kgv
Date: Sun Mar 3 21:07:55 2019 +0300

    0029570: Visualization, Graphic3d_Aspect - merge Graphic3d_Group aspects
    
    Graphic3d_AspectFillArea3d, Graphic3d_AspectLine3d, Graphic3d_AspectMarker3d
    and Graphic3d_AspectText3d have been merged into new class Graphic3d_Aspects.
    The old classes are preserved as dummy sub-classes of Graphic3d_Aspects
    preserving different per-aspect defaults.
    
    Methods IsGroupPrimitivesAspectSet(), GroupPrimitivesAspect(), FillAreaAspect(),
    LineAspect() and MarkerAspect() have been removed from Graphic3d_Group.
    Instead, a new method Graphic3d_Group::ReplaceAspects() has been introduced
    for replacing existing group aspects.
    
    AIS_Shape now uses new method AIS_InteractiveObject::replaceAspects()
    for updating computed groups with new aspects without presentation recomputation
    in places where SynchronizeAspects() is not applicable.
    
    OpenGl_AspectFace, OpenGl_AspectLine, OpenGl_AspectMarker
    and OpenGl_AspectText have been merged into new class OpenGl_Aspects.
    
    ViewerTest::parseColor() - fix uninitialized alpha component.
    Graphic3d_AspectText3d/Prs3d_TextAspect - removed unused properties Space, ExpansionFactor, Angle.
    Remove getters Values() deprecated since OCCT 7.1.0.
(0082707)
git   
2019-03-05 23:08   
Branch CR29570_2 has been updated forcibly by kgv.

SHA-1: 02a19c33cc143fd19ebf878933470db524b78219
(0082709)
git   
2019-03-06 06:49   
Branch CR29570_2 has been updated forcibly by kgv.

SHA-1: 153e9ec4bfe9a6dedd6ba1cca6708bfee7d76f72
(0082710)
git   
2019-03-06 07:03   
Branch CR29570_2 has been updated forcibly by kgv.

SHA-1: 3ded56c7030ea15dd77cef2b6175a3a91e4d6d43
(0082712)
git   
2019-03-06 07:44   
Branch CR29570_2 has been updated forcibly by kgv.

SHA-1: 9ab7baa2e83d36472ed3592ea9af602f3f5c7ce7
(0082714)
git   
2019-03-06 08:09   
Branch CR29570_2 has been updated forcibly by kgv.

SHA-1: 9d9e2e68d0452a1bedc9902aa526461c217a7290
(0082715)
git   
2019-03-06 08:13   
Branch CR29570_2 has been updated forcibly by kgv.

SHA-1: 8ec22c4a7605a9fa374f465ca0ee94be6fb2d658
(0082719)
git   
2019-03-06 09:59   
Branch CR29570_2 has been updated forcibly by kgv.

SHA-1: 4c90de24c6eb177718c312f5e8e477e9b8572cd8
(0082732)
san   
2019-03-06 14:27   
Branch CR29570_2 reviewed without remarks.
(0082742)
apn   
2019-03-06 16:19   
Combination -
OCCT branch : CR29570_2
master SHA - 8ec22c4a7605a9fa374f465ca0ee94be6fb2d658
d67d4b811012eef8913d3c535c29654d0acf3c4c
Products branch : CR29570_2 SHA - 7f1c5ae49cded957bddb8fe9ef0efd08ae087f80
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16554.75999999999 / 16562.049999999996 [-0.04%]
Products
Total CPU difference: 9079.120000000039 / 9082.700000000026 [-0.04%]
Windows-64-VC14:
OCCT
Total CPU difference: 17962.296875 / 17955.015625 [+0.04%]
Products
Total CPU difference: 10469.4375 / 10469.015625 [+0.00%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0082780)
git   
2019-03-07 18:06   
Branch CR29570_2 has been updated by apn.

SHA-1: cd9da0eb421fabacedd4b28991428937d598e5c2


Detailed log of new commits:

Author: kgv
Date: Thu Mar 7 12:30:36 2019 +0300

    # 0029570 fix compilation on vc10

(0082817)
git   
2019-03-11 14:01   
Branch CR29570_2 has been deleted by inv.

SHA-1: cd9da0eb421fabacedd4b28991428937d598e5c2
(0082825)
git   
2019-03-11 14:02   
Branch CR29570_1 has been deleted by inv.

SHA-1: 47d95227b6951907cd61b8e8a6b9e0cdb307e3d2
(0082828)
git   
2019-03-11 14:02   
Branch CR29570 has been deleted by inv.

SHA-1: 1e6bf871e093edb13db5fc16b9a66afafe901598