0027919: Visualization - support multiple transformation persistence groups within single presentation

Added transform persistence property to Graphic3d_Group and Select3D_SensitiveEntity.
SelectMgr_ViewerSelector, Graphic3d_Layer and OpenGl_Structure have been updated
to process per-group transform persistence within picking, ZFit and rendering.

Added zoomable state to Prs3d_ArrowAspect supported by PrsDim_Dimension.

Added gp_GTrsf::SetMat4(), opposite to gp_GTrsf::GetMat4().
This commit is contained in:
nds
2021-07-19 13:31:05 +03:00
committed by bugmaster
parent ad3f20c684
commit 4e993e4d0d
27 changed files with 544 additions and 195 deletions

View File

@@ -691,8 +691,14 @@ void PrsDim_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager)& ,
aFirstArrowBegin = aFirstAttach;
aSecondArrowBegin = aSecondAttach;
aFirstArrowEnd = aFirstAttach.Translated (-aFirstArrowVec);
aSecondArrowEnd = aSecondAttach.Translated (-aSecondArrowVec);
aFirstArrowEnd = aFirstAttach;
aSecondArrowEnd = aSecondAttach;
if (aDimensionAspect->ArrowAspect()->IsZoomable())
{
aFirstArrowEnd.Translate (-aFirstArrowVec);
aSecondArrowEnd.Translate (-aSecondArrowVec);
}
// Group1: stenciling text and the angle dimension arc
thePresentation->NewGroup();

View File

@@ -363,6 +363,7 @@ void PrsDim_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentat
Standard_Real aLength = myDrawer->DimensionAspect()->ArrowAspect()->Length();
Standard_Real anAngle = myDrawer->DimensionAspect()->ArrowAspect()->Angle();
Standard_Boolean isZoomable = myDrawer->DimensionAspect()->ArrowAspect()->IsZoomable();
if (myDrawer->DimensionAspect()->IsArrows3d())
{
@@ -375,16 +376,17 @@ void PrsDim_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentat
}
else
{
gp_Pnt aLocation = isZoomable ? theLocation : gp::Origin();
gp_Pnt aLeftPoint (gp::Origin());
gp_Pnt aRightPoint (gp::Origin());
const gp_Dir& aPlane = GetPlane().Axis().Direction();
PointsForArrow (theLocation, theDirection, aPlane, aLength, anAngle, aLeftPoint, aRightPoint);
PointsForArrow (aLocation, theDirection, aPlane, aLength, anAngle, aLeftPoint, aRightPoint);
Handle(Graphic3d_ArrayOfTriangles) anArrow = new Graphic3d_ArrayOfTriangles(3);
anArrow->AddVertex (aLeftPoint);
anArrow->AddVertex (theLocation);
anArrow->AddVertex (aLocation);
anArrow->AddVertex (aRightPoint);
// Set aspect for arrow triangles
@@ -400,6 +402,10 @@ void PrsDim_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentat
aGroup->SetPrimitivesAspect (aShadingStyle);
aGroup->AddPrimitiveArray (anArrow);
if (!isZoomable)
{
aGroup->SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_ZoomPers, theLocation));
}
}
SelectionGeometry::Arrow& aSensitiveArrow = mySelectionGeom.NewArrow();
@@ -707,10 +713,16 @@ void PrsDim_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& th
aFirstArrowBegin = aLineBegPoint;
aSecondArrowBegin = aLineEndPoint;
aFirstArrowEnd = aLineBegPoint.Translated (-gp_Vec (aFirstArrowDir).Scaled (anArrowLength));
aSecondArrowEnd = aLineEndPoint.Translated (-gp_Vec (aSecondArrowDir).Scaled (anArrowLength));
aFirstArrowEnd = aLineBegPoint;
aSecondArrowEnd = aLineEndPoint;
gp_Pnt aCenterLineBegin = isArrowsExternal
if (aDimensionAspect->ArrowAspect()->IsZoomable())
{
aFirstArrowEnd.Translate (-gp_Vec (aFirstArrowDir).Scaled (anArrowLength));
aSecondArrowEnd.Translate (-gp_Vec (aSecondArrowDir).Scaled (anArrowLength));
}
gp_Pnt aCenterLineBegin = isArrowsExternal
? aLineBegPoint : aFirstArrowEnd;
gp_Pnt aCenterLineEnd = isArrowsExternal || theIsOneSide