// generate new presentable shape
if (myPrsSh.IsNull())
{
- if (HasLocation())
- {
- TopLoc_Location lbid = Location() * myShape.Location();
- TopoDS_Shape ShBis = myShape.Located(lbid);
- myPrsSh = new StdSelect_Shape (ShBis, theStyle);
- }
- else
- {
- myPrsSh = new StdSelect_Shape (myShape, theStyle);
- }
+ myPrsSh = new StdSelect_Shape (myShape, theStyle);
}
// initialize presentation attributes of child presentation
myPrsSh->SetZLayer (aSel->ZLayer());
myPrsSh->SetTransformPersistence (aSel->TransformPersistence());
+ myPrsSh->SetLocalTransformation (Location());
myPrsSh->Attributes()->SetLink (theStyle);
myPrsSh->Attributes()->SetColor (theStyle->Color());
myPrsSh->Attributes()->SetTransparency (theStyle->Transparency());
void StdSelect_BRepOwner::SetLocation(const TopLoc_Location& aLoc)
{
SelectMgr_EntityOwner::SetLocation(aLoc);
- // we must not nullify the myPrsSh here, because unhilight method
- // will be working with wrong entity in this case, the best is to
- // set the update flag and then recompute myPrsSh on hilighting
if (!myPrsSh.IsNull())
- myPrsSh->SetToUpdate();
+ {
+ myPrsSh->SetLocalTransformation (Location());
+ }
}
//=======================================================================
const Handle(PrsMgr_PresentationManager)& theManager,
const Standard_Integer theDispMode)
{
- if (myPrsSh.IsNull() && Selectable().IsNull())
- return;
-
- theManager->UpdateHighlightTrsf (theViewer, Selectable(), theDispMode, myPrsSh);
+ if (!myPrsSh.IsNull() || HasSelectable())
+ {
+ theManager->UpdateHighlightTrsf (theViewer, Selectable(), theDispMode, myPrsSh);
+ }
}
// =======================================================================
puts "==========="
-puts "OCC27986"
-puts "Visualization - AIS_InteractiveContext::SetLocation() does not update dynamic highlighting"
+puts "0027986: Visualization - AIS_InteractiveContext::SetLocation() does not update dynamic highlighting"
puts "Test local selection"
puts "==========="
puts ""
vfit
vzoom 0.5
vselmode b 4 1
+vselect 150 150
vmoveto 250 250
vsetlocation b 2 1 0
set aColor1 [vreadpixel 220 200 rgb name]
set aColor2 [vreadpixel 350 220 rgb name]
if { "$aColor1" != "BLACK" || "$aColor2" != "CYAN2" } { puts "Error: dynamic highlighting is not updated" }
+if { "[vreadpixel 150 150 rgb name]" != "BLACK" } { puts "Error: sub-shape highlighting is not updated" }
vdump $imagedir/${casename}.png