]> OCCT Git - occt-copy.git/commitdiff
0028250: Data Exchange - Wrong number of geometric tolerance modifiers.
authorika <ika@opencascade.com>
Tue, 20 Dec 2016 10:25:02 +0000 (13:25 +0300)
committerkgv <kgv@opencascade.com>
Thu, 22 Dec 2016 14:24:30 +0000 (17:24 +0300)
fix some copy paste mistakes,
update test cases.

src/RWStepDimTol/RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol.cxx
src/RWStepDimTol/RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndGeoTolWthMod.cxx
src/STEPCAFControl/STEPCAFControl_Writer.cxx
src/XDEDRAW/XDEDRAW_GDTs.cxx
tests/gdt/export/A1
tests/gdt/export/B1
tests/gdt/export/B2
tests/gdt/export/B4
tests/gdt/export/B5

index fdb95577c40f2781d9bfb3c8d8f890a4ef3f93e6..37afafea53deb710981329dfbf6db96307d82c6b 100644 (file)
@@ -89,7 +89,7 @@ void RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol::ReadStep
   Handle(StepDimTol_HArray1OfGeometricToleranceModifier) aModifiers;
   Standard_Integer sub = 0;
   if ( data->ReadSubList (num, 1, "modifiers", ach, sub) ) {
-    Standard_Integer nb0 = data->NbParams(sub5);
+    Standard_Integer nb0 = data->NbParams(sub);
     aModifiers = new StepDimTol_HArray1OfGeometricToleranceModifier (1, nb0);
     Standard_Integer num2 = sub;
     for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
index 82fd6d2c8288c56112f89bf6cf3cf90e3ca5cc2f..4bb6bf7c0715cc3a78c74e1c6f7049134d38fa6b 100644 (file)
@@ -84,7 +84,7 @@ void RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndGeoTolWthMod::ReadStep
   Handle(StepDimTol_HArray1OfGeometricToleranceModifier) aModifiers;
   Standard_Integer sub = 0;
   if ( data->ReadSubList (num, 1, "modifiers", ach, sub) ) {
-    Standard_Integer nb0 = data->NbParams(sub5);
+    Standard_Integer nb0 = data->NbParams(sub);
     aModifiers = new StepDimTol_HArray1OfGeometricToleranceModifier (1, nb0);
     Standard_Integer num2 = sub;
     for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
index 78bae8f894b877dc61842fd7c4d6b6788a696f0f..0b7b60893d89082e4d2111cbe91b4819212bb925 100644 (file)
@@ -3237,7 +3237,7 @@ static void WriteGeomTolerance (const Handle(XSControl_WorkSession) &WS,
   Standard_Integer aModifNb = aModifiers.Length();
   if (anObject->GetMaterialRequirementModifier() != XCAFDimTolObjects_GeomToleranceMatReqModif_None)
       aModifNb++;
-  for (Standard_Integer i = 1; i < aModifiers.Length(); i++)
+  for (Standard_Integer i = 1; i <= aModifiers.Length(); i++)
     if (aModifiers.Value(i) == XCAFDimTolObjects_GeomToleranceModif_All_Around ||
         aModifiers.Value(i) == XCAFDimTolObjects_GeomToleranceModif_All_Over)
         aModifNb--;
index 210b909b45bfe1c24b1297ed4c3b2828ad677a16..3a2649866b2df524c52d811de56745658a976b6b 100644 (file)
@@ -428,10 +428,20 @@ static Standard_Integer DumpNbDGTs (Draw_Interpretor& di, Standard_Integer argc,
       Handle(XCAFDimTolObjects_GeomToleranceObject) anObject = aGTAttr->GetObject();
       if (anObject.IsNull())
         continue;
-      if (anObject->GetModifiers().Length() > 0 ||
-          anObject->GetMaterialRequirementModifier() != XCAFDimTolObjects_GeomToleranceMatReqModif_None) {
+      if (anObject->GetMaterialRequirementModifier() != XCAFDimTolObjects_GeomToleranceMatReqModif_None) {
         nbWithModif++;
       }
+      else if (anObject->GetModifiers().Length() > 0) {
+        Standard_Boolean isHasModif = Standard_False;
+        for (Standard_Integer i = 1; i <= anObject->GetModifiers().Length(); i++)
+          if (anObject->GetModifiers().Value(i) != XCAFDimTolObjects_GeomToleranceModif_All_Around &&
+            anObject->GetModifiers().Value(i) != XCAFDimTolObjects_GeomToleranceModif_All_Over) {
+            isHasModif = Standard_True;
+            break;
+          }
+        if (isHasModif)
+          nbWithModif++;
+      }
       if (anObject->GetMaxValueModifier() != 0) {
         nbWithMaxTol++;
       }
index 0272ad9f5e5b5679082b234effd340d62c1a040b..3824da2d4b162b438cbbc3c1a7cc6d510cbe8606 100644 (file)
@@ -10,7 +10,7 @@ set ref_data {
   NbOfWithPath           : 0
   NbOfCommonLabels       : 0
  NbOfTolerances          : 6
-  NbOfGTWithModifiers    : 1
+  NbOfGTWithModifiers    : 0
   NbOfGTWithMaxTolerance : 0
   NbOfGTWithDatums       : 5
  NbOfDatumFeature        : 3
index cb35c448fd5cb09f8a294aefa9f05159622177c1..700c151d4f9e87556cd6b3ff6269f0f3713f0f96 100644 (file)
@@ -10,7 +10,7 @@ set ref_data {
   NbOfWithPath           : 0
   NbOfCommonLabels       : 0
  NbOfTolerances          : 33
-  NbOfGTWithModifiers    : 23
+  NbOfGTWithModifiers    : 17
   NbOfGTWithMaxTolerance : 0
   NbOfGTWithDatums       : 30
  NbOfDatumFeature        : 10
index db2745c6ecda79eed1e886708d1cff64ff239334..970a8a42387270781d5bdb532099ce68723bfa44 100644 (file)
@@ -10,7 +10,7 @@ set ref_data {
   NbOfWithPath           : 0
   NbOfCommonLabels       : 0
  NbOfTolerances          : 33
-  NbOfGTWithModifiers    : 23
+  NbOfGTWithModifiers    : 17
   NbOfGTWithMaxTolerance : 0
   NbOfGTWithDatums       : 30
  NbOfDatumFeature        : 10
index 6276f3ed318de5342202e04d3cc6a4aa64990f0e..14f6697ca65517f4727d7ffbcba489d69f8d9d21 100644 (file)
@@ -10,7 +10,7 @@ set ref_data {
   NbOfWithPath           : 0
   NbOfCommonLabels       : 0
  NbOfTolerances          : 31
-  NbOfGTWithModifiers    : 8
+  NbOfGTWithModifiers    : 6
   NbOfGTWithMaxTolerance : 0
   NbOfGTWithDatums       : 30
  NbOfDatumFeature        : 6
index 26e7e8eadbb23a23265090a5ad6b03f23ef618fc..b994fc8b5ae0b87ecb6882f77416e01b0f44b37f 100644 (file)
@@ -10,7 +10,7 @@ set ref_data {
   NbOfWithPath           : 0
   NbOfCommonLabels       : 0
  NbOfTolerances          : 31
-  NbOfGTWithModifiers    : 8
+  NbOfGTWithModifiers    : 6
   NbOfGTWithMaxTolerance : 0
   NbOfGTWithDatums       : 30
  NbOfDatumFeature        : 6