mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-21 10:55:33 +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:
parent
a0d0f96afe
commit
cf152970e2
@ -1901,7 +1901,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
|
|||||||
return;
|
return;
|
||||||
gp_Pnt aPtext(0., 0., 0.);
|
gp_Pnt aPtext(0., 0., 0.);
|
||||||
// if Annotation plane location inside bounding box set it to text position
|
// 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())
|
if (!aBox.IsVoid())
|
||||||
{
|
{
|
||||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
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();
|
Handle(Transfer_TransientProcess) aTP = theTR->TransientProcess();
|
||||||
const Interface_Graph& aGraph = aTP->Graph();
|
const Interface_Graph& aGraph = aTP->Graph();
|
||||||
|
|
||||||
//calculate units
|
|
||||||
|
Standard_Real aFact = 1.;
|
||||||
|
|
||||||
Handle(StepShape_ShapeDimensionRepresentation) aSDR = NULL;
|
Handle(StepShape_ShapeDimensionRepresentation) aSDR = NULL;
|
||||||
for (Interface_EntityIterator anIt = aGraph.Sharings(theGDT); aSDR.IsNull() && anIt.More(); anIt.Next()) {
|
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();
|
XSAlgo::AlgoContainer()->PrepareForTransfer();
|
||||||
STEPControl_ActorRead anActor;
|
STEPControl_ActorRead anActor;
|
||||||
anActor.PrepareUnits(aSDR, aTP);
|
anActor.PrepareUnits(aSDR, aTP);
|
||||||
Standard_Real aFact = UnitsMethods::LengthFactor();
|
aFact = UnitsMethods::LengthFactor();
|
||||||
|
}
|
||||||
|
|
||||||
if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalSize))) {
|
if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalSize))) {
|
||||||
// retrieve derived geometry
|
// retrieve derived geometry
|
||||||
@ -3148,6 +3157,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
|
|||||||
anUnitCtx.ComputeFactors(NU);
|
anUnitCtx.ComputeFactors(NU);
|
||||||
if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnit))) {
|
if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnit))) {
|
||||||
aVal = aVal * anUnitCtx.LengthFactor();
|
aVal = aVal * anUnitCtx.LengthFactor();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnit))) {
|
if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnit))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user