1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0030218: Visualization - custom selection presentation is not updated within SelectMgr_SelectableObject::UpdateTransformation()

SelectMgr_SelectableObject now assigns transformation to mySelectionPrs and myHilightPrs presentations.
Removed confusing method PrsMgr_PresentableObject::UpdateTransformation() with presentation as argument.
This commit is contained in:
kgv 2018-10-08 19:16:06 +03:00 committed by apn
parent 84e847557a
commit 1b63268eb2
4 changed files with 37 additions and 15 deletions

View File

@ -77,7 +77,7 @@ void PrsMgr_PresentableObject::Fill (const Handle(PrsMgr_PresentationManager)& t
{
Handle(Prs3d_Presentation) aStruct3d = thePrs->Presentation();
Compute (thePrsMgr, aStruct3d, theMode);
UpdateTransformation (aStruct3d);
aStruct3d->SetTransformation (myTransformation);
aStruct3d->SetClipPlanes (myClipPlanes);
aStruct3d->SetTransformPersistence (TransformPersistence());
}
@ -296,15 +296,6 @@ void PrsMgr_PresentableObject::UpdateTransformation()
}
}
//=======================================================================
//function : UpdateTransformation
//purpose :
//=======================================================================
void PrsMgr_PresentableObject::UpdateTransformation(const Handle(Prs3d_Presentation)& P)
{
P->SetTransformation (myTransformation);
}
//=======================================================================
//function : SetTransformPersistence
//purpose :

View File

@ -157,14 +157,13 @@ public:
: getIdentityTrsf(); }
const gp_GTrsf& InversedTransformation() const { return myInvTransformation; }
//! resets local transformation to identity.
Standard_EXPORT virtual void ResetTransformation();
//! Updates final transformation (parent + local) of presentable object and its presentations.
Standard_EXPORT virtual void UpdateTransformation();
Standard_EXPORT virtual void UpdateTransformation (const Handle(Prs3d_Presentation)& P);
//! Set Z layer ID and update all presentations of the presentable object.
//! The layers mechanism allows drawing objects in higher layers in overlay of objects in lower layers.
Standard_EXPORT virtual void SetZLayer (const Graphic3d_ZLayerId theLayerId);

View File

@ -256,6 +256,14 @@ void SelectMgr_SelectableObject::UpdateTransformation()
}
PrsMgr_PresentableObject::UpdateTransformation();
if (!mySelectionPrs.IsNull())
{
mySelectionPrs->SetTransformation (TransformationGeom());
}
if (!myHilightPrs.IsNull())
{
myHilightPrs->SetTransformation (TransformationGeom());
}
}
//=======================================================================
@ -349,6 +357,7 @@ Handle(Prs3d_Presentation) SelectMgr_SelectableObject::GetHilightPresentation (c
myHilightPrs = new Prs3d_Presentation (theMgr->StructureManager());
myHilightPrs->SetTransformPersistence (TransformPersistence());
myHilightPrs->SetClipPlanes (myClipPlanes);
myHilightPrs->SetTransformation (TransformationGeom());
}
return myHilightPrs;
@ -366,6 +375,7 @@ Handle(Prs3d_Presentation) SelectMgr_SelectableObject::GetSelectPresentation (co
mySelectionPrs = new Prs3d_Presentation (theMgr->StructureManager());
mySelectionPrs->SetTransformPersistence (TransformPersistence());
mySelectionPrs->SetClipPlanes (myClipPlanes);
mySelectionPrs->SetTransformation (TransformationGeom());
}
return mySelectionPrs;

22
tests/bugs/vis/bug30218 Normal file
View File

@ -0,0 +1,22 @@
puts "============="
puts "0030218: Visualization - custom selection presentation is not updated within SelectMgr_SelectableObject::UpdateTransformation()"
puts "============="
pload XDE VISUALIZATION
vclear
vinit View1
meshfromstl m [locate_data_file OCC6652.stl]
vfit
vzoom 0.75
vsetdispmode m 3
vselmode m 8 1
vselect 5 5 200 200
vlocation m -setLocation 500 0 0
vmoveto 370 370
if { [vreadpixel 145 145 rgb name] != "BLACK" } { puts "Error: MeshVS highlighting has wrong location" }
if { [vreadpixel 300 215 rgb name] != "GRAY80" } { puts "Error: MeshVS highlighting has wrong location" }
vdump ${imagedir}/${casename}.png