View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0023387 | Community | OCCT:Visualization | public | 2012-08-17 11:03 | 2015-06-29 15:57 |
Reporter | Jerome Monaco | Assigned To | bugmaster | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Platform | Windows | OS | VC++ 2010 | ||
Product Version | 6.5.3 | ||||
Target Version | 6.9.0 | Fixed in Version | 6.9.0 | ||
Summary | 0023387: Visualization - transparency of specified material is ignored within AIS_Shape::SetMaterial() | ||||
Description | When using AIS_Shape::SetMaterial the transparency is not updated with the transparency of the material and finally the tranparency is not updated. The corrected code is below : AIS_Shape.cxx line 724 //======================================================================= //function : SetMaterial //purpose : //======================================================================= void AIS_Shape::SetMaterial(const Graphic3d_MaterialAspect& aMat) { if( !HasColor() && !IsTransparent() && !HasMaterial() ) { myDrawer->SetShadingAspect(new Prs3d_ShadingAspect()); } hasOwnMaterial = Standard_True; myDrawer->ShadingAspect()->SetMaterial(aMat,myCurrentFacingModel); /// OLD CODE : myDrawer->ShadingAspect()->SetTransparency(myTransparency,myCurrentFacingModel); myDrawer->ShadingAspect()->SetTransparency(aMat.Transparency(),myCurrentFacingModel); if(!GetContext().IsNull()){ if(GetContext()->MainPrsMgr()->HasPresentation(this,1)){ Handle(Prs3d_Presentation) aPresentation = GetContext()->MainPrsMgr()->CastPresentation(this,1)->Presentation(); Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(aPresentation); Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->ShadingAspect()->Aspect(); aPresentation->SetPrimitivesAspect(anAreaAsp); // Check if aspect of given type is set for the group, // because setting aspect for group with no already set aspect // can lead to loss of presentation data if (aGroup->IsGroupPrimitivesAspectSet(Graphic3d_ASPECT_FILL_AREA)) aGroup->SetGroupPrimitivesAspect(anAreaAsp); } myRecomputeEveryPrs =Standard_False; // no mode to recalculate :only viewer update myToRecomputeModes.Clear(); } } | ||||
Steps To Reproduce | Handle(AIS_InteractiveContext) ais = ... BRepPrimAPI_MakeBox MB( 100.0, 100.0, 100.0 ); TopoDS_Shape s = MB.Solid(); Handle( AIS_Shape ) aShape = new AIS_Shape( s ); Graphic3d_MaterialAspect aMat( Graphic3d_NameOfMaterial::Graphic3d_NOM_BRASS ); aMat.SetTransparency( 0.75 ); aShape->SetMaterial( aMat ); ais->Display( aShape, Standard_True ); pload MODELING VISUALIZATION box b 1 2 3 vinit View1 vclear vsetdispmode 1 vdisplay b vfit vsetmaterial b water | ||||
Tags | No tags attached. | ||||
Test case number | |||||
related to | 0024864 | closed | apn | Open CASCADE | Visualization - Implementing refractions in ray-tracing |
related to | 0025511 | closed | bugmaster | Open CASCADE | Visualization - drop redundant viewer option V3d_View::Transparency() |
related to | 0023474 | closed | bugmaster | Community | Changing material/color/transparency of a shaded AIS_Shape requires 'Redisplay' |
related to | 0024855 | closed | apn | Open CASCADE | Revision of parameters of standard materials |
related to | 0025459 | closed | bugmaster | Open CASCADE | Visualization - AIS_ColoredShape::SetMaterial() should not reset custom colors |
|
Existing behavior might looks unnatural to some degree. However proposed solution contradicts to current design of Interactive Object and might break existing code. Thus it doesn't make sense until AIS re-design. |
|
This issue becomes more critical after implementation of transparent materials and refraction support - see 0024864. |
|
The behavior of AIS_Shape::SetMaterial() has been improved within 0025459 - now transparency of specified material is overridden only when AIS_Shape::SetTransparency() called before or afterwards (should be discarded by AIS_Shape::UnsetTransparency()). So the main issue described in the bug should be solved now. However the consistency of all there flags and methods to be further checked. |
|
Dear bugmaster, please close the bug as fixed within 0025459. |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-08-17 11:03 | Jerome Monaco | New Issue | |
2012-08-17 11:03 | Jerome Monaco | Assigned To | => san |
2012-08-30 19:49 |
|
Status | new => assigned |
2012-10-23 12:05 |
|
Target Version | => 6.6.0 |
2012-10-23 12:05 |
|
Steps to Reproduce Updated | |
2012-10-27 03:46 |
|
Relationship added | related to 0023474 |
2013-02-26 18:32 |
|
Target Version | 6.6.0 => 6.7.0 |
2013-12-12 11:07 |
|
Target Version | 6.7.0 => 6.7.1 |
2014-02-17 15:17 | kgv | Note Added: 0027923 | |
2014-02-17 15:17 | kgv | Priority | normal => low |
2014-02-17 15:17 | kgv | Target Version | 6.7.1 => 7.0.0 |
2014-04-25 14:23 | kgv | Relationship added | related to 0024855 |
2014-04-25 14:46 | kgv | Steps to Reproduce Updated | |
2014-04-25 14:56 |
|
Assigned To | san => dbp |
2014-04-25 14:59 |
|
Note Added: 0029075 | |
2014-04-25 14:59 |
|
Priority | low => normal |
2014-04-25 14:59 |
|
Target Version | 7.0.0 => 6.8.0 |
2014-04-25 15:04 |
|
Relationship added | related to 0024864 |
2014-04-25 15:04 |
|
Note Edited: 0029075 | |
2014-10-17 08:47 | kgv | Target Version | 6.8.0 => 7.1.0 |
2014-11-19 19:38 | kgv | Relationship added | related to 0025459 |
2014-11-27 15:44 | kgv | Note Added: 0034753 | |
2014-11-27 15:46 | kgv | Summary | Transparency is not set thru SetMaterial aspect in AIS_Shape => Visualization - transparency of specified material is ignored within AIS_Shape::SetMaterial() |
2014-11-27 15:48 | kgv | Relationship added | related to 0025511 |
2014-11-27 16:04 | kgv | Note Edited: 0034753 | |
2015-06-29 15:30 | kgv | Note Added: 0042555 | |
2015-06-29 15:30 | kgv | Assigned To | dbp => bugmaster |
2015-06-29 15:30 | kgv | Status | assigned => feedback |
2015-06-29 15:30 | kgv | Resolution | open => fixed |
2015-06-29 15:30 | kgv | Fixed in Version | => 6.9.0 |
2015-06-29 15:30 | kgv | Target Version | 7.1.0 => 6.9.0 |
2015-06-29 15:57 |
|
Status | feedback => closed |