From b0b766826118f74b9857a932b8cec8c52a25c492 Mon Sep 17 00:00:00 2001 From: ika Date: Tue, 15 Sep 2020 17:20:35 +0300 Subject: [PATCH] 0027185: Data Exchange - IGES - incorrect reading of DE for undefined entity Fix reading of pointers to color entity. --- src/IGESData/IGESData_UndefinedEntity.cxx | 10 +++++----- tests/bugs/iges/bug27186 | 2 -- tests/de/iges_2/F9 | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/IGESData/IGESData_UndefinedEntity.cxx b/src/IGESData/IGESData_UndefinedEntity.cxx index f055741230..d3f321644c 100644 --- a/src/IGESData/IGESData_UndefinedEntity.cxx +++ b/src/IGESData/IGESData_UndefinedEntity.cxx @@ -218,7 +218,7 @@ Standard_Boolean IGESData_UndefinedEntity::ReadDir iapb = Standard_False; if (v[3] < -max) iapb = Standard_True; else if (v[3] < 0) { - anent = GetCasted(IGESData_IGESEntity,IR->BoundEntity((-1-v[3])/2)); + anent = GetCasted(IGESData_IGESEntity,IR->BoundEntity((1-v[3])/2)); if (!anent->IsKind(STANDARD_TYPE(IGESData_LineFontEntity))) iapb = Standard_True; } // Sending of message : Line Font Pattern field is incorrect. @@ -232,7 +232,7 @@ Standard_Boolean IGESData_UndefinedEntity::ReadDir iapb = Standard_False; if (v[4] < -max) iapb = Standard_True; else if (v[4] < 0) { - anent = GetCasted(IGESData_IGESEntity,IR->BoundEntity((-1-v[4])/2)); + anent = GetCasted(IGESData_IGESEntity,IR->BoundEntity((1-v[4])/2)); if (!anent->IsKind(STANDARD_TYPE(IGESData_LevelListEntity))) iapb = Standard_True; } @@ -276,7 +276,7 @@ Standard_Boolean IGESData_UndefinedEntity::ReadDir iapb = Standard_False; if (v[7] < 0 || v[7] > max) iapb = Standard_True; - else if (v[7] < 0) { + else if (v[7] > 0) { anent = GetCasted(IGESData_IGESEntity,IR->BoundEntity((1+v[7])/2)); if (!anent->IsKind(STANDARD_TYPE(IGESData_LabelDisplayEntity))) iapb = Standard_True; } @@ -290,9 +290,9 @@ Standard_Boolean IGESData_UndefinedEntity::ReadDir } iapb = Standard_False; - if (v[14] < 0 || v[14] > max) iapb = Standard_True; + if (v[14] < -max || v[14] > max) iapb = Standard_True; else if (v[14] < 0) { - anent = GetCasted(IGESData_IGESEntity,IR->BoundEntity((1+v[14])/2)); + anent = GetCasted(IGESData_IGESEntity,IR->BoundEntity((1-v[14])/2)); if (!anent->IsKind(STANDARD_TYPE(IGESData_ColorEntity))) { thedstat += 512; v[14] = 0; } } diff --git a/tests/bugs/iges/bug27186 b/tests/bugs/iges/bug27186 index 27a4531b00..b6b386fdab 100644 --- a/tests/bugs/iges/bug27186 +++ b/tests/bugs/iges/bug27186 @@ -1,5 +1,3 @@ -puts "TODO OCC27186 ALL: Directory Entry Error Status" - puts "========" puts "OCC27186" puts "========" diff --git a/tests/de/iges_2/F9 b/tests/de/iges_2/F9 index a91541812f..2acfc66642 100644 --- a/tests/de/iges_2/F9 +++ b/tests/de/iges_2/F9 @@ -7,7 +7,7 @@ puts "TODO CR23096 ALL: LABELS : Faulty" set filename 919-004-T03-04-CP-VL.igs set ref_data { -DATA : Faulties = 0 ( 2 ) Warnings = 0 ( 0 ) Summary = 0 ( 2 ) +DATA : Faulties = 0 ( 1 ) Warnings = 0 ( 0 ) Summary = 0 ( 1 ) TPSTAT : Faulties = 0 ( 2 ) Warnings = 310 ( 2179 ) Summary = 310 ( 2181 ) CHECKSHAPE : Wires = 0 ( 3 ) Faces = 0 ( 3 ) Shells = 0 ( 0 ) Solids = 0 ( 0 ) NBSHAPES : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 1457 ( 1455 )