1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0027818: Visualization - provide an interface to define highlight presentation properties

- introduces a wrapper for setting up highlight properties: Graphic3d_HighlightStyle;
- API of all methods that use highlight or selection color is changed to deal with Graphic3d_HighlightStyle;
- highlight in shading mode now supports transparency, implemented via blending;
- transparency for selection can also be set, but implementing custom entity owners with additional presentation on application level;
- methods PrsMgr_PresentationManager::Highlight, PrsMgr_PresentationManager::BoundBox that highlight object with hard-coded color are removed;
- deprecated methods of SelectMgr_EntityOwner, that use presentation manager's highlight method, were removed;
- methods of IsHilighted AIS context with selection color checks were replaced;
- added API to store dynamic and selection highlight to Prs3d_Drawer class;
- customization of dynamic and selection highlight for particular objects is now available through SelectMgr_SelectableObject::HilightAttributes();
- AIS_InteractiveContext highlight methods were updated to support individual highlight styles of interactive objects;
- introduced new command - vselprops, that allows to customize global selection and highlight properties like autoactivation, pixel tolerance and colors;
- Draw Harness commands vautoactivatesel and vselprecision were removed, use vselprops instead;
- fixed bug in command's parser;
- test case for issue #27818
This commit is contained in:
vpa
2016-09-28 12:43:17 +03:00
committed by kgv
parent 3a9b5dc86a
commit 8e5fb5eabc
69 changed files with 1381 additions and 1002 deletions

View File

@@ -840,12 +840,12 @@ void AIS_Manipulator::HilightSelected (const Handle(PrsMgr_PresentationManager3d
if (!theSeq (1)->IsKind (STANDARD_TYPE (AIS_ManipulatorOwner)))
{
thePM->Color (this, GetContext()->HilightColor(), 0);
thePM->Color (this, GetContext()->HighlightStyle(), 0);
return;
}
Handle(AIS_ManipulatorOwner) anOwner = Handle(AIS_ManipulatorOwner)::DownCast (theSeq (1));
myHighlightAspect->Aspect()->SetInteriorColor (GetContext()->HilightColor());
myHighlightAspect->Aspect()->SetInteriorColor (GetContext()->HighlightStyle()->Color());
Handle(Graphic3d_Group) aGroup = getGroup (anOwner->Index(), anOwner->Mode());
if (aGroup.IsNull())
{
@@ -871,7 +871,9 @@ void AIS_Manipulator::ClearSelected()
//function : HilightOwnerWithColor
//purpose :
//=======================================================================
void AIS_Manipulator::HilightOwnerWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM, const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner)
void AIS_Manipulator::HilightOwnerWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM,
const Handle(Graphic3d_HighlightStyle)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner)
{
Handle(AIS_ManipulatorOwner) anOwner = Handle(AIS_ManipulatorOwner)::DownCast (theOwner);
Handle(Prs3d_Presentation) aPresentation = getHighlightPresentation (anOwner);
@@ -879,7 +881,7 @@ void AIS_Manipulator::HilightOwnerWithColor (const Handle(PrsMgr_PresentationMan
{
return;
}
aPresentation->Highlight (Aspect_TOHM_COLOR, theColor);
aPresentation->Highlight (theStyle);
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPresentation->Groups());
aGroupIter.More(); aGroupIter.Next())
{