myVIsoNumber = -1;
myTopLevel = Standard_False;
+ Graphic3d_MaterialAspect aMatAspect;
+ if ( !HasMaterial() ) {
+ aMatAspect.SetAmbient( 0.5 );
+ aMatAspect.SetDiffuse( 0.5 );
+ aMatAspect.SetEmissive( 0.5 );
+ aMatAspect.SetShininess(0.5 );
+ aMatAspect.SetSpecular( 0.5 );
+
+ myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(aMatAspect);
+ myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(aMatAspect);
+ }
+ myCurrentMaterial = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
}
void GEOM_AISShape::setIO(const Handle(SALOME_InteractiveObject)& io){
if(isTopLevel()) {
SetColor(topLevelColor());
-
Handle(Prs3d_LineAspect) anAspect = Attributes()->WireAspect();
anAspect->SetColor( topLevelColor() );
Attributes()->SetWireAspect( anAspect );
}
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
- Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
- FMat.SetTransparency(aValue); BMat.SetTransparency(aValue);
+ FMat.SetTransparency(aValue);
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
- myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
+ myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(FMat);
+ myCurrentMaterial = FMat;
myTransparency = aValue;
}
{
myDrawer->ShadingAspect()->Aspect()->SetDistinguishOn();
- Graphic3d_MaterialAspect aMatAspect;
- if ( !HasMaterial() ) {
- aMatAspect.SetAmbient( 0.5 );
- aMatAspect.SetDiffuse( 0.5 );
- aMatAspect.SetEmissive( 0.5 );
- aMatAspect.SetShininess(0.5 );
- aMatAspect.SetSpecular( 0.5 );
-
- myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(aMatAspect);
- myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(Graphic3d_NOM_JADE);
- }
-
- Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
- Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
- FMat.SetTransparency(myTransparency); BMat.SetTransparency(myTransparency);
- myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
- myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
+ Graphic3d_MaterialAspect aMatAspect(Graphic3d_NOM_PLASTIC);
+ aMatAspect.SetTransparency(myTransparency);
+ myCurrentMaterial = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
+ myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial( isTopLevel() ? aMatAspect : myCurrentMaterial );
+ myDrawer->ShadingAspect()->Aspect()->SetBackMaterial( isTopLevel() ? aMatAspect : myCurrentMaterial );
//Handle(Graphic3d_AspectFillArea3d) a4bis = myDrawer->ShadingAspect()->Aspect();
// P->SetPrimitivesAspect(a4bis);
// G->SetGroupPrimitivesAspect(a4bis);
//a4bis->SetInteriorColor(myShadingColor);
- myDrawer->ShadingAspect()->SetColor(isTopLevel() ? topLevelColor() : myShadingColor);
-
- // PAL12113: AIS_Shape::Compute() works correctly with shapes containing no faces
- //StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer);
- AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
+ if( isTopLevel() )
+ myDrawer->ShadingAspect()->SetColor( topLevelColor() );
+ else if(myDrawer->ShadingAspect()->Aspect()->FrontMaterial().MaterialType( Graphic3d_MATERIAL_ASPECT ))
+ myDrawer->ShadingAspect()->SetColor(myShadingColor);
+
+ // PAL12113: AIS_Shape::Compute() works correctly with shapes containing no faces
+ //StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer);
+ AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
}
void GEOM_AISShape::storeIsoNumbers()