mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +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:
parent
84e847557a
commit
1b63268eb2
@ -77,7 +77,7 @@ void PrsMgr_PresentableObject::Fill (const Handle(PrsMgr_PresentationManager)& t
|
|||||||
{
|
{
|
||||||
Handle(Prs3d_Presentation) aStruct3d = thePrs->Presentation();
|
Handle(Prs3d_Presentation) aStruct3d = thePrs->Presentation();
|
||||||
Compute (thePrsMgr, aStruct3d, theMode);
|
Compute (thePrsMgr, aStruct3d, theMode);
|
||||||
UpdateTransformation (aStruct3d);
|
aStruct3d->SetTransformation (myTransformation);
|
||||||
aStruct3d->SetClipPlanes (myClipPlanes);
|
aStruct3d->SetClipPlanes (myClipPlanes);
|
||||||
aStruct3d->SetTransformPersistence (TransformPersistence());
|
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
|
//function : SetTransformPersistence
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@ -157,14 +157,13 @@ public:
|
|||||||
: getIdentityTrsf(); }
|
: getIdentityTrsf(); }
|
||||||
|
|
||||||
const gp_GTrsf& InversedTransformation() const { return myInvTransformation; }
|
const gp_GTrsf& InversedTransformation() const { return myInvTransformation; }
|
||||||
|
|
||||||
//! resets local transformation to identity.
|
//! resets local transformation to identity.
|
||||||
Standard_EXPORT virtual void ResetTransformation();
|
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();
|
||||||
|
|
||||||
Standard_EXPORT virtual void UpdateTransformation (const Handle(Prs3d_Presentation)& P);
|
|
||||||
|
|
||||||
//! Set Z layer ID and update all presentations of the presentable object.
|
//! 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.
|
//! 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);
|
Standard_EXPORT virtual void SetZLayer (const Graphic3d_ZLayerId theLayerId);
|
||||||
|
@ -256,6 +256,14 @@ void SelectMgr_SelectableObject::UpdateTransformation()
|
|||||||
}
|
}
|
||||||
|
|
||||||
PrsMgr_PresentableObject::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 = new Prs3d_Presentation (theMgr->StructureManager());
|
||||||
myHilightPrs->SetTransformPersistence (TransformPersistence());
|
myHilightPrs->SetTransformPersistence (TransformPersistence());
|
||||||
myHilightPrs->SetClipPlanes (myClipPlanes);
|
myHilightPrs->SetClipPlanes (myClipPlanes);
|
||||||
|
myHilightPrs->SetTransformation (TransformationGeom());
|
||||||
}
|
}
|
||||||
|
|
||||||
return myHilightPrs;
|
return myHilightPrs;
|
||||||
@ -366,6 +375,7 @@ Handle(Prs3d_Presentation) SelectMgr_SelectableObject::GetSelectPresentation (co
|
|||||||
mySelectionPrs = new Prs3d_Presentation (theMgr->StructureManager());
|
mySelectionPrs = new Prs3d_Presentation (theMgr->StructureManager());
|
||||||
mySelectionPrs->SetTransformPersistence (TransformPersistence());
|
mySelectionPrs->SetTransformPersistence (TransformPersistence());
|
||||||
mySelectionPrs->SetClipPlanes (myClipPlanes);
|
mySelectionPrs->SetClipPlanes (myClipPlanes);
|
||||||
|
mySelectionPrs->SetTransformation (TransformationGeom());
|
||||||
}
|
}
|
||||||
|
|
||||||
return mySelectionPrs;
|
return mySelectionPrs;
|
||||||
|
22
tests/bugs/vis/bug30218
Normal file
22
tests/bugs/vis/bug30218
Normal 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
|
Loading…
x
Reference in New Issue
Block a user