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

0032731: Data Exchange, Step Import - Incorrect PMI text location

Added new complex Entity for representation of PMI
Added moving the presentation with new entity
This commit is contained in:
dpasukhi
2022-01-31 11:09:20 +03:00
committed by smoskvin
parent 0b6a0adb3a
commit e1f5ac2c9b
15 changed files with 535 additions and 6 deletions

View File

@@ -204,6 +204,7 @@
#include <StepVisual_PlanarBox.hxx>
#include <StepVisual_PresentationLayerAssignment.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepVisual_StyleContextSelect.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_ViewVolume.hxx>
@@ -1868,6 +1869,25 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aTessItem);
if (aTessSet.IsNull())
continue;
gp_Trsf aTransf;
if (aTessSet->IsKind(STANDARD_TYPE(StepVisual_RepositionedTessellatedGeometricSet)))
{
Handle(StepVisual_RepositionedTessellatedGeometricSet) aRTGS =
Handle(StepVisual_RepositionedTessellatedGeometricSet)::DownCast(aTessSet);
Handle(Geom_Axis2Placement) aLocation = StepToGeom::MakeAxis2Placement(aRTGS->Location());
if (!aLocation.IsNull())
{
const gp_Ax3 anAx3Orig = gp::XOY();
const gp_Ax3 anAx3Targ(aLocation->Ax2());
if (anAx3Targ.Location().SquareDistance(anAx3Orig.Location()) >= Precision::SquareConfusion() ||
!anAx3Targ.Direction().IsEqual(anAx3Orig.Direction(), Precision::Angular()) ||
!anAx3Targ.XDirection().IsEqual(anAx3Orig.XDirection(), Precision::Angular()) ||
!anAx3Targ.YDirection().IsEqual(anAx3Orig.YDirection(), Precision::Angular()))
{
aTransf.SetTransformation(anAx3Targ, anAx3Orig);
}
}
}
NCollection_Handle<StepVisual_Array1OfTessellatedItem> aListItems = aTessSet->Items();
Standard_Integer nb = aListItems.IsNull() ? 0 : aListItems->Length();
Handle(StepVisual_TessellatedCurveSet) aTessCurve;
@@ -1913,7 +1933,7 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
}
aB.Add(aComp, aCurW);
}
anAnnotationShape = aComp;
anAnnotationShape = aComp.Moved(aTransf);
}
if (!anAnnotationShape.IsNull())
{