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

0026641: Visualization, TKOpenGl - handle correctly transformation persistence within perspective projection.

Add a new method AIS_InteractiveContext::SetTransformPersistence, which sets transform persistence to object and selection.
Add a new method SelectMgr_SelectionManager::UpdateSelection, which re-adds selectable object in BVHs in all viewer selectors.
Add a new method SelectMgr_ViewerSelector::MoveSelectableObject, which moves object from set of not transform persistence objects to set of transform persistence objects (or vice versa).
Add a new method Graphic3d_TransformUtils::Convert, which converts gp_Trsf to Graphic3d_Mat4.
Remove the method PrsMgr_PresentableObject::SetTransformPersistence(flag, point).
This commit is contained in:
isk
2016-07-05 13:32:52 +03:00
committed by bugmaster
parent fbad941bd4
commit 1d92133e83
20 changed files with 254 additions and 77 deletions

View File

@@ -3656,7 +3656,7 @@ static int VDisplay2 (Draw_Interpretor& theDI,
}
if (toSetTrsfPers)
{
aShape->SetTransformPersistence (aTrsfPersFlags, aTPPosition);
aCtx->SetTransformPersistence (aShape, aTrsfPersFlags, aTPPosition);
}
if (anObjDispMode != -2)
{
@@ -3710,7 +3710,7 @@ static int VDisplay2 (Draw_Interpretor& theDI,
}
if (toSetTrsfPers)
{
aShape->SetTransformPersistence (aTrsfPersFlags, aTPPosition);
aCtx->SetTransformPersistence (aShape, aTrsfPersFlags, aTPPosition);
}
if (anObjDispMode != -2)
{
@@ -4454,6 +4454,7 @@ static Standard_Integer VState (Draw_Interpretor& theDI,
{
const Graphic3d_Mat4d& aProjection = aMgr.ProjectionMatrix();
const Graphic3d_Mat4d& aWorldView = aMgr.WorldViewMatrix();
Standard_Integer aViewportWidth = 0;
Standard_Integer aViewportHeight = 0;
aMgr.WindowSize (aViewportWidth, aViewportHeight);

View File

@@ -2846,7 +2846,7 @@ static int VDrawText (Draw_Interpretor& theDI,
if (aTrsfPersFlags != Graphic3d_TMF_None)
{
aTextPrs->SetTransformPersistence (aTrsfPersFlags, aTPPosition);
aContext->SetTransformPersistence (aTextPrs, aTrsfPersFlags, aTPPosition);
aTextPrs->SetZLayer(Graphic3d_ZLayerId_TopOSD);
if (aTextPrs->Position().Z() != 0)
{
@@ -2855,7 +2855,7 @@ static int VDrawText (Draw_Interpretor& theDI,
}
else if (aTrsfPersFlags != aTextPrs->TransformPersistence().Flags)
{
aTextPrs->SetTransformPersistence (aTrsfPersFlags);
aContext->SetTransformPersistence (aTextPrs, aTrsfPersFlags);
}
ViewerTest::Display (aName, aTextPrs, Standard_False);
return 0;

View File

@@ -3570,7 +3570,7 @@ static int VColorScale (Draw_Interpretor& theDI,
}
if (aCS->GetTransformPersistenceMode() != Graphic3d_TMF_2d)
{
aCS->SetTransformPersistence (Graphic3d_TMF_2d, gp_Pnt (-1,-1,0));
aContext->SetTransformPersistence (aCS, Graphic3d_TMF_2d, gp_Pnt (-1.0, -1.0, 0.0));
}
Standard_Real aMinRange = aCS->GetMin();
@@ -4879,7 +4879,7 @@ static int VLayerLine(Draw_Interpretor& di, Standard_Integer argc, const char**
aLineType, aWidth,
aTransparency);
aLine->SetTransformPersistence (Graphic3d_TMF_2d,gp_Pnt(-1,-1,0));
aContext->SetTransformPersistence (aLine, Graphic3d_TMF_2d, gp_Pnt (-1.0, -1.0, 0.0));
aLine->SetZLayer (Graphic3d_ZLayerId_TopOSD);
aLine->SetToUpdate();
aContext->Display (aLine, Standard_True);