// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
+#include <AIS_Shape.hxx>
#include <AIS_GraphicTool.hxx>
#include <AIS_InteractiveContext.hxx>
-#include <AIS_Shape.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Bnd_Box.hxx>
#include <BRep_Builder.hxx>
myInitAng(0.)
{
Set (shap);
- SetHilightMode(0);
}
//=======================================================================
const Handle(Prs3d_Presentation)& aPrs,
const Standard_Integer theMode)
{
- aPrs->Clear();
if(myshape.IsNull()) return;
// wire,edge,vertex -> pas de HLR + priorite display superieure
StdSelect::SetDrawerForBRepOwner(aSelection,myDrawer);
}
-Quantity_NameOfColor AIS_Shape::Color() const {
-Quantity_Color aColor;
- Color(aColor);
- return aColor.Name();
-}
-
void AIS_Shape::Color( Quantity_Color& aColor ) const {
aColor = myDrawer->ShadingAspect()->Color(myCurrentFacingModel);
}
return myDrawer->ShadingAspect()->Transparency(myCurrentFacingModel);
}
-//=======================================================================
-//function : SetColor
-//purpose :
-//=======================================================================
-
-void AIS_Shape::SetColor(const Quantity_NameOfColor aCol)
-{
- SetColor(Quantity_Color(aCol));
-}
-
//=======================================================================
//function : setColor
//purpose :
void AIS_Shape::SetColor (const Quantity_Color& theColor)
{
setColor (myDrawer, theColor);
- myOwnColor = theColor;
+ myDrawer->SetColor (theColor);
hasOwnColor = Standard_True;
// modify shading presentation without re-computation
if (IsTransparent())
{
Standard_Real aTransp = myDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
- mat.SetTransparency (aTransp);
+ mat.SetTransparency (Standard_ShortReal(aTransp));
}
myDrawer->ShadingAspect()->SetMaterial (mat ,myCurrentFacingModel);
}
}
}
-//=======================================================================
-//function : SetMaterial
-//purpose :
-//=======================================================================
-
-void AIS_Shape::SetMaterial(const Graphic3d_NameOfMaterial aMat)
-{
- SetMaterial(Graphic3d_MaterialAspect(aMat));
-}
-
//=======================================================================
//function : SetMaterial
//purpose :
}
if (HasColor())
{
- myDrawer->ShadingAspect()->SetColor (myOwnColor, myCurrentFacingModel);
- myDrawer->ShadingAspect()->SetTransparency (myTransparency, myCurrentFacingModel);
+ myDrawer->ShadingAspect()->SetColor (myDrawer->Color(), myCurrentFacingModel);
+ myDrawer->ShadingAspect()->SetTransparency (myDrawer->Transparency(), myCurrentFacingModel);
}
}
else
void AIS_Shape::SetTransparency (const Standard_Real theValue)
{
setTransparency (myDrawer, theValue);
- myTransparency = theValue;
+ myDrawer->SetTransparency ((Standard_ShortReal )theValue);
// modify shading presentation without re-computation
const PrsMgr_Presentations& aPrsList = Presentations();
}
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
- aPrs->SetDisplayPriority (10); // force highest priority for translucent objects
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
{
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
void AIS_Shape::UnsetTransparency()
{
- myTransparency = 0.0;
+ myDrawer->SetTransparency (0.0f);
if (!myDrawer->HasOwnShadingAspect())
{
return;
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
}
}
- aPrs->ResetDisplayPriority();
}
myRecomputeEveryPrs = Standard_False; // no mode to recalculate :only viewer update