{
aDrawer = new AIS_ColoredDrawer (myDrawer);
myShapeColors.Bind (theShape, aDrawer);
- LoadRecomputable (AIS_WireFrame);
- LoadRecomputable (AIS_Shaded);
+ SetToUpdate();
}
return aDrawer;
}
return;
}
myShapeColors.Clear();
- LoadRecomputable (AIS_WireFrame);
- LoadRecomputable (AIS_Shaded);
+ SetToUpdate();
}
//=======================================================================
return;
}
- LoadRecomputable (AIS_WireFrame);
- LoadRecomputable (AIS_Shaded);
+ SetToUpdate();
if (theToUnregister)
{
myShapeColors.UnBind (theShape);
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setColor (aDrawer, theColor);
aDrawer->SetOwnColor (theColor);
- LoadRecomputable (AIS_WireFrame);
- LoadRecomputable (AIS_Shaded);
}
//=======================================================================
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setTransparency (aDrawer, theTransparency);
aDrawer->SetOwnTransparency (theTransparency);
- LoadRecomputable (AIS_WireFrame);
- LoadRecomputable (AIS_Shaded);
}
//=======================================================================
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setWidth (aDrawer, theLineWidth);
aDrawer->SetOwnWidth (theLineWidth);
- LoadRecomputable (AIS_WireFrame);
- LoadRecomputable (AIS_Shaded);
}
//=======================================================================
void AIS_ColoredShape::SetColor (const Quantity_Color& theColor)
{
- setColor (myDrawer, theColor);
- myDrawer->SetColor (theColor);
- hasOwnColor = Standard_True;
- LoadRecomputable (AIS_WireFrame);
- LoadRecomputable (AIS_Shaded);
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
aDrawer->FaceBoundaryAspect()->SetColor (theColor);
}
}
+ AIS_Shape::SetColor (theColor);
}
//=======================================================================
void AIS_ColoredShape::SetWidth (const Standard_Real theLineWidth)
{
- setWidth (myDrawer, theLineWidth);
- myOwnWidth = theLineWidth;
- LoadRecomputable (AIS_WireFrame);
- LoadRecomputable (AIS_Shaded);
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
aDrawer->FaceBoundaryAspect()->SetWidth (theLineWidth);
}
}
+ AIS_Shape::SetWidth (theLineWidth);
+}
+
+//=======================================================================
+//function : UnsetWidth
+//purpose :
+//=======================================================================
+void AIS_ColoredShape::UnsetWidth()
+{
+ SetWidth (1.0f);
}
//=======================================================================
void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
{
- setTransparency (myDrawer, theValue);
- myDrawer->SetTransparency ((Standard_ShortReal )theValue);
- LoadRecomputable (AIS_WireFrame);
- LoadRecomputable (AIS_Shaded);
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
aDrawer->ShadingAspect()->SetTransparency (theValue, myCurrentFacingModel);
}
}
+ AIS_Shape::SetTransparency (theValue);
}
//=======================================================================
//=======================================================================
void AIS_ColoredShape::UnsetTransparency()
{
- myDrawer->SetTransparency (0.0f);
- if (myDrawer->HasOwnShadingAspect())
- {
- myDrawer->ShadingAspect()->SetTransparency (0.0, myCurrentFacingModel);
- if (!HasColor()
- && !HasMaterial()
- && !myDrawer->ShadingAspect()->Aspect()->ToMapTexture())
- {
- myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
- }
- }
-
- for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
- {
- const Handle(Prs3d_Drawer)& aDrawer = anIter.Value();
- if (aDrawer->HasOwnShadingAspect())
- {
- aDrawer->ShadingAspect()->SetTransparency (0.0, myCurrentFacingModel);
- }
- }
- SynchronizeAspects();
+ SetTransparency (0.0f);
}
//=======================================================================
void AIS_ColoredShape::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
{
- setMaterial (myDrawer, theMaterial, HasColor(), IsTransparent());
- //myOwnMaterial = theMaterial;
- hasOwnMaterial = Standard_True;
- LoadRecomputable (AIS_Shaded);
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
- //if (aDrawer->HasOwnMaterial()) continue;
+ if (aDrawer->HasOwnMaterial())
+ {
+ continue;
+ }
+
if (aDrawer->HasOwnShadingAspect())
{
setMaterial (aDrawer, theMaterial, aDrawer->HasOwnColor(), aDrawer->HasOwnTransparency());
}
}
+ AIS_Shape::SetMaterial (theMaterial);
}
//=======================================================================
// After this call if type of deflection is relative
// computed deflection coefficient is stored as absolute.
- Prs3d::GetDeflection (myshape, myDrawer);
+ StdPrs_ToolTriangulatedShape::GetDeflection (myshape, myDrawer);
break;
}
case AIS_Shaded:
}
const TopAbs_ShapeEnum aTypOfSel = AIS_Shape::SelectionType (theMode);
- const Standard_Real aDeflection = Prs3d::GetDeflection (myshape, myDrawer);
- const Standard_Real aDeviationAngle = myDrawer->HLRAngle();
+ const Standard_Real aDeflection = StdPrs_ToolTriangulatedShape::GetDeflection (myshape, myDrawer);
+ const Standard_Real aDeviationAngle = myDrawer->DeviationAngle();
const Standard_Integer aPriority = StdSelect_BRepSelectionTool::GetStandardPriority (myshape, aTypOfSel);
if (myDrawer->IsAutoTriangulation()
&& !BRepTools::Triangulation (myshape, Precision::Infinite()))
Handle(SelectMgr_SelectableObject) aThis (this);
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next())
{
- Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (aSelEntIter.Value()->BaseSensitive()->OwnerId());
- anOwner->Set (aThis);
+ const Handle(SelectMgr_EntityOwner)& anOwner = aSelEntIter.Value()->BaseSensitive()->OwnerId();
+ anOwner->SetSelectable (aThis);
}
StdSelect_BRepSelectionTool::PreBuildBVH (theSelection);