1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +03:00

0026680: Visualization - Changed behavior of mesh visualization and selection in OMF sample

- handling of global selection mode was added to MeshVS_Mesh;
- corrected unhighlight of interactives with auto-highlight disabled;
- test case for issue 0026680.
This commit is contained in:
vpa
2015-09-17 18:57:48 +03:00
committed by kgv
parent 71c6e1e52d
commit 673cf4e376
3 changed files with 57 additions and 3 deletions

View File

@@ -426,7 +426,10 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean toUpdate
}
while (!anObjToClear.IsEmpty())
{
anObjToClear.FindKey (anObjToClear.Size())->ClearSelected();
const Handle(AIS_InteractiveObject)& anObj = anObjToClear.FindKey (anObjToClear.Size());
const Standard_Integer aHiMode = anObj->HasHilightMode() ? anObj->HilightMode() : 0;
myMainPM->Unhighlight (anObj, aHiMode);
anObj->ClearSelected();
anObjToClear.RemoveLast();
}

View File

@@ -908,6 +908,13 @@ void MeshVS_Mesh::HilightSelected ( const Handle(PrsMgr_PresentationManager3d)&
for( i=1; i<=len; i++ )
{
if (theOwners.Value (i) == GlobalSelOwner())
{
const Standard_Integer aHiMode = HasHilightMode() ? HilightMode() : 0;
const Quantity_NameOfColor aSelColor = GetContext().IsNull() ? Quantity_NOC_GRAY80 : GetContext()->SelectionColor();
thePM->Color (this, aSelColor, aHiMode);
continue;
}
anOwner = Handle (MeshVS_MeshEntityOwner)::DownCast ( theOwners.Value ( i ) );
if ( !anOwner.IsNull() )
{
@@ -1016,6 +1023,16 @@ void MeshVS_Mesh::HilightOwnerWithColor ( const Handle(PrsMgr_PresentationManage
const Quantity_NameOfColor Color,
const Handle(SelectMgr_EntityOwner)& Owner)
{
if (Owner.IsNull())
return;
if (Owner == GlobalSelOwner())
{
Standard_Integer aHiMode = HasHilightMode() ? HilightMode() : 0;
PM->Color (this, Color, aHiMode, NULL, Graphic3d_ZLayerId_Top);
return;
}
if ( myHilighter.IsNull() )
return;
@@ -1029,8 +1046,6 @@ void MeshVS_Mesh::HilightOwnerWithColor ( const Handle(PrsMgr_PresentationManage
aHilightPrs->SetTransformPersistence( Presentation()->TransformPersistenceMode(), Presentation()->TransformPersistencePoint() );
//----------------
if( Owner.IsNull() ) return;
const Standard_Boolean isMeshEntityOwner = Owner->IsKind ( STANDARD_TYPE ( MeshVS_MeshEntityOwner ) );
const Standard_Boolean isWholeMeshOwner =
//agv !Owner.IsNull() && Owner==myWholeMeshOwner;