DiscussionsIssue archiveOCCT:Application Framework

Archived issue #0028839

TPrsStd_AISPresentation - Change material will change the transparency

CommunityOCCT:Application Frameworkclosed9 public notes

Search issues

Description

Steps to reproduce the issue:
1. AIS_Shape is bound to TPrsStd_AISPresentation,
2. Call TPrsStd_AISPresentation::SetMaterial(Graphic3d_NOM_TRANSPARENT)
3. Call TPrsStd_AISPresentation::Display(), Object will be transparent
4. Call TPrsStd_AISPresentation::Erase()
5. Call TPrsStd_AISPresentation::Display(), Object will be opaque

Public activity

9 archived notes

Participants are labeled by their role within this record.

01Commenter 2
TPrsStd_AISPresentation is not a normal AIS presentable object, it is not intended to be modified in this way.
All properties should be defined within OCAF document instead.

02Author
But why the object status flip between transparent and opaque when calling Display and Erase?
03Commenter 2
Do you have this issue in OCCT 7.1.0 or on current master (or both)?
04Author
The problem is caused by inconsistency of transparency property of below two casses:

Standard_Real AIS_Shape::Transparency() const
void AIS_Shape::SetTransparency (const Standard_Real theValue)

Standard_Real AIS_InteractiveObject::Transparency() const
void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
Standard_Boolean AIS_InteractiveObject::IsTransparent() const { return myTransparency > 0.005; }
05Author
I'm using OCCT 7.1.0
06Author
The root problem occurs in method:

Standard_Boolean AIS_InteractiveObject::IsTransparent() const { return myTransparency > 0.005; }

This method don't consider the transparency changes when material has been changed.
07Commenter 2
Please check on current master - I can not reproduce the issue with the given code.
08Author
Dear kgv,
I checked the source code, the code have been changed about transparency implementation in OCCT master. Though i don't get time to build the current master to run test, i believe this issue is fixed after code analysis.
09Commenter 2
Dear Commenter 1, please close the issue.