#include <SelectMgr_SequenceOfOwner.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_SelectionManager.hxx>
-#include <StdPrs_WFDeflectionShape.hxx>
+#include <StdPrs_WFShape.hxx>
#include <StdSelect_BRepSelectionTool.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_Selection.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <TopExp_Explorer.hxx>
-IMPLEMENT_STANDARD_HANDLE(ModuleBase_BRepOwner, StdSelect_BRepOwner);
IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_BRepOwner, StdSelect_BRepOwner);
//*******************************************************************************************
-IMPLEMENT_STANDARD_HANDLE(ModuleBase_ResultPrs, ViewerData_AISShape);
IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_ResultPrs, ViewerData_AISShape);
-
-
ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult)
: ViewerData_AISShape(TopoDS_Shape()), myResult(theResult), myAdditionalSelectionPriority(0)
{
TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
Set(aShape);
Handle(Prs3d_Drawer) aDrawer = Attributes();
- if (aDrawer->HasOwnPointAspect())
+ if (aDrawer->HasOwnPointAspect())
aDrawer->PointAspect()->SetTypeOfMarker(Aspect_TOM_PLUS);
else
aDrawer->SetPointAspect(new Prs3d_PointAspect(Aspect_TOM_PLUS, Quantity_NOC_YELLOW, 1.));
myAdditionalSelectionPriority = thePriority;
}
-void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
- const Handle(Prs3d_Presentation)& thePresentation,
- const Standard_Integer theMode)
+void ModuleBase_ResultPrs::Compute(
+ const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ const Handle(Prs3d_Presentation)& thePresentation,
+ const Standard_Integer theMode)
{
std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(myResult);
bool aReadyToDisplay = aShapePtr.get();
Set(myOriginalShape);
}
// change deviation coefficient to provide more precise circle
- ModuleBase_Tools::setDefaultDeviationCoefficient(myResult, Attributes());
+ //ModuleBase_Tools::setDefaultDeviationCoefficient(myResult, Attributes());
AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
if (!aReadyToDisplay) {
- Events_InfoMessage("ModuleBase_ResultPrs", "An empty AIS presentation: ModuleBase_ResultPrs").send();
+ Events_InfoMessage("ModuleBase_ResultPrs",
+ "An empty AIS presentation: ModuleBase_ResultPrs").send();
static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent);
}
TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
int aPriority = StdSelect_BRepSelectionTool::GetStandardPriority(aShape, TopAbs_COMPSOLID);
/// It is important to have priority for the shape of comp solid result less than priority
- /// for the presentation shape which is a sub-result. Reason is to select the sub-objects before: #1592
+ /// for the presentation shape which is a sub-result.
+ /// Reason is to select the sub-objects before: #1592
aPriority = aPriority - 1;
double aDeflection = Prs3d::GetDeflection(aShape, myDrawer);
Handle(ModuleBase_BRepOwner) aOwner = new ModuleBase_BRepOwner(aShape, aPriority);
- StdSelect_BRepSelectionTool::ComputeSensitive(aShape, aOwner, aSelection,
+ StdSelect_BRepSelectionTool::ComputeSensitive(aShape, aOwner, aSelection,
aDeflection, myDrawer->HLRAngle(), 9, 500);
for (aSelection->Init(); aSelection->More(); aSelection->Next()) {
Handle(SelectMgr_EntityOwner) anOwner =
- Handle(SelectMgr_EntityOwner)::DownCast(aSelection->Sensitive()->BaseSensitive()->OwnerId());
+ Handle(SelectMgr_EntityOwner)
+ ::DownCast(aSelection->Sensitive()->BaseSensitive()->OwnerId());
anOwner->Set(this);
}
return;
}
}
//AIS_Shape::ComputeSelection(aSelection, 0);
- }
+ }
AIS_Shape::ComputeSelection(aSelection, aMode);
if (myAdditionalSelectionPriority > 0) {
for (aSelection->Init(); aSelection->More(); aSelection->Next()) {
- Handle(SelectBasics_EntityOwner) aBasicsOwner = aSelection->Sensitive()->BaseSensitive()->OwnerId();
+ Handle(SelectBasics_EntityOwner) aBasicsOwner =
+ aSelection->Sensitive()->BaseSensitive()->OwnerId();
if (!aBasicsOwner.IsNull())
aBasicsOwner->Set(aBasicsOwner->Priority() + myAdditionalSelectionPriority);
}
}
}
-void ModuleBase_ResultPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM,
+void ModuleBase_ResultPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM,
const SelectMgr_SequenceOfOwner& theOwners)
{
Handle(SelectMgr_EntityOwner) anOwner;
for (int i = 1; i <= theOwners.Length(); i++) {
anOwner = theOwners.Value(i);
aCompOwner = Handle(ModuleBase_BRepOwner)::DownCast(anOwner);
- if (aCompOwner.IsNull())
- anOwner->Hilight(thePM);
+ if (aCompOwner.IsNull()) {
+ thePM->Color(anOwner->Selectable(), GetContext()->SelectionStyle());
+ }
else {
TopoDS_Shape aShape = aCompOwner->Shape();
Handle( Prs3d_Presentation ) aSelectionPrs = GetSelectPresentation( thePM );
aSelectionPrs->Clear();
- StdPrs_WFDeflectionShape::Add(aSelectionPrs, aShape, myDrawer);
+ StdPrs_WFShape::Add(aSelectionPrs, aShape, myDrawer);
aSelectionPrs->SetDisplayPriority(9);
- aSelectionPrs->Highlight(Aspect_TOHM_COLOR, aSelectionPrs->HighlightColor());
+ aSelectionPrs->Highlight(GetContext()->SelectionStyle());
aSelectionPrs->Display();
- thePM->Highlight(this);
+ thePM->Color(this, GetContext()->SelectionStyle());
}
}
}
-
-void ModuleBase_ResultPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM,
- const Quantity_NameOfColor theColor,
+
+void ModuleBase_ResultPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM,
+ const Handle(Graphic3d_HighlightStyle)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner)
{
Handle(StdSelect_BRepOwner) aOwner = Handle(StdSelect_BRepOwner)::DownCast(theOwner);
TopoDS_Shape aShape = aOwner->Shape();
if (!aShape.IsNull()) {
- thePM->Color(this, theColor);
+ thePM->Color(this, theStyle);
Handle( Prs3d_Presentation ) aHilightPrs = GetHilightPresentation( thePM );
aHilightPrs->Clear();
- StdPrs_WFDeflectionShape::Add(aHilightPrs, aShape, myDrawer);
- aHilightPrs->Highlight(Aspect_TOHM_COLOR, theColor);
+ StdPrs_WFShape::Add(aHilightPrs, aShape, myDrawer);
+ aHilightPrs->Highlight(theStyle);
if (thePM->IsImmediateModeOn())
thePM->AddToImmediateList(aHilightPrs);