Archived issue #0028839
TPrsStd_AISPresentation - Change material will change the transparency
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
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.
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.
All properties should be defined within OCAF document instead.
But why the object status flip between transparent and opaque when calling Display and Erase?
Do you have this issue in OCCT 7.1.0 or on current master (or both)?
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; }
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; }
I'm using OCCT 7.1.0
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.
Standard_Boolean AIS_InteractiveObject::IsTransparent() const { return myTransparency > 0.005; }
This method don't consider the transparency changes when material has been changed.
Please check on current master - I can not reproduce the issue with the given code.
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.
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.
Dear Commenter 1, please close the issue.