1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-16 10:54:53 +03:00

0030405: Presentations of PMI are incorrectly scaled after change of units

Corrected search of the entity StepShape_ShapeDimensionRepresentation defining used units in the method readConnectionPoints
This commit is contained in:
gka 2019-01-23 18:37:23 +03:00 committed by bugmaster
parent a0d0f96afe
commit cf152970e2

View File

@ -1901,7 +1901,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
return;
gp_Pnt aPtext(0., 0., 0.);
// if Annotation plane location inside bounding box set it to text position
// else set the center of bounding box to text position
// else set the center of bounding box to text position 0027372
if (!aBox.IsVoid())
{
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
@ -1952,15 +1952,24 @@ void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
Handle(Transfer_TransientProcess) aTP = theTR->TransientProcess();
const Interface_Graph& aGraph = aTP->Graph();
//calculate units
Standard_Real aFact = 1.;
Handle(StepShape_ShapeDimensionRepresentation) aSDR = NULL;
for (Interface_EntityIterator anIt = aGraph.Sharings(theGDT); aSDR.IsNull() && anIt.More(); anIt.Next()) {
aSDR = Handle(StepShape_ShapeDimensionRepresentation)::DownCast(anIt.Value());
Handle(Standard_Transient) anEnt = anIt.Value();
Handle(StepShape_DimensionalCharacteristicRepresentation) aDCR =
Handle(StepShape_DimensionalCharacteristicRepresentation)::DownCast(anEnt);
if (!aDCR.IsNull())
aSDR = !aDCR.IsNull() ? aDCR->Representation() : Handle(StepShape_ShapeDimensionRepresentation)::DownCast(anEnt);
}
if (!aSDR.IsNull())
{
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor;
anActor.PrepareUnits(aSDR, aTP);
Standard_Real aFact = UnitsMethods::LengthFactor();
aFact = UnitsMethods::LengthFactor();
}
if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalSize))) {
// retrieve derived geometry
@ -3148,6 +3157,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
anUnitCtx.ComputeFactors(NU);
if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnit))) {
aVal = aVal * anUnitCtx.LengthFactor();
}
else
if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnit))) {