]> OCCT Git - occt.git/commitdiff
Upgrade Alicona core OCCT to version 7.8
authorabulyche <andrey.bulychev@opencascade.com>
Mon, 5 Dec 2022 14:04:37 +0000 (14:04 +0000)
committermzernova <mzernova@opencascade.com>
Mon, 3 Mar 2025 12:11:30 +0000 (12:11 +0000)
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/TopLoc/TopLoc_Location.hxx
tests/bugs/step/bug33095

index cf4821ffcb85362c1f439aa494b2a303ca0ea05d..a874de64e7c398ca29d49ecec59f78419d65e693 100644 (file)
@@ -3703,14 +3703,17 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
               Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
               STEPConstruct_UnitContext anUnitCtx;
               anUnitCtx.ComputeFactors(NU, theLocalFactors);
-              if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnit))) {
+              if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI)) ||
+                  aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnit)))
+              {
+                convertAngleValue(anUnitCtx, aVal);
+              }
+              else if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnit)) ||
+                       aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI)) ||
+                       anUnitCtx.LengthFactor() > 0.)
+              {
                 aVal = aVal * anUnitCtx.LengthFactor();
-
               }
-              else
-                if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnit))) {
-                  convertAngleValue(anUnitCtx, aVal);
-                }
               Handle(TCollection_HAsciiString) aName = aMWU->Name();
               if (aName->Search("upper") > 0) // upper limit
                 aDim2 = aVal;
@@ -3810,13 +3813,11 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
         Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
         STEPConstruct_UnitContext anUnitCtxUpperBound;
         anUnitCtxUpperBound.ComputeFactors(NU, theLocalFactors);
-        if (aMWU->IsKind(STANDARD_TYPE(StepBasic_PlaneAngleMeasureWithUnit)) ||
-          aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI)))
+        if (aMWU->IsKind(STANDARD_TYPE(StepBasic_PlaneAngleMeasureWithUnit)))
         {
           convertAngleValue(anUnitCtxUpperBound, aVal);
         }
-        else if ((aMWU->IsKind(STANDARD_TYPE(StepBasic_MeasureWithUnit)) && anUnitCtxUpperBound.LengthFactor() > 0.) ||
-          aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI)))
+        else if (anUnitCtxUpperBound.LengthFactor() > 0.)
         {
           aVal = aVal * anUnitCtxUpperBound.LengthFactor();
         }
@@ -3846,13 +3847,11 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
         NU = anUnit.NamedUnit();
         STEPConstruct_UnitContext anUnitCtxLowerBound;
         anUnitCtxLowerBound.ComputeFactors(NU, theLocalFactors);
-        if (aMWU->IsKind(STANDARD_TYPE(StepBasic_PlaneAngleMeasureWithUnit)) ||
-          aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI)))
+        if (aMWU->IsKind(STANDARD_TYPE(StepBasic_PlaneAngleMeasureWithUnit)))
         {
           convertAngleValue(anUnitCtxLowerBound, aVal);
         }
-        else if ((aMWU->IsKind(STANDARD_TYPE(StepBasic_MeasureWithUnit)) && anUnitCtxLowerBound.LengthFactor() > 0.) ||
-                 aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI)))
+        else if (anUnitCtxUpperBound.LengthFactor() > 0.)
         {
           aVal = aVal * anUnitCtxLowerBound.LengthFactor();
         }
index 8cb2c4a9d06981442c171638637efd081c780073..dfc4c39e6900621438dcccd406f82b1c01ae4144 100644 (file)
@@ -153,7 +153,7 @@ Standard_Boolean operator != (const TopLoc_Location& Other) const
 
   static Standard_Real ScalePrec()
   {
-    return  1.e-14;
+    return  1.e-13;
   }
 
 protected:
index 269189c7eefb3279951daf97d54de7e90aa42c62..fe79485fddab048c388fd12936528af83b15d26c 100644 (file)
@@ -10,12 +10,14 @@ catch { Close D_m }
 # Read file in mm
 ReadStep D_mm [locate_data_file bug33095_cad_with_pmi.stp]
 set plusMinusTol_mm [XGetDimensionPlusMinusTol D_mm 0:1:4:77]
+set dim_value_mm [XGetDimensionValue D_mm 0:1:4:77]
 
 # Read file in m
 XNewDoc D_m
 XSetLengthUnit D_m m
 ReadStep D_m [locate_data_file bug33095_cad_with_pmi.stp]
 set plusMinusTol_m [XGetDimensionPlusMinusTol D_m 0:1:4:77]
+set dim_value_m [XGetDimensionValue D_m 0:1:4:77]
 
 # Checking
 regexp {lower +([-0-9.+eE]+) +upper +([-0-9.+eE]+)} $plusMinusTol_m full lower_m upper_m
@@ -23,6 +25,7 @@ regexp {lower +([-0-9.+eE]+) +upper +([-0-9.+eE]+)} $plusMinusTol_mm full lower_
 
 set lower_m_to_mm [expr {$lower_m * 1000}]
 set upper_m_to_mm [expr {$upper_m * 1000}]
+set value_m_to_mm [expr {$dim_value_m * 1000}]
 
 if {[expr {abs($lower_m_to_mm - $lower_mm)}] > 1e-2} {
  puts "Error: incorrect scaling lower toleranse value"
@@ -30,3 +33,6 @@ if {[expr {abs($lower_m_to_mm - $lower_mm)}] > 1e-2} {
 if {[expr {abs($upper_m_to_mm - $upper_mm)}] > 1e-2} {
  puts "Error: incorrect scaling upper toleranse value"
 }
+if {[expr {abs($value_m_to_mm - $dim_value_mm)}] > 1e-2} {
+ puts "Error: incorrect scaling main dimension value"
+}